/* 数字课程页面 - CSS 样式文件 */
/* 主要功能：定义数字课程页面的布局和样式 */

/* 第一部分：顶部图片区域 */
.top-banner-section {
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  overflow: hidden;
}

.top-banner-section .top-banner-img {
  width: 100%;
  height: auto;
  display: block;
}

/* 第二部分：课程内容区域 */
.course-content-section {
  padding: 0;
  margin-bottom: 0px;
}

.course-content-section .course-container {
  max-width: 1360px;
  margin: 0 auto;
  display: flex;
  align-items: stretch;
  gap: 40px;
  padding: 0 50px;
}

/* 左侧菜单区域 */
.course-menu {
  width: 240px;
  flex-shrink: 0;
  margin-left: 0;
  margin-top: 60px;
}

.course-menu .menu-title {
  font-size: 20px;
  font-weight: bold;
  padding: 15px 20px;
  background: linear-gradient(135deg, #e60044 0%, #ff6b6b 100%);
  color: #fff;
  border-radius: 8px 8px 0 0;
  flex-shrink: 0;
}

.course-menu .menu-list {
  background: transparent;
  border: none;
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 25px;
  flex: 1;
}

.course-menu .menu-item {
  padding: 12px 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 15px;
  color: #00aeff;
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  min-height: 50px;
  border-radius: 8px;
  overflow: hidden;
  z-index: 1;
}

.course-menu .menu-item .menu-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  z-index: -1;
}

/* .course-menu .menu-item:hover {
  color: #e60044;
} */

.course-menu .menu-item.active {
  color: #fff;
}

.course-menu .menu-item .menu-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
}

.course-menu .menu-item .menu-text {
  flex: 1;
  font-weight: 500;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 右侧展示区域 */
.course-display {
  flex: 1;
  background: #f5f7fa;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.course-display .display-images {
  width: 100%;
}

.course-display .image-item.single-image {
  width: 100%;
  height: auto;
}

.course-display .image-item.single-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* 第三部分：产品价值 */
.product-value-section {
  padding: 0;
  background: #fff;
  overflow: hidden;
}

.product-value-section .section-title {
  font-size: 28px;
  font-weight: bold;
  color: #333;
  text-align: center;
  margin: 0;
}

.product-value-section .product-value-grid {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  overflow: hidden;
}

.product-value-section .product-value-item {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.product-value-section .product-value-item.has-hover {
  cursor: pointer;
}

.product-value-section .value-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.product-value-section .product-value-item.has-hover:hover .value-img {
  transform: scale(1.25);
}

.product-value-section .value-empty {
  width: 100%;
  height: 100%;
  min-height: 300px;
  background: #f4f8ff;
  display: block;
}

.product-value-section .value-img.value-bg {
  background: #f4f8ff;
}

.product-value-section .value-img.zoomed {
  transform: scale(1.5);
}

/* 第四部分：底部图片区域 */
.bottom-banner-section {
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  overflow: hidden;
  margin-top: 0;
}

.bottom-banner-section .bottom-banner-img {
  width: 100%;
  height: auto;
  display: block;
}

/* 底部版权区域 */
.footer {
  background: #333;
  color: #fff;
  padding: 30px 0;
  text-align: center;
}

.footer .footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.footer .footer-content p {
  font-size: 14px;
  color: #aaa;
}

/* 响应式设计 */
@media (max-width: 992px) {
  .course-menu {
    width: 160px;
    flex-shrink: 0;
    margin-top: 40px;
  }
  
  .course-menu .menu-list {
    gap: 15px;
  }
  
  .course-menu .menu-item {
    padding: 8px 10px;
    min-height: 40px;
    gap: 8px;
  }
  
  .course-menu .menu-item .menu-icon {
    width: 28px;
    height: 28px;
  }
  
  .course-menu .menu-item .menu-text {
    max-width: 80px;
    font-size: 12px;
  }
  
  .course-display .display-images {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
  }
}

@media (max-width: 768px) {
  .course-content-section {
    padding: 5px 0;
  }
  
  .course-content-section .course-container {
    padding: 0 8px;
    gap: 8px;
  }
  
  .course-menu {
    width: 80px;
    margin-top: 30px;
  }
  
  .course-menu .menu-title {
    font-size: 12px;
    padding: 6px 8px;
  }
  
  .course-menu .menu-list {
    gap: 10px;
  }
  
  .course-menu .menu-item {
    padding: 6px 6px;
    min-height: 35px;
    gap: 5px;
    border-radius: 6px;
  }
  
  .course-menu .menu-item .menu-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
  }
  
  .course-menu .menu-item .menu-text {
    font-size: 10px;
    max-width: 45px;
    white-space: normal;
    word-break: break-word;
    line-height: 1.2;
  }
  
  .course-display {
    border-radius: 6px;
  }
  
  .course-display .display-images {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
  
  .course-display .image-item img {
    height: 80px;
  }
}

@media (max-width: 480px) {
  .course-menu {
    width: 70px;
  }
  
  .course-menu .menu-title {
    font-size: 11px;
    padding: 5px 6px;
  }
  
  .course-menu .menu-list {
    gap: 8px;
  }
  
  .course-menu .menu-item {
    padding: 5px 5px;
    min-height: 30px;
  }
  
  .course-menu .menu-item .menu-icon {
    width: 18px;
    height: 18px;
  }
  
  .course-menu .menu-item .menu-text {
    font-size: 9px;
    max-width: 38px;
  }
  
  .course-display .display-images {
    gap: 5px;
  }
  
  .course-display .image-item img {
    height: 70px;
  }
}

@media (max-width: 480px) {
  .course-display .display-images {
    grid-template-columns: 1fr;
  }
  
  .course-display .image-item img {
    height: 180px;
  }
}

@media (max-width: 480px) {
  .course-display .display-images {
    grid-template-columns: 1fr;
  }
  
  .course-display .image-item img {
    height: 180px;
  }
}

/* =====================================================
   移动端导航栏样式（当 useMobileNav=true 时使用）
   ===================================================== */

/* CSS 变量定义（移动端导航栏） */
:root {
  --nav-height: 44px;
  --nav-min-height: 44px;
  --nav-max-height: 44px;
  --dropdown-gap: 0;
  --dropdown-max-width: 85vw;
  --dropdown-padding: 3vh;
  --nav-item-gap: 1vh;
  --nav-item-font-size: clamp(12px, 1.8vh, 16px);
}

/* 移动端课程内容区域 */
html.mobile-nav-enabled .course-content-section .course-container {
  align-items: stretch;
}

html.mobile-nav-enabled .course-menu {
  margin-top: 0;
  display: flex;
  flex-direction: column;
}

html.mobile-nav-enabled .course-menu .menu-title {
  flex-shrink: 0;
}

html.mobile-nav-enabled .course-menu .menu-list {
  flex: 1;
}

html.mobile-nav-enabled .course-menu .menu-item {
  flex: 1;
  min-height: 0;
  height: auto;
}

html.mobile-nav-enabled .course-menu .menu-item .menu-bg {
  object-fit: contain;
}

html.mobile-nav-enabled .course-menu .menu-item .menu-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  line-height: 1;
}

@media (max-width: 768px) {
  html.mobile-nav-enabled .course-menu {
    margin-top: 0;
  }
  
  html.mobile-nav-enabled .course-menu .menu-list {
    gap: 8px;
    flex: 1;
  }
  
  html.mobile-nav-enabled .course-menu .menu-item {
    padding: 4px 4px;
    gap: 4px;
    border-radius: 6px;
  }
  
  html.mobile-nav-enabled .course-menu .menu-item .menu-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
  }
  
  html.mobile-nav-enabled .course-menu .menu-item .menu-text {
    font-size: clamp(8px, 1.8vw, 10px);
    max-width: 45px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
    line-height: 1;
  }
  
  html.mobile-nav-enabled .course-display .image-item img {
    height: auto;
    width: 100%;
  }
}

@media (max-width: 480px) {
  html.mobile-nav-enabled .course-menu {
    width: 70px;
  }
  
  html.mobile-nav-enabled .course-menu .menu-title {
    font-size: 11px;
    padding: 5px 6px;
  }
  
  html.mobile-nav-enabled .course-menu .menu-list {
    gap: 6px;
    flex: 1;
  }
  
  html.mobile-nav-enabled .course-menu .menu-item {
    padding: 3px 3px;
    gap: 3px;
  }
  
  html.mobile-nav-enabled .course-menu .menu-item .menu-icon {
    width: 16px;
    height: 16px;
  }
  
  html.mobile-nav-enabled .course-menu .menu-item .menu-text {
    font-size: clamp(7px, 1.6vw, 9px);
    max-width: 38px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
    line-height: 1;
  }
  
  html.mobile-nav-enabled .course-display .display-images {
    gap: 5px;
  }
  
  html.mobile-nav-enabled .course-display .image-item img {
    height: auto;
    width: 100%;
  }
}

/* 移动端导航栏样式 */
.header.mobile-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-height);
  min-height: var(--nav-min-height);
  max-height: var(--nav-max-height);
  background-color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  box-shadow: none !important;
}

.header.mobile-header .search-bar {
  height: var(--nav-height);
  min-height: var(--nav-min-height);
  max-height: var(--nav-max-height);
  background-color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0;
  box-sizing: border-box;
  box-shadow: none !important;
  width: 100%;
  flex: 1;
}

.header.mobile-header .search-bar .nav-left {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-left: 15px;
}

.header.mobile-header .search-bar .nav-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 15px;
  z-index: 10001;
  position: relative;
}

.header.mobile-header .back-button {
  width: 30px;
  height: auto;
  cursor: pointer;
  margin-top: 5px;
  transform: scale(1);
  transform-origin: center center;
}

.header.mobile-header .menu-button {
  width: 26px;
  height: auto;
  cursor: pointer;
  margin-top: 5px;
  z-index: 10000;
  position: relative;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
  transform: scale(1.3);
  transform-origin: center center;
}

/* 下拉列表样式（移动端导航栏） */
.header.mobile-header ~ .dropdown-menu,
.header.mobile-header + .dropdown-menu,
body > .dropdown-menu {
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  margin-top: 0;
  z-index: 100000;
  background-color: transparent;
  opacity: 0;
  visibility: hidden;
  display: block !important;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  pointer-events: none;
  overflow-y: auto;
  padding-left: 10px;
  padding-right: 10px;
}

.header.mobile-header ~ .dropdown-menu.active,
.header.mobile-header + .dropdown-menu.active,
body > .dropdown-menu.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.header.mobile-header ~ .dropdown-menu .dropdown-bg,
.header.mobile-header + .dropdown-menu .dropdown-bg,
body > .dropdown-menu .dropdown-bg {
  position: relative;
  width: 100%;
  max-width: var(--dropdown-max-width);
  margin: 0 auto;
  background-color: rgba(255, 255, 255, 0.98);
  border-radius: 16px;
  border: 1px solid #ccc;
  padding: var(--dropdown-padding);
  box-sizing: border-box;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  z-index: 100001;
  display: block !important;
}

.header.mobile-header ~ .dropdown-menu .dropdown-bg .bg-base,
.header.mobile-header + .dropdown-menu .dropdown-bg .bg-base,
body > .dropdown-menu .dropdown-bg .bg-base {
  display: none;
}

.header.mobile-header ~ .dropdown-menu .dropdown-bg .nav-header,
.header.mobile-header + .dropdown-menu .dropdown-bg .nav-header,
body > .dropdown-menu .dropdown-bg .nav-header {
  display: flex;
  align-items: center;
  padding: 0 0 0 10px;
  cursor: pointer;
  height: auto;
  min-height: 0;
}

.header.mobile-header ~ .dropdown-menu .dropdown-bg .nav-header .home-icon,
.header.mobile-header + .dropdown-menu .dropdown-bg .nav-header .home-icon,
body > .dropdown-menu .dropdown-bg .nav-header .home-icon {
  width: clamp(16px, 2.5vh, 24px);
  height: auto;
  margin-right: 8px;
}

.header.mobile-header ~ .dropdown-menu .dropdown-bg .nav-header .home-text,
.header.mobile-header + .dropdown-menu .dropdown-bg .nav-header .home-text,
body > .dropdown-menu .dropdown-bg .nav-header .home-text {
  font-size: var(--nav-item-font-size);
  font-weight: 500;
  color: #333;
  line-height: normal;
  margin: 0;
  padding: 0;
}

.header.mobile-header ~ .dropdown-menu .dropdown-bg .nav-divider,
.header.mobile-header + .dropdown-menu .dropdown-bg .nav-divider,
body > .dropdown-menu .dropdown-bg .nav-divider {
  height: 1px;
  background-color: #999;
  margin: 0 5px;
  margin-top: 1vh;
}

.header.mobile-header ~ .dropdown-menu .dropdown-bg .nav-images,
.header.mobile-header + .dropdown-menu .dropdown-bg .nav-images,
body > .dropdown-menu .dropdown-bg .nav-images {
  display: grid;
  grid-template-columns: auto auto;
  gap: var(--nav-item-gap);
  padding-top: var(--nav-item-gap);
  box-sizing: border-box;
  z-index: 10;
  justify-items: start;
}

.header.mobile-header ~ .dropdown-menu .dropdown-bg .nav-images .nav-item,
.header.mobile-header + .dropdown-menu .dropdown-bg .nav-images .nav-item,
body > .dropdown-menu .dropdown-bg .nav-images .nav-item {
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s ease;
  width: max-content;
  justify-content: flex-start;
  padding: 0.5vh;
  min-width: 0;
}

.header.mobile-header ~ .dropdown-menu .dropdown-bg .nav-images .nav-item:nth-child(even),
.header.mobile-header + .dropdown-menu .dropdown-bg .nav-images .nav-item:nth-child(even),
body > .dropdown-menu .dropdown-bg .nav-images .nav-item:nth-child(even) {
  padding-left: 3vw;
}

.header.mobile-header ~ .dropdown-menu .dropdown-bg .nav-images .nav-arrow,
.header.mobile-header + .dropdown-menu .dropdown-bg .nav-images .nav-arrow,
body > .dropdown-menu .dropdown-bg .nav-images .nav-arrow {
  width: clamp(10px, 1.5vh, 16px);
  height: auto;
  margin-right: 5px;
  flex-shrink: 0;
}

.header.mobile-header ~ .dropdown-menu .dropdown-bg .nav-images .nav-text,
.header.mobile-header + .dropdown-menu .dropdown-bg .nav-images .nav-text,
body > .dropdown-menu .dropdown-bg .nav-images .nav-text {
  font-size: var(--nav-item-font-size) !important;
  font-weight: 500;
  color: #333;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  flex: 0 0 auto;
  word-break: keep-all;
}
