:root{ --hero-h: 78vh; }

body{ min-height:100vh; display:flex; flex-direction:column; }
main#content{ flex:1 0 auto; }
img{ max-width:100%; height:auto; }

/* ---------- 导航栏 ---------- */
.site-header .navbar{ box-shadow:0 1px 8px rgba(0,0,0,.08); }
.site-header .navbar-brand img{ max-height:40px; width:auto; }
.site-header .navbar-nav .menu-item-has-children{ position:relative; }

/* 带子菜单的顶级链接显示小箭头（桌面端） */
.navbar-nav .nav-link.has-sub::after{
  content:""; display:inline-block; margin-left:.4em; vertical-align:.2em;
  border-top:.3em solid; border-right:.3em solid transparent; border-left:.3em solid transparent;
}
/* 移动端的箭头按钮 */
.submenu-toggle{
  background:none; border:0; padding:.5rem .75rem; color:inherit;
}
.submenu-toggle::after{
  content:""; display:inline-block; border-top:.35em solid; border-right:.35em solid transparent; border-left:.35em solid transparent;
  transition:transform .2s;
}
.submenu-toggle.show::after{ transform:rotate(180deg); }

/* 手机/平板（折叠态）：父项一行，链接 + 箭头按钮，子菜单展开在下方 */
@media (max-width: 991.98px){
  .navbar-nav .menu-item-has-children{ display:flex; flex-wrap:wrap; align-items:center; }
  .navbar-nav .menu-item-has-children > .nav-link{ flex:1 1 auto; }
  .navbar-nav .menu-item-has-children > .nav-link.has-sub::after{ display:none; }
  .navbar-nav .menu-item-has-children > .dropdown-menu{
    flex:0 0 100%; position:static; border:0; background:transparent; padding:0 0 .25rem 1rem; box-shadow:none;
  }
}
/* 桌面端：鼠标悬停展开二级菜单 */
@media (min-width: 992px){
  .navbar-nav .dropdown-menu{ margin-top:0; min-width:12rem; border-radius:.5rem; box-shadow:0 .5rem 1.25rem rgba(0,0,0,.12); }
  .navbar-nav .menu-item-has-children:hover > .dropdown-menu,
  .navbar-nav .menu-item-has-children:focus-within > .dropdown-menu{ display:block; animation:ddFade .18s ease-out; }
}
@keyframes ddFade{ from{opacity:0; transform:translateY(6px);} to{opacity:1; transform:none;} }

/* ---------- Hero Swiper ---------- */
.hero-swiper{ width:100%; height:var(--hero-h); min-height:320px; background:#111; }
.hero-swiper .swiper-slide{ position:relative; overflow:hidden; }
.hero-swiper picture, .hero-swiper picture img{
  position:absolute; inset:0; width:100%; height:100%; object-fit:cover;
}
.hero-swiper .slide-overlay{ position:absolute; inset:0; background:linear-gradient(90deg,rgba(0,0,0,.55),rgba(0,0,0,.1)); }
.hero-swiper .slide-content{ position:relative; z-index:2; height:100%; display:flex; align-items:center; }
.hero-swiper .slide-content .inner{ max-width:640px; color:#fff; }
.hero-swiper .slide-title{ font-size:clamp(1.75rem,4vw,3.5rem); font-weight:700; line-height:1.15; }
.hero-swiper .slide-sub{ font-size:clamp(1rem,1.6vw,1.35rem); opacity:.92; }
/* 动画元素初始隐藏，由 JS 触发 */
.swiper-animate{ visibility:hidden; }
.swiper-animate.animate__animated{ visibility:visible; }
.hero-swiper .swiper-button-prev, .hero-swiper .swiper-button-next{ color:#fff; }
.hero-swiper .swiper-pagination-bullet{ background:#fff; opacity:.6; }
.hero-swiper .swiper-pagination-bullet-active{ opacity:1; }

/* 手机竖屏：高度按屏幕比例，内容底部居中更自然 */
@media (max-width: 767.98px), (orientation: portrait){
  :root{ --hero-h: 82vh; }
  .hero-swiper .slide-overlay{ background:linear-gradient(0deg,rgba(0,0,0,.65),rgba(0,0,0,.05) 70%); }
  .hero-swiper .slide-content{ align-items:flex-end; padding-bottom:3.5rem; }
  .hero-swiper .swiper-button-prev, .hero-swiper .swiper-button-next{ display:none; }
}

/* ---------- 文章 ---------- */
.entry-content img{ border-radius:.5rem; }
.card-post .card-img-top{ aspect-ratio:16/9; object-fit:cover; }
.site-footer{ flex-shrink:0; }

@media (prefers-reduced-motion: reduce){
  .swiper-animate{ visibility:visible; animation:none !important; }
}

/* 页脚菜单 */
.site-footer .nav a{ color:#adb5bd; text-decoration:none; padding:.25rem .75rem; }
.site-footer .nav a:hover{ color:#fff; }
.site-footer .widget-title{ color:#fff; }
.site-footer a{ color:#adb5bd; }
