:root {
  --forum-hero-height: 540px;
}

.page-forum {
  background-color: var(--bg-light, #f9f9f9);
}

.forum-hero {
  position: relative;
  width: 100%;
  color: #ffffff;
}

.forum-hero__media {
  position: relative;
  overflow: hidden;
}

.forum-hero__image {
  width: 100%;
  height: auto;
  object-fit: cover;
  display: block;
}

.forum-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0.15));
}

.forum-hero__content {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
}

.forum-hero__text {
  max-width: 950px;
  margin-left: 100px;
}

.forum-hero__kicker {
  font-size: 14px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 12px;
  opacity: 0.9;
}

.forum-hero__title {
  font-size: 48px;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 18px;
}

.forum-hero__subtitle {
  font-size: 24px;
  line-height: 1.7;
  max-width: 950px;
  color: rgba(255, 255, 255, 0.85);
}

.forum-hero__tabs-wrap {
  margin-top: 60px;
}

.forum-hero__tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding-block: 18px;
}

.forum-tab {
  border: none;
  border-radius: 999px;
  background-color: #DBE2EA;
  font-size: 14px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 20px 50px;
  cursor: pointer;
  color: #004494;
  position: relative;
}

.forum-tab--active {
  background-color: #004494;
  color: #ffffff;
}

.forum-section {
  padding-block: 60px;
}

.forum-section.bg-light {
  background-color: var(--bg-light, #f9f9f9);
}

.forum-section__inner {
  width: 100%;
}

.forum-section__header {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 32px;
}

.forum-section__header--center {
  justify-content: center;
}

.forum-section__title {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dark, #333333);
  text-align: center;
  position: relative;
}

.forum-section__title::after {
  content: "";
  display: block;
  width: 33%;
  max-width: 160px;
  height: 3px;
  background-color: #0F9DC0;
  margin: 16px auto 0;
}

.forum-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.forum-card-grid--previous {
  margin-top: 8px;
}

.forum-card {
  background-color: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
  display: flex;
  flex-direction: column;
  min-height: 420px;
  border: 2px solid transparent;
  transition:
    border-color 0.3s ease,
    background-color 0.3s ease;
}

.forum-card--previous {
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.04);
}

.forum-card__media img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
  border-radius: inherit;
}

.forum-card:hover {
  border-color: #004494;
  background-color: #f4fafd;
}

.forum-card:hover .forum-card__media img {
  transform: scale(1.05);
}

.forum-card__body {
  padding: 20px;
}

.forum-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 16px;
  color: #656565;
}

.forum-card__meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.forum-card__title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 10px;
  color: #000000;
}

.forum-card__desc {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-gray, #666666);
}

.forum-section__actions {
  margin-top: 28px;
  display: flex;
  justify-content: center;
}

.forum-view-more {
  min-width: 160px;
  padding: 10px 32px;
  border-radius: 12px;
  border: 1px solid #004394;
  background-color: transparent;
  cursor: pointer;
  font-size: 16px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #004394;
}

.forum-section--sponsor {
  border-top: 1px solid var(--border-color, #e5e5e5);
}

.forum-section--previous {
  background-color: #DDDDDD;
}

.forum-sponsor-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.forum-sponsor-card {
  background-color: #ffffff;
  border-radius: 10px;
  width: 100%;
  aspect-ratio: 8 / 3;
  /* 320:120 比例 */
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid transparent;
  transition:
    border-color 0.3s ease,
    background-color 0.3s ease;
}

.forum-sponsor-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.forum-sponsor-card:hover {
  border-color: #004494;
  background-color: #f4fafd;
}

@media (max-width: 1200px) {
  .forum-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .forum-sponsor-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .forum-hero {
    display: flex;
    flex-direction: column;
  }

  .forum-hero__media {
    height: 220px;
    order: 1;
  }

  .forum-hero__media img {
    height: 100%;
    object-fit: cover;
  }

  .forum-hero__content {
    position: static;
    padding: 24px 16px;
    background: linear-gradient(180deg, #004c96 0%, #007ec9 100%);
    order: 2;
  }

  .forum-hero__text {
    margin: 0;
    max-width: 100%;
  }

  .forum-hero__title {
    font-size: 26px;
    margin-bottom: 12px;
  }

  .forum-hero__subtitle {
    font-size: 15px;
    line-height: 1.6;
    max-width: 100%;
    /* 限制最大行数 */
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .forum-hero__tabs {
    flex-wrap: wrap;
  }

  .forum-card-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .forum-sponsor-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* 移动端细化适配 */
@media (max-width: 768px) {
  :root {
    --forum-hero-height: auto;
  }

  .forum-hero__text {
    margin-left: 20px;
    margin-right: 20px;
    max-width: 100%;
  }

  .forum-hero__title {
    font-size: 28px;
    margin-bottom: 12px;
  }

  .forum-hero__subtitle {
    font-size: 16px;
    line-height: 1.5;
  }

  .forum-hero__tabs-wrap {
    margin-top: 30px;
  }

  .forum-hero__tabs {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 12px;
    gap: 10px;
  }

  .forum-hero__tabs::-webkit-scrollbar {
    display: none;
  }

  .forum-tab {
    padding: 10px 16px;
    font-size: 12px;
    letter-spacing: 0.1em;
    flex: 0 0 auto;
    text-align: center;
    min-width: max-content;
  }

  .forum-section {
    padding-block: 40px;
  }

  .forum-section__title {
    font-size: 24px;
    letter-spacing: 0.1em;
  }

  .forum-card {
    min-height: auto;
  }

  .forum-card__media img {
    height: 200px;
  }

  .forum-card__body {
    padding: 16px;
  }

  .forum-card__title {
    font-size: 18px;
  }

  .forum-card__meta {
    font-size: 14px;
  }

  .forum-sponsor-grid {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .forum-view-more {
    width: 100%;
      text-align: center;
    max-width: 280px;
  }
}

/* 小屏手机适配 */
@media (max-width: 480px) {
  .forum-hero__title {
    font-size: 24px;
  }

  .forum-hero__subtitle {
    font-size: 14px;
  }

  .forum-tab {
    padding: 9px 14px;
    font-size: 11px;
    min-width: max-content;
  }

  .forum-section__title {
    font-size: 20px;
  }

  .forum-card__media img {
    height: 180px;
  }

  .forum-sponsor-grid {
    grid-template-columns: 1fr;
  }
}
