/* ========================================
   5天线下乐器集训学习系统 - 样式表
   仅移动端适配，单列流式布局
   ======================================== */

/* ---------- CSS变量定义（草原风·蒙古元素） ---------- */
:root {
  --primary: #003D7A;        /* 主色：蒙古永恒蓝 */
  --primary-dark: #002B57;   /* 主色深色 */
  --primary-light: #EBF0F8;  /* 主色浅色背景 */
  --accent: #C8963E;         /* 强调色：草原金 */
  --accent-dark: #A67A2E;    /* 金色深色 */
  --accent-light: #FDF6E8;   /* 金色浅色背景 */
  --mongol-red: #C41E3A;     /* 蒙古红 */
  --success: #52C41A;        /* 成功色：草原绿 */
  --warning: #FAAD14;        /* 警告色：暖橙 */
  --bg: #F5F0E6;             /* 页面背景色：暖色奶茶底 */
  --card-bg: #FFFCF5;        /* 卡片背景色：暖白 */
  --text: #2C1810;           /* 主文字色：深棕 */
  --text-light: #5C4033;     /* 次要文字色 */
  --text-muted: #8B7355;     /* 弱化文字色：浅棕 */
  --border: #D9C9A8;         /* 边框色：暖金边 */
  --shadow: 0 2px 12px rgba(44, 24, 16, 0.1);  /* 卡片阴影（暖色） */
  --radius: 12px;            /* 圆角半径 */
  --radius-sm: 8px;          /* 小圆角 */
}

/* ---------- 全局重置 ---------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;  /* 移除移动端点击高亮 */
}

html {
  font-size: 16px;           /* 移动端基准字体大小 */
  scroll-behavior: smooth;   /* 平滑滚动 */
  overflow-x: hidden;        /* 禁止横向滚动 */
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;        /* 确保不横向滚动 */
  padding-bottom: env(safe-area-inset-bottom);  /* iPhone安全区域适配 */
}

/* ---------- 页面头部（蒙古风格） ---------- */
.header {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  padding: 24px 16px 0;
  text-align: center;
  position: relative;
}

/* 头部底部金色装饰带（蒙古图腾风格） */
.header::after {
  content: '';
  display: block;
  height: 3px;
  background: linear-gradient(to right, transparent 5%, var(--accent) 30%, var(--accent) 70%, transparent 95%);
  margin: 0;
  opacity: 0.6;
}

/* 头部顶部蒙古装饰纹 */
.header-decor-top {
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 6px;
  text-align: center;
  opacity: 0.6;
  margin-bottom: 6px;
}

.header-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 2px;
  margin-bottom: 4px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.header-subtitle {
  font-size: 13px;
  opacity: 0.85;
  margin-bottom: 20px;
}

/* ---------- 级别切换标签（吸顶·金色边） ---------- */
.level-tabs {
  display: flex;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  padding: 0 16px 12px;
  gap: 8px;
  /* 吸顶定位 */
  position: sticky;
  top: 0;
  z-index: 100;
}

.level-tab {
  flex: 1;
  min-height: 44px;          /* 触控区域≥44px */
  border: none;
  border-radius: 22px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.8);
}

.level-tab.active {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  border: 2px solid var(--accent);
}

/* 点击反馈动效 */
.level-tab:active {
  transform: scale(0.95);
}

/* ---------- 主内容区 ---------- */
.main-content {
  padding: 16px;
  max-width: 640px;          /* 限制最大宽度 */
  margin: 0 auto;
}

/* ---------- 级别内容区 ---------- */
.level-content {
  display: none;             /* 默认隐藏 */
}

.level-content.active {
  display: block;            /* 激活时显示 */
  animation: fadeIn 0.35s ease;  /* 淡入动画 */
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.level-desc {
  font-size: 14px;
  color: var(--text-light);
  text-align: center;
  margin-bottom: 16px;
  padding: 10px 16px;
  background: var(--accent-light);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

/* ---------- 手风琴折叠面板 ---------- */
.accordion {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.accordion-item {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.accordion-header {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 56px;          /* 触控区域充足 */
  padding: 14px 16px;
  border: none;
  background: var(--card-bg);
  cursor: pointer;
  transition: background 0.2s;
  gap: 10px;
}

.accordion-header:active {
  background: var(--accent-light);  /* 点击轻反馈 */
}

.day-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  height: 28px;
  padding: 0 10px;
  background: var(--primary);
  color: #fff;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  white-space: nowrap;
  border: 1.5px solid var(--accent);
}

.day-title {
  flex: 1;
  text-align: left;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.accordion-icon {
  font-size: 12px;
  color: var(--text-muted);
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

/* 展开状态的图标旋转 */
.accordion-item.open .accordion-icon {
  transform: rotate(90deg);
}

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.accordion-item.open .accordion-body {
  max-height: 800px;         /* 展开时足够高 */
}

.accordion-content {
  padding: 4px 16px 18px;
}

.accordion-content h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  margin: 12px 0 6px;
  padding-left: 10px;
  border-left: 3px solid var(--primary);
}

.accordion-content ul {
  list-style: none;
  padding-left: 0;
}

.accordion-content li {
  position: relative;
  padding: 5px 0 5px 20px;
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.7;
}

.accordion-content li::before {
  content: "◆";
  position: absolute;
  left: 4px;
  color: var(--accent);
  font-weight: 700;
  font-size: 10px;
}

/* ---------- 学习资料区 ---------- */
.resources-section {
  margin-top: 24px;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.instructors-section {
  margin-top: 24px;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

.phone-section {
  margin-top: 24px;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

.phone-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 0;
}

.phone-number {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 1.5px;
}

.copy-btn {
  padding: 8px 16px;
  background: var(--accent);
  color: #fff;
  border: 2px solid var(--accent-dark);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  letter-spacing: 1px;
}

.copy-btn:active {
  background: var(--accent-dark);
}

.copy-btn.copied {
  background: var(--success);
}

.instructor-list {
  padding: 0 4px;
}

/* 培训地址区 */
.address-section {
  margin-top: 24px;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

.address-box {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 12px;
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.address-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 0.5px;
  text-align: center;
  line-height: 1.6;
}


.section-title {
  font-size: 17px;
  font-weight: 700;
  padding: 18px 16px 4px;
  text-align: center;
  color: var(--primary);
  position: relative;
}

/* 标题底部蒙古纹饰 */
.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--accent), transparent);
  margin: 6px auto 0;
}

.section-desc {
  font-size: 13px;
  color: var(--text-muted);
  padding: 0 16px 12px;
}

.section-desc span {
  color: var(--primary);
  font-weight: 600;
}

/* 资料分类Tab */
.resource-tabs {
  display: flex;
  padding: 0 16px;
  gap: 8px;
  margin-bottom: 12px;
}

.resource-tab {
  flex: 1;
  min-height: 40px;          /* 触控区域≥44px */
  padding: 8px 4px;
  border: 2px solid var(--border);
  border-radius: 20px;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.25s ease;
}

.resource-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.resource-tab:active {
  transform: scale(0.95);
}

/* 资料面板 */
.resource-panel {
  display: none;
  padding: 0 16px 18px;
}

.resource-panel.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

/* 资料列表项 */
.resource-item {
  display: flex;
  align-items: center;
  padding: 14px 12px;
  margin-bottom: 8px;
  background: var(--accent-light);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s ease;
  min-height: 52px;
}

.resource-item:active {
  background: #F5EBD4;
  border-color: var(--accent);
  transform: scale(0.98);
}

.resource-item .res-icon {
  font-size: 22px;
  margin-right: 12px;
  flex-shrink: 0;
}

.resource-item .res-info {
  flex: 1;
  min-width: 0;
}

.resource-item .res-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resource-item .res-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  display: block;
}

.resource-item .res-arrow {
  font-size: 14px;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-left: 8px;
}

/* ---------- 指导老师卡片 ---------- */
.instructor-card {
  margin-bottom: 12px;
  background: var(--accent-light);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow: hidden;
}

.instructor-photo-wrap {
  width: 100%;
}

.instructor-photo {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

.instructor-name {
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  padding: 12px 0 8px;
  display: block;
}

.instructor-info {
  padding: 12px 14px;
}

.instructor-role {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.6;
  display: block;
}

/* ---------- 照片大图浮层 ---------- */
.lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
}

.lightbox-img {
  max-width: 100%;
  max-height: 85vh;
  border-radius: 8px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.lightbox-close {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ---------- 页脚 ---------- */
.footer {
  margin-top: 24px;
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  padding: 24px 16px 36px;
}

.footer-content {
  max-width: 640px;
  margin: 0 auto;
}

.footer-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

.footer-notes {
  list-style: none;
  padding: 0;
}

.footer-notes li {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.8;
  padding: 2px 0;
}

.footer-copy {
  margin-top: 20px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

/* 页脚底部蒙古装饰纹 */
.footer-copy::after {
  content: '᠅᠅᠅  ☽  ᠅᠅᠅';
  display: block;
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 3px;
  margin-top: 12px;
  opacity: 0.5;
}

/* ---------- 回到顶部按钮 ---------- */
.back-to-top {
  position: fixed;
  right: 16px;
  bottom: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: 2px solid var(--accent-dark);
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(200, 150, 62, 0.4);
  transition: all 0.3s ease;
  opacity: 0;
  visibility: hidden;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:active {
  transform: scale(0.9);
  background: var(--accent-dark);
}

/* ---------- 适配小屏幕（≤375px） ---------- */
@media screen and (max-width: 375px) {
  .header-title {
    font-size: 19px;
  }
  .level-tab {
    font-size: 14px;
  }
  .resource-tab {
    font-size: 12px;
  }
  .accordion-content li {
    font-size: 13px;
  }
}
