* {
  box-sizing: border-box;
}

.home-content {
  display: flex;
  margin-top: 100px;
  margin-left: 5vw;
  margin-right: 5vw;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.home-subtitle {
  display: block;
  text-align: center;
}

/* --- 3. 内容区内部：自动化网格 (Card Grid) --- */
.card-grid {
  display: grid;
  gap: 20px;
  margin: 60px auto;
  padding: 0 5vw;
  /* 解释：自动填满列，每列最小200px，最大1fr。无需媒体查询即可自适应 */
  grid-template-columns: repeat(auto-fit, minmax(max(300px, 20%), 1fr));
}

/* --- 卡片基础容器 --- */
.card {
  background: #111;
  border-radius: 12px; /* 现代圆角 */
  overflow: hidden; /* 确保图片不溢出圆角 */
  box-shadow: 0 4px 10px rgba(255, 255, 255, 0.05); /* 柔和的阴影 */
  transition: transform 0.3s ease, box-shadow 0.3s ease; /* 动效过渡 */

  /* 让内部内容对齐更好 (如果卡片高度不一致) */
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  text-decoration-color: #111;
}

.card * {
  text-decoration: underline;
  text-decoration-color: #111;
}

/* --- 鼠标悬停交互 (Hover) --- */
.card:hover {
  transform: translateY(-5px); /* 向上浮动 */
  box-shadow: 0 10px 20px rgba(255, 255, 255, 0.05); /* 加深阴影 */
}

/* --- 1. 图片区域 --- */
.card-img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: #111;
}

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

/* --- 2. 内容区域 --- */
.card-content {
  display: flex;
  flex-direction: row;
  gap: 12px;
  align-items: center;
}

.card-countries {
  display: flex;
  gap: 4px;
  flex-direction: row;
}

.card-country {
  width: 20px;
  object-fit: fill;
}

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

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

.card-content p {
  font-size: 16px;
  color: #666;
}

.card-info p {
  font-size: 16px;
  color: #666;
}

/* --- 3. 底部按钮 --- */
.btn {
  margin-top: auto; /* 核心技巧：自动顶到底部 */
  padding: 10px 20px;
  background-color: #333;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn:hover {
  background-color: #000;
}

#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;
}

/*国家列表*/
.home-country {
  display: flex;
  margin-top: 100px;
  margin-left: 5vw;
  margin-right: 5vw;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.countryTitle {
  text-align: center;
}

.countries-list {
  margin-top: 60px;
  margin-bottom: 60px;
  margin-left: 5vw;
  margin-right: 5vw;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 15px;
}

.country-item {
  background: #fff;
  padding: 14px 10px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: 0.2s;
}

.country-list-flag {
  width: 30px;
  height: 20px;
  object-fit: cover;
}

.country-list-itemName {
  flex: 1; /* 文字占满剩余宽度 */
  white-space: nowrap; /* 不换行（可选） */
  overflow: hidden; /* 超出隐藏（可选） */
  text-overflow: ellipsis; /* 超出部分显示 ...（可选） */
}

.country-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  background: #f0f7ff;
}

.country-item-link {
  text-decoration: none;
  color: inherit;
}
