/* ===========================================
   layout.css — 头部导航、底部 footer、grid
   =========================================== */

/* ---------- Header 顶部导航 ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
  z-index: 1000;
  transition: all var(--tr-base);
}

.site-header.scrolled {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--sh-sm);
}

.header-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-shrink: 0;
}

.site-logo img {
  height: 40px;
  width: auto;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  flex-wrap: nowrap;
  white-space: nowrap;
}

.main-nav a {
  display: inline-block;
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--fs-base);
  color: var(--c-text);
  font-weight: 500;
  position: relative;
  transition: color var(--tr-fast);
  white-space: nowrap;
  flex-shrink: 0;
}

.main-nav a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 4px;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: var(--c-primary);
  transition: width var(--tr-base);
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--c-primary);
}

.main-nav a:hover::after,
.main-nav a.active::after {
  width: 70%;
}

/* 汉堡菜单按钮 */
.menu-toggle {
  display: none;
  width: 36px;
  height: 36px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  z-index: 1001;
}

.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--c-text);
  border-radius: var(--r-full);
  transition: all var(--tr-base);
}

.menu-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- Main 内容主体 ---------- */
.site-main {
  padding-top: var(--header-h);
  min-height: 60vh;
}

/* ---------- Footer 底部 ---------- */
.site-footer {
  background: linear-gradient(180deg, var(--c-primary-dark) 0%, var(--c-primary-darker) 100%);
  color: var(--c-text-white);
  padding: var(--sp-16) 0 var(--sp-8);
  margin-top: 0;
}

.footer-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-12);
  align-items: start;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.footer-logo img {
  height: 36px;
  width: auto;
  filter: brightness(0) invert(1);
}

.footer-logo-text {
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--c-text-white);
}

.footer-desc {
  font-size: var(--fs-sm);
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.8;
  max-width: 600px;
}

.footer-nav {
  display: flex;
  gap: var(--sp-6);
  flex-wrap: wrap;
  margin-top: var(--sp-2);
  list-style: none;
}

.footer-nav a {
  font-size: var(--fs-sm);
  color: rgba(255, 255, 255, 0.8);
  transition: color var(--tr-fast);
}

.footer-nav a:hover,
.footer-nav a.active {
  color: var(--c-text-white);
  font-weight: 500;
}

.footer-qrcodes {
  display: flex;
  gap: var(--sp-6);
  justify-content: flex-end;
  flex-wrap: wrap;
}

.qrcode-item {
  text-align: center;
}

.qrcode-item img {
  width: 100px;
  height: 100px;
  background: var(--c-text-white);
  padding: 6px;
  border-radius: var(--r-md);
}

.qrcode-item .qrcode-label {
  margin-top: var(--sp-2);
  font-size: var(--fs-sm);
  color: rgba(255, 255, 255, 0.9);
}

.footer-bottom {
  max-width: var(--container-max);
  margin: var(--sp-12) auto 0;
  padding: var(--sp-6) var(--container-pad) 0;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  text-align: center;
  font-size: var(--fs-sm);
  color: rgba(255, 255, 255, 0.6);
}

.footer-bottom a {
  color: rgba(255, 255, 255, 0.6);
  transition: color var(--tr-fast);
}

.footer-bottom a:hover {
  color: var(--c-text-white);
}

/* ---------- Grid 通用 ---------- */
.grid {
  display: grid;
  gap: var(--sp-6);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }
.grid-6 { grid-template-columns: repeat(6, 1fr); }

/* ---------- Flex 工具类 ---------- */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); }
.gap-6 { gap: var(--sp-6); }
.gap-8 { gap: var(--sp-8); }

/* ---------- Banner 通用 ---------- */
.page-banner {
  position: relative;
  height: 360px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  overflow: hidden;
  margin-bottom: 0;
}

.page-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.5) 40%, rgba(255,255,255,0) 70%);
}

/* 整图 banner（如师资页），去掉白色渐变遮罩 */
.page-banner--plain::before {
  background: none;
}

.page-banner-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
  width: 100%;
  position: relative;
  z-index: 1;
}

.page-banner h1 {
  font-size: var(--fs-3xl);
  color: var(--c-text);
  font-weight: 700;
  position: relative;
  padding-left: var(--sp-4);
}

.page-banner h1::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--c-primary);
  border-radius: var(--r-full);
}

.page-banner .banner-en {
  font-size: var(--fs-md);
  color: var(--c-text-secondary);
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: var(--sp-2);
}
