/* ===== 手机（≤768px）：全部纵向排列 ===== */
@media screen and (max-width: 768px) {
  /* ---- 外层表格容器 ---- */
  table.tab[width="1200"] {
    width: 100% !important;
    max-width: 100% !important;
    display: table !important;
    margin: 0 !important;
    padding: 0 4px !important;
    box-sizing: border-box !important;
  }

  table.tab[width="1200"] tbody,
  table.tab[width="1200"] tr {
    display: table-row-group / table-row !important;
    width: 100% !important;
  }

  table.tab[width="1200"] td {
    display: table-cell !important;
    padding: 6px 4px !important;
    box-sizing: border-box !important;
    height: auto !important;
  }

  /* ---- 顶部横幅 ---- */
  table[width="1180"] {
    width: 100% !important;
    max-width: 100% !important;
  }
  table[width="1180"] td[height="90"] {
    height: auto !important;
    min-height: 60px;
    padding: 15px 10px !important;
    background-size: cover !important;
    background-position: center !important;
  }
  table[width="1180"] td[height="90"] .STYLE30 {
    font-size: 20px !important;
    letter-spacing: 2px !important;
    word-break: break-word;
  }

  /* ---- 概况信息：四个图片按钮纵向排列（一列） ---- */
  table.tab[width="1200"] td[colspan="2"] table.kuang4 td[height="79"] {
    height: auto !important;
    padding: 8px 0 !important;
  }
  table.tab[width="1200"]
    td[colspan="2"]
    table.kuang4
    td[height="79"]
    > div[style*="display: flex"] {
    display: flex !important;
    flex-direction: column !important; /* 纵向排列 */
    align-items: center !important;
    gap: 12px !important;
    padding: 10px 0 !important;
    height: auto !important;
  }
  table.tab[width="1200"]
    td[colspan="2"]
    table.kuang4
    td[height="79"]
    > div[style*="display: flex"]
    a {
    width: 100% !important;
    max-width: 200px !important;
    text-align: center !important;
  }
  table.tab[width="1200"]
    td[colspan="2"]
    table.kuang4
    td[height="79"]
    > div[style*="display: flex"]
    a
    img {
    width: 100% !important;
    max-width: 200px !important;
    height: auto !important;
  }

  /* ---- 主内容区：轮播图 + 最新信息 上下排列 ---- */
  table.tab[width="1200"]
    > tbody
    > tr
    > td[colspan="2"]
    table[width="100%"]
    > tbody
    > tr
    > td[width="50%"] {
    display: block !important;
    width: 100vw !important;
    padding: 6px 0 !important;
    box-sizing: border-box !important;
  }

  /* 轮播图区域 */
  #myFocus {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
  }
  #myFocus .pic {
    width: 100% !important;
    height: 330px !important;
  }
  #myFocus .pic ul li {
    width: 100% !important;
    height: auto !important;
  }
  #myFocus .pic ul li img {
    width: 100% !important;
    max-height: 250px !important;
    object-fit: cover !important;
  }
  #myFocus .pic ul li a {
    display: block;
    width: 100%;
    text-align: center;
  }
  #myFocus .pic ul li a > div {
    font-size: 14px !important;
    padding: 4px 0 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* 最新信息列表 */
  table.tab[width="1200"]
    > tbody
    > tr
    > td[colspan="2"]
    table[width="100%"]
    > tbody
    > tr
    > td[width="50%"]
    table.kuang4
    td[height="220"] {
    height: auto !important;
    min-height: 120px;
  }

  /* ---- 部门工作动态 + 办事服务 上下排列 ---- */
  table.tab[width="1200"]
    > tbody
    > tr
    > td[colspan="2"]
    table[width="100%"]
    > tbody
    > tr
    > td[width="50%"] {
    display: block !important;
    width: 100vw !important;
    padding: 6px 0 !important;
    box-sizing: border-box !important;
  }
  .trcol {
    display: flex;
    flex-direction: column;
  }
  .trcol > td {
    width: 100vw !important;
  }
  .flex-container {
    width: 100vw;
    flex-wrap: wrap;
    align-items: normal !important;
    height: 130px !important;
  }
  /* ---- 右侧栏（原rowspan=4）移到下方，内部纵向排列 ---- */
  table.tab[width="1200"] > tbody > tr > td[width="255"][rowspan="4"] {
    display: table-cell !important;
    width: 100vw !important;
    float: none !important;
    padding: 0 !important;
    margin-top: 12px !important;
    border: none !important;
  }

  table.tab[width="1200"]
    > tbody
    > tr
    > td[width="255"][rowspan="4"]
    table.kuang4 {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* 右侧公示公告、领导活动、统计信息的高度自适应 */
  table.tab[width="1200"]
    > tbody
    > tr
    > td[width="255"][rowspan="4"]
    table.kuang4
    td[height="220"],
  table.tab[width="1200"]
    > tbody
    > tr
    > td[width="255"][rowspan="4"]
    table.kuang4
    td[height="240"] {
    height: auto !important;
    min-height: 100px;
    padding: 6px !important;
  }

  /* 右侧列表条目 */
  table.tab[width="1200"]
    > tbody
    > tr
    > td[width="255"][rowspan="4"]
    table.kuang4
    td[height="35"] {
    height: auto !important;
    min-height: 30px;
    padding: 4px 6px !important;
    line-height: 1.6 !important;
  }
  table.tab[width="1200"]
    > tbody
    > tr
    > td[width="255"][rowspan="4"]
    table.kuang4
    td[height="35"]
    a {
    font-size: 13px !important;
    display: inline-block;
    max-width: 90%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* 右侧两个图片按钮（依申请公开等） */
  table.tab[width="1200"]
    > tbody
    > tr
    > td[width="255"][rowspan="4"]
    table.kuang4
    table[width="100%"]
    td {
    display: table-cell !important;
    width: 50% !important;
    padding: 4px !important;
    text-align: center !important;
  }
  table.tab[width="1200"]
    > tbody
    > tr
    > td[width="255"][rowspan="4"]
    table.kuang4
    table[width="100%"]
    td
    img {
    width: 100% !important;
    max-width: 125px !important;
    height: auto !important;
  }

  /* 统计信息表格 */
  table.tab[width="1200"]
    > tbody
    > tr
    > td[width="255"][rowspan="4"]
    table.kuang4
    td[height="240"]
    table
    td {
    padding: 6px 4px !important;
    font-size: 13px !important;
  }

  /* ---- 部门风采：移动端修复溢出 + 恢复自动轮播 ---- */
  #dm {
    width: 100vw !important;
    max-width: 100% !important;
    overflow: hidden !important; /* 配合JS滚动，隐藏超出部分 */
    height: auto !important;
    padding: 6px 0 !important;
    box-sizing: border-box !important;
    position: relative;
  }

  /* 恢复 #dm212 显示（无缝滚动必需） */
  #dm212 {
    display: table-cell !important;
  }

  /* 外层滚动表格：宽度由内容撑开，父容器裁剪 */
  #dm > table {
    display: table !important;
    width: auto !important;
    min-width: 100% !important;
    border-collapse: collapse;
    table-layout: auto; /* 列宽由内容决定 */
  }

  /* 每个卡片容器（td）固定宽度，保证一行显示1~2个 */
  #dm > table td {
    display: table-cell !important;
    width: 150px !important; /* 固定卡片宽度 */
    min-width: 150px !important;
    padding: 0 8px !important;
    vertical-align: top !important;
    text-align: center !important;
    box-sizing: content-box; /* padding 不包含在宽度内，避免撑大 */
  }

  /* 卡片内部表格 */
  #dm > table td table {
    width: 100% !important;
    max-width: 150px !important;
    margin: 0 auto;
    border-collapse: collapse;
  }

  #dm > table td table tbody tr td {
    display: table-cell !important;
    width: auto !important;
    padding: 4px 0 !important;
    text-align: center !important;
  }

  /* 图片自适应 */
  #dm > table td table tbody tr td img {
    width: 100% !important;
    max-width: 140px !important;
    height: auto !important;
    border-radius: 4px;
    display: block;
    margin: 0 auto;
  }

  /* 标题文字 */
  #dm > table td table tbody tr td p {
    font-size: 13px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px !important;
    margin: 4px auto 0 !important;
    padding: 0 !important;
    text-align: center;
  }

  #dm > table td table tbody tr td p a {
    font-size: 13px !important;
    color: #333 !important;
  }

  /* 移除之前无效的 mobile-slide-active 干扰 */
  #dm #dm102 table td.mobile-slide-active {
    display: table-cell !important;
  }
  /* ---- 通用列表条目优化 ---- */
  table[style*="border-bottom:#CCCCCC 1px dashed"] {
    width: 100% !important;
  }
  table[style*="border-bottom:#CCCCCC 1px dashed"] td {
    padding: 6px 8px !important;
    height: auto !important;
    min-height: 30px;
    line-height: 1.6 !important;
  }
  table[style*="border-bottom:#CCCCCC 1px dashed"] td a {
    font-size: 14px !important;
    display: inline-block;
    max-width: 90%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* ---- 标题栏（灰色背景） ---- */
  td[bgcolor="#EEEEEE"] {
    padding: 6px 10px !important;
    height: auto !important;
    min-height: 36px;
  }
  td[bgcolor="#EEEEEE"] .STYLE3x {
    font-size: 14px !important;
  }
}

/* ---------- 极小屏（≤480px）进一步优化 ---------- */
@media screen and (max-width: 480px) {
  table.tab[width="1200"] {
    padding: 0 2px !important;
  }

  table[width="1180"] td[height="90"] .STYLE30 {
    font-size: 17px !important;
    letter-spacing: 1px !important;
  }

  /* 概况信息四个图片按钮，每个宽度自适应 */
  table.tab[width="1200"]
    td[colspan="2"]
    table.kuang4
    td[height="79"]
    > div[style*="display: flex"]
    a {
    max-width: 160px !important;
  }
  table.tab[width="1200"]
    td[colspan="2"]
    table.kuang4
    td[height="79"]
    > div[style*="display: flex"]
    a
    img {
    max-width: 160px !important;
  }

  /* 列表条目字号缩小 */
  table[style*="border-bottom:#CCCCCC 1px dashed"] td a {
    font-size: 13px !important;
  }

  /* 右侧栏列表 */
  table.tab[width="1200"]
    > tbody
    > tr
    > td[width="255"][rowspan="4"]
    table.kuang4
    td[height="35"]
    a {
    font-size: 12px !important;
  }

  /* 部门风采图片缩小 */
  #dm table td table tbody tr td img {
    width: 110px !important;
    max-width: 110px !important;
  }
  #dm table td table tbody tr td p {
    max-width: 110px !important;
    font-size: 12px !important;
  }
  #dm table td table tbody tr td p a {
    font-size: 12px !important;
  }

  /* 标题栏 */
  td[bgcolor="#EEEEEE"] .STYLE3x {
    font-size: 13px !important;
  }

  /* 统计信息 */
  table.tab[width="1200"]
    > tbody
    > tr
    > td[width="255"][rowspan="4"]
    table.kuang4
    td[height="240"]
    table
    td {
    font-size: 12px !important;
  }

  /* 右侧图片按钮 */
  table.tab[width="1200"]
    > tbody
    > tr
    > td[width="255"][rowspan="4"]
    table.kuang4
    table[width="100%"]
    td
    img {
    max-width: 100px !important;
  }
}
