* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
  "PingFang SC", "Microsoft YaHei", sans-serif;
}

:root {
  --primary-blue: #0A2463;
  --accent-red: #D62828;
  --accent-yellow: #FFD166;
  --light-gray: #F8F9FA;
  --dark-gray: #212529;
  --medium-blue: #1E40AF;
}

body {
  background-color: #f5f7fb;
  color: var(--dark-gray);
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== Header ===== */
.header {
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--medium-blue) 100%);
  color: white;
  padding: 2rem 0;
  text-align: center;
  border-bottom: 5px solid var(--accent-red);
  position: relative;
  overflow: hidden;
}

.header::before {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: 0;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
  background-size: 20px 20px;
  opacity: 0.3;
}

.header .container {
  position: relative;
  z-index: 1;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.header .school-name {
  font-size: 1.4rem;
  font-weight: 700;
}

.header .school-name a {
  color: white;
  text-decoration: none;
}

.header .school-name a:hover {
  color: var(--accent-yellow);
}

.header-links {
  display: flex;
  gap: 16px;
  align-items: center;
}

.header-links a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 4px 10px;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 4px;
  transition: all 0.2s;
}

.header-links a:hover {
  color: white;
  border-color: white;
  background: rgba(255,255,255,0.1);
}

.header .subtitle {
  font-size: 1.6rem;
  font-weight: 700;
  margin-top: 0.5rem;
}

.header .campus-tag {
  font-size: 0.85rem;
  opacity: 0.75;
  margin-top: 0.3rem;
}

.lang-switch {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 8px;
}

.lang-switch button {
  width: 28px;
  height: 28px;
  font-size: 11px;
  font-weight: 500;
  background: transparent;
  color: rgba(255,255,255,0.7);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 4px;
  cursor: pointer;
}

.lang-switch button.active {
  background: rgba(255,255,255,0.2);
  color: white;
  border-color: white;
  font-weight: 600;
}

/* ===== Ad Section ===== */
.promo-section {
  padding: 40px 0;
  text-align: center;
}

.promo-section img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

/* ===== Topics Section ===== */
.topics-section {
  padding: 60px 0;
  background: white;
}

.topics-section h2 {
  text-align: center;
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--primary-blue);
}

.topics-schedule {
  text-align: center;
  font-size: 15px;
  line-height: 1.7;
  color: #555;
  margin-bottom: 36px;
  padding: 0 10px;
}

.topics-schedule small {
  font-size: 13px;
}
.topic-schedule > small:last-child {
  font-size: 5px;
  color: #999;
}
.topic-schedule sup {
  font-size: 9px;
  top: -0.3em;
}

.topics-notes {
  font-size: 13px;
  line-height: 1.6;
  color: #888;
  margin-top: 30px;
  padding: 0 10px;
  text-align: left;
}

.carousel-wrapper {
  position: relative;
}

.carousel-container {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  gap: 24px;
  padding: 12px 0 24px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  cursor: grab;
}

.carousel-container::-webkit-scrollbar {
  display: none;
}

.topic-card {
  flex: 0 0 320px;
  scroll-snap-align: start;
  background: var(--light-gray);
  border-radius: 12px;
  padding: 28px 24px;
  text-align: center;
  border: 1px solid #e5e7eb;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.topic-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.topic-card .icon {
  margin: 0 auto 16px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.topic-card .icon img {
  height: 100%;
  width: auto;
}

.topic-card h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--primary-blue);
  line-height: 1.3;
  min-height: 47px;
}

.topic-subtitle {
  font-size: 13px;
  color: var(--accent-red);
  font-weight: 600;
  margin-bottom: 12px;
  line-height: 1.3;
  min-height: 34px;
}

.topic-lang-list {
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  margin-top: 16px;
  margin-bottom: 0;
  color: #374151;
}

.topic-flex-grow {
  display: flex;
  flex-direction: column;
}

.topic-philosophy {
  font-size: 13px;
  color: #4b5563;
  line-height: 1.6;
  margin-bottom: 16px;
  text-align: left;
}

.topic-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  border-top: 1px solid #e5e7eb;
  padding-top: 12px;
  padding-bottom: 12px;
}

.topic-detail {
  font-size: 12px;
  line-height: 1.5;
  color: #6b7280;
  text-align: left;
}

.topic-schedule {
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid #e5e7eb;
  min-height: 100px;
}

.topic-card-daycare {
  flex: 0 0 384px !important;
}

.topic-fee {
  display: none;
}
.admin-mode .topic-fee {
  display: block;
}

.topic-class {
  font-size: 12px;
  color: #374151;
  font-weight: 600;
  margin-top: 8px;
  text-align: center;
}

.topic-card .btn-enroll {
  display: block;
  width: 100%;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 600;
  color: white;
  background: var(--accent-red);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

.topic-card .btn-enroll:hover {
  background: #b71c1c;
}

.btn-schedule-detail {
  display: block;
  width: 100%;
  padding: 8px 24px;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--primary-blue, #0A2463);
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-schedule-detail:hover {
  background: #dbeafe;
}
.schedule-detail-placeholder {
  height: 35px;
  margin-bottom: 8px;
}

/* Lightbox */
.lightbox-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.85);
  justify-content: center;
  align-items: center;
  flex-direction: column;
  touch-action: pinch-zoom;
}
.lightbox-image {
  max-width: 95vw;
  max-height: 95vh;
  object-fit: contain;
  cursor: zoom-in;
  border-radius: 4px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  transition: transform 0.2s;
  user-select: none;
  -webkit-user-drag: none;
  position: relative;
}
.lightbox-image.lightbox-zoomed {
  cursor: grab;
  max-width: none;
  max-height: none;
  width: auto;
  height: auto;
}
.lightbox-title {
  color: #fff;
  background: rgba(0,0,0,0.6);
  padding: 12px 20px;
  border-radius: 8px;
  max-width: 90vw;
  text-align: center;
  font-size: 15px;
  line-height: 1.5;
  margin-bottom: 12px;
}
.lightbox-close {
  position: absolute;
  top: 16px;
  right: 24px;
  font-size: 36px;
  color: white;
  cursor: pointer;
  opacity: 0.8;
  line-height: 1;
  z-index: 10000;
}
.lightbox-close:hover {
  opacity: 1;
}

/* Carousel Navigation */
.carousel-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-top: 20px;
}

.carousel-arrow {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid #d1d5db;
  background: white;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.carousel-arrow:hover {
  background: var(--primary-blue);
  color: white;
  border-color: var(--primary-blue);
}

.carousel-dots {
  display: flex;
  gap: 8px;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid #d1d5db;
  background: white;
  cursor: pointer;
  transition: all 0.2s;
}

.carousel-dot.active {
  background: var(--primary-blue);
  border-color: var(--primary-blue);
}

/* ===== Contact Form Section ===== */
.contact-section {
  padding: 60px 0;
  background: var(--light-gray);
}

.contact-section h2 {
  text-align: center;
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--primary-blue);
}

.contact-section .subtitle {
  text-align: center;
  color: #6b7280;
  font-size: 14px;
  margin-bottom: 32px;
}

.contact-form {
  max-width: 560px;
  margin: 0 auto;
}

.form-row {
  margin-bottom: 20px;
}

.form-field {
  display: flex;
  flex-direction: column;
}

.form-field label {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 6px;
}

.form-field input,
.form-field textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.5;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-family: inherit;
  box-sizing: border-box;
}

.form-field textarea {
  resize: vertical;
  min-height: 120px;
}

.contact-note {
  font-size: 13px;
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 4px;
  padding: 10px 12px;
  margin: 0;
  line-height: 1.5;
}

.form-actions {
  margin-top: 24px;
}

.form-actions button {
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 4px;
  border: 1px solid #9ca3af;
  background: var(--accent-red);
  color: white;
  cursor: pointer;
  transition: background 0.2s;
}

.form-actions button:hover {
  background: #b71c1c;
}

.required {
  color: #dc2626;
  margin-left: 4px;
  font-weight: 600;
}

/* ===== School Selector ===== */
.school-select-trigger {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  color: #374151;
  box-sizing: border-box;
  user-select: none;
  transition: border-color 0.15s;
}
.school-select-trigger:hover,
.school-select-trigger.open {
  border-color: var(--primary-blue);
}
.school-select-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.school-select-arrow {
  margin-left: 8px;
  font-size: 12px;
  color: #9ca3af;
  transition: transform 0.2s;
}
.school-select-trigger.open .school-select-arrow {
  transform: rotate(180deg);
}
.school-select-panel {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 9999;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  margin-top: 2px;
}
.school-select-panel.open {
  display: flex;
  flex-direction: column;
}
.school-search-input {
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-bottom: 1px solid #e5e7eb;
  font-size: 14px;
  color: #374151;
  outline: none;
  box-sizing: border-box;
  border-radius: 6px 6px 0 0;
}
.school-search-input:focus {
  border-bottom-color: var(--primary-blue);
}
.school-options-wrapper {
  max-height: 280px;
  overflow-y: auto;
}
.school-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid #f3f4f6;
  transition: background 0.1s;
}
.school-option:last-child {
  border-bottom: none;
}
.school-option:hover {
  background: #eff6ff;
}
.school-option-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.school-option-icon svg {
  display: block;
}
.school-option-text {
  flex: 1;
  min-width: 0;
}
.school-option-name {
  font-size: 13px;
  font-weight: 600;
  color: #1f2937;
  line-height: 1.3;
}
.school-option-addr {
  font-size: 11px;
  color: #6b7280;
  line-height: 1.3;
  margin-top: 2px;
}
.school-option-custom {
  border-top: 2px solid #e5e7eb;
  margin-top: 4px;
}
.school-address-input {
  width: 100%;
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  color: #374151;
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.school-address-input:focus {
  border-color: var(--primary-blue);
  outline: none;
  box-shadow: 0 0 0 3px rgba(10,36,99,0.1);
}
.school-map-container {
  width: 100%;
  height: 320px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  overflow: hidden;
  margin-top: 16px;
}
.school-map-container .leaflet-container {
  width: 100%;
  height: 100%;
}
.school-marker-icon {
  background: none !important;
  border: none !important;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .header .school-name {
    font-size: 1.1rem;
  }

  .header .subtitle {
    font-size: 1.2rem;
  }

  .carousel-container {
    gap: 16px;
    padding: 12px 12px 24px;
  }

  .topic-card {
    flex: 0 0 calc(100vw - 60px);
    padding: 20px 16px;
  }

  .topic-card-daycare {
    flex: 0 0 calc(100vw - 60px) !important;
  }

  .topic-schedule {
    min-height: 100px;
  }

  .topic-fee {
    min-height: 96px;
  }

  .header-top {
    flex-direction: column;
  }

  .topics-section {
    padding: 40px 0;
  }

  .topics-section h2 {
    font-size: 22px;
  }

  .topic-card h3 {
    font-size: 16px;
  }
}
