/* index.mobile.css — 首页移动端响应式样式
   不修改原 index.css，通过媒体查询叠加覆盖 */

/* ===== 汉堡菜单按钮 — 桌面端隐藏 ===== */
.mobile-menu-toggle {
  display: none;
}

@media (max-width: 768px) {

  /* ===== 全局基础 ===== */
  body {
    min-width: 0;
    overflow-x: hidden;
  }

  .container {
    width: 100%;
    padding: 0 16px;
  }

  /* ===== 顶部红色栏 ===== */
  .topbar {
    height: auto;
    padding: 10px 0;
  }

  .topbar__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    height: auto;
  }

  .brand__logo {
    height: 44px;
  }

  .brand__cn {
    font-size: 13px;
  }

  .brand__sub {
    font-size: 11px;
  }

  .topbar__actions {
    width: 100%;
    gap: 10px;
    align-items: stretch;
    flex-direction: column;
    justify-content: flex-start;
  }

  /* 与桌面一致：仅隐藏顶栏搜索，不删 HTML；去掉 search--hidden 类即显示 */
  .search.search--hidden {
    display: none;
  }

  /* 移动端：三路热线横排缩小，与设计稿同款结构 */
  .topbar__hotlines {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-left: 0;
    padding: 12px 0 8px;
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    gap: 0;
    box-sizing: border-box;
  }

  .topbar__hotline-item {
    flex: 1 1 0;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 0;
    padding: 0 2px;
  }

  .topbar__hotline-icon-wrap {
    width: 36px;
    height: 36px;
  }

  .topbar__hotline-icon-wrap .topbar__hotline-icon {
    width: 17px;
    height: 17px;
  }

  .topbar__hotline-body {
    gap: 3px;
    align-items: flex-start;
  }

  .topbar__hotline-num {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
  }

  .topbar__hotline-role {
    font-size: 9px;
    font-weight: 400;
    letter-spacing: 0;
    color: rgba(255, 255, 255, 0.88);
    white-space: normal;
    max-width: 100%;
    line-height: 1.25;
    text-align: left;
  }

  .topbar__hotline-divider {
    display: block;
    flex-shrink: 0;
    width: 1px;
    height: 34px;
    align-self: center;
    margin: 0 2px;
    background: rgba(255, 255, 255, 0.28);
  }

  .topbar__hotline-num:hover {
    opacity: 0.92;
  }

  /* 顶栏为纵向 flex 时不要用 flex:1，否则会把搜索条在竖直方向撑变形 */
  .search {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    align-self: stretch;
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 40px;
    min-height: 40px;
    box-sizing: border-box;
  }

  .topbar .search__input {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    height: auto;
    align-self: stretch;
    font-size: 16px;
    line-height: 1.25;
  }

  .topbar .search__button {
    flex: 0 0 auto;
    align-self: stretch;
    height: auto;
    padding: 0 14px;
    font-size: 13px;
    white-space: nowrap;
  }

  .topbar__meta {
    font-size: 12px;
    white-space: nowrap;
  }

  .search-toast {
    bottom: 72px;
    font-size: 13px;
    padding: 11px 18px;
  }

  /* ===== 主导航 — 汉堡菜单 ===== */

  /* 导航栏：吸顶由 main.js .main-nav--fixed；汉堡 */
  .main-nav {
    position: relative;
    z-index: 120;
    height: 48px;
    overflow: visible;
    border-bottom: 2px solid #e8e0d8;
  }

  .main-nav.main-nav--fixed {
    z-index: 220;
  }

  .main-nav > .container {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 12px;
  }

  /* 汉堡按钮 */
  .mobile-menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 10;
    position: relative;
  }

  .mobile-menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: #3a3a3a;
    border-radius: 1px;
    transition: all 0.3s ease;
    margin: 0;
  }

  .mobile-menu-toggle span + span {
    margin-top: 6px;
  }

  /* 展开时动画为 X */
  .main-nav.is-open .mobile-menu-toggle span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }
  .main-nav.is-open .mobile-menu-toggle span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
  }
  .main-nav.is-open .mobile-menu-toggle span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  /* 导航列表 — 默认隐藏，展开时垂直下拉 */
  .main-nav__list {
    display: none;
    position: absolute;
    top: 48px;
    left: 0;
    right: 0;
    background: #fff;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
    flex-direction: column;
    height: auto;
    max-height: 75vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 200;
    border-top: 2px solid #bb2027;
    align-items: stretch;
    justify-content: flex-start;
  }

  .main-nav.is-open .main-nav__list {
    display: flex;
  }

  /* 一级菜单项 */
  .main-nav__list > li {
    width: 100%;
    flex-shrink: 1;
    height: auto;
    position: relative;
    display: block;
  }

  .main-nav__list > li > a {
    padding: 14px 44px 14px 16px;
    font-size: 15px;
    height: auto;
    white-space: normal;
    border-bottom: 1px solid #f0ebe5;
    width: 100%;
    position: relative;
  }

  /* 当前激活项 — 左侧红色竖线 */
  .main-nav__list > li.is-active::after {
    display: none;
  }

  .main-nav__list > li.is-active > a {
    color: #bb2027;
    font-weight: 700;
    border-left: 3px solid #bb2027;
    padding-left: 13px;
    background: rgba(187, 32, 39, 0.03);
  }

  /* 桌面端 hover 下划线在手机端不需要 */
  .main-nav__list > li:not(.is-active):hover::after {
    display: none;
  }

  /* 有子菜单的加号/减号图标 */
  .main-nav__list > li.has-sub > a::after {
    content: "+";
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    font-weight: 300;
    opacity: 1;
    color: #999;
    transition: transform 0.3s, color 0.3s;
    margin-left: 0;
  }

  .main-nav__list > li.has-sub.sub-open > a::after {
    content: "−";
    color: #bb2027;
  }

  .main-nav__list > li.has-sub.sub-open > a {
    color: #bb2027;
    background: rgba(187, 32, 39, 0.03);
  }

  /* 二级子菜单 — 手风琴展开 */
  .sub-nav {
    display: none !important;
    position: static !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    box-shadow: none !important;
    background: #faf7f2;
    max-height: 0;
    overflow: hidden;
  }

  .main-nav__list > li.has-sub.sub-open > .sub-nav {
    display: block !important;
    max-height: 500px;
    animation: subMenuOpen 0.3s ease;
  }

  /* 多级：一级展开后，内层 sub-nav 同步可见 */
  .main-nav__list > li.has-sub.sub-open .sub-nav .sub-nav {
    display: block !important;
    max-height: none !important;
    overflow: visible !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    background: #efe9e2;
    box-shadow: none !important;
  }

  .sub-nav .sub-nav a {
    padding-left: 52px;
    font-size: 13px;
  }

  .sub-nav .sub-nav .sub-nav a {
    padding-left: 68px;
  }

  @keyframes subMenuOpen {
    from {
      max-height: 0;
      opacity: 0;
    }
    to {
      max-height: 500px;
      opacity: 1;
    }
  }

  .sub-nav li {
    border-bottom: 1px solid #ece7e0;
  }

  .sub-nav li:last-child {
    border-bottom: 0;
  }

  .sub-nav a {
    padding: 12px 16px 12px 36px;
    font-size: 14px;
    color: #555;
    position: relative;
  }

  .sub-nav a::before {
    content: "";
    position: absolute;
    left: 20px;
    top: 50%;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #c3b9aa;
    transform: translateY(-50%);
  }

  .sub-nav a:hover {
    background: #bb2027;
    color: #fff;
  }

  .sub-nav a:hover::before {
    background: #fff;
  }

  /* ===== 首屏轮播 ===== */
  .hero {
    height: 200px;
  }

  .hero__bg-symbol {
    display: none;
  }

  .hero__motto {
    display: none;
  }

  .hero__controls {
    bottom: 10px;
    gap: 8px;
  }

  .hero__arrow {
    width: 26px;
    height: 26px;
    font-size: 11px;
  }

  /* ===== 内容主区域 ===== */
  .section {
    padding: 20px 0 24px;
  }

  .section--news,
  .section--training,
  .section--enterprise,
  .section--scene,
  .section--campus {
    padding-top: 20px;
    padding-bottom: 24px;
  }

  .section-title {
    margin-bottom: 14px;
  }

  .section-title img {
    width: 180px;
    height: auto;
  }

  .section-title h2 {
    font-size: 15px;
  }

  /* ===== 学校要闻 ===== */
  .news-layout {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .news-aside-spacer {
    display: none;
    height: 0;
    margin: 0;
  }

  .news-hero-card__media img {
    height: 180px;
  }

  .news-mid-item {
    grid-template-columns: 1fr 88px;
    gap: 10px 12px;
    padding: 12px 0;
  }

  .news-mid-item__thumb {
    width: 88px;
    height: 66px;
  }

  .news-brand-panel {
    padding: 14px 12px;
  }

  .news-slider__item img {
    height: 170px;
  }

  .news-side-list {
    gap: 12px;
  }

  .news-side-item {
    grid-template-columns: 96px 1fr;
    gap: 10px;
  }

  .news-side-item img {
    width: 96px;
    height: 64px;
  }

  .news-bullet-list li {
    gap: 10px;
    padding: 8px 0;
  }

  .news-bullet-list a {
    font-size: 13px;
  }

  /* ===== 干部培训 — Tabs ===== */
  .tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    justify-content: flex-start;
    scrollbar-width: none;
  }

  .tabs::-webkit-scrollbar {
    display: none;
  }

  .tab-btn {
    padding: 8px 14px 10px;
    font-size: 13px;
    flex-shrink: 0;
  }

  .tab-panel {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .card-grid--four {
    grid-template-columns: repeat(2, 1fr);
  }

  /* 手机端显示前4张（前2行2列） */
  .card-grid--four .image-card:nth-child(n+5) {
    display: none;
  }

  .image-card img {
    height: 110px;
  }

  .image-card h3 {
    font-size: 12px;
    padding: 8px 10px 12px;
  }

  /* ===== 企业培训 ===== */
  .enterprise-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .enterprise-grid .enterprise-card:nth-child(1),
  .enterprise-grid .enterprise-card:nth-child(2),
  .enterprise-grid .enterprise-card:nth-child(3),
  .enterprise-grid .enterprise-card:nth-child(4) {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .enterprise-card {
    height: 160px;
  }

  /* ===== 现场教学 ===== */
  .scene-layout {
    grid-template-columns: 1fr;
    min-height: auto;
    border-radius: 0;
  }

  .scene-tabs {
    grid-template-columns: repeat(5, 1fr);
    min-height: auto;
  }

  .scene-tab {
    min-height: 70px;
    gap: 5px;
    font-size: 12px;
    padding: 8px 4px;
  }

  .scene-tab__icon {
    width: 22px;
    height: 22px;
    background-size: 14px;
  }

  .scene-tab > span {
    writing-mode: horizontal-tb;
    letter-spacing: 0.02em;
    font-size: 11px;
    flex-shrink: 0;
    line-height: 1.35;
    text-align: center;
    word-break: keep-all;
  }

  .scene-tab.is-active::after {
    display: none;
  }

  .scene-panels {
    min-height: 220px;
  }

  .scene-feature__content {
    padding: 20px 18px;
  }

  .scene-feature__content h3 {
    font-size: 15px;
    margin-bottom: 8px;
  }

  /* ===== 校园风光 ===== */
  .campus-grid--top {
    grid-template-columns: 1fr 1fr;
  }

  .campus-grid--bottom {
    grid-template-columns: 1fr 1fr;
  }

  .campus-card--wide {
    height: 130px;
  }

  .campus-grid--bottom .campus-card {
    height: 100px;
  }

  .campus-card__caption {
    font-size: 11px;
    padding: 6px 10px;
  }

  /* ===== 页脚 ===== */
  .site-footer {
    padding: 20px 0 0;
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .footer-col h3 {
    font-size: 13px;
    margin-bottom: 10px;
  }

  .footer-col a,
  .footer-col p {
    font-size: 11px;
    margin-bottom: 6px;
  }

  .footer-copyright {
    margin-top: 16px;
    padding: 12px 0 14px;
  }

  .footer-copyright__text {
    font-size: 11px;
    line-height: 1.5;
  }
}

@media (max-width: 480px) {

  .topbar__actions {
    flex-wrap: wrap;
  }

  .hero {
    height: 170px;
  }

  .tab-panel {
    grid-template-columns: 1fr 1fr;
  }

  .campus-grid--top {
    grid-template-columns: 1fr;
  }

  .campus-card--wide {
    height: 160px;
  }

  .campus-grid--bottom {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
}
