:root {
  --color-primary: #C53030;
  --color-primary-dark: #9B2C2C;
  --color-primary-light: #E53E3E;
  --color-secondary: #D69E2E;
  --color-secondary-dark: #B7791F;
  --color-dark: #1A202C;
  --color-dark-secondary: #2D3748;
  --color-bg: #FFFDF7;
  --color-bg-alt: #FFF8F0;
  --color-text: #2D3748;
  --color-text-light: #718096;
  --radius-full: 9999px;
  --max-width: 480px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior: none;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  overflow-x: hidden;
  min-height: 100vh;
  min-height: 100dvh;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  text-decoration: none;
}

button {
  cursor: pointer;
  font-family: inherit;
}

/* ===== 导航栏 - 毛玻璃特效 ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(26, 32, 44, 0.75);
  backdrop-filter: blur(15px) saturate(180%);
  -webkit-backdrop-filter: blur(15px) saturate(180%);
  z-index: 100;
  border-bottom: 1px solid rgba(214, 158, 46, 0.3);
}

.logo {
  font-weight: 900;
  font-size: 1.35rem;
  color: var(--color-secondary);
  letter-spacing: -0.5px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.btn-sm {
  display: inline-block;
  background-color: var(--color-primary);
  color: white;
  padding: 0.5rem 1.2rem;
  border-radius: var(--radius-full);
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: 0 4px 10px rgba(197, 48, 48, 0.3);
}

/* ===== Hero Section - 武韵主视觉 ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: flex-end;
  padding: 2.5rem 2rem;
  padding-bottom: 6rem;
  overflow: hidden;
  z-index: 1;
}

.hero-bg {
  position: absolute;
  top: -10%;
  left: -5%;
  width: 110%;
  height: 120%;
  background-size: cover;
  background-position: center;
  z-index: 1;
}

.hero-bg-b {
  opacity: 0;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* 深红到黑的高级渐变，营造武术庄重感 */
  background: linear-gradient(to top, rgba(26,32,44,0.97) 0%, rgba(128,0,0,0.6) 35%, rgba(197,48,48,0.25) 70%, rgba(26,32,44,0.1) 100%);
  z-index: 2;
  pointer-events: none;
}

.hero-content {
  position: relative;
  color: white;
  width: 100%;
  z-index: 3;
}

.invite-banner {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  margin-bottom: 1.25rem;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  background: rgba(214, 158, 46, 0.25);
  color: rgba(255, 255, 255, 0.96);
  font-size: 0.9rem;
  font-weight: 600;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(214, 158, 46, 0.3);
}

/* Hero 标题大字 - 逐字动画 */
.hero-title {
  font-size: 3.2rem;
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 1.1;
  text-shadow: 0 3px 15px rgba(0,0,0,0.4);
}

.hero-title .char {
  display: inline-block;
  opacity: 0;
  animation: charIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes charIn {
  0% { opacity: 0; transform: translateY(20px) scale(0.9); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.hero-subtitle {
  font-size: 1.1rem;
  margin-top: 0.75rem;
  opacity: 0;
  color: rgba(255,255,255,0.85);
  font-weight: 500;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
  letter-spacing: 0.3px;
}

.hero-cta-group {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.75rem;
  opacity: 0;
}

.btn-primary {
  display: inline-block;
  background-color: var(--color-primary);
  color: white;
  padding: 1rem 2rem;
  border-radius: var(--radius-full);
  text-align: center;
  font-weight: 700;
  font-size: 1.1rem;
  border: none;
  box-shadow: 0 8px 20px rgba(197, 48, 48, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary:active {
  transform: scale(0.97);
  box-shadow: 0 4px 12px rgba(197, 48, 48, 0.3);
}

.btn-secondary {
  display: inline-block;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  padding: 0.9rem 1.8rem;
  border-radius: var(--radius-full);
  text-align: center;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* 武术特色标签 */
.feature-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 2rem;
  justify-content: center;
}

.pill {
  display: inline-block;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  background: rgba(214, 158, 46, 0.2);
  color: var(--color-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid rgba(214, 158, 46, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* ===== Section 通用 ===== */
.section {
  padding: 3rem 1.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-alt {
  background: var(--color-bg-alt);
  max-width: none;
  padding: 3rem 1.5rem;
}

.section-title {
  font-size: 1.6rem;
  font-weight: 800;
  text-align: center;
  color: var(--color-dark);
  margin-bottom: 1.75rem;
  letter-spacing: -0.3px;
}

.section-title::after {
  content: '';
  display: block;
  width: 50px;
  height: 4px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
  border-radius: 2px;
  margin: 12px auto 0;
}

/* ===== 特色卡片 ===== */
.features-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.feature-card {
  background: white;
  padding: 1.5rem 1rem;
  border-radius: 16px;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  border: 1px solid rgba(197, 48, 48, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:active {
  transform: scale(0.97);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 0.6rem;
}

.feature-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-dark);
  margin-bottom: 0.5rem;
}

.feature-card p {
  font-size: 0.82rem;
  color: var(--color-text-light);
  line-height: 1.5;
}

/* ===== 课程列表 ===== */
.course-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.course-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: white;
  padding: 1.2rem 1.2rem;
  border-radius: 14px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
  border-left: 4px solid var(--color-primary);
}

.course-icon {
  font-size: 2.2rem;
  flex-shrink: 0;
}

.course-item h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-dark);
  margin-bottom: 0.25rem;
}

.course-desc {
  font-size: 0.82rem;
  color: var(--color-text-light);
  margin-bottom: 0.4rem;
}

.course-tag {
  display: inline-block;
  background: var(--color-primary);
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}

/* ===== Gallery 画廊 ===== */
.gallery-carousel {
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin: 0 -1.5rem;
  padding: 0 1.5rem;
}

.gallery-carousel::-webkit-scrollbar {
  display: none;
}

.gallery-track {
  display: flex;
  gap: 1rem;
  width: max-content;
}

.gallery-item {
  scroll-snap-align: start;
  border-radius: 16px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.gallery-landscape {
  width: 280px;
  height: 200px;
}

.gallery-portrait {
  width: 220px;
  height: 290px;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ===== 报名流程 ===== */
.steps {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.step {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: white;
  padding: 1rem 1.2rem;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  border: 1px solid rgba(197, 48, 48, 0.08);
}

.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: white;
  border-radius: 50%;
  font-weight: 800;
  font-size: 1rem;
  flex-shrink: 0;
}

.step h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-dark);
  margin-bottom: 0.2rem;
}

.step p {
  font-size: 0.8rem;
  color: var(--color-text-light);
}

.step-arrow {
  text-align: center;
  color: var(--color-primary-light);
  font-size: 1.2rem;
  padding: 0.1rem 0;
  opacity: 0.6;
}

/* ===== 联系区 ===== */
.contact-section {
  max-width: none;
  padding: 3rem 1.5rem;
  background: linear-gradient(135deg, var(--color-dark) 0%, #2D3748 100%);
}

.contact-section .section-title {
  color: white;
}

.contact-section .section-title::after {
  background: linear-gradient(90deg, var(--color-secondary), var(--color-primary));
}

.contact-card {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255,255,255,0.08);
  padding: 1rem 1.2rem;
  border-radius: 14px;
  border: 1px solid rgba(214, 158, 46, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.contact-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-secondary);
  flex-shrink: 0;
}

.contact-value {
  flex: 1;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.85);
}

.contact-item .btn-sm {
  flex-shrink: 0;
}

/* ===== Footer ===== */
.footer {
  text-align: center;
  padding: 2rem 1.5rem;
  background: var(--color-dark);
  color: rgba(255,255,255,0.6);
  font-size: 0.85rem;
}

.footer p {
  margin-bottom: 0.3rem;
}

.footer-sub {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.4);
}

/* ===== 模态框 ===== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: white;
  padding: 2rem 1.5rem;
  border-radius: 20px;
  width: 100%;
  max-width: 420px;
  text-align: center;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  max-height: 90vh;
  overflow-y: auto;
}

.close-modal {
  position: absolute;
  top: 12px;
  right: 18px;
  font-size: 2rem;
  color: #A0AEC0;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}

.close-modal:hover {
  color: var(--color-dark);
}

.modal-content h2 {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--color-dark);
  margin-bottom: 0.5rem;
}

.share-preview {
  background: #F7FAFC;
  padding: 1rem;
  border-radius: 12px;
  margin: 1rem 0;
  border: 1px solid #E2E8F0;
  text-align: left;
}

.share-buttons {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.share-buttons .btn-primary,
.share-buttons .btn-secondary {
  flex: 1;
}

/* ===== 模态框表单 ===== */
.modal-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.modal-label {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--color-dark);
  margin-top: 0.3rem;
}

.modal-input {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  background: #F7FAFC;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.modal-input:focus {
  border-color: var(--color-primary);
  background: white;
}

textarea.modal-input {
  resize: vertical;
  min-height: 70px;
}

/* ===== Action Sheet（底部操作面板）===== */
.action-sheet-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 3000;
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.action-sheet-overlay.active {
  display: flex;
}

.action-sheet {
  background: white;
  width: 100%;
  max-width: 500px;
  border-radius: 20px 20px 0 0;
  padding: 1.5rem 1.5rem 2.5rem;
  box-shadow: 0 -8px 30px rgba(0,0,0,0.1);
}

.action-sheet-title {
  text-align: center;
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-dark);
  margin-bottom: 1rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid #E2E8F0;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 1rem;
  border: none;
  background: #F7FAFC;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-dark);
  margin-bottom: 0.6rem;
  transition: background 0.15s;
  cursor: pointer;
}

.action-btn:active {
  background: #EDF2F7;
}

.action-icon {
  font-size: 1.4rem;
}

.action-cancel {
  justify-content: center;
  background: transparent;
  border: 1px solid #E2E8F0;
  color: #A0AEC0;
  margin-top: 0.5rem;
}

/* ===== 工具类 ===== */
/* 禁用滚动 */
body.scroll-locked {
  overflow: hidden !important;
  position: fixed;
  width: 100%;
}

/* ===== 安全区域适配 ===== */
@supports (padding-top: env(safe-area-inset-top)) {
  .navbar {
    padding-top: calc(1rem + env(safe-area-inset-top));
  }
  
  .hero {
    padding-bottom: calc(6rem + env(safe-area-inset-bottom));
  }
}

/* ===== 深色模式适配 ===== */
@media (prefers-color-scheme: dark) {
  .feature-card {
    background: #2D3748;
    border-color: rgba(197, 48, 48, 0.2);
  }
  
  .feature-card h3 {
    color: #F7FAFC;
  }
  
  .course-item {
    background: #2D3748;
  }
  
  .course-item h3 {
    color: #F7FAFC;
  }
  
  .step {
    background: #2D3748;
  }
  
  .step h3 {
    color: #F7FAFC;
  }
  
  .modal-content {
    background: #1A202C;
    color: #F7FAFC;
  }
  
  .modal-content h2,
  .modal-label {
    color: #F7FAFC;
  }
  
  .modal-input {
    background: #2D3748;
    border-color: #4A5568;
    color: #F7FAFC;
  }
  
  .modal-input:focus {
    border-color: var(--color-primary);
    background: #2D3748;
  }
  
  .share-preview {
    background: #2D3748;
    border-color: #4A5568;
  }
  
  .action-sheet {
    background: #1A202C;
  }
  
  .action-sheet-title {
    color: #F7FAFC;
    border-bottom-color: #4A5568;
  }
  
  .action-btn {
    background: #2D3748;
    color: #F7FAFC;
  }
  
  .action-btn:active {
    background: #4A5568;
  }
}