/* Main-site phone-first overrides. Loaded after style.css. */
.mobile-carousel-controls { display: none; }

@media (max-width: 768px) {
  *, *::before, *::after { min-width: 0; }
  html, body { overflow-x: hidden; }
  .container { width: auto !important; max-width: none; margin-right: 16px; margin-left: 16px; padding-right: 0 !important; padding-left: 0 !important; }
  img, video, iframe, embed, object { max-width: 100%; height: auto; }
  a, p, span, li, td, th { overflow-wrap: anywhere; }
  input, select, textarea, button { max-width: 100%; }
  .content-body table { display: block; width: max-content; min-width: 100%; max-width: none; overflow-x: auto; }

  .header-top-inner, .footer-bottom { display: flex; flex-direction: column; align-items: center !important; gap: 16px; }
  .header-top { padding: 12px 0; }
  .header .logo, .header .logo img, .header-search, .header-search form, .search-input-group { width: 100%; }
  .header .logo { display: flex; justify-content: center; }
  .header .logo a { display: inline-flex; justify-content: center; }
  .header .logo img { width: auto !important; max-width: 100%; max-height: 56px; object-fit: contain; }
  .header-search { display: flex; justify-content: center; }
  .header-search form { max-width: 360px; margin-right: auto !important; margin-left: auto !important; }
  .header .nav { display: none; }
  .header-nav .container { display: flex; align-items: center; justify-content: space-between; min-height: 52px; }
  .mobile-nav-title { display: flex !important; align-items: center; justify-content: center; height: 52px; min-height: 52px; line-height: 1; }
  .sp_nav, .mobile-nav-grid a, .dropdown_header { min-height: 44px; }
  .sp_nav { display: flex; align-items: center; justify-content: center; }
  .header-nav .sp_nav {
    top: 0 !important;
    right: 12px !important;
    width: 44px !important;
    height: 52px !important;
    margin: 0 !important;
    transform: none !important;
  }
  .header-nav .sp_nav .sp_nav1 { top: 19px !important; }
  .header-nav .sp_nav .sp_nav2 { top: 25px !important; }
  .header-nav .sp_nav .sp_nav3 { top: 31px !important; }
  .sp_nav-box { box-sizing: border-box; height: 100dvh !important; padding-top: 52px !important; overflow-y: auto; }
  .sp_nav-box .container { display: block !important; box-sizing: border-box; width: 100% !important; max-width: none !important; height: auto !important; margin: 0 !important; padding: 0 !important; }
  .sp_nav-box .inner { display: block !important; width: 100% !important; padding: 0 !important; }
  .mobile-nav-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 8px; padding: 18px 16px; }
  .sp_nav-box .mobile-nav-grid { margin: 0 !important; padding: 20px 16px 28px !important; }
  .mobile-nav-grid li, .mobile-nav-grid a { width: 100%; }
  .mobile-nav-grid a { display: flex; flex-direction: column !important; align-items: center !important; justify-content: flex-start !important; gap: 7px; min-height: 82px; padding: 8px 4px; text-align: center; }
  .mobile-nav-grid .nav-icon { display: block; width: 38px !important; height: 38px !important; margin: 0 !important; object-fit: contain; flex: 0 0 38px; }
  .mobile-nav-grid li a span { display: block; width: 100%; font-size: 13px !important; line-height: 1.35; color: #333; text-align: center; white-space: nowrap; }
  body.sp_nav_body .kf { display: none !important; }
  body.index-page:not(.sp_nav_body) .kf { display: block !important; }
  body.sp_nav_body .header-top { display: none !important; }
  body.sp_nav_body .header-nav { position: fixed !important; top: 0 !important; left: 0 !important; width: 100% !important; z-index: 101 !important; }

  .f_link_dropdown_container { display: grid; grid-template-columns: 1fr; gap: 10px; }
  .footer-left, .footer-right, .footer-contact, .footer-copyright { width: 100%; text-align: center; }
  .footer-left img { max-width: 160px; }
  .kf { right: 8px; bottom: 16px; transform: scale(.86); transform-origin: right bottom; }

  .list-3 li, .article-list li, .category-articles .article-link, .module-articles li a { display: flex; flex-direction: column; gap: 10px; }
  .list-3 li .article-image { width: 100%; aspect-ratio: 16 / 9; }
  .list-3 li .article-image img { width: 100%; height: 100%; object-fit: cover; }
  .content-title h1 { font-size: 24px; line-height: 1.45; }
  .content-title p, .article-meta, .article-info { display: flex; flex-wrap: wrap; gap: 6px 12px; }
  .content-body, .article-header { padding: 20px 16px; }
  .content-body pre, .content-body code { white-space: pre-wrap; overflow-wrap: anywhere; }
  .pages { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
  form input, form select, form textarea, form button { width: 100%; min-height: 44px; }
  .el-form-item__content, .el-input, .el-select { width: 100%; }

  .caiyi-section .caiyi-item { justify-content: center; gap: 8px !important; padding: 4px 0 !important; }
  .caiyi-section .caiyi-num { display: inline-flex !important; width: 30px !important; height: 30px !important; border: 2px solid #1e5fa8 !important; color: #1e5fa8 !important; background: #fff; }
  .caiyi-section .caiyi-title { box-sizing: border-box; flex: 0 1 280px !important; min-height: 44px; padding: 10px 26px 10px 46px !important; border: 0 !important; border-radius: 0 !important; background: url('/template/1/3/images/logoimages/shekepuji-title1.png') no-repeat center center !important; background-size: 100% 100% !important; box-shadow: none !important; color: #fff !important; font-size: 15px !important; font-weight: 600; line-height: 1.4; text-align: center; text-indent: 0 !important; white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; }
  .caiyi-section .caiyi-item.active .caiyi-title, .caiyi-section .caiyi-item:active .caiyi-title { background-image: url('/template/1/3/images/logoimages/shekepuji-title2.png') !important; background-size: 100% 100% !important; }

  .szsk-more-area, .info-more-area { min-height: 60px; padding: 10px 16px !important; gap: 0 !important; }
  .szsk-more-dot, .info-more-dot { display: none !important; }
  .szsk-more-btn, .info-more-btn { display: inline-flex !important; align-items: center; justify-content: center; min-width: 108px; min-height: 44px; padding: 0 24px !important; border-radius: 22px !important; font-size: 15px !important; line-height: 1; }
  .szsk-article-list li:nth-child(n + 4), .info-article-list li:nth-child(n + 4) { display: none !important; }
  .szsk-article-list li a, .info-article-list li a { min-width: 0; justify-content: flex-start !important; text-align: left !important; }
  .szsk-article-title, .info-article-title { min-width: 0; overflow: hidden !important; text-overflow: ellipsis !important; white-space: nowrap !important; text-align: left !important; }

  /* Homepage: use a compact, centered visual rhythm instead of desktop spacing. */
  .xijinping-section {
    margin-top: 12px !important;
    padding: 0 !important;
  }

  .xijinping-section .container {
    margin-right: 12px;
    margin-left: 12px;
  }

  .xijinping-section img {
    display: block;
    width: 100% !important;
  }

  .homepage-section-card,
  .special-columns-section,
  .longjiang-columns-section,
  .four-modules-section,
  .caiyi-section,
  .zhixiang-section {
    padding: 16px 0 !important;
  }

  .homepage-section-card .container,
  .special-columns-section .container,
  .longjiang-columns-section .container,
  .four-modules-section .container,
  .caiyi-section .container,
  .zhixiang-section .container {
    box-sizing: border-box;
    padding: 16px !important;
    background: #fff;
    border: 1px solid rgba(19, 90, 165, .10);
    border-radius: 14px;
    box-shadow: 0 5px 16px rgba(25, 74, 119, .08);
  }

  .section-title,
  .section-title .title-with-decoration {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    margin: 0 0 14px !important;
    padding: 0 !important;
    text-align: center !important;
  }

  .section-title .title-with-decoration > span,
  .section-title strong,
  .section-main-title {
    display: block;
    margin: 0 !important;
    color: #135aa5 !important;
    font-size: 21px !important;
    font-weight: 700;
    line-height: 1.35;
    text-align: center !important;
  }

  .section-title .title-decoration {
    width: 20px !important;
    height: auto !important;
  }

  .news-grid,
  .longjiang-columns-wrapper,
  .longjiang-modules,
  .caiyi-content {
    justify-content: center !important;
    text-align: center;
  }

  .news-column,
  .longjiang-column-item,
  .longjiang-module,
  .caiyi-list {
    width: 100% !important;
  }

  .news-list li a,
  .article-list li a,
  .module-articles li a {
    text-align: left;
  }

  .longjiang-article-list .article-title {
    text-align: left !important;
  }

  /* 社科集萃：四个栏目统一使用与内容等宽的蓝色标题底。 */
  .longjiang-column-header {
    box-sizing: border-box;
    display: flex !important;
    width: 100% !important;
    min-height: 54px !important;
    margin-bottom: 12px !important;
    padding: 0 20px !important;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f4d96 0%, #1d6fbe 52%, #0f4d96 100%) !important;
    background-size: 100% 100% !important;
    border-radius: 8px;
  }

  .longjiang-column-header .header-title {
    color: #fff !important;
    text-align: center !important;
  }

  .longjiang-column-item {
    box-sizing: border-box;
    width: 100% !important;
    margin: 0 0 18px !important;
    transform: none !important;
    opacity: 1 !important;
  }

  .longjiang-columns-wrapper {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0 !important;
  }

  /* 社科智汇和专题专栏：移动端单卡横向轮播，保留左右箭头。 */
  .mobile-carousel-track,
  .four-modules-grid,
  .special-columns-grid {
    display: flex !important;
    grid-template-columns: none !important;
    gap: 12px !important;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .mobile-carousel-track::-webkit-scrollbar,
  .four-modules-grid::-webkit-scrollbar,
  .special-columns-grid::-webkit-scrollbar { display: none; }

  .four-modules-grid > *,
  .special-columns-grid > * {
    box-sizing: border-box;
    flex: 0 0 100%;
    width: 100% !important;
    scroll-snap-align: start;
  }

  .mobile-carousel-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 12px;
  }

  .mobile-carousel-arrow {
    display: inline-flex;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(19, 90, 165, .25);
    border-radius: 50%;
    background: #fff;
    color: #135aa5;
    font-size: 25px;
    line-height: 1;
  }

  .kf .con,
  .kf .kt-top,
  .kf .kf-collapse {
    display: none !important;
  }

  .kf {
    width: 52px !important;
    height: 52px !important;
    right: 10px !important;
    bottom: 24px !important;
    transform: none;
    z-index: 1000 !important;
  }

  .kf .kf-side-mobile {
    display: flex !important;
    width: 52px;
    height: 52px;
    align-items: center;
    justify-content: center;
    transform: none !important;
    position: fixed !important;
    top: auto !important;
    left: auto !important;
    right: 10px !important;
    bottom: 24px !important;
    overflow: visible;
  }

  .kf .kf-side-mobile img {
    display: block;
    width: 52px !important;
    height: 52px !important;
    max-width: none;
    object-fit: contain;
  }

  .kf .backTop {
    display: none !important;
  }
}

@media (max-width: 480px) {
  .container { margin-right: 12px; margin-left: 12px; }
  .mobile-nav-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); padding-right: 12px; padding-left: 12px; }
  .content-title h1 { font-size: 22px; }
}
