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

body {
  font-family:'Inter','Segoe UI',sans-serif;
  background:#f5f7fa;
  color:#1b1b1b;
  line-height:1.6;
  scroll-behavior:smooth;
}

a { text-decoration:none; color:inherit; }

/* Color Variables */
:root {
  --accent:#ff6b4a;
  --primary:#1b1b1b;
  --bg:#f5f7fa;
  --card:#ffffff;
  --shadow:0 8px 20px rgba(0,0,0,0.08);
  --header-h:88px;
}

/* Layout */
.container {
  width:90%;
  max-width:1200px;
  margin:0 auto;
}
h1,h2,h3 { font-weight:700; }

.section {
  padding: 5rem 2rem;
  text-align: center;
}
section[id] {
  scroll-margin-top: calc(var(--header-h) + 16px);
}
.section h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;   /* 增大标题与段落的间距 */
  color: #222;
}
.section p {
  max-width: min(90%, 72ch);
  margin: 0 auto 2rem;     /* 控制阅读宽度并增加下方留白 */
  font-size: 1rem;
  line-height: 1.8;        /* 提升段落行距可读性 */
  color: #333;             /* 更深灰，提高对比度 */
}
/* Header */
header {
  position:fixed;
  top:0;
  width:100%;
  background:var(--bg);
  border-bottom:1px solid #e0e4ea;
  z-index:1000;
}
.nav {
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:1.2rem 0;
  gap: 1rem;
}
.logo { font-size:1.6rem; font-weight:700; }
nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}
nav::-webkit-scrollbar {
  display: none;
}
nav a {
  margin-left:0;
  font-weight:500;
  transition:color .2s;
}
nav a:hover { color:var(--accent); }

/* Hero */
.hero {
  min-height:90vh;
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:left;
  padding-top:6rem;
}
.hero-content { max-width:800px; }
.hero-content h1 {
  font-size:3rem;
  margin-bottom:1rem;
}
.hero-content h2 {
  margin-bottom: 1rem;
}
.hero-content p {
  font-size:1.1rem;
  max-width:500px;
  margin-bottom:1.5rem;
}
.btn {
  display:inline-block;
  background:var(--primary);
  color:#fff;
  padding:.9rem 1.8rem;
  border-radius:12px;
  font-weight:600;
  transition:all .3s ease;
  box-shadow:0 4px 12px rgba(0,0,0,0.15);
}
.btn:hover {
  background:#333;
  box-shadow:0 6px 16px rgba(0,0,0,0.18);
}

/* Explore More buttons */
.explore-btn {
  margin-top:2rem;
  background:var(--accent);
}
.explore-btn:hover {
  background:#e2593a;
  box-shadow:0 6px 16px rgba(0,0,0,0.18);
}

/* Cards & Grids */
.card {
  background:var(--card);
  border-radius:20px;
  padding:2rem;
  box-shadow:var(--shadow);
  transition:transform .2s, box-shadow .2s;
}

.card-game{
  padding: 0;
  overflow: hidden;
}
.card-game h2 {
  font-size: 1.3rem;
  padding: 1rem 1rem 1.2rem;
}
.card-game .responsive-img {
  margin-top: 0;
  border-radius: 20px 20px 0 0;
}

.card:hover {
  transform:translateY(-6px);
  box-shadow:0 10px 24px rgba(0,0,0,0.12);
}

.grid {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(260px,1fr));
  gap:2rem;
  margin-top:2.5rem;
}

/* Contact Section */
.contact-wrapper {
  background:var(--bg);
  padding:4rem 0;
  text-align:center;
}
.contact-sub {
  max-width:500px;
  margin:0.5rem auto 2rem;
  color:#555;
  font-size:0.95rem;
}
.contact-card {
  max-width:480px;
  margin:0 auto;
  background:var(--card);
  padding:2rem 2.5rem;
  border-radius:18px;
  box-shadow:0 6px 18px rgba(0,0,0,0.07);
}
.contact-form {
  display:flex;
  flex-direction:column;
  gap:0.8rem;
}
.contact-form input,
.contact-form textarea {
  padding:0.7rem 1rem;
  border:1px solid #d0d5db;
  border-radius:12px;
  font:inherit;
  background:#fff;
  box-shadow:inset 0 1px 3px rgba(0,0,0,0.04);
}
.contact-form textarea { min-height:90px; resize:vertical; }

.contact-form button {
  background:var(--accent);
  color:#fff;
  padding:0.7rem 1.2rem;
  border:none;
  border-radius:12px;
  font-weight:600;
  cursor:pointer;
  transition:background .3s, box-shadow .3s;
  box-shadow:0 4px 12px rgba(0,0,0,0.12);
}

.contact-form button:hover {
  background:#e2593a;
  box-shadow:0 6px 16px rgba(0,0,0,0.15);
}

.responsive-img {
  /* 基础设置：确保图片不超过容器宽度，保持比例 */
  max-width: 100%;  /* 关键：图片最大宽度不超过父容器 */
  width: 100%;      /* 让图片在容器中稳定铺满宽度 */
  max-height: 600px; /* 最大高度限制（大屏幕） */
  height: auto;
  display: block;
  border-radius: 20px;
  margin-top: 1.5rem;
  box-shadow: var(--shadow);
}

/* 针对中等屏幕（如平板）调整最大高度 */
@media (max-width: 768px) {
  .responsive-img {
    max-height: 400px; /* 屏幕小于768px时，最大高度改为400px */
  }
}

/* 针对小屏幕（如手机）进一步调整 */
@media (max-width: 480px) {
  .responsive-img {
    max-height: 300px; /* 屏幕小于480px时，最大高度改为300px */
    border-radius: 10px; /* 可选：小屏幕减小圆角 */
    margin-top: 1rem; /* 可选：小屏幕减小顶部间距 */
  }
}

/* 视频课程区域样式 */
.video-section {
  background-color: #fff;
}

/* 主视频播放器容器 */
.video-player-wrapper {
  max-width: 1000px;
  margin: 0 auto 60px;
  background-color: #f5f5f5;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* 视频容器 */
.video-container {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 比例 */
  background-color: #000;
}

/* 视频元素 */
#main-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 视频控制层 */
.video-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 15px;
  background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%);
  color: white;
  opacity: 0;
  transition: opacity 0.3s;
}

/* 进度条 */
.progress-bar {
  position: relative;
  height: 4px;
  background-color: rgba(255,255,255,0.3);
  border-radius: 2px;
  margin-bottom: 10px;
  cursor: pointer;
}

.progress-fill {
  position: absolute;
  height: 100%;
  background-color: #3498db;
  border-radius: 2px;
  width: 0%;
}

.progress-handle {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  background-color: white;
  border-radius: 50%;
  box-shadow: 0 0 3px rgba(0,0,0,0.5);
  transition: all 0.1s;
}

.progress-bar:hover .progress-handle {
  transform: translateY(-50%) scale(1.2);
}

/* 控制按钮组 */
.controls-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.control-btn {
  background: none;
  border: none;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  margin-right: 15px;
  transition: color 0.2s;
}

.control-btn:hover {
  color: #3498db;
}

/* 时间显示 */
.time-display {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.9);
  margin-right: 20px;
}

/* 音量控制 */
.volume-control {
  display: flex;
  align-items: center;
  width: 120px;
}

#volume-slider {
  width: 80px;
  cursor: pointer;
  accent-color: #3498db;
}

/* 大播放按钮 */
.big-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background-color: rgba(52, 152, 219, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s;
}

.big-play-btn:hover {
  background-color: #3498db;
  transform: translate(-50%, -50%) scale(1.1);
}

.big-play-btn i {
  font-size: 2rem;
  color: white;
  margin-left: 5px;
}

/* 视频信息 */
.video-info {
  padding: 20px;
  text-align: left;
}

#video-title {
  font-size: 1.5rem;
  margin-bottom: 10px;
  color: #2c3e50;
}

#video-desc {
  font-size: 1rem;
  color: #666;
  margin: 0;
}

/* 视频列表 */
.video-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-top: 40px;
}

@media (min-width: 768px) {
  .video-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 992px) {
  .video-list {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* 视频列表项 */
.video-item {
  background-color: #f5f5f5;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
  display: flex;
  flex-direction: column;
}

.video-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.video-item.active {
  border: 2px solid #3498db;
}

.video-item img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.video-item-info {
  padding: 15px;
  text-align: left;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.video-item-info h4 {
  font-size: 1.1rem;
  margin-bottom: 5px;
  color: #2c3e50;
}

.video-duration {
  font-size: 0.9rem;
  color: #999;
  margin: 0;
}

/* 页脚 */
footer {
  background-color: transparent;
  color: #666;
  text-align: center;
  padding: 16px 0;
  margin-top: 0;
  font-size: 12px;
  line-height: 1.8;
}
.footer-meta a {
  color: inherit;
  text-decoration: none;
}


/* 响应式调整 */
@media (max-width: 768px) {
  :root {
    --header-h: 116px;
  }
  .nav {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.9rem 0;
  }
  nav {
    width: 100%;
    padding-bottom: 0.2rem;
  }
  nav a {
    font-size: 0.95rem;
  }
  .hero h1 {
    font-size: 2.2rem;
  }
  .hero {
    min-height: 82vh;
    text-align: center;
  }
  .hero-content p {
    max-width: 100%;
  }
  
  h2 {
    font-size: 1.8rem;
  }
  
  .volume-control {
    display: none;
  }
  
  .video-controls {
    padding: 10px;
  }
  
  .control-btn {
    font-size: 1rem;
    margin-right: 10px;
  }
  
  .video-item img {
    height: 120px;
  }
}


.upload-section {
  padding: 30px 0;
}

/* 容器：水平居中 + 垂直排列 */
.upload-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  padding: 20px;
  box-sizing: border-box;
}

/* 拖拽区域：核心样式 */
.drop-area {
  width: 100%;
  padding: 40px 20px;
  margin-bottom: 25px;
  border: 2px dashed #ccc;
  border-radius: 8px;
  transition: all 0.3s ease;
  cursor: pointer;
  background-color: #fafafa;
}
/* 拖拽悬停状态：视觉反馈 */
.drop-area.active {
  border-color: #2c98f0;
  background-color: #f0f8ff;
}

/* 上传按钮样式 */
.video-inner-upload {
  margin-bottom: 15px;
}
.upload-btn {
  background-color: #2c98f0;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.upload-btn:hover {
  background-color: #1a88e0;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}
#file-upload {
  display: none; /* 隐藏原生文件选择框 */
}

/* 拖拽提示文本 */
.drop-hint {
  color: #888;
  font-size: 14px;
  margin: 0;
}

/* 视频信息区 */
.video-info {
  width: 100%;
  padding: 0 15px;
  box-sizing: border-box;
}
#video-title {
  margin-bottom: 15px;
  color: #333;
  font-size: 22px;
}
#video-desc {
  margin-bottom: 12px;
  color: #666;
  line-height: 1.6;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}
.upload-tip {
  margin: 10px 0 0;
  font-size: 13px;
  color: #888;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .upload-container {
    padding: 15px;
  }
  .drop-area {
    padding: 30px 15px;
  }
  #video-title {
    font-size: 18px;
  }
  .upload-btn {
    padding: 8px 16px;
    font-size: 14px;
  }
}
