/* ==================== 全局样式（桌面端默认） ==================== */
/* 数字政府子菜单：默认隐藏，鼠标悬停时显示 */
#yiwang dd .hoverbox {
  display: none;
}
#yiwang dd:hover .hoverbox {
  display: flex;
}

/* ==================== 响应式适配 ==================== */
@media (max-width: 1240px) {
  /* 容器宽度自适应（修复 100vw 导致的横向溢出） */
  .container,
  .content {
    width: 100% !important; /* 原为 100vw，改为 100% */
    max-width: 100% !important;
    padding-left: 15px !important;
    padding-right: 15px !important;
  }
  /* 内容区顶部间距，防止与菜单重叠（如头部汉堡菜单展开时） */
  .content {
    clear: both !important;
  }
  /* 头条新闻字号缩小 */
  .headliNews h4 {
    font-size: 24px;
  }
  /* 轮播与新闻列表上下排列 */
  .newbox {
    flex-direction: column;
    height: auto;
  }
  .newbox .slidebox,
  .newbox .newlist {
    width: 100%;
  }
  /* 数字政府卡片两列 */
  #yiwang dd {
    width: calc(50% - 20px);
  }
  /* 悬停浮层改为静态（避免遮挡） */
  .hoverbox {
    position: static;
    box-shadow: none;
    padding: 10px 0;
  }
}

@media (max-width: 768px) {
  /* 防止横向滚动条 */
  html,
  body {
    overflow-x: hidden !important;
    width: 100% !important;
    min-width: 0 !important; /* 修复原 min-width: none; 的语法错误 */
  }

  /* 全局字号微调 */
  body {
    font-size: 12px;
  }

  /* 强制所有主要容器宽度100% */
  .container,
  .content,
  .header .container,
  .nav .container,
  .footer .container {
    width: 100% !important; /* 原为 100vw，改为 100% */
    max-width: 100% !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
    box-sizing: border-box !important;
  }
  .content {
    width: 100%;
    margin: 0;
  }
  /* 头条新闻 */
  .headliNews h4 {
    font-size: 18px;
    width: auto; /* 原 65vw，改为 auto 避免溢出 */
  }
  .headliNews span {
    font-size: 14px;
  }
  .jrtt_logo {
    display: block !important;
    width: 60px !important;
    height: auto !important;
    margin: 0 auto 10px !important;
  }

  /* 新闻列表导航标签 */
  .newbox .newlist .informationNav .main_nav:nth-child(1) {
    width: 20%;
  }
  .newbox .newlist .informationNav .main_nav {
    width: 36%;
    padding: 0 5px;
  }

  .center_list li {
    font-size: 14px;
    line-height: 30px;
  }
  .center_list li .time {
    font-size: 12px;
  }
  .newbox {
    height: 885px;
  }
  /* 搜索框在移动端垂直排列 */
  .newbox .search {
    flex-direction: column !important;
    gap: 8px !important;
  }
  .newbox .search .fl,
  .newbox .search .searchButton {
    width: 180px !important;
  }

  /* 数字政府板块 */
  #tit {
    height: 115px;
  }
  #tit h1 {
    font-size: 2rem;
  }
  #tit p {
    font-size: 1.2rem;
  }
  #tit span {
    font-size: 0.9rem;
    bottom: -0.8rem;
  }
  /* 卡片高度自适应，避免子菜单重叠 */
  #yiwang dd {
    width: calc(100% - 20px);
    min-height: 150px;
    height: auto;
  }
  .hoverbox > li {
    min-width: 100%;
  }
  #yiwang dd > img {
    top: 5px;
  }

  /* ========== 专题轮播（ztzl）移动端适配 ========== */
  .conbot {
    width: 100%;
    overflow: hidden;
  }
  .conbot .bd {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }
  .conbot .bd ul {
    white-space: nowrap;
    margin: 0;
    padding: 0;
    list-style: none;
    display: inline-block;
  }
  .conbot .bd ul li {
    display: inline-block;
    width: 280px;
    max-width: 80vw;
    margin-right: 15px;
    white-space: normal;
    vertical-align: top;
  }
  .conbot .bd ul li img {
    width: 100%;
    height: 200px;
    display: block;
  }
  /* 移动端隐藏左右箭头 */
  .conbot .prev,
  .conbot .next {
    display: none !important;
  }

  /* ========== 修复轮播图显示（保持比例容器） ========== */
  .fir_img {
    position: relative !important;
    width: 100% !important; /* 原为 100vw，改为 100% */
    height: 430px !important;
    overflow: hidden !important;
  }
  .fir_img .ul {
    width: 100%;
    height: 100%;
  }
  .fir_img .ul li {
    position: absolute !important;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
  }
  .fir_img .ul li.active {
    opacity: 1;
  }
  .fir_img .ul li img {
    width: 100% !important;
    height: 430px !important;
    object-fit: cover !important;
  }
  .bar {
    position: absolute !important;
    bottom: 3px !important;
    right: 20px !important;
    left: auto !important;
    top: auto !important;
    margin: 0 !important;
    z-index: 10;
    display: flex;
  }
  .bar li {
    width: 10px !important;
    height: 10px !important;
  }
  .bannerText {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important; /* 原为 100vw，改为 100% */
    background: rgba(0, 0, 0, 0.5) !important;
    color: #fff !important;
    padding: 8px 12px !important;
    font-size: 12px !important;
    white-space: normal !important;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
  }
  .newlist {
    margin: 15px 0 0 !important;
  }
  .newbox .newlist .center_list li a {
    width: 250px;
  }

  /* ========== 移动端子菜单样式（覆盖全局 hover，由 JS 控制） ========== */
  #yiwang dd .hoverbox {
    display: none; /* 默认隐藏，不加 !important 以便 JS 控制 */
    position: static;
    width: 100%;
    box-sizing: border-box;
    margin-top: 10px;
    margin-bottom: 10px;
  }
  #yiwang dd:hover .hoverbox {
    display: none;
  }

  /* 二级菜单（.Submenu）样式 */
  .hoverbox li .Submenu {
    display: none;
    position: static;
    width: 100%;
    padding-left: 20px;
    box-sizing: border-box;
  }
  .hoverbox li:hover .Submenu {
    display: none;
  }
}
