/* =========================================================
   江西开放大学招生站群 —— 公共样式
   头部 / 页脚 / 滚动显现动画 / 通用组件
   ========================================================= */

:root {
  --c-text: #333;            /* 主文字 */
  --c-text2: #666;           /* 次级文字 */
  --c-text3: #999;           /* 弱化文字/日期 */
  --c-blue: #1E6FC0;         /* 链接蓝 */
  --c-blue-deep: #1D4F9E;    /* 深蓝（分页选中、强调） */
  --c-primary: #0988C5;      /* 主蓝（分隔线/渐变起点） */
  --c-cyan: #50C3DD;         /* 渐变终点青 */
  --c-band: #0686C3;         /* 页脚色带 */
  --c-line: #E5E5E5;
  --header-h: 90px;
  --container: 1400px;
  --radius: 16px;
  --shadow-card: 0 10px 28px rgba(25, 80, 140, .10);
  --tr: .35s cubic-bezier(.25, .7, .35, 1);
  --font-serif: "STZhongsong", "STSong", "SimSun", "Noto Serif SC", serif;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Source Han Sans SC", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  color: var(--c-text);
  background: #fff;
  line-height: 1.6;
  min-width: 320px;
}

img { border: 0; vertical-align: middle; }
ul, ol { list-style: none; }
a { text-decoration: none; color: inherit; transition: color var(--tr); }
button { font-family: inherit; cursor: pointer; }
input, button { outline: none; }

.container { width: min(var(--container), 92vw); margin: 0 auto; }

/* =========================================================
   滚动显现动画（进入可视窗口触发）
   html.js 由 JS 添加，无 JS 环境下内容直接可见
   ========================================================= */
html.js [data-reveal] {
  opacity: 0;
  transform: translateY(42px);
  transition: opacity .85s ease, transform .85s cubic-bezier(.22, .61, .36, 1);
  transition-delay: var(--rv-delay, 0s);
  will-change: opacity, transform;
}
html.js [data-reveal="left"]  { transform: translateX(-52px); }
html.js [data-reveal="right"] { transform: translateX(52px); }
html.js [data-reveal="zoom"]  { transform: scale(.86); }
html.js [data-reveal].revealed { opacity: 1; transform: none; }

/* =========================================================
   顶部头部
   页面顶部：深蓝向下渐隐、与 banner 融为一体（无生硬下边线）
   吸顶用 position: sticky 从第 0px 起钉住，无定位切换、不抖动；
   负 margin 抵占位，banner 仍从视口顶部铺起。
   .is-fixed（JS 滚动后添加）只切换配色：实色横向渐变条 + 阴影
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  margin-bottom: calc(var(--header-h) * -1);
  transition: background .3s ease, box-shadow .3s ease;
}
/* 顶部状态：比横条更高的垂直渐变，底边融入 banner；
   z-index:-1 保证在 header 内容之下（.header-inner 不定位，见下） */
.site-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 120px;
  pointer-events: none;
  background: linear-gradient(180deg,
    rgba(13, 42, 96, .95) 0%,
    rgba(15, 52, 116, 0) 100%);
  transition: opacity .3s ease;
  z-index: -1;
}
/* 吸顶状态：仅切换视觉为实色横条 + 阴影（定位始终由 sticky 负责） */
.site-header.is-fixed {
  background: linear-gradient(90deg, rgba(15, 52, 116, .95) 0%, rgba(18, 60, 128, .88) 100%);
  box-shadow: 0 10px 30px rgba(8, 35, 80, .22);
}
.site-header.is-fixed::before { content: none; }

/* 不设定位：移动端抽屉(.header-nav)需以 .site-header 为包含块通栏铺开，
   渐变层级改由上面 ::before 的 z-index:-1 负责 */
.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 30px;
}
.brand { display: flex; align-items: center; gap: 18px; flex: none; }
.brand-logo { height: 60px; width: auto; }
.brand-title {
  color: #fff;
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 3px;
  white-space: nowrap;
}

/* nav 只放链接；搜索表单与 nav 同为 .header-nav 的子项，桌面端一行排开（原布局不变） */
.header-nav { margin-left: auto; display: flex; align-items: center; gap: 38px; }
.main-nav { display: flex; align-items: center; gap: 38px; }
/* 面板/窗口标注的包裹 div 布局透明化（display:contents），使链接/面包屑仍按原 flex 布局排列 */
.header-nav > div, .main-nav > div, .main-nav > div > div, .crumbs > div, .crumbs > div > div { display: contents; }
.main-nav a {
  position: relative;
  color: #fff;
  font-size: 17px;
  padding: 8px 0;
  opacity: .92;
  white-space: nowrap;
}
.main-nav a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: #fff;
  transform: translateX(-50%) scaleX(0);
  transition: transform .3s ease;
}
.main-nav a:hover { opacity: 1; }
.main-nav a:hover::after { transform: translateX(-50%) scaleX(1); }

.nav-search {
  display: flex;
  align-items: center;
  width: 225px;
  height: 44px;
  padding: 0 14px 0 20px;
  border: 1px solid rgba(255, 255, 255, .75);
  border-radius: 999px;
  transition: background var(--tr);
}
.nav-search:focus-within { background: rgba(255, 255, 255, .12); }
.nav-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  color: #fff;
  font-size: 15px;
}
.nav-search input::placeholder { color: rgba(255, 255, 255, .85); }
.nav-search button { border: 0; background: none; display: flex; padding: 4px; }
.nav-search img { width: 20px; height: 20px; }

/* 移动端汉堡按钮 */
.nav-toggle {
  display: none;
  margin-left: auto;
  width: 44px;
  height: 44px;
  border: 0;
  background: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
}
.nav-toggle span {
  display: block;
  width: 26px;
  height: 2px;
  border-radius: 2px;
  background: #fff;
  transition: transform .3s ease, opacity .3s ease;
}
.nav-toggle.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* =========================================================
   页脚
   ========================================================= */
.site-footer {
  --footer-top: #fff;   /* 内页页脚上方为白色，首页由 index.css 覆盖为浅蓝 */
  background: linear-gradient(180deg,
    var(--footer-top) 0,
    var(--footer-top) 42%,
    var(--c-band) 42%);
  padding-top: 54px;
}
.footer-card {
  background: url("../img/bottom-bg.png") center / 100% 100% no-repeat;
  padding: 56px 64px 62px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
}
.footer-brand { display: flex; align-items: center; gap: 16px; margin-bottom: 36px; }
.footer-brand img { height: 60px; width: auto; }
/* 内页页脚：logo-color.png 自带“招生与学生工作”字样（始于原图 x≈490/833），
   此处按比例裁去只留校徽校名，右侧显示“招生网” */
.brand-logo-crop { display: inline-flex; height: 60px; width: 245px; overflow: hidden; flex: none; }
.brand-logo-crop img { height: 100%; width: auto; max-width: none; }
.footer-name {
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: 700;
  color: #222;
  letter-spacing: 2px;
}
.footer-contact li {
  display: flex;
  align-items: center;
  gap: 13px;
  font-size: 18px;
  color: var(--c-text);
  padding: 8px 0;
}
.footer-contact img { width: 30px; height: 30px; flex: none; }

.footer-qrs { display: flex; gap: 58px; padding-top: 6px; flex: none; }
.qr-card {
  width: 172px;
  border: 3px solid #8ACBF0;
  border-radius: 14px;
  overflow: hidden;
  
  background: #41A9D8;
}
.qr-img { padding: 10px; background: #fff;}
.qr-img img { display: block; width: 100%; }
.qr-card p {
  background: #41A9D8;
  color: #fff;
  text-align: center;
  font-size: 17px;
  line-height: 1.55;
  padding: 9px 6px 12px;
}
.copyright {
  text-align: center;
  color: rgba(255, 255, 255, .92);
  font-size: 15px;
  letter-spacing: 1px;
  padding: 30px 16px 34px;
}

/* =========================================================
   视频弹窗（列表页/首页通用，data-video 有地址时可用）
   ========================================================= */
.video-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4vw;
  background: rgba(8, 25, 50, .84);
  opacity: 0;
  visibility: hidden;
  transition: opacity .35s ease, visibility .35s ease;
}
.video-modal.open { opacity: 1; visibility: visible; }
.video-modal-box {
  position: relative;
  width: min(960px, 100%);
  aspect-ratio: 16 / 9;
  max-height: 82vh;
  margin: 40px auto 0;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
}
.video-modal-box video { width: 100%; height: 100%; object-fit: contain; }
.video-modal-close {
  position: absolute;
  top: -48px;
  right: -6px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  transition: background var(--tr);
}
.video-modal-close:hover { background: rgba(255, 255, 255, .32); }

/* =========================================================
   响应式
   ========================================================= */
@media (max-width: 1500px) {
  .header-inner { gap: 22px; }
  .brand { gap: 14px; }
  .brand-logo { height: 54px; }
  .brand-title { font-size: 24px; letter-spacing: 2px; }
  .header-nav, .main-nav { gap: 26px; }
  .main-nav a { font-size: 16px; }
  .nav-search { width: 190px; }
}

@media (max-width: 1330px) {
  .header-nav, .main-nav { gap: 20px; }
  .nav-search { width: 160px; height: 40px; }
}

@media (max-width: 1200px) {
  .nav-toggle { display: flex; }
  /* 注意：sticky 祖先内的 position:fixed 在 iOS Safari 会改以祖先为包含块（错位到视口顶），
     因此抽屉用 absolute 挂在 .site-header 下：header 恒钉在视口顶，抽屉始终紧贴其底边展开 */
  .header-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: -1; /* 垫到 header 内容背后，展开时从横条后方滑出 */
    display: block;
    background: linear-gradient(180deg, #103A80 0%, #0D5EA9 100%);
    padding: 10px 6vw 26px;
    transform: translateY(-115%);
    visibility: hidden;
    transition: transform .4s cubic-bezier(.25, .7, .35, 1), visibility .4s;
    box-shadow: 0 24px 40px rgba(8, 30, 70, .3);
  }
  .header-nav.open { transform: translateY(0); visibility: visible; }
  .main-nav { display: block; }
  /* 菜单展开：header 底色与抽屉渐变起点 #103A80 一致，视觉上连成一整块；
     ::before 渐隐用 opacity 过渡（已自带 .3s），与底色淡入同步、不闪 banner */
  .site-header.menu-open { background: #103A80; }
  .site-header.menu-open::before { opacity: 0; }
  .main-nav a {
    display: block;
    padding: 15px 4px;
    font-size: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
  }
  .main-nav a::after { display: none; }
  .nav-search { width: 100%; height: 46px; margin-top: 18px; }

  .footer-card { padding: 44px 44px 50px; }
  .footer-qrs { gap: 30px; }
}

@media (max-width: 992px) {
  :root { --header-h: 76px; }
  .brand-logo { height: 48px; }
  .brand-title { font-size: 21px; }
  .footer-card { flex-direction: column; gap: 34px; padding: 36px 34px 44px; }
  .footer-qrs { padding-top: 0; }
  .footer-contact li { font-size: 16px; }
}

@media (max-width: 768px) {
  :root { --header-h: 60px; }
  .header-inner { gap: 12px; }
  .brand { gap: 10px; }
  .brand-logo { height: 40px; }
  .brand-title { font-size: 17px; letter-spacing: 1px; }
  .nav-toggle { width: 40px; height: 40px; }
  .nav-toggle span { width: 22px; }

  .site-footer { padding-top: 34px; }
  .footer-card { padding: 24px 20px 32px; }
  .footer-brand { margin-bottom: 20px; gap: 10px; }
  .footer-brand img { height: 46px; }
  .brand-logo-crop { height: 46px; width: 188px; }
  .footer-name { font-size: 21px; }
  .footer-contact li { font-size: 14px; padding: 5px 0; gap: 10px; }
  .footer-contact img { width: 22px; height: 22px; }
  .footer-qrs { width: 100%; justify-content: center; gap: 18px; }
  .qr-card { width: 148px; }
  .qr-card p { font-size: 13px; }
  .copyright { font-size: 12px; padding: 20px 14px 24px; }
}

/* 小屏手机：页脚站名缩到一行（21px×7字放不下会换行，校名裁框同步略缩） */
@media (max-width: 400px) {
  .footer-brand { gap: 8px; }
  .footer-brand img { height: 42px; }
  .brand-logo-crop { height: 42px; width: 172px; }
  .footer-name { font-size: 16px; letter-spacing: 1px; white-space: nowrap; }
}

/* 减弱动态效果偏好 */
@media (prefers-reduced-motion: reduce) {
  html.js [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }
  * { scroll-behavior: auto !important; }
}
