/* ============================================================
   mobile.css  —  PC default: hamburger hidden  v=202605254
   All layout overrides live inside @media (max-width:767px)
   ============================================================ */

/* hide hamburger and mobile-only elements on desktop */
#navToggle { display: none; }
#mobileSearchBtn { display: none; }
.nav-arrow { display: none !important; }
#MobileBar { display: none; }
#mobileMenuOverlay { display: none; }
#mobileMenuDrawer { display: none; }

@media (max-width: 767px) {

  /* GLOBAL */
  html, body { overflow-x: hidden; }
  #Header, #Container, #BannScroll, .web_ad, #pic_banner,
  .pic_article, #FootMenu {
    width: 100% !important;
    max-width: 100%;
    box-sizing: border-box;
  }
  img { max-width: 100%; height: auto; }
  #Container { margin: 0 auto !important; }

  /* HEADER */
  #Header {
    height: auto;
    padding: 12px 12px 50px;
    position: relative;
    width: 100% !important;
    background: linear-gradient(to bottom, #50a6fb, #244572);
    margin-bottom: 5px !important;
  }
  #Header h1 {
    position: static;
    float: left;
    width: 255px;
    height: auto;
    aspect-ratio: 500 / 114;
    background-size: contain;
    background-position: left top;
    background-repeat: no-repeat;
  }
  #Header h1 a { display: block; width: 100%; height: 100%; }
  #TopPannel { display: none; }
  .wd { display: none; }

  /* HAMBURGER BUTTON */
  #navToggle {
    display: block;
    float: right;
    margin: 9px 10px 0 0;
    width: 44px;
    height: 44px;
    background: none;
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: 5px;
    cursor: pointer;
    padding: 9px;
    box-sizing: border-box;
  }
  #navToggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: #fff;
    border-radius: 1px;
  }
  #navToggle span + span { margin-top: 5px; }

  /* SEARCH ICON BUTTON in header row (left of hamburger) */
  #mobileSearchBtn {
    display: block;
    float: right;
    margin: 9px 6px 0 0;
    width: 44px;
    height: 44px;
    background: #fa872e;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    padding: 11px;
    box-sizing: border-box;
    line-height: 0;
  }
  #mobileSearchBtn:active { background: #F16A00; }

  /* MOBILE SEARCH + DATE + WEATHER BAR */
  #MobileBar {
    display: block;
    width: 100%;
    clear: both;
    padding: 6px 10px;
    box-sizing: border-box;
  }
  #mobileSearchForm {
    display: none;
    width: 100%;
    margin-bottom: 5px;
  }
  .mobile-search-form {
    display: flex;
    width: 100%;
  }
  .mobile-search-inp {
    flex: 1;
    height: 32px;
    padding: 0 8px;
    border: none;
    border-radius: 3px 0 0 3px;
    font-size: 13px;
    box-sizing: border-box;
    outline: none;
    min-width: 0;
  }
  .mobile-search-btn {
    width: 52px;
    height: 32px;
    background: #fa872e;
    color: #fff;
    border: none;
    border-radius: 0 3px 3px 0;
    cursor: pointer;
    font-size: 13px;
    flex-shrink: 0;
  }
  .mobile-search-btn:active { background: #F16A00; }
  .mobile-info-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 6px 12px;
    box-sizing: border-box;
  }
  #mobileDate {
    font-size: 11px;
    color: rgba(255,255,255,0.9);
    white-space: nowrap;
  }
  .mobile-info-bar iframe {
    display: block;
    height: 24px;
    border: none;
  }

  /* PC NAV — hidden on mobile, replaced by mobile drawer */
  #Nav { display: none !important; }

  /* === MOBILE MENU OVERLAY + DRAWER === */
  #mobileMenuOverlay {
    display: block;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.52);
    z-index: 9000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
  }
  #mobileMenuOverlay.mm-open { opacity: 1; pointer-events: auto; }
  #mobileMenuDrawer {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; right: 0;
    width: 82%;
    max-width: 300px;
    height: 100%;
    background: linear-gradient(160deg, #2a5fa0 0%, #1a3557 100%);
    z-index: 9001;
    transform: translateX(100%);
    transition: transform 0.28s ease-out;
    overflow: hidden;
  }
  #mobileMenuDrawer.mm-open { transform: translateX(0); }
  .mm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: rgba(0,0,0,0.2);
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255,255,255,0.12);
  }
  .mm-title {
    color: rgba(255,255,255,0.92);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.5px;
  }
  #mobileMenuClose {
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
  }
  .mm-nav {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
  }
  .mm-item { border-bottom: 1px solid rgba(255,255,255,0.1); }
  .mm-row {
    display: flex;
    align-items: center;
    min-height: 50px;
  }
  .mm-link {
    flex: 1;
    display: block;
    padding: 13px 16px;
    color: rgba(255,255,255,0.92);
    text-decoration: none;
    font-size: 15px;
    line-height: 1.3;
  }
  .mm-link.mm-active { color: #fff; font-weight: 700; }
  .mm-link:active { background: rgba(255,255,255,0.08); }
  .mm-arrow {
    min-width: 50px;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.5);
    font-size: 11px;
    cursor: pointer;
    transition: transform 0.2s, color 0.2s;
    flex-shrink: 0;
    border-left: 1px solid rgba(255,255,255,0.08);
  }
  .mm-item.mm-expanded > .mm-row > .mm-arrow {
    transform: rotate(90deg);
    color: rgba(255,255,255,0.85);
  }
  .mm-sub {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.28s ease-out;
    background: rgba(0,0,0,0.2);
  }
  .mm-item.mm-expanded > .mm-sub { max-height: 600px; }
  .mm-sub li { border-bottom: 1px solid rgba(255,255,255,0.06); }
  .mm-sub li:last-child { border-bottom: none; }
  .mm-sub li a {
    display: block;
    padding: 11px 16px 11px 32px;
    color: rgba(255,255,255,0.75);
    font-size: 13px;
    text-decoration: none;
    line-height: 1.4;
  }
  .mm-sub li a:active { background: rgba(255,255,255,0.08); }

  /* FOCUS NEWS + SLIDESHOW */
  /* flex column: put slideshow (order:1) before news list (order:2) */
  #BannScroll { height: auto; width: 100% !important; display: flex !important; flex-direction: column !important; }
  #BannScroll #focusNews { order: 1; margin-bottom: 5px; }
  #BannScroll #Xxxw { order: 2; }
  #focusNews {
    float: none;
    width: 100% !important;
    height: 240px;
    border-width: 2px;
  }
  #focusNews .slideCon { height: 240px; }
  #focusNews .slideCon li { width: 100%; height: 240px; }
  #focusNews .slideCon li .pic img {
    width: 100%;
    height: 240px;
    object-fit: cover;
  }
  /* 学院新闻 — show as text list stacked below slideshow */
  #Xxxw {
    display: block !important;
    float: none !important;
    width: 100% !important;
    height: auto !important;
    clear: both;
  }
  #Xxxw h3 { width: 100% !important; box-sizing: border-box; }
  #Xxxw .txtList li { width: 100% !important; }

  /* hide focusNews thumbnail strip (JS sets fixed widths) */
  #focusNews .hd, #focusNews .BgHd { display: none; }

  /* clip ad banner child (JS sets 1240px inline width) */
  .web_ad * { max-width: 100% !important; overflow: hidden; }

  /* clip horizontal news ticker inside NewsWenhua */
  #NewsWenhua .bd, #NewsWenhua .InScroll { overflow: hidden !important; width: 100% !important; }
  .txtListScroll { overflow: hidden !important; }

  /* clip people carousel (JS sets wide inline width on ul) */
  .pic_article .slideBox { overflow: hidden !important; }
  .pic_article .slideBox .tempWrap { overflow: hidden !important; width: 100% !important; }

  /* NEWS SECTIONS — flex column with explicit order */
  .mode-a { display: flex !important; flex-direction: column !important; }
  .mode-a .Main { display: contents; }
  #NewsNotice { order: 1; float: none !important; width: 100% !important; margin: 0 0 5px 0 !important; }
  #NewsWenhua { order: 2; float: none !important; width: 100% !important; margin: 0 0 5px 0 !important; }
  #NewsBjuba  { order: 3; float: none !important; width: 100% !important; margin: 0 0 5px 0 !important; }
  .Box h3 { width: 100%; box-sizing: border-box; }

  /* QUICK CHANNEL */
  #Dept { margin: 0 0 5px 0; }
  #Dept .BoxCont .txtList li {
    float: left;
    width: calc(33.3% - 22px);
    margin: 4px 5px;
  }

  /* PIC ARTICLE (领导推荐图文) */
  .pic_article { width: 100% !important; margin: 5px 0; }
  .pic_article .i-imgBox { width: 100% !important; height: auto; }
  .pic_article .slideBox { padding: 10px 30px; }
  .pic_article .slideBox .tempWrap { width: 100% !important; }
  .pic_article li { width: 46%; }

  /* FOOTER */
  #Footer { height: auto; }
  #FooterInner { height: auto; }
  #FootMenu {
    width: 100% !important;
    height: auto;
    line-height: 2;
    padding: 5px 10px;
    box-sizing: border-box;
  }
  #Footer .ewm { display: none; }
  #CopyRight { font-size: 11px; padding: 10px; }
  #FootCount { font-size: 11px; }
  .web_ad { width: 100% !important; height: auto !important; margin: 5px 0; }
  .web_ad a { display: block; line-height: 0; }
  .web_ad img { display: block; width: 100%; height: auto; }

  /* INNER PAGES — mode-b (article lists) */
  .mode-b { display: block; }
  .mode-b .Side {
    float: none;
    width: 100% !important;
    margin-bottom: 10px;
    display: block;
  }
  .mode-b .Main {
    float: none;
    width: 100% !important;
    border: none;
  }

  /* INNER PAGES — mode-d (campus photo, leaders, download) */
  .mode-d .Side {
    float: none;
    width: 100% !important;
    display: block;
  }
  .mode-d .Main {
    float: none;
    width: 100% !important;
    display: block;
  }
  .mode-d .Main .banner img { width: 100% !important; }

  /* CAMPUS PHOTO GALLERY */
  #CampusPic .picList { margin: 10px 5px; }
  #CampusPic .picList li {
    width: calc(50% - 10px);
    height: auto;
  }
  #CampusPic .picList li img {
    width: 100%;
    height: auto;
  }

  /* LEADER LIST */
  #LeaderList #EntryList .txtPic li .pe_u_thumb {
    width: 100px;
  }
  #LeaderList #EntryList .txtPic li .pe_u_thumb img {
    width: 100px;
    height: 140px;
  }
  #LeaderList #EntryList .txtPic li .pe_u_thumb_title {
    width: calc(100% - 120px);
  }

  /* LEAD DETAIL */
  #LeadDetail .LeadPic {
    float: none;
    width: 100%;
    text-align: center;
    margin-bottom: 10px;
  }
  #LeadDetail .LeadName {
    float: none;
    width: 100% !important;
    height: auto;
    background: none !important;
    border-bottom: 2px solid #315194;
    padding-bottom: 5px;
  }
  #LeadDetail .LeadDetailMore {
    float: none;
    width: 100% !important;
    padding: 10px 0;
  }

  /* ARTICLE CONTENT */
  .contArticle_text img { max-width: 100%; height: auto; }
  .contArticle_text table { max-width: 100%; overflow-x: auto; display: block; }

  /* DOWNLOAD SECTION */
  .Container { width: 100% !important; }
  .Container .PathBg { width: 100% !important; }
  .mainbox, .mainbox_a {
    width: 100% !important;
    padding: 10px;
    box-sizing: border-box;
    height: auto !important;
  }
  .side {
    float: none;
    width: 100% !important;
    margin-right: 0;
    margin-bottom: 15px;
  }
  .main { float: none; width: 100% !important; }
  #AboutNav, #AboutNew { width: 100%; }
  #AboutNav .title, #AboutNew .title {
    width: 100%;
    background-size: 100% 29px;
  }
  #Aboutdata { width: 100% !important; height: auto !important; }
  #Aboutdata .BoxCont { height: auto !important; }
  .txtPic li { width: 100%; }
  #Aboutdata .BoxCont .book_text { width: calc(100% - 125px); }
}
