/* ============================================
   北京师范大学招生H5首页 - 样式表
   移动优先：默认撑满屏幕，PC端限制375px居中
   ============================================ */

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

/* 禁止选中文字（移动端体验） */
body {
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --bnu-red: #C00218;
  --text-primary: #333333;
  --text-secondary: #666666;
  --bg-page: #FEF6ED;
  --bg-card: #FFFFFF;
  --border-light: #EEEEEE;
  --divider-dashed: #D9D9D9;
}

html {
  background: var(--bg-page);
}

body {
  background: var(--bg-page);
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 页面容器 - 默认撑满屏幕 */
.page-container {
  width: 100%;
  min-height: 100vh;
  background: var(--bg-page);
  position: relative;
  overflow-x: hidden;
  padding-bottom: 60px;
}

/* ============================================
   PC端适配：限制375px居中，两侧灰色留白
   ============================================ */
@media screen and (min-width: 431px) {
  html {
    background: #E8E8E8;
  }

  body {
    background: #E8E8E8;
    display: flex;
    justify-content: center;
  }

  .page-container {
    max-width: 375px;
  }

  .bottom-nav {
    max-width: 375px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
  }
}

/* ============================================
   模块1：Banner
   ============================================ */
.banner-section {
  width: 100%;
  position: relative;
  overflow: hidden;
  background: #F0EDE8; /* 暖米色占位底色，与校园插画色调协调 */
}

.banner-section .banner-img {
  width: 100%;
  display: block;
  position: relative;
  z-index: 1;
}

/* Banner叠加层：logo + 标语 */
.banner-overlay {
  position: absolute;
  top: 6%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 80%;
}

.banner-logo {
  width: 80%;
  max-width: 250px;
  height: auto;
  display: block;
  /* 给深色logo在插画上增加可读性 */
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.15));
}

.banner-slogan {
  margin-top: 6px;
  font-family: 'STXingkai', '行楷', 'XingKai SC', cursive, serif;
  font-size: 13px;
  letter-spacing: 3px;
  color: #333;
  text-shadow: 0 1px 2px rgba(0,0,0,0.08);
  white-space: nowrap;
}

/* Banner骨架屏加载动画 */
.banner-section::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(
    110deg,
    #EDE8E2 30%,
    #F5F1EC 50%,
    #EDE8E2 70%
  );
  background-size: 200% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
}

.banner-section:has(.banner-img[complete])::before,
.banner-section:has(.banner-img:not([src]))::before,
.banner-section.banner-loaded::before {
  display: none;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================
   模块2：通知栏
   ============================================ */
.notice-section {
  padding: 12px 12px 0;
  position: relative;
  z-index: 2;
  background: var(--bg-page);
}

.content-card {
  margin-top: -180px;
  position: relative;
  z-index: 2;
  background: transparent;
  padding-top: 0;
}

.notice-bar {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  background: #FFFFFF;
  border-radius: 10px;
  gap: 10px;
}

.notice-icon {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

.notice-text {
  flex: 1;
  font-size: 13px;
  color: #444;
  line-height: 1.4;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
}

.notice-text-inner {
  display: inline-block;
  animation: scroll-text 10s linear infinite;
}

@keyframes scroll-text {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.notice-arrow {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ============================================
   模块3：功能入口宫格
   ============================================ */
.function-section {
  padding: 16px 12px 0;
  background: var(--bg-page);
}

.function-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  row-gap: 18px;
  background: #FFFFFF;
  border-radius: 12px;
  padding: 16px 8px;
}

.function-item {
  text-align: center;
  cursor: pointer;
  transition: opacity 0.15s ease;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.function-item:active {
  opacity: 0.65;
}

.function-icon-blue {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: #FDE8EB;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
  padding: 6px;
}

.function-icon-blue svg {
  width: 36px;
  height: 36px;
}

.function-label {
  color: var(--text-primary);
  font-size: 12px;
  line-height: 1.3;
  white-space: nowrap;
}

/* ============================================
   模块4：办学实力数据条
   ============================================ */
.stats-section {
  padding: 0 12px 0;
  background: linear-gradient(to bottom, transparent 0%, var(--bg-page) 100%);}

.stats-bar {
  display: flex;
  align-items: center;
  background: #FFFFFF;
  border-radius: 12px;
  padding: 14px 8px;
}

.stats-item {
  flex: 1;
  text-align: center;
}

.stats-number {
  color: #C00218;
  font-weight: 700;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.5px;
}

.stats-unit {
  font-size: 12px;
  font-weight: 600;
  margin-left: 1px;
}

.stats-label {
  color: #555;
  font-size: 10px;
  line-height: 1.3;
  margin-top: 4px;
  white-space: nowrap;
}

.stats-divider {
  width: 1px;
  height: 30px;
  background: #D0DDED;
  flex-shrink: 0;
}

/* ============================================
   模块4：招生宣传片 / 招生直播回放
   ============================================ */
/* 宣传图模块 */
.promo-banner-section {
  background: var(--bg-page);
  padding: 16px 12px;
}

.promo-banner-wrapper {
  border-radius: 12px;
  overflow: hidden;
}

.promo-banner-img {
  width: 100%;
  display: block;
  border-radius: 12px;
}
}

.media-play-btn svg {
  width: 48px;
  height: 48px;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.2));
}

/* ============================================
   模块5.5：直播回放卡片（覆盖在底图上）
   ============================================ */
.replay-section {
  position: relative;
  width: 100%;
  background-image: url('/images/major-intro-bg.png');
  background-size: 100% auto;
  background-position: top center;
  background-repeat: no-repeat;
  padding: 50px 24px 20px;
}

.replay-section .replay-header-img {
  display: none;
}

.replay-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.replay-card {
  background: rgba(255,255,255,0.92);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  text-decoration: none;
  color: inherit;
  display: block;
}

.replay-card:active {
  opacity: 0.9;
}

.replay-card-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 16/10;
  overflow: hidden;
  background: linear-gradient(135deg, #fff5e6, #ffe8d0);
}

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

.replay-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.replay-play-btn svg {
  width: 18px;
  height: 18px;
  color: #C00218;
  margin-left: 2px;
}

.replay-card-tag {
  position: absolute;
  top: 6px;
  left: 6px;
  background: #C00218;
  color: #fff;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 500;
}

.replay-card-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  background: rgba(255,255,255,0.85);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.replay-card-play svg {
  width: 16px;
  height: 16px;
  margin-left: 2px;
}

.replay-card-info {
  padding: 8px 10px;
}

.replay-card-title {
  font-size: 13px;
  font-weight: 600;
  color: #333;
  line-height: 1.3;
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.replay-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 3px;
}

.replay-card-speaker {
  font-size: 11px;
  color: #666;
}

.replay-card-views {
  font-size: 11px;
  color: #999;
}

.replay-more-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  padding: 10px;
  margin-top: 12px;
  background: rgba(255,255,255,0.85);
  border: 1px solid rgba(192,2,24,0.2);
  border-radius: 8px;
  color: #C00218;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  position: relative;
  z-index: 1;
}

.replay-more-btn:active {
  opacity: 0.85;
}

.replay-more-btn svg {
  width: 16px;
  height: 16px;
}

/* ============================================
   模块5：招生资讯
   ============================================ */
.news-section {
  position: relative;
  width: 100%;
  background-image: url('/images/admission-news.png');
  background-size: 100% auto;
  background-position: top center;
  background-repeat: no-repeat;
  padding: 50px 20px 20px;
}

.news-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

.news-cat-tag {
  padding: 4px 14px;
  background: rgba(255,255,255,0.85);
  border: 1px solid rgba(192,2,24,0.25);
  border-radius: 20px;
  font-size: 12px;
  color: #C00218;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.news-cat-tag.active {
  background: #C00218;
  color: #fff;
  border-color: #C00218;
}

.news-list {
  position: relative;
  z-index: 1;
}

.news-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(255,255,255,0.9);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 10px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.news-item:active {
  opacity: 0.9;
}

.news-item-info {
  flex: 1;
  min-width: 0;
}

.news-item-category {
  font-size: 11px;
  color: #C00218;
  font-weight: 500;
  margin-bottom: 4px;
}

.news-item-title {
  font-size: 14px;
  color: #333;
  font-weight: 500;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-item-cover {
  flex-shrink: 0;
  width: 72px;
  height: 54px;
  border-radius: 6px;
  overflow: hidden;
  background: #f5f5f5;
}

.news-item-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.news-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0ebe3;
}

.news-more-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  padding: 10px;
  margin-top: 12px;
  background: rgba(255,255,255,0.85);
  border: 1px solid rgba(192,2,24,0.2);
  border-radius: 8px;
  color: #C00218;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  position: relative;
  z-index: 1;
}

.news-more-btn:active {
  opacity: 0.85;
}

.news-more-btn svg {
  width: 16px;
  height: 16px;
}

/* ============================================
   模块6：底部固定导航栏
   ============================================ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 56px;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  border-top: 1px solid var(--border-light);
  z-index: 1000;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #999999;
  font-size: 11px;
  line-height: 1.3;
  padding: 4px 0;
  transition: color 0.15s ease;
  cursor: pointer;
}

.nav-item:active {
  opacity: 0.7;
}

.nav-item.active {
  color: var(--bnu-red);
}

.nav-icon {
  width: 24px;
  height: 24px;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-icon svg {
  width: 22px;
  height: 22px;
}

.nav-text {
  font-size: 11px;
  line-height: 1.3;
}

/* ============================================
   安全区域适配（iPhone X+ 底部）
   ============================================ */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .bottom-nav {
    padding-bottom: env(safe-area-inset-bottom);
    height: calc(56px + env(safe-area-inset-bottom));
  }
  .page-container {
    padding-bottom: calc(60px + env(safe-area-inset-bottom));
  }
}
