/* ============================================================
   Tommy English Website - 主样式表
   配色方案：
     主文字：  #0f172a (深海军蓝)
     主按钮：  #ff7a00 (活力橙)
     次按钮：  #0d9488 (深湖绿)
     浅区块：  #f1f5f9
     暖区块：  #fff9f0
     页脚：    #0f172a
     卡片：    #ffffff
   ============================================================ */

/* ---------- CSS 变量 & 全局重置 ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: #0f172a;
  line-height: 1.7;
  background: #ffffff;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.3s ease;
}

ul {
  list-style: none;
}

/* ---------- 公共容器 ---------- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- 公共模块标题 ---------- */
.section {
  padding: 88px 0;
}

.section-header {
  text-align: center;
  margin-bottom: 56px;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 8px;
}

.section-subtitle {
  font-size: 1rem;
  color: #64748b;
  margin-bottom: 16px;
}

.decorative-line {
  width: 48px;
  height: 4px;
  background: #0d9488;
  border-radius: 2px;
  margin: 0 auto;
}

/* ---------- 按钮公共样式 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  border-radius: 50px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.btn-primary {
  background: #ff7a00;
  color: #ffffff;
}
.btn-primary:hover {
  background: #e06b00;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 122, 0, 0.35);
}

.btn-outline {
  background: transparent;
  color: #ffffff;
  border: 2px solid #ffffff;
}
.btn-outline:hover {
  background: #ffffff;
  color: #0f172a;
}

/* 霓虹流光人格测试按钮 — 更大更粗，彩虹渐变 */
.btn-neon-test {
  padding: 16px 42px;
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  border: none;
  background: linear-gradient(135deg, #ec4899 0%, #f43f5e 50%, #e11d48 100%);
  box-shadow: 0 4px 24px rgba(236,72,153,0.45);
  animation: neonFlow 4.5s linear infinite;
  letter-spacing: 0.04em;
}
.btn-neon-test:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 8px 32px rgba(236,72,153,0.55);
}

@keyframes neonFlow {
  0%   { filter: hue-rotate(0deg) saturate(1.15) brightness(1.05); }
  100% { filter: hue-rotate(360deg) saturate(1.15) brightness(1.05); }
}

/* 导航栏 CTA 按钮 */
.btn-nav-cta {
  padding: 8px 22px;
  font-size: 0.9rem;
  background: #ff7a00;
  color: #ffffff;
}
.btn-nav-cta:hover {
  background: #e06b00;
  box-shadow: 0 4px 14px rgba(255, 122, 0, 0.3);
}

/* 提交按钮 */
.btn-submit {
  width: 100%;
  padding: 14px;
  background: #0d9488;
  color: #ffffff;
  font-size: 1rem;
  letter-spacing: 2px;
  margin-top: 8px;
}
.btn-submit:hover {
  background: #0b7d73;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(13, 148, 136, 0.35);
}

/* ==================== 1. 导航栏 ==================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.3s ease;
}
/* JS 控制滚动时加深阴影 */
.navbar.scrolled {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  font-size: 1.4rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.5px;
  /* 文字兜底时不折行、不撑破顶栏，超长自动省略 */
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* 品牌 Logo 图片（1:1 正方形）：固定高度，宽度同高，自动防变形 */
.logo-img {
  display: block;
  height: 40px;
  width: 40px;
  max-width: 40px;
  object-fit: contain;
  object-position: center center;
  border-radius: 8px;          /* 轻微圆角，与顶栏整体风格协调（无背景也看不出来） */
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links a {
  font-size: 0.95rem;
  font-weight: 500;
  color: #475569;
  transition: color 0.3s ease;
}
.nav-links a:hover {
  color: #ff7a00;
}

/* 汉堡菜单按钮（移动端） */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 1001;
}
.hamburger span {
  display: block;
  width: 26px;
  height: 2.5px;
  background: #0f172a;
  border-radius: 2px;
  transition: all 0.3s ease;
}
/* 激活状态：变为 X */
.hamburger.active span:nth-child(1) {
  transform: translateY(7.5px) rotate(45deg);
}
.hamburger.active span:nth-child(2) {
  opacity: 0;
}
.hamburger.active span:nth-child(3) {
  transform: translateY(-7.5px) rotate(-45deg);
}

/* ==================== 2. Hero 首屏 ==================== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  /* 教室场景背景图 - 替换为实际图片 */
  background: url("./hero-classroom-photo.jpg") center / cover no-repeat;
  color: #ffffff;
  padding: 0 24px;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 720px;
}

.hero-title {
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 12px;
  letter-spacing: 1px;
}

.hero-subtitle {
  font-size: 1.2rem;
  font-weight: 400;
  opacity: 0.9;
  margin-bottom: 28px;
}

/* 圆角标签 */
.hero-tags {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 36px;
}
.tag {
  padding: 8px 20px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 500;
}

/* 按钮组 */
.hero-btns {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
}

/* 预约试听按钮弹跳动画 */
.btn-bounce {
  animation: bounce 2s ease-in-out infinite;
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  40% { transform: translateY(-8px); }
  60% { transform: translateY(-4px); }
}

/* Hero 绿色按钮 — 单词拼写挑战专用 */
.btn-hero-green {
  padding: 16px 42px;
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #10b981, #059669);
  border: none;
  border-radius: 50px;
  letter-spacing: 0.04em;
  box-shadow: 0 4px 24px rgba(16, 185, 129, 0.4);
}
.btn-hero-green:hover {
  background: linear-gradient(135deg, #059669, #047857);
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 8px 32px rgba(16, 185, 129, 0.55);
}

/* Hero 统一橙色按钮 — 与霓虹按钮同等大小，静态纯色橙底 */
.btn-hero-orange {
  padding: 16px 42px;
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  background: #ff7a00;
  border: none;
  border-radius: 50px;
  letter-spacing: 0.04em;
  box-shadow: 0 4px 24px rgba(255, 122, 0, 0.4);
}
.btn-hero-orange:hover {
  background: #e06b00;
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 8px 32px rgba(255, 122, 0, 0.55);
}

/* 向下滚动提示 */
.scroll-hint {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  cursor: pointer;
  animation: float 2s ease-in-out infinite;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}
.scroll-hint:hover {
  opacity: 1;
}
@keyframes float {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

/* ==================== 3. 课程介绍 ==================== */
.courses {
  background: #f1f5f9;
}

.courses-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.course-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 36px 24px 32px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-align: center;
}
.course-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
}

.card-icon {
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 12px;
}

.card-desc {
  font-size: 0.92rem;
  color: #475569;
  line-height: 1.7;
  text-align: left;
}

/* ==================== 3.5 老师介绍 ==================== */
.teacher {
  background: #ffffff;
}

/* 桌面：左文右图 */
.teacher-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: center;
}

/* ---- 左侧：文字 ---- */
.teacher-info { min-width: 0; }

/* 老师标签：醒目圆角徽章 */
.teacher-tag {
  display: inline-block;
  padding: 9px 20px;
  border-radius: 999px;
  background: #fff7ed;
  color: #ff7a00;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.5;
  box-shadow: 0 2px 10px rgba(255, 122, 0, 0.14);
}

.teacher-name {
  font-size: 2rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.3;
  margin-bottom: 16px;
}

.teacher-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.teacher-intro {
  color: #475569;
  font-size: 1rem;
  line-height: 1.95;
  margin-bottom: 24px;
}
.teacher-intro p { margin-bottom: 12px; }
.teacher-intro p:last-child { margin-bottom: 0; }

.teacher-highlights {
  display: grid;
  gap: 12px;
  margin-bottom: 30px;
}
.teacher-highlights li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  background: #f8fafc;
  border-left: 3px solid #ff7a00;
  border-radius: 12px;
}
.th-icon {
  font-size: 1.3rem;
  line-height: 1.3;
}
.th-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.th-text b {
  color: #0f172a;
  font-weight: 700;
  font-size: 1rem;
}
.th-text i {
  font-style: normal;
  color: #64748b;
  font-size: 0.9rem;
}

.teacher-more { display: inline-block; }

/* ---- 右侧：照片 ---- */
.teacher-photo-box {
  display: flex;
  justify-content: center;
}
.teacher-photo {
  width: 100%;
  max-width: 400px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 22px;
  background: #e2e8f0;
  box-shadow: 0 20px 44px rgba(15, 23, 42, 0.14);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
/* 已上传照片 → 可点击放大（与课堂展示灯箱一致） */
.teacher-photo-box.is-zoomable .teacher-photo { cursor: zoom-in; }
.teacher-photo-box.is-zoomable:hover .teacher-photo {
  transform: translateY(-4px);
  box-shadow: 0 26px 54px rgba(15, 23, 42, 0.2);
}
/* 后台未上传照片时的占位 */
.teacher-photo-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  font-weight: 800;
  color: #94a3b8;
  background: linear-gradient(135deg, #e2e8f0, #f1f5f9);
}

/* 平板及以下：单列，照片置顶（移动端优先的阅读顺序） */
@media (max-width: 1024px) {
  .teacher-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .teacher-photo-box { order: -1; }
  .teacher-photo { max-width: 340px; }
  .teacher-name { font-size: 1.7rem; }
}

@media (max-width: 768px) {
  .teacher-grid { gap: 24px; }
  .teacher-photo {
    max-width: 300px;
    border-radius: 18px;
  }
  .teacher-highlights li { padding: 11px 14px; }
  /* 移动端「了解更多」通栏，拇指好点 */
  .teacher-more {
    display: block;
    width: 100%;
    text-align: center;
    padding: 14px 24px;
    font-size: 1.05rem;
  }
}

@media (max-width: 480px) {
  .teacher-photo {
    max-width: 100%;
    aspect-ratio: 4 / 5;
  }
}

/* ==================== 4. 课堂展示 ==================== */
.gallery {
  background: #fff9f0;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.gallery-item {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}
.gallery-img-box {
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.3s ease;
}
.gallery-item:hover {
  transform: translateY(-4px);
}
.gallery-item:hover .gallery-img-box {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}
.gallery-item img {
  width: 100%;
  height: auto;
  object-fit: cover;
  transition: transform 0.3s ease;
  aspect-ratio: 4 / 3;
  display: block;
}
.gallery-item:hover img {
  transform: scale(1.05);
}

.gallery-caption {
  margin-top: 6px;
  padding: 0 4px;
  font-size: 14px;
  color: #000;
  line-height: 1.5;
  text-align: center;
  font-weight: 500;
}

/* ---- 课堂视频区：数据复用「老师介绍」页成果视频，列表中只加载封面图，点击才创建播放器 ---- */
.gallery-video-title {
  margin-top: 34px;
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
  text-align: center;
}
.gallery-video-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 16px;
}
.gallery-video-item {
  cursor: pointer;
  transition: transform 0.3s ease;
}
.gallery-video-item:hover {
  transform: translateY(-4px);
}
.gallery-video-box {
  position: relative;
  /* 尺寸完全交给内部 <img> 撑开（与上方课堂展示图片的做法一致）。
     不要在这里设 aspect-ratio 再让 img 用 height:100% —— 会形成高度循环依赖，
     导致容器高度失控、预览图被撑得比课堂展示的图大很多。 */
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(135deg, #e5e9f0, #cfd8e3);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.3s ease;
}
.gallery-video-item:hover .gallery-video-box {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}
/* 与 .gallery-item img 完全一致的尺寸规则：宽 100% + 高按 4:3 自适应 */
.gallery-video-box img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}
.gallery-video-item:hover .gallery-video-box img {
  transform: scale(1.05);
}
/* 没有封面时容器没有内容撑高，这里补上同样的 4:3，保证播放按钮有落点 */
.gallery-video-box.is-empty {
  aspect-ratio: 4 / 3;
}
/* 封面缺失时只保留渐变底 + 播放按钮（不再叠一个 📹，否则会和播放按钮重叠） */
.gallery-play-badge {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  pointer-events: none;
  z-index: 2;
  /* 隐藏 HTML 里的 ▶ 字符：各端字体差异大（有的渲染成彩色 emoji、有的很小），
     改用下方 ::before 的纯 CSS 三角形，保证 PC / iOS / 安卓显示完全一致 */
  font-size: 0;
  line-height: 0;
}
/* 纯 CSS 白色三角形，位于圆形底正中 */
.gallery-play-badge::before {
  content: '';
  display: block;
  width: 0;
  height: 0;
  border-left: 18px solid rgba(255, 255, 255, 0.95);
  border-top: 11px solid transparent;
  border-bottom: 11px solid transparent;
  margin-left: 5px;          /* 三角形视觉重心补偿，使其看起来居中 */
}
.gallery-video-item:hover .gallery-play-badge {
  background: rgba(255, 122, 0, 0.92);
}
/* 手机端：图片更大，播放按钮相应放大一点 */
@media (max-width: 768px) {
  .gallery-play-badge {
    width: 64px;
    height: 64px;
  }
  .gallery-play-badge::before {
    border-left-width: 20px;
    border-top-width: 12px;
    border-bottom-width: 12px;
    margin-left: 6px;
  }
}

/* ===== 课堂展示灯箱 ===== */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.lightbox-overlay.active {
  display: flex;
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 40px;
  color: #fff;
  cursor: pointer;
  z-index: 2001;
  line-height: 1;
  transition: color 0.2s;
}
.lightbox-close:hover {
  color: #f43f5e;
}
.lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
  cursor: default;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

/* ==================== 5. 用户留言滚动区 ==================== */
.messages {
  background: #ffffff;
  overflow: hidden;
}

.messages-scroll-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
  padding: 20px 0;
}

.messages-scroll-track {
  display: flex;
  gap: 24px;
  animation: scrollLeft 40s linear infinite;
  width: max-content;
}

/* 鼠标悬停时暂停滚动 */
.messages-scroll-wrapper:hover .messages-scroll-track {
  animation-play-state: paused;
}

/* 从右到左无限滚动 */
@keyframes scrollLeft {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

.message-card {
  flex-shrink: 0;
  width: 280px;
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.message-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.message-img-wrap {
  width: 100%;
  height: 180px;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 14px;
  background: #f1f5f9;
}
.message-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.message-card:hover .message-img-wrap img {
  transform: scale(1.08);
}

.message-text {
  margin-bottom: 14px;
}
.message-text p {
  font-size: 0.92rem;
  color: #334155;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.message-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: #94a3b8;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
}

.message-author {
  font-weight: 600;
  color: #0d9488;
}

.message-time {
  color: #94a3b8;
}

/* ==================== 留言详情弹窗 ==================== */
.msg-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.msg-popup-overlay.active {
  opacity: 1;
  visibility: visible;
}

.msg-popup-dialog {
  position: relative;
  background: #ffffff;
  border-radius: 20px;
  max-width: 560px;
  width: 92%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  transform: scale(0.92) translateY(20px);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.msg-popup-overlay.active .msg-popup-dialog {
  transform: scale(1) translateY(0);
}

.msg-popup-image {
  width: 100%;
  max-height: 400px;
  overflow: hidden;
  border-radius: 20px 20px 0 0;
}
.msg-popup-image img {
  width: 100%;
  height: 100%;
  max-height: 400px;
  object-fit: cover;
  display: block;
}

.msg-popup-body {
  padding: 28px;
}

.msg-popup-text {
  font-size: 1.05rem;
  color: #334155;
  line-height: 1.8;
  margin-bottom: 20px;
  white-space: pre-wrap;
  word-break: break-word;
}

.msg-popup-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: #94a3b8;
  padding-top: 16px;
  border-top: 1px solid #f1f5f9;
}

.msg-popup-author {
  font-weight: 700;
  color: #0d9488;
  font-size: 1rem;
}

.msg-popup-close {
  position: absolute;
  top: 12px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  border: none;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: background 0.3s ease;
}
.msg-popup-close:hover {
  background: rgba(0, 0, 0, 0.7);
}

@media (max-width: 768px) {
  .message-card {
    width: 240px;
  }
  .message-img-wrap {
    height: 150px;
  }
}

/* ==================== 发布宣言按钮 ==================== */
.declaration-btn-wrap {
  text-align: center;
  margin-bottom: 32px;
}

.btn-declaration {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 16px 42px;
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #f43f5e, #e11d48);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  letter-spacing: 2px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(244, 63, 94, 0.4);
}
.btn-declaration:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(244, 63, 94, 0.55);
}

/* ==================== 宣言发布弹窗 ==================== */
.declaration-overlay {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.declaration-overlay.active {
  opacity: 1;
  visibility: visible;
}

.declaration-dialog {
  position: relative;
  background: #ffffff;
  border-radius: 20px;
  max-width: 520px;
  width: 92%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 36px 32px 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  transform: scale(0.92) translateY(20px);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.declaration-overlay.active .declaration-dialog {
  transform: scale(1) translateY(0);
}

.declaration-close {
  position: absolute;
  top: 12px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.1);
  color: #475569;
  border: none;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
  line-height: 1;
}
.declaration-close:hover {
  background: rgba(0, 0, 0, 0.2);
}

.declaration-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 4px;
  text-align: center;
}

.declaration-hint {
  font-size: 0.88rem;
  color: #94a3b8;
  text-align: center;
  margin-bottom: 24px;
}

.dec-form-group {
  margin-bottom: 20px;
}
.dec-form-group label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}
.dec-form-group input[type="file"] {
  width: 100%;
  padding: 10px 14px;
  font-size: 0.85rem;
  font-family: inherit;
  color: #475569;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.3s ease;
}
.dec-form-group input[type="file"]:focus {
  border-color: #0d9488;
}
.dec-form-group input[type="text"] {
  width: 100%;
  padding: 12px 16px;
  font-size: 0.95rem;
  font-family: inherit;
  color: #0f172a;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.dec-form-group input[type="text"]:focus {
  border-color: #0d9488;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.12);
}
.dec-form-group textarea {
  width: 100%;
  padding: 12px 16px;
  font-size: 0.95rem;
  font-family: inherit;
  color: #0f172a;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  outline: none;
  resize: vertical;
  min-height: 100px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.dec-form-group textarea:focus {
  border-color: #0d9488;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.12);
}

.dec-preview {
  max-width: 100%;
  max-height: 200px;
  border-radius: 10px;
  display: none;
  margin-top: 10px;
  border: 1px solid #e5e7eb;
}

.dec-char-count {
  font-size: 0.78rem;
  color: #94a3b8;
  margin-top: 4px;
}

.btn-dec-submit {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #f43f5e, #e11d48);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 2px;
  transition: all 0.3s ease;
  margin-top: 8px;
}
.btn-dec-submit:hover {
  background: linear-gradient(135deg, #e11d48, #be123c);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(244, 63, 94, 0.45);
}
.btn-dec-submit:disabled {
  background: #d1d5db;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* ==================== 视频缩略图 ==================== */
.message-video-wrap {
  width: 100%;
  height: 180px;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 14px;
  background: #0f172a;
  position: relative;
  cursor: pointer;
}
.message-video-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.5;
}
.video-play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

/* ==================== 6. 联系表单 ==================== */
.contact {
  background: #f1f5f9;
}

.contact-card {
  max-width: 520px;
  margin: 0 auto;
  background: #ffffff;
  border-radius: 20px;
  padding: 44px 40px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.form-group {
  margin-bottom: 22px;
}

.form-group label {
  display: block;
  font-size: 0.92rem;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 6px;
}

.required {
  color: #ff7a00;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  font-size: 0.95rem;
  font-family: inherit;
  color: #0f172a;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  appearance: none;
  -webkit-appearance: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: #0d9488;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.12);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

/* 下拉箭头 */
.form-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

/* 错误提示 */
.error-msg {
  display: block;
  font-size: 0.8rem;
  color: #ef4444;
  margin-top: 4px;
  min-height: 1.2em;
}

/* 输入框错误状态 */
.form-group.error input,
.form-group.error select,
.form-group.error textarea {
  border-color: #ef4444;
}
.form-group.error input:focus,
.form-group.error select:focus,
.form-group.error textarea:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

/* 隐私提示 */
.privacy-note {
  text-align: center;
  font-size: 0.78rem;
  color: #94a3b8;
  margin-top: 16px;
}

/* ==================== 霓虹流光弹窗 ==================== */
.neon-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}
.neon-overlay.active {
  opacity: 1;
  visibility: visible;
}

.neon-dialog {
  position: relative;
  background: #0f172a;
  border-radius: 24px;
  padding: 48px 44px 40px;
  text-align: center;
  max-width: 400px;
  width: 90%;
  z-index: 1;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.neon-overlay.active .neon-dialog {
  transform: scale(1) translateY(0);
}

/* 霓虹流光边框 */
.neon-dialog::before {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 27px;
  padding: 3px;
  background: conic-gradient(
    from 0deg,
    #ff0080, #ff8c00, #40e0d0, #8b5cf6, #ff0080
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: neonSpin 3s linear infinite;
  z-index: -1;
}

/* 边框流光旋转 + 色调偏移 */
@keyframes neonSpin {
  0% {
    filter: hue-rotate(0deg);
  }
  100% {
    filter: hue-rotate(360deg);
  }
}

/* 弹窗外发光 */
.neon-dialog::after {
  content: "";
  position: absolute;
  inset: -12px;
  border-radius: 34px;
  background: transparent;
  box-shadow:
    0 0 30px rgba(255, 0, 128, 0.3),
    0 0 60px rgba(255, 140, 0, 0.2),
    0 0 90px rgba(64, 224, 208, 0.15);
  z-index: -2;
  animation: neonGlow 2s ease-in-out infinite alternate;
}
@keyframes neonGlow {
  0% {
    box-shadow:
      0 0 30px rgba(255, 0, 128, 0.3),
      0 0 60px rgba(255, 140, 0, 0.2),
      0 0 90px rgba(64, 224, 208, 0.15);
  }
  100% {
    box-shadow:
      0 0 45px rgba(138, 43, 226, 0.4),
      0 0 75px rgba(255, 0, 128, 0.3),
      0 0 105px rgba(255, 140, 0, 0.2);
  }
}

/* 弹窗内部光泽 */
.neon-dialog-inner {
  position: relative;
  z-index: 1;
}

.neon-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0d9488, #10b981);
  margin-bottom: 24px;
  box-shadow: 0 0 28px rgba(16, 185, 129, 0.5);
  animation: iconPulse 2s ease-in-out infinite;
}
@keyframes iconPulse {
  0%, 100% { box-shadow: 0 0 28px rgba(16, 185, 129, 0.5); }
  50% { box-shadow: 0 0 44px rgba(16, 185, 129, 0.8); }
}

.neon-icon svg {
  width: 36px;
  height: 36px;
}

.neon-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 10px;
  letter-spacing: 2px;
}

.neon-subtitle {
  font-size: 1rem;
  color: #94a3b8;
  margin-bottom: 32px;
  line-height: 1.6;
}

.neon-close-btn {
  display: inline-block;
  padding: 12px 40px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #ffffff;
  background: linear-gradient(135deg, #0d9488, #14b8a6);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  letter-spacing: 1px;
  transition: all 0.3s ease;
}
.neon-close-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(13, 148, 136, 0.45);
}

/* ==================== 7. 页脚 ==================== */
.footer {
  background: #0f172a;
  color: #cbd5e1;
  padding-top: 56px;
}

.footer-container {
  display: grid;
  grid-template-columns: 2fr 1.5fr 1fr;
  gap: 48px;
  padding-bottom: 40px;
}

.footer-logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 12px;
}

.footer-desc {
  font-size: 0.9rem;
  line-height: 1.7;
  color: #94a3b8;
  max-width: 280px;
}

.footer-heading {
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 16px;
}

.footer-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 0.9rem;
  color: #94a3b8;
}
.footer-list li svg {
  flex-shrink: 0;
  color: #0d9488;
}

.footer-list a {
  color: #94a3b8;
  transition: color 0.3s ease;
}
.footer-list a:hover {
  color: #ff7a00;
}

/* 版权区域 */
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
  padding: 20px 24px;
  font-size: 0.85rem;
  color: #64748b;
}

/* ICP / 公安备案 */
.footer-beian {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 10px 24px 24px;
  font-size: 12px;
}
.beian-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #64748b;
  text-decoration: none;
  transition: color 0.2s;
  line-height: 1;
}
.beian-link:hover {
  color: #94a3b8;
}
.beian-icon {
  flex-shrink: 0;
}

/* ============================================================
   响应式设计
   ============================================================ */

/* --- 平板 (≤ 1024px) --- */
@media (max-width: 1024px) {
  .courses-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .hero-title {
    font-size: 2.2rem;
  }
  .footer-container {
    grid-template-columns: 1fr 1fr;
    gap: 36px;
  }
}

/* --- 手机 (≤ 768px) --- */
@media (max-width: 768px) {
  .section {
    padding: 64px 0;
  }
  .section-title {
    font-size: 1.6rem;
  }

  /* 导航栏 */
  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 72%;
    max-width: 320px;
    height: 100vh;
    background: #ffffff;
    flex-direction: column;
    justify-content: center;
    gap: 28px;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.1);
    transition: right 0.35s ease;
  }
  .nav-links.active {
    right: 0;
  }
  .nav-links a {
    font-size: 1.1rem;
  }
  .hamburger {
    display: flex;
  }
  /* 顶栏品牌缩小且不换行，避免长校名折行显得杂乱 */
  .logo {
    font-size: 1.02rem;
    white-space: nowrap;
    letter-spacing: 0;
  }
  /* 手机端 logo 图片稍小一档，避免挤压右侧登录/菜单 */
  .logo-img {
    height: 34px;
    width: 34px;
    max-width: 34px;
  }
  /* 登录/注册胶囊在手机端收紧（ID 选择器确保覆盖 player.js 注入的样式） */
  #playerAuthSlot .tmy-user-chip {
    padding: 6px 12px;
    font-size: 13px;
    white-space: nowrap;
  }

  /* Hero */
  .hero-title {
    font-size: 1.7rem;
  }
  .hero-subtitle {
    font-size: 1rem;
  }
  .tag {
    font-size: 0.82rem;
    padding: 6px 16px;
  }

  /* 课程卡片 */
  .courses-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .course-card {
    padding: 28px 20px;
  }

  /* 课堂展示 */
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .gallery-video-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  /* 联系表单 */
  .contact-card {
    padding: 28px 22px;
    border-radius: 16px;
  }

  /* 页脚 */
  .footer-container {
    grid-template-columns: 1fr;
    gap: 32px;
    text-align: center;
  }
  .footer-desc {
    max-width: none;
  }
  .footer-list li {
    justify-content: center;
  }
}

/* --- 小屏手机 (≤ 480px) --- */
@media (max-width: 480px) {
  .hero-title {
    font-size: 1.45rem;
  }
  .hero-tags {
    gap: 8px;
  }
  .hero-btns {
    flex-direction: column;
    align-items: center;
  }
  .hero-btns .btn {
    width: 80%;
  }
  .gallery-grid {
    grid-template-columns: 1fr;
  }
  .gallery-video-grid {
    grid-template-columns: 1fr;
  }
  .contact-card {
    padding: 24px 16px;
  }
}
