/* --- 整体布局（保持两栏始终存在） --- */
.countryHotVideo-content {
  display: flex;
  gap: 20px;
  padding: 20px 5vw;
  background: #111;
  margin-top: 80px;

  /* 关键：让布局固定为左右结构，不会被压扁 */
  min-height: calc(100vh - 100px);
}

/* --- 左侧国家列表（始终显示） --- */
.sidebar {
  width: 260px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  box-shadow: var(--shadow);

  display: flex;
  flex-direction: column;

  /* 固定高度并允许滚动 */
  max-height: calc(100vh - 140px);
  overflow-y: auto;

  border-radius: 12px;
  padding: 12px;

  position: relative;
  -webkit-overflow-scrolling: touch;
}

/* 国家列表容器 */
.countries-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: sticky;
  -webkit-overflow-scrolling: touch;
}

/* ---------- 右侧：独立滚动容器 ---------- */
.content-right {
  flex: 1; /* 占据剩余宽度 */
  min-width: 0; /* 防止子元素撑开 */
  display: flex;
  flex-direction: column;
}

.content-title {
  color: #fff;
  margin-top: 30px;
  margin-bottom: 30px;
  text-align: center;
}

/* 这个 wrapper 控制右侧滚动行为 */
.videos-wrapper {
  /* 高度＝视口高度 - 视图内可能存在的上方间距 */
  max-height: calc(100vh - 40px); /* 40px 为 top 空间，若有 header 请调整 */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-left: 0px; /* 与侧栏留一点间距 */
}

/* 单项 */
.country-item {
  background: #fff;
  padding: 14px 10px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;

  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: 0.2s;

  color: #111;
}

.country-item:hover {
  transform: translateY(-3px);
  background: #f0f7ff;
}

/* 激活状态 */
.country-item.active {
  color: #111;
  background: #d0eaff;
}

/* 国旗与文字 */
.country-list-flag {
  width: 30px;
  height: 20px;
  object-fit: cover;
}

.country-list-itemName {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- 视频卡片区域 --- */
.card-grid {
  flex: 1; /* 占满右侧空间 */
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* 大屏自适应 */
  width: 100%;
  margin-top: 0px;
  margin-bottom: 20px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 10px;
  box-sizing: border-box;
}

/* --- 视频卡片 --- */
.card {
  background: #111;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: 0.3s;
  box-sizing: border-box;
}

.card h6,
.card p {
  text-decoration: underline;
  text-decoration-color: #111; /* 下划线颜色 */
  text-decoration-thickness: 1px; /* 可调粗细 */
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(255, 255, 255, 0.05);
}

/* 图片 */
.card-img {
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
}

.card-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 内容 */
.card-info {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-country {
  width: 20px;
  height: 14px;
  object-fit: cover;
}

.card-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.card-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-info h6 {
  color: #fff;
  font-size: 16px;
}

.card-info p {
  color: #999;
  font-size: 14px;
}

#videoModal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 10000;
  justify-content: center;
  align-items: center;
  padding: 20px;
}
.modal-content {
  position: relative;
  width: 90%;
  max-width: 1200px;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
}
.close-btn {
  position: absolute;
  right: 10px;
  top: 10px;
  font-size: 28px;
  color: #fff;
  cursor: pointer;
  z-index: 10;
}
.video-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
}
.video-wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* 响应式：中屏 (小于 1200px) */
@media (max-width: 1200px) {
  .card-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    box-sizing: border-box;
    padding: 0 0px;
  }
}

/* 响应式：小屏 (小于 768px) */
@media (max-width: 768px) {
  .card-grid {
    grid-template-columns: 1fr; /* 单列 */
    box-sizing: border-box;
    padding: 0 0px;
  }
}

/* --- 手机端优化：国家列表换成横向滑动 --- */
@media (max-width: 900px) {
  .countryHotVideo-content {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    max-height: auto;
    overflow-y: hidden;
    overflow-x: auto;

    display: flex;
    flex-direction: row;
    gap: 12px;
    padding: 12px 12px;
    box-sizing: border-box;
  }

  .countries-list {
    flex-direction: row;
    gap: 12px;
  }
}
