@charset "utf-8";

/* 吉林省阳光学校 · 全站头部（蓝→透明，浮在页面内容之上） */
#site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  pointer-events: none;
}

.site-header {
  position: relative;
  width: 100%;
  min-height: 0;
  color: #fff;
  overflow: visible;
  pointer-events: auto;
  background-color: transparent !important;
}

.site-header__bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 220px;
  z-index: 0;
  pointer-events: none;
  background-color: transparent !important;
  background-image: linear-gradient(
    180deg,
    #0a56b5 0%,
    #1a6bc8 38%,
    rgba(26, 107, 200, 0.62) 68%,
    rgba(10, 86, 181, 0) 100%
  ) !important;
}

/* 内容屏：蓝条铺满整条头部，避免导航落到浅色背景上看不清 */
.site-header--content-panel .site-header__bg {
  height: 100%;
  background-image: linear-gradient(
    180deg,
    #0a56b5 0%,
    #0d5dbd 78%,
    #1768c5 100%
  ) !important;
}

.site-header__inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  margin: 0;
  padding: 14px 16px 14px 24px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-rows: auto;
  align-items: center;
  column-gap: 12px;
  row-gap: 0;
}

.site-header__brand {
  display: flex;
  align-items: center;
  gap: 18px;
  color: #fff;
  text-decoration: none;
  flex-shrink: 0;
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
  align-self: center;
  z-index: 2;
}

.site-header__brand:hover {
  opacity: 0.95;
}

.site-header__logo {
  width: 58px;
  height: 58px;
  flex-shrink: 0;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0, 40, 100, 0.2));
  opacity: 0;
  visibility: hidden;
}

.site-header__logo.is-ready {
  opacity: 1;
  visibility: visible;
}

.site-header__titles {
  display: flex;
  align-items: center;
  min-width: 0;
}

.site-header__name {
  margin: 0;
  padding: 0;
  line-height: 0;
}

.site-header__name[hidden] {
  display: none;
}

.site-header__name-img {
  display: block;
  height: 52px;
  width: auto;
  max-width: min(420px, 36vw);
  object-fit: contain;
  object-position: left center;
  filter: drop-shadow(0 1px 3px rgba(0, 40, 100, 0.28));
  opacity: 0;
  visibility: hidden;
}

.site-header__name-img.is-ready {
  opacity: 1;
  visibility: visible;
}

.site-header__nav {
  display: contents;
}

.site-header__menu-btn,
.site-header__backdrop {
  display: none;
}

.site-header__util {
  display: flex;
  justify-content: flex-end;
  width: auto;
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  align-self: center;
}

.util-nav {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  justify-content: flex-end;
  margin-left: auto;
  gap: 2px 0;
  font-size: 13px;
  line-height: 1;
}

.util-nav__items {
  display: contents;
}

.util-nav a {
  color: #fff;
  text-decoration: none;
  padding: 4px 10px;
  transition: opacity 0.2s;
  text-shadow: 0 1px 2px rgba(0, 50, 120, 0.2);
}

.util-nav a:last-of-type {
  padding-right: 6px;
}

.util-nav a:hover {
  opacity: 0.85;
}

.util-nav__sep {
  color: rgba(255, 255, 255, 0.6);
  padding: 0 2px;
  user-select: none;
}

.util-nav__en {
  padding-left: 6px !important;
  letter-spacing: 0.05em;
}

.util-nav__search {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 2px;
  margin-right: 0;
  padding: 4px 2px 4px 6px;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  vertical-align: middle;
}

.util-nav__search:hover {
  opacity: 0.85;
}

.main-nav {
  grid-column: 2;
  grid-row: 1;
  width: auto;
  max-width: 100%;
  min-width: 0;
  justify-self: center;
}

.main-nav__list {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: clamp(2px, 0.4vw, 10px);
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 100%;
}

.main-nav__item > a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px clamp(6px, 0.7vw, 14px);
  font-size: clamp(14px, 1.05vw, 20px);
  font-weight: bold;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s, opacity 0.2s;
  text-shadow: 0 1px 3px rgba(0, 40, 100, 0.35);
}

.main-nav__item > a:hover {
  opacity: 1;
}

.main-nav__item:not(.has-sub) > a:hover {
  opacity: 0.85;
}

.main-nav__item.has-sub:hover > a,
.main-nav__item.has-sub:focus-within > a {
  color: #ffcc66;
  text-shadow: none;
}

.main-nav__item.is-active > a {
  font-weight: bold;
}

/* 主导航子菜单下拉箭头 */
.main-nav__item.has-sub > a::after {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  margin-top: 3px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.95;
  transition: border-top-color 0.2s;
}

.main-nav__item {
  position: relative;
}

.main-nav__item .sub-menu {
  display: block;
  position: absolute;
  top: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  min-width: 188px;
  padding: 6px 0 10px;
  margin: 0;
  background: #fff;
  border-top: 3px solid #1a6bc8;
  border-radius: 0 0 10px 10px;
  box-shadow: 0 8px 24px rgba(0, 40, 100, 0.18);
  list-style: none;
  z-index: 20;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
}

.main-nav__item:hover .sub-menu,
.main-nav__item:focus-within .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.main-nav__item .sub-menu a {
  display: block;
  padding: 13px 28px;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.45;
  color: #333;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.18s, background-color 0.18s;
}

.main-nav__item .sub-menu a:hover {
  color: #1a6bc8;
  background: #f3f8fd;
}

.main-nav__item .sub-menu a + a {
  border-top: 1px solid #f0f0f0;
}

@media (min-width: 1600px) {
  .site-header__inner {
    padding: 16px 20px 16px 28px;
  }

  .site-header__logo {
    width: 68px;
    height: 68px;
  }

  .site-header__name-img {
    height: 60px;
    max-width: min(520px, 40vw);
  }

  .main-nav__item > a {
    font-size: 22px;
    padding: 8px 16px;
  }
}

/* 首页模块一（阳光学校）：头部保留顶部渐变遮罩，避免轮播文字穿透导航 */
body.page-home .site-header.site-header--transparent {
  background-color: transparent !important;
}

body.page-home .site-header.site-header--transparent .site-header__bg {
  background-color: transparent !important;
  background-image: linear-gradient(
    180deg,
    rgba(10, 86, 181, 0.96) 0%,
    rgba(26, 107, 200, 0.72) 42%,
    rgba(26, 107, 200, 0.28) 72%,
    rgba(10, 86, 181, 0) 100%
  ) !important;
}

/* ≤1279：汉堡菜单 + 实心顶栏，避免导航换行叠在标题上 */
@media (max-width: 1279px) {
  body.is-nav-open {
    overflow: hidden;
  }

  #site-header {
    position: fixed;
    top: 0;
    z-index: 1000;
    padding-top: env(safe-area-inset-top, 0px);
    pointer-events: auto;
    overflow: visible;
  }

  body {
    padding-top: var(--site-header-height, 64px);
  }

  .site-header {
    min-height: 64px;
    background-color: #0a56b5 !important;
  }

  .site-header__bg {
    height: 100%;
    background-color: #0a56b5 !important;
    background-image: none !important;
  }

  body.page-home .site-header.site-header--transparent,
  body.page-home .site-header.site-header--content-panel {
    background-color: #0a56b5 !important;
  }

  body.page-home .site-header.site-header--transparent .site-header__bg,
  body.page-home .site-header.site-header--content-panel .site-header__bg {
    background-color: #0a56b5 !important;
    background-image: none !important;
  }

  .site-header__inner {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px 10px 16px;
    gap: 12px;
  }

  .site-header__brand {
    grid-column: auto;
    grid-row: auto;
    gap: 12px;
    min-width: 0;
  }

  .site-header__logo {
    width: 44px;
    height: 44px;
  }

  .site-header__name-img {
    height: 36px;
    max-width: min(240px, 52vw);
  }

  .site-header__menu-btn {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    margin-left: auto;
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff;
    cursor: pointer;
    flex-shrink: 0;
    z-index: 3;
  }

  .site-header__menu-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
    transition: transform 0.2s, opacity 0.2s;
  }

  .site-header.is-nav-open .site-header__menu-btn span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .site-header.is-nav-open .site-header__menu-btn span:nth-child(2) {
    opacity: 0;
  }

  .site-header.is-nav-open .site-header__menu-btn span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .site-header__backdrop {
    display: block;
    position: fixed;
    top: 64px;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1;
    background: rgba(0, 20, 60, 0.45);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s, visibility 0.2s;
  }

  .site-header.is-nav-open .site-header__backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .site-header__nav {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 64px;
    right: 0;
    z-index: 2;
    width: min(320px, 86vw);
    height: calc(100vh - 64px);
    height: calc(100dvh - 64px);
    padding: 12px 0 24px;
    background: #0a56b5;
    box-shadow: -8px 0 28px rgba(0, 20, 60, 0.28);
    justify-content: flex-start;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.24s ease;
  }

  .site-header.is-nav-open .site-header__nav {
    transform: translateX(0);
  }

  .site-header__util {
    width: 100%;
    grid-column: auto;
    grid-row: auto;
    justify-self: stretch;
    order: 2;
    padding: 8px 16px 16px;
  }

  .util-nav {
    display: flex;
    justify-content: flex-start;
    flex-wrap: wrap;
    margin-left: 0;
    gap: 8px 4px;
    font-size: 13px;
  }

  .util-nav a {
    padding: 6px 8px;
  }

  .main-nav {
    flex: 0 0 auto;
    width: 100%;
    grid-column: auto;
    grid-row: auto;
    justify-self: stretch;
    order: 1;
  }

  .main-nav__list {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: flex-start;
    width: 100%;
    height: auto;
    gap: 0;
  }

  .main-nav__item {
    flex: 0 0 auto;
  }

  .main-nav__item > a {
    display: flex;
    width: 100%;
    padding: 14px 20px;
    font-size: 17px;
    box-sizing: border-box;
  }

  /* 收起时不占位，避免子栏目把菜单撑出大块空白 */
  .main-nav__item .sub-menu {
    display: none;
    position: static;
    left: auto;
    transform: none;
    min-width: 0;
    max-width: none;
    margin: 0 16px 8px;
    border-radius: 8px;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .main-nav__item:hover .sub-menu,
  .main-nav__item:focus-within .sub-menu {
    display: none;
  }

  .main-nav__item.is-open .sub-menu {
    display: block;
  }
}

@media (max-width: 640px) {
  .site-header__logo {
    width: 40px;
    height: 40px;
  }

  .site-header__name-img {
    height: 32px;
    max-width: min(200px, 58vw);
  }
}
