/* ============================================================
   header.css — 头部、导航、搜索、移动端抽屉、返回顶部
   ============================================================ */

/* ============ 头部（透明压题 + 滚动渐变） ============ */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  color: #fff;
  transition: background-color .35s ease, box-shadow .35s ease;
}
.site-header.scrolled {
  background: rgba(26, 79, 139, 0.96);
  box-shadow: 0 2px 14px rgba(10, 42, 90, 0.32);
}

/* 顶部信息条 */
.header-top {
  height: var(--topbar-h);
  background: rgba(16, 58, 102, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  font-size: .8125rem;
  transition: background-color .35s ease;
}
.site-header.scrolled .header-top { background: rgba(16, 58, 102, 0.92); }
.header-top .container {
  display: flex; align-items: center; justify-content: space-between; height: 100%;
}
.ht-left { color: rgba(255, 255, 255, 0.92); letter-spacing: .3px; }
.ht-left b { font-weight: 600; color: #fff; }
.ht-right { display: flex; align-items: center; gap: 16px; }
.ht-right a { color: rgba(255, 255, 255, 0.95); transition: color .2s; }
.ht-right a:hover { color: #ffd76a; }   /* 顶部校训图 hover 保持醒目 */

/* 搜索框 */
.search-form { display: flex; align-items: center; }
.search-form input {
  width: 168px; height: 24px; padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 12px 0 0 12px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff; font-size: .75rem; outline: none;
}
.search-form input::placeholder { color: rgba(255, 255, 255, 0.75); }
.search-form button {
  height: 24px; width: 30px;
  border-radius: 0 12px 12px 0;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  color: var(--navy);
  transition: background .2s;
}
.search-form button:hover { background: #ffd76a; }
.search-form button svg { width: 13px; height: 13px; }

/* 主头部：logo + 导航 */
.header-main { height: var(--header-h); }
.header-main .container {
  display: flex; align-items: center; justify-content: space-between; height: 100%;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand .brand-logo {
  width: 48px; height: 48px;
  border-radius: 50%; overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.18);
  flex-shrink: 0;
}
.brand .brand-logo img { width: 100%; height: 100%; object-fit: contain; }
.brand-text strong {
  display: block; font-size: 1.3rem; font-weight: 700; letter-spacing: 1px; line-height: 1.25;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}
.brand-text em {
  display: block; font-style: normal; font-size: .66rem;
  letter-spacing: 3.2px; color: rgba(255, 255, 255, 0.88);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

/* 导航菜单 */
.main-nav { display: flex; }
.nav-menu { display: flex; align-items: center; }
.nav-menu > li { position: relative; }
.nav-menu > li > a {
  position: relative; display: block;
  padding: 8px 13px;
  color: rgba(255, 255, 255, 0.96);
  font-size: .92rem; font-weight: 500; letter-spacing: .6px;
  white-space: nowrap;
  transition: background-color .25s, color .25s;
}
.nav-menu > li > a::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 3px;
  height: 2px; background: #ffd76a;
  transform: scaleX(0); transform-origin: left center;
  transition: transform .3s ease;
}
.nav-menu > li:hover > a, .nav-menu > li.active > a { color: #fff; }
.nav-menu > li:hover > a::after, .nav-menu > li.active > a::after { transform: scaleX(1); }
.nav-menu .arrow { font-size: .7rem; margin-left: 2px; opacity: .85; }

/* 下拉子菜单 */
.nav-sub {
  position: absolute; top: 100%; left: 0; min-width: 150px;
  background: rgba(26, 79, 139, 0.97);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: 0 8px 20px rgba(10, 42, 90, 0.3);
  padding: 6px 0;
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .25s ease, transform .25s ease, visibility .25s;
}
.nav-menu > li:hover .nav-sub { opacity: 1; visibility: visible; transform: translateY(0); }
.nav-sub a {
  display: block; padding: 8px 18px;
  color: rgba(255, 255, 255, 0.94); font-size: .85rem;
  transition: background-color .2s, padding-left .2s;
}
.nav-sub a:hover { background: rgba(255, 255, 255, 0.12); padding-left: 24px; color: #fff; }

/* 汉堡按钮（移动端） */
.menu-btn {
  display: none;
  align-items: center; gap: 6px;
  color: #fff; font-size: .9rem;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius);
  padding: 6px 12px;
}
.menu-btn .bar { display: block; width: 16px; height: 2px; background: #fff; margin: 3px 0; }

/* ============ 移动端抽屉导航 ============ */
.nav-mask {
  position: fixed; inset: 0; z-index: 1100;
  background: rgba(10, 42, 90, 0.55);
  opacity: 0; visibility: hidden;
  transition: opacity .3s, visibility .3s;
}
.nav-mask.show { opacity: 1; visibility: visible; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 1200;
  width: min(320px, 84vw);
  background: #fff;
  transform: translateX(100%);
  transition: transform .35s ease;
  display: flex; flex-direction: column;
  overflow-y: auto;
}
.drawer.open { transform: translateX(0); box-shadow: -8px 0 30px rgba(10, 42, 90, 0.25); }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px;
  background: var(--navy);
  color: #fff;
}
.drawer-head span { font-size: 1rem; font-weight: 600; }
.drawer-close { color: #fff; font-size: 1.5rem; line-height: 1; }
.drawer-search { display: flex; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.drawer-search input {
  flex: 1; height: 34px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: var(--radius);
  font-size: .85rem; outline: none;
}
.drawer-search input:focus { border-color: var(--blue); }
.drawer-search button {
  padding: 0 16px; background: var(--navy); color: #fff;
  border-radius: var(--radius); font-size: .85rem;
}
.drawer-menu > li > a {
  display: block; padding: 13px 18px;
  border-bottom: 1px solid #f0f0f0;
  font-size: .92rem; color: var(--ink);
}
.drawer-menu .sub-item a { padding-left: 34px; font-size: .85rem; color: var(--ink-soft); }
.drawer-menu > li > a:hover { color: var(--blue); background: var(--blue-pale); }

/* ============ 返回顶部 ============ */
.to-top {
  position: fixed; right: 26px; bottom: 30px; z-index: 900;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--navy); color: #fff;
  font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: all .3s;
}
.to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top:hover { background: var(--blue-light); }
