/* ============================================
   华田中央大学 - 布局样式 Layout
   ============================================ */

/* ---------- 主导航栏（整合顶部信息·清华风格） ---------- */
.site-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(180deg, #e8f0fa 0%, #d5e2f6 100%);
  z-index: var(--z-fixed);
  transition: box-shadow var(--transition-normal);
  border-bottom: 2px solid var(--color-gold-500);
}

.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(90deg, rgba(30, 74, 122, 0.08) 0%, transparent 30%),
    radial-gradient(circle at 90% 30%, rgba(201, 169, 97, 0.06) 0%, transparent 40%);
  pointer-events: none;
}

.site-header.scrolled {
  box-shadow: 0 2px 16px rgba(10, 22, 40, 0.12);
}

.header-inner {
  max-width: var(--container-max-width);
  height: var(--header-height);
  margin: 0 auto;
  padding: 0 var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-8);
  position: relative;
  z-index: 1;
}

/* 校徽校名（左侧突显） */
.site-brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  cursor: pointer;
  text-decoration: none;
}

.site-brand-logo {
  height: 72px;
  width: auto;
  display: block;
  transition: transform var(--transition-fast);
}

.site-brand:hover .site-brand-logo {
  transform: scale(1.03);
}

/* 纯校徽（圆形，用于小空间） */
.site-logo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-gold-400);
  font-size: 22px;
  font-weight: var(--font-weight-bold);
  font-family: var(--font-family-serif);
  flex-shrink: 0;
  position: relative;
  box-shadow: 0 2px 12px rgba(26, 58, 94, 0.3);
}

.site-logo::before {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  border: 1.5px solid rgba(201, 169, 97, 0.4);
}

.site-title {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.site-title-cn {
  font-size: 22px;
  font-weight: var(--font-weight-bold);
  color: var(--color-primary-800);
  letter-spacing: 1px;
  font-family: var(--font-family-serif);
}

.site-title-en {
  font-size: 11px;
  color: var(--color-gold-600);
  letter-spacing: 1px;
  font-family: Georgia, "Times New Roman", serif;
  text-transform: uppercase;
  margin-top: 2px;
}

/* 右侧区域（两行：工具链接 + 主导航） */
.header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-2);
  flex: 1;
  justify-content: center;
}

/* 顶部工具链接行 */
.header-utility {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.utility-links {
  display: flex;
  gap: var(--space-5);
}

.utility-links a {
  color: var(--color-text-tertiary);
  font-size: var(--font-size-xs);
  transition: color var(--transition-fast);
}

.utility-links a:hover {
  color: var(--color-primary-600);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding-left: var(--space-4);
  border-left: 1px solid var(--color-border-light);
}

.lang-switch {
  padding: 2px 10px;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-xs);
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  background: transparent;
}

.lang-switch:hover {
  border-color: var(--color-primary-400);
  color: var(--color-primary-600);
}

.search-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.search-btn:hover {
  color: var(--color-primary-600);
}

/* 主导航 */
.main-nav {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.nav-item {
  position: relative;
}

.nav-item > a {
  display: block;
  padding: var(--space-2) var(--space-4);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-primary);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  position: relative;
}

.nav-item > a:hover,
.nav-item.active > a {
  color: var(--color-primary-700);
}

.nav-item.active > a::after {
  content: "";
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 2px;
  background: var(--color-primary-600);
  border-radius: 1px;
}

/* 下拉菜单 */
.nav-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  min-width: 200px;
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: var(--space-2);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
  z-index: var(--z-dropdown);
  border: 1px solid var(--color-border-light);
}

.nav-item:hover .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.nav-dropdown li a {
  display: block;
  padding: var(--space-3) var(--space-4);
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.nav-dropdown li a:hover {
  background-color: var(--color-primary-50);
  color: var(--color-primary-700);
  padding-left: var(--space-5);
}

/* 移动端菜单按钮（汉堡） */
.header-actions {
  display: none;
}

.mobile-menu-btn {
  display: none;
  width: var(--touch-target);
  height: var(--touch-target);
  border: none;
  background: transparent;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.mobile-menu-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background-color: var(--color-primary-700);
  border-radius: 1px;
  transition: all var(--transition-normal);
}

/* 打开状态：汉堡变叉号 */
.mobile-menu-btn.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

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

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

/* 移动端菜单遮罩 */
.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 22, 40, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
  z-index: calc(var(--z-fixed) - 1);
}

.nav-overlay.show {
  opacity: 1;
  visibility: visible;
}

/* 菜单打开时锁定页面滚动 */
body.nav-open {
  overflow: hidden;
}

/* ---------- 页面主体 ---------- */
.site-main {
  min-height: calc(100vh - var(--header-height) - var(--footer-height));
}

/* ---------- 页面 Banner（流式高度：小屏 220px → 桌面 380px） ---------- */
.page-hero {
  position: relative;
  width: 100%;
  height: clamp(220px, 36vw, 380px);
  background: var(--gradient-hero);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.page-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(201, 169, 97, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(45, 95, 154, 0.3) 0%, transparent 50%);
}

.page-hero::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M40 40L0 0h20L40 20 60 0h20L40 40zm0 0l40 40H60L40 60 20 80H0l40-40z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.5;
}

.page-hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  color: var(--color-white);
  animation: fadeInUp 0.8s ease;
}

.page-hero-content h1 {
  font-size: var(--font-size-5xl);
  color: var(--color-white);
  margin-bottom: var(--space-4);
  font-weight: var(--font-weight-bold);
  letter-spacing: clamp(2px, 1.5vw, 8px);
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.2);
  padding: 0 var(--space-4);
}

.page-hero-content p {
  font-size: var(--font-size-lg);
  color: rgba(255, 255, 255, 0.8);
  letter-spacing: clamp(1px, 0.8vw, 4px);
  font-family: var(--font-family-serif);
  padding: 0 var(--space-4);
}

/* 面包屑 */
.breadcrumb-wrapper {
  background: var(--color-gray-50);
  border-bottom: 1px solid var(--color-border-light);
}

.breadcrumb {
  padding: var(--space-4) 0;
  font-size: var(--font-size-sm);
  color: var(--color-text-tertiary);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.breadcrumb a {
  color: var(--color-text-secondary);
  transition: color var(--transition-fast);
}

.breadcrumb a:hover {
  color: var(--color-primary-600);
}

.breadcrumb .separator {
  color: var(--color-text-muted);
  font-size: 12px;
}

.breadcrumb .current {
  color: var(--color-primary-700);
  font-weight: var(--font-weight-medium);
}

/* ---------- 页面内容区（流式留白） ---------- */
.page-content {
  padding: clamp(48px, 7vw, 80px) 0;
}

.content-sidebar-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: var(--space-12);
  align-items: start;
}

/* grid 子项允许收缩到轨道宽以下：防止宽表格/长内容把 1fr 轨道撑破，
   宽表格由 .table-responsive 内部横向滚动接管 */
.content-sidebar-layout > * {
  min-width: 0;
}

/* 侧边栏导航 */
.sidebar-nav {
  position: sticky;
  top: calc(var(--header-height) + var(--space-8));
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  border: 1px solid var(--color-border-light);
}

.sidebar-nav-header {
  background: var(--gradient-primary);
  color: var(--color-white);
  padding: var(--space-6);
}

.sidebar-nav-header h3 {
  color: var(--color-white);
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-1);
}

.sidebar-nav-header p {
  font-size: var(--font-size-xs);
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
  letter-spacing: 1px;
}

.sidebar-nav-menu {
  padding: var(--space-2);
}

.sidebar-nav-menu li a {
  display: block;
  padding: var(--space-3) var(--space-4);
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  position: relative;
}

.sidebar-nav-menu li a:hover,
.sidebar-nav-menu li a.active {
  background-color: var(--color-primary-50);
  color: var(--color-primary-700);
}

.sidebar-nav-menu li a.active {
  font-weight: var(--font-weight-medium);
}

.sidebar-nav-menu li a.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 16px;
  background: var(--gradient-gold);
  border-radius: 0 2px 2px 0;
}

/* ---------- 底部页脚 ---------- */
.site-footer {
  background: var(--color-primary-900);
  color: rgba(255, 255, 255, 0.7);
  position: relative;
  overflow: hidden;
}

.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-gold-500), transparent);
}

.footer-main {
  padding: var(--space-20) 0 var(--space-16);
  display: grid;
  grid-template-columns: 1.3fr 3fr 1fr;
  gap: var(--space-12);
  position: relative;
  z-index: 1;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  position: relative;
}

.footer-brand::after {
  content: "";
  position: absolute;
  right: calc(-1 * var(--space-6));
  top: 10%;
  bottom: 10%;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.footer-brand .site-logo {
  width: 64px;
  height: 64px;
  font-size: 28px;
}

.footer-logo-img {
  height: 56px;
  width: auto;
  display: block;
  filter: brightness(0) invert(1);
  opacity: 0.9;
  transition: opacity var(--transition-fast);
}

.footer-brand:hover .footer-logo-img {
  opacity: 1;
}

.footer-brand h3 {
  color: var(--color-white);
  font-size: var(--font-size-2xl);
  font-family: var(--font-family-serif);
  margin-bottom: var(--space-2);
}

.footer-brand .footer-brand-en {
  font-size: var(--font-size-xs);
  color: var(--color-gold-400);
  letter-spacing: 2px;
  text-transform: uppercase;
  font-family: Georgia, serif;
}

.footer-brand p {
  color: rgba(255, 255, 255, 0.5);
  font-size: var(--font-size-sm);
  line-height: 1.8;
  margin: 0;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-6);
}

.footer-link-group h4 {
  color: var(--color-white);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-6);
  position: relative;
  padding-bottom: var(--space-3);
  font-family: var(--font-family-sans);
}

.footer-link-group h4::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 24px;
  height: 2px;
  background: var(--gradient-gold);
  border-radius: 1px;
}

.footer-link-group ul li {
  margin-bottom: var(--space-3);
}

.footer-link-group ul li a {
  color: rgba(255, 255, 255, 0.5);
  font-size: var(--font-size-sm);
  transition: all var(--transition-fast);
}

.footer-link-group ul li a:hover {
  color: var(--color-gold-400);
  padding-left: 4px;
}

.footer-contact h4 {
  color: var(--color-white);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-6);
  position: relative;
  padding-bottom: var(--space-3);
}

.footer-contact h4::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 24px;
  height: 2px;
  background: var(--gradient-gold);
  border-radius: 1px;
}

.footer-contact-item {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  font-size: var(--font-size-sm);
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.6;
}

.footer-contact-item .icon {
  color: var(--color-gold-500);
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 2px;
}

/* 教育集团（右侧特色列） */
.footer-edu-group {
  position: relative;
  padding-left: var(--space-8);
}

.footer-edu-group::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10%;
  bottom: 10%;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.footer-edu-group h4 {
  color: var(--color-gold-400);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-6);
  position: relative;
  padding-bottom: var(--space-3);
}

.footer-edu-group h4::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 24px;
  height: 2px;
  background: var(--color-gold-500);
  border-radius: 1px;
}

.footer-edu-group ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-edu-links li {
  margin-bottom: var(--space-3);
}

.footer-edu-links a {
  color: rgba(255, 255, 255, 0.6);
  font-size: var(--font-size-sm);
  transition: all var(--transition-fast);
  display: inline-block;
}

.footer-edu-links a:hover {
  color: var(--color-gold-400);
  padding-left: 4px;
}

/* 联系我们（链接组内） */
.contact-link-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.contact-link-list li {
  color: rgba(255, 255, 255, 0.45);
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-3);
  line-height: 1.5;
}

.contact-link-list .icon {
  color: var(--color-gold-500);
  margin-right: 6px;
  font-size: 14px;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: var(--space-6) 0;
  text-align: center;
  font-size: var(--font-size-xs);
  color: rgba(255, 255, 255, 0.3);
  position: relative;
  z-index: 1;
}

.footer-bottom-links {
  display: flex;
  justify-content: center;
  gap: var(--space-6);
  margin-bottom: var(--space-3);
}

.footer-bottom-links a {
  color: rgba(255, 255, 255, 0.4);
  font-size: var(--font-size-xs);
  transition: color var(--transition-fast);
}

.footer-bottom-links a:hover {
  color: var(--color-gold-400);
}

/* ---------- 动画 ---------- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* ---------- 响应式 ---------- */

/* 笔记本（≤1200px）：导航间距收紧 */
@media (max-width: 1200px) {
  .main-nav { gap: 0; }
  .nav-item > a { padding: var(--space-3) var(--space-4); }

  .footer-main {
    grid-template-columns: 1.2fr 2.5fr;
    gap: var(--space-10);
  }

  .footer-brand::after {
    display: none;
  }

  .footer-edu-group {
    grid-column: 1 / -1;
    padding-left: 0;
    padding-top: var(--space-8);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  .footer-edu-group::before {
    display: none;
  }

  .footer-edu-group ul {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4) var(--space-8);
  }

  .footer-edu-links li {
    margin-bottom: 0;
  }
}

/* 平板（≤1024px）：抽屉式导航 + 单列主体 */
@media (max-width: 1024px) {
  .header-utility { display: none; }

  .header-right {
    position: static;
  }

  .main-nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-white);
    flex-direction: column;
    align-items: stretch;
    padding: var(--space-4) var(--space-4) calc(var(--space-12) + env(safe-area-inset-bottom, 0px));
    gap: var(--space-1);
    /* 关闭时彻底移出文档流：不贡献 scrollWidth，避免移动端出现横向溢出 */
    display: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: var(--z-fixed);
    box-shadow: var(--shadow-xl);
  }

  .main-nav.open {
    display: flex;
    animation: navSlideIn var(--transition-normal) both;
  }

  /* 移动端导航项：整行可点、≥44px 触控高度 */
  .nav-item > a {
    padding: var(--space-4);
    font-size: var(--font-size-lg);
    min-height: var(--touch-target);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: var(--radius-md);
    color: var(--color-text-primary);
  }

  .nav-item.active > a {
    color: var(--color-primary-700);
  }

  /* 下拉项展开指示箭头 */
  .nav-item.has-dropdown > a::after {
    content: "\25BE";
    font-size: 14px;
    color: var(--color-text-tertiary);
    transition: transform var(--transition-fast);
  }

  .nav-item.has-dropdown.open > a::after {
    transform: rotate(180deg);
  }

  .nav-dropdown {
    position: static;
    transform: none;
    opacity: 1;
    visibility: visible;
    box-shadow: none;
    border: none;
    padding: 0 0 var(--space-2) var(--space-4);
    display: none;
    min-width: 0;
  }

  .nav-item.open .nav-dropdown {
    display: block;
  }

  .nav-dropdown li a {
    padding: var(--space-3) var(--space-4);
    min-height: var(--touch-target);
    display: flex;
    align-items: center;
    font-size: var(--font-size-base);
  }

  .mobile-menu-btn {
    display: flex;
  }

  .footer-main {
    grid-template-columns: 1fr;
    gap: var(--space-10);
    padding: var(--space-16) 0 var(--space-12);
  }

  .footer-brand::after {
    display: none;
  }

  .footer-links {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-6);
  }

  .footer-edu-group {
    grid-column: auto;
    padding-left: 0;
    padding-top: 0;
    border-top: none;
  }

  .footer-edu-group ul {
    display: block;
  }

  .footer-edu-links li {
    margin-bottom: var(--space-3);
  }

  .content-sidebar-layout {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .sidebar-nav {
    position: static;
  }
}

/* 手机（≤768px）：紧凑头部 + 更小 Hero */
@media (max-width: 768px) {
  :root {
    --header-height: 64px;
  }

  .header-inner {
    height: 64px;
    padding: 0 var(--space-4);
    gap: var(--space-4);
  }

  .site-brand-logo {
    height: 40px;
  }

  .site-logo {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }

  .site-title-cn {
    font-size: 1.125rem;
  }

  .site-title-en {
    display: none;
  }

  .page-hero {
    height: clamp(200px, 48vw, 260px);
  }

  .page-hero-content h1 {
    font-size: var(--font-size-3xl);
  }

  .page-hero-content p {
    font-size: var(--font-size-base);
  }

  .footer-links {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6);
  }

  .footer-bottom-links {
    flex-wrap: wrap;
    gap: var(--space-4);
  }
}

/* 小屏手机（≤480px） */
@media (max-width: 480px) {
  .site-title-cn {
    font-size: 1rem;
  }

  .site-brand-logo {
    height: 34px;
  }

  .footer-links {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .footer-brand .site-logo {
    width: 56px;
    height: 56px;
    font-size: 24px;
  }

  .footer-logo-img {
    height: 44px;
  }
}
