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

:root {
  --primary-cyan: #7DD8D8;
  --primary-blue: #5BB8C9;
  --primary-orange: #F5A623;
  --primary-yellow: #F8C754;
  --bg-light: #E8F6F6;
  --bg-white: #FFFFFF;
  --text-dark: #2D4A5A;
  --text-light: #6B8A9A;
  --sand: #F5E6C8;
  --border: #D4ECEC;
  --shadow: 0 4px 20px rgba(91, 184, 201, 0.15);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg-light);
  color: var(--text-dark);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Banner */
.banner {
  width: 100%;
  position: relative;
  overflow: hidden;
}

.banner-img {
  width: 100%;
  display: block;
}

/* Section */
.section {
  margin: 16px;
  padding: 20px;
  background: var(--bg-white);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--primary-cyan);
}

.title-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary-cyan), var(--primary-blue));
  border-radius: 10px;
  color: white;
}

.title-icon svg {
  width: 20px;
  height: 20px;
}

.section-title h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-dark);
}

/* 报名须知 */
.notice-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.notice-item h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--primary-blue);
  margin-bottom: 6px;
}

.notice-item p {
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.7;
}

.notice-item strong {
  color: var(--primary-orange);
}

.location-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 10px 16px;
  background: linear-gradient(135deg, var(--primary-cyan), var(--primary-blue));
  color: white;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.location-btn:active {
  transform: scale(0.97);
  box-shadow: 0 2px 10px rgba(91, 184, 201, 0.3);
}

.location-icon {
  display: flex;
  align-items: center;
}

.location-icon svg {
  width: 18px;
  height: 18px;
}

/* 活动流程 */
.schedule-table {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.schedule-header {
  display: grid;
  grid-template-columns: 1fr 1fr 2fr;
  background: linear-gradient(135deg, var(--primary-cyan), var(--primary-blue));
  color: white;
  font-weight: 600;
  font-size: 14px;
  padding: 12px 16px;
}

.schedule-row {
  display: grid;
  grid-template-columns: 1fr 1fr 2fr;
  padding: 12px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
}

.schedule-row:last-child {
  border-bottom: none;
}

.schedule-row:nth-child(even) {
  background: rgba(125, 216, 216, 0.08);
}

.schedule-row.highlight {
  background: rgba(245, 166, 35, 0.08);
}

.schedule-row span {
  display: flex;
  align-items: center;
}

/* 报名表单 */
.reg-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
}

.required {
  color: #E74C3C;
}

.form-group input[type="text"],
.form-group input[type="tel"],
.form-group input[type="number"],
.form-group select {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-size: 15px;
  color: var(--text-dark);
  background: var(--bg-white);
  transition: border-color 0.3s, box-shadow 0.3s;
  -webkit-appearance: none;
  appearance: none;
}

.form-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B8A9A' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary-cyan);
  box-shadow: 0 0 0 3px rgba(125, 216, 216, 0.2);
}

.form-group input::placeholder {
  color: #B0C4CE;
}

/* Radio */
.radio-group {
  display: flex;
  gap: 24px;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 400 !important;
  color: var(--text-dark) !important;
}

.radio-label input[type="radio"] {
  display: none;
}

.radio-custom {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 50%;
  position: relative;
  transition: border-color 0.3s;
}

.radio-label input[type="radio"]:checked + .radio-custom {
  border-color: var(--primary-blue);
}

.radio-label input[type="radio"]:checked + .radio-custom::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  background: var(--primary-blue);
  border-radius: 50%;
}

/* Checkbox */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 400 !important;
  color: var(--text-light) !important;
}

.checkbox-label input[type="checkbox"] {
  display: none;
}

.checkbox-custom {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 6px;
  position: relative;
  transition: all 0.3s;
  flex-shrink: 0;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
  background: var(--primary-blue);
  border-color: var(--primary-blue);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 6px;
  width: 5px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.link {
  color: var(--primary-blue);
  text-decoration: none;
  font-weight: 500;
}

/* Submit Button */
.submit-btn {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--primary-orange), #E8941A);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 15px rgba(245, 166, 35, 0.35);
}

.submit-btn:active {
  transform: scale(0.98);
  box-shadow: 0 2px 8px rgba(245, 166, 35, 0.3);
}

.submit-btn:disabled {
  background: #CCC;
  box-shadow: none;
  cursor: not-allowed;
}

/* Footer */
.footer {
  text-align: center;
  padding: 30px 16px 40px;
  color: var(--text-light);
  font-size: 13px;
}

.footer-sub {
  font-size: 12px;
  margin-top: 4px;
  color: #A0B8C4;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: 16px;
  width: 100%;
  max-width: 400px;
  max-height: 80vh;
  overflow: hidden;
  animation: modalIn 0.3s ease;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 18px;
  color: var(--text-dark);
}

.modal-close {
  font-size: 28px;
  color: var(--text-light);
  cursor: pointer;
  line-height: 1;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  max-height: 50vh;
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.8;
}

.modal-body p {
  margin-bottom: 10px;
}

.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.modal-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--primary-cyan), var(--primary-blue));
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

/* Success Modal */
.success-modal {
  text-align: center;
  padding: 30px 20px;
}

.success-icon {
  margin-bottom: 12px;
}

.success-icon svg {
  animation: checkmark 0.5s ease-in-out;
}

@keyframes checkmark {
  0% { transform: scale(0); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.success-modal h3 {
  font-size: 20px;
  color: var(--text-dark);
  margin-bottom: 10px;
}

.success-modal p {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 6px;
}

.success-sub {
  font-size: 13px !important;
  color: #A0B8C4 !important;
}

.success-modal .modal-btn {
  margin-top: 20px;
  max-width: 200px;
  margin-left: auto;
  margin-right: auto;
}

/* Wave Decoration */
.notice-section::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 0;
  right: 0;
  height: 8px;
  background: linear-gradient(135deg, var(--primary-cyan), var(--primary-blue));
  border-radius: 16px 16px 0 0;
}

.notice-section {
  position: relative;
}

/* Map Container */
.map-container {
  width: 100% !important;
  height: 200px !important;
  min-height: 200px;
  margin-top: 12px;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid var(--border);
  position: relative;
  background: #f5f5f5;
  display: block;
}

.map-container::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}

.map-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--text-light);
  font-size: 14px;
}

.amap-container {
  width: 100% !important;
  height: 100% !important;
}

/* 地图加载失败兜底 */
.map-fallback {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(135deg, #E8F6F6, #D6EBF0);
}

.map-fallback svg {
  margin-bottom: 4px;
}

.map-fallback-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-dark);
}

.map-fallback-coord {
  font-size: 12px;
  color: var(--text-light);
}

.map-fallback-btn {
  margin-top: 8px;
  padding: 8px 24px;
  background: linear-gradient(135deg, var(--primary-orange), #E8941A);
  color: white;
  border: none;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

/* Responsive */
@media (min-width: 768px) {
  body {
    max-width: 480px;
    margin: 0 auto;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.1);
  }
}

/* 表单内查看分组文字按钮 */
.team-link-text {
  display: block;
  text-align: center;
  margin-top: 16px;
  color: var(--primary-blue);
  font-size: 15px;
  text-decoration: none;
  font-weight: 600;
}

/* 分组页面 */
.roster-header {
  padding: 24px 20px 16px;
  text-align: center;
  background: linear-gradient(135deg, var(--primary-blue), var(--primary-cyan));
  color: #fff;
}

.back-btn {
  position: absolute;
  left: 16px;
  top: 24px;
  color: #fff;
  text-decoration: none;
  font-size: 15px;
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 20px;
}

.roster-header h1 {
  font-size: 22px;
}

.roster-sub {
  margin-top: 4px;
  font-size: 13px;
  opacity: 0.9;
}

.team-list {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.team-loading {
  text-align: center;
  color: var(--text-light);
  padding: 40px 0;
}

.team-card {
  background: var(--bg-white);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.team-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: var(--bg-light);
  border-bottom: 2px solid var(--primary-cyan);
}

.team-card-head h3 {
  font-size: 17px;
  color: var(--text-dark);
}

.team-count {
  font-size: 13px;
  color: var(--text-light);
}

.team-members {
  padding: 4px 18px;
}

.member-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
}

.member-row:last-child {
  border-bottom: none;
}

.member-name {
  font-weight: 600;
  color: var(--text-dark);
  min-width: 64px;
}

.member-info {
  flex: 1;
  font-size: 13px;
  color: var(--text-light);
}

.member-gender {
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 20px;
}

.member-gender.male {
  background: #E3F2FD;
  color: #1E88E5;
}

.member-gender.female {
  background: #FCE4EC;
  color: #E91E63;
}

.team-empty {
  padding: 18px;
  text-align: center;
  color: var(--text-light);
  font-size: 14px;
}
