/* ===========================
   YN 赛事报名系统 - 主样式
   =========================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --primary: #2563EB;
  --primary-dark: #1d4ed8;
  --primary-light: #EFF6FF;
  --secondary: #64748B;
  --success: #16A34A;
  --warning: #D97706;
  --danger: #DC2626;
  --dark: #0F172A;
  --surface: #F8FAFC;
  --card-bg: #FFFFFF;
  --border: #E2E8F0;
  --text: #1E293B;
  --text-muted: #64748B;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow: 0 4px 16px rgba(0,0,0,.08);
  --shadow-lg: 0 10px 40px rgba(0,0,0,.12);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: .2s cubic-bezier(.4,0,.2,1);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'PingFang SC',
               'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  font-size: 15px;
  color: var(--text);
  background: var(--surface);
  margin: 0;
  line-height: 1.6;
}

/* ── 滚动条 ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 3px; }

/* ── 链接 ── */
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }

/* ── 导航栏 ── */
.navbar {
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 0 0;
  position: sticky; top: 0; z-index: 1040;
}
.navbar-brand {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--primary) !important;
  letter-spacing: -.3px;
}
.navbar .nav-link {
  color: var(--text) !important;
  font-weight: 500;
  padding: .5rem .9rem !important;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
}
.navbar .nav-link:hover, .navbar .nav-link.active {
  background: var(--primary-light);
  color: var(--primary) !important;
}

/* ── 卡片 ── */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}
.card:hover { box-shadow: var(--shadow); }
.card-header {
  background: transparent;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  padding: 1rem 1.25rem;
}

/* ── 按钮 ── */
.btn {
  border-radius: var(--radius-sm);
  font-weight: 500;
  transition: all var(--transition);
  letter-spacing: .01em;
}
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
}
.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37,99,235,.35);
}
.btn-outline-primary { color: var(--primary); border-color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); border-color: var(--primary); }
.btn-sm { font-size: .8125rem; padding: .3rem .65rem; }
.btn-lg { padding: .75rem 2rem; font-size: 1rem; }

/* ── 表单 ── */
.form-control, .form-select {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
  font-size: .9375rem;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
  outline: none;
}
.form-label { font-weight: 500; font-size: .875rem; margin-bottom: .35rem; }
.required-mark { color: var(--danger); margin-left: 2px; }

/* ── 徽章 ── */
.badge {
  font-weight: 500;
  border-radius: 6px;
  font-size: .75rem;
  padding: .3em .6em;
}

/* ── 状态徽章 ── */
.status-badge-pending  { background: #FEF3C7; color: #92400E; }
.status-badge-approved { background: #D1FAE5; color: #065F46; }
.status-badge-rejected { background: #FEE2E2; color: #991B1B; }
.status-badge-cancelled{ background: #F1F5F9; color: #475569; }
.status-badge-draft    { background: #F1F5F9; color: #64748B; }
.status-badge-published{ background: #DBEAFE; color: #1E40AF; }
.status-badge-closed   { background: #FEF3C7; color: #92400E; }

/* ── 赛事卡片 ── */
.event-card {
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
}
.event-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.event-card .cover-img {
  width: 100%; height: 180px; object-fit: cover;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.event-card .cover-placeholder {
  width: 100%; height: 180px;
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem; color: rgba(255,255,255,.7);
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.event-card .card-body { padding: 1.1rem; }
.event-card .event-title {
  font-weight: 600; font-size: .95rem;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; margin-bottom: .5rem;
}
.event-card .event-meta { font-size: .8125rem; color: var(--text-muted); }
.event-card .reg-status-open { color: var(--success); }
.event-card .reg-status-closed { color: var(--danger); }

/* ── 英雄区 ── */
.hero-section {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  color: white; padding: 4rem 0 3rem;
  position: relative; overflow: hidden;
}
.hero-section::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-section h1 { font-weight: 700; font-size: 2.2rem; }
.hero-section p { font-size: 1.1rem; color: rgba(255,255,255,.75); }
.search-bar {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 50px;
  padding: .6rem 1.5rem;
  color: white;
}
.search-bar::placeholder { color: rgba(255,255,255,.5); }
.search-bar:focus {
  background: rgba(255,255,255,.15);
  border-color: rgba(255,255,255,.4);
  box-shadow: none; color: white;
}

/* ── 管理员侧边栏 ── */
.admin-layout { display: flex; min-height: calc(100vh - 60px); }
.sidebar {
  width: 240px; min-width: 240px;
  background: var(--dark); color: #94A3B8;
  padding: 1.5rem 0;
  display: flex; flex-direction: column;
}
.sidebar .sidebar-section-title {
  font-size: .7rem; text-transform: uppercase;
  letter-spacing: .1em; color: #475569;
  padding: 1.2rem 1.5rem .4rem;
  font-weight: 600;
}
.sidebar .nav-link {
  color: #94A3B8 !important;
  padding: .55rem 1.5rem;
  border-radius: 0;
  font-size: .9rem;
  display: flex; align-items: center; gap: .6rem;
  transition: all var(--transition);
}
.sidebar .nav-link:hover {
  background: rgba(255,255,255,.06);
  color: #E2E8F0 !important;
}
.sidebar .nav-link.active {
  background: var(--primary);
  color: white !important;
}
.sidebar .nav-link i { font-size: 1rem; width: 20px; text-align: center; }
.admin-main { flex: 1; padding: 2rem; overflow-x: auto; }
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.5rem; flex-wrap: wrap; gap: .75rem;
}
.page-title { font-size: 1.4rem; font-weight: 700; margin: 0; }

/* ── 表单设计器 ── */
.designer-layout { display: flex; gap: 1.5rem; }
.field-palette {
  width: 220px; min-width: 220px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}
.field-palette-item {
  display: flex; align-items: center; gap: .5rem;
  padding: .5rem .75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: grab; margin-bottom: .45rem;
  font-size: .875rem; font-weight: 500;
  background: var(--surface);
  transition: all var(--transition);
  user-select: none;
}
.field-palette-item:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
.field-palette-item:active { cursor: grabbing; }
.designer-canvas {
  flex: 1; min-height: 400px;
  background: var(--card-bg);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}
.designer-canvas.drag-over { border-color: var(--primary); background: var(--primary-light); }
.field-item {
  display: flex; align-items: stretch;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  margin-bottom: .65rem;
  transition: box-shadow var(--transition), border-color var(--transition);
  cursor: default;
}
.field-item:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(37,99,235,.12); }
.field-item.sortable-chosen { opacity: .7; }
.field-item .drag-handle {
  width: 32px; display: flex; align-items: center; justify-content: center;
  color: #CBD5E1; cursor: grab; flex-shrink: 0;
  border-right: 1px solid var(--border);
}
.field-item .drag-handle:hover { color: var(--primary); }
.field-item .field-content { flex: 1; padding: .7rem 1rem; }
.field-item .field-label { font-weight: 600; font-size: .9rem; }
.field-item .field-meta { font-size: .78rem; color: var(--text-muted); margin-top: 2px; }
.field-item .field-actions {
  display: flex; align-items: center; gap: .25rem;
  padding: .5rem;
}
.field-prop-panel {
  width: 280px; min-width: 280px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}

/* ── 统计卡片 ── */
.stat-card {
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  color: white;
  position: relative; overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute; right: -20px; bottom: -20px;
  width: 100px; height: 100px;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
}
.stat-card .stat-icon { font-size: 2rem; opacity: .85; }
.stat-card .stat-value { font-size: 2rem; font-weight: 700; line-height: 1; }
.stat-card .stat-label { font-size: .85rem; opacity: .85; margin-top: .25rem; }
.stat-card-blue   { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.stat-card-green  { background: linear-gradient(135deg, #16a34a, #15803d); }
.stat-card-yellow { background: linear-gradient(135deg, #d97706, #b45309); }
.stat-card-purple { background: linear-gradient(135deg, #7c3aed, #6d28d9); }

/* ── 团体成员列表 ── */
.member-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-bottom: .75rem;
}
.member-row .member-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: .75rem;
  font-weight: 600; font-size: .9rem;
}

/* ── 档案选择卡片 ── */
.profile-card-select {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  cursor: pointer;
  transition: all var(--transition);
}
.profile-card-select:hover { border-color: var(--primary); background: var(--primary-light); }
.profile-card-select.selected { border-color: var(--primary); background: var(--primary-light); }
.profile-card-select input[type=radio] { display: none; }

/* ── 报名步骤 ── */
.steps { display: flex; align-items: center; gap: 0; margin-bottom: 2rem; }
.step { display: flex; align-items: center; flex: 1; position: relative; }
.step-circle {
  width: 32px; height: 32px; border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--card-bg);
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 600;
  color: var(--text-muted);
  flex-shrink: 0; z-index: 1;
}
.step.active .step-circle { border-color: var(--primary); background: var(--primary); color: white; }
.step.done .step-circle { border-color: var(--success); background: var(--success); color: white; }
.step-line { height: 2px; background: var(--border); flex: 1; }
.step.done + .step .step-line, .step.done .step-line { background: var(--success); }
.step-label { font-size: .78rem; color: var(--text-muted); margin-top: .35rem; text-align: center; }
.step.active .step-label { color: var(--primary); font-weight: 600; }

/* ── 表格 ── */
.table-hover tbody tr { transition: background var(--transition); }
.table th {
  font-size: .8rem; text-transform: uppercase;
  letter-spacing: .06em; font-weight: 600;
  color: var(--text-muted); background: var(--surface);
}
.table td { vertical-align: middle; font-size: .9rem; }

/* ── 闪现消息 ── */
.alert { border-radius: var(--radius-sm); border: none; font-size: .9rem; }

/* ── 响应式 ── */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .admin-main { padding: 1rem; }
  .designer-layout { flex-direction: column; }
  .field-palette, .field-prop-panel { width: 100%; }
  .hero-section h1 { font-size: 1.6rem; }
}

/* ── 动画 ── */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeIn .3s ease forwards; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.5} }
.pulse { animation: pulse 2s infinite; }

/* ── 分页 ── */
.page-link { border-radius: var(--radius-sm) !important; margin: 0 2px; border-color: var(--border); color: var(--primary); }
.page-item.active .page-link { background: var(--primary); border-color: var(--primary); }

/* ── 空状态 ── */
.empty-state {
  text-align: center; padding: 4rem 2rem;
  color: var(--text-muted);
}
.empty-state i { font-size: 3.5rem; opacity: .35; margin-bottom: 1rem; display: block; }
.empty-state h5 { font-weight: 600; color: var(--text); }

/* ── 通知徽章 ── */
.notif-badge {
  position: absolute; top: 4px; right: 4px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--danger); color: white;
  font-size: .65rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid white;
}

/* ── 报名页专项优化 ── */
.registration-card {
  border-radius: var(--radius);
  background: var(--card-bg);
  border: 1px solid var(--border);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.member-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: all var(--transition);
  position: relative;
}
.member-card:hover { 
  border-color: var(--primary); 
  box-shadow: 0 8px 30px rgba(0,0,0,0.06); 
  transform: translateY(-2px);
}
.member-card .member-header {
  border-bottom: 1px dashed var(--border);
  padding-bottom: 1rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.member-card .member-title {
  font-weight: 700;
  color: var(--dark);
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* 优化 Radio/Checkbox 在 PC 端的对齐 */
.form-check-inline {
  display: inline-flex;
  align-items: center;
  padding-top: 8px;
  margin-right: 1.5rem;
}
.form-check-input { margin-top: 0 !important; cursor: pointer; }
.form-check-label { cursor: pointer; }

/* 优化 Divider 和 Tips */
.form-divider {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
  border-bottom: 2px solid var(--primary-light);
  padding-bottom: 0.4rem;
  margin: 1.5rem 0 1.25rem;
  display: flex;
  align-items: center;
}
.form-divider::before {
  content: '';
  width: 4px; height: 1.2em;
  background: var(--primary);
  margin-right: 10px;
  border-radius: 2px;
}
.form-tips {
  background: var(--primary-light);
  border-left: 4px solid var(--primary);
  padding: 0.85rem 1.1rem;
  border-radius: 6px;
  font-size: 0.875rem;
  color: #1e3a8a;
  margin-bottom: 1.25rem;
}

/* 适配 PC 端显示 (lg 及以上) */
@media (min-width: 992px) {
  .member-card .row > div[class*="col-md-"] {
    margin-bottom: 1.25rem !important;
  }
}
