/* nav01 mobile — all rules scoped to max-width 768px; PC layout unchanged */
@media (max-width: 768px) {
  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  html:has(.site-wrapper.menu-collasped-active),
  html:has(.site-wrapper.menu-collasped-active) body {
    overflow: hidden;
    height: 100%;
  }

  body {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }

  /* ---- 侧栏抽屉 + 遮罩 ---- */
  .site-aside {
    z-index: 1040;
  }

  .site-aside .aside-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 0;
  }

  .menu-collasped-active .site-aside .aside-overlay {
    display: block;
  }

  .site-aside .aside-wrapper {
    position: relative;
    z-index: 1;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
  }

  .site-aside .aside-menu li a {
    min-height: 44px;
  }

  .site-aside .aside-menu > li > ul {
    display: block;
    padding-left: 2.5rem;
  }

  .site-aside .aside-menu li .menu-sign {
    display: inline-block;
  }

  /* ---- 顶栏 ---- */
  .site-header {
    padding-top: env(safe-area-inset-top);
  }

  .site-header .navbar-expand-lg > .container-fluid {
    height: 52px;
    padding-left: 8px;
    padding-right: 8px;
  }

  .site-header .navbar-brand {
    max-width: 130px;
  }

  .site-header .navbar-brand img {
    max-height: 36px;
  }

  .site-header .navbar-right {
    gap: 0.35rem;
  }

  .nav01-mobile-quick {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 12px 10px;
    border-bottom: 1px solid var(--border-color, #dee2e6);
    background: var(--bg-base, #fff);
  }

  .nav01-mobile-quick a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 6px 14px;
    border-radius: 18px;
    font-size: 13px;
    color: var(--body-color, #212529);
    background: var(--bg-secondary, #f5f7fa);
    border: 1px solid var(--border-color, #dee2e6);
    text-decoration: none;
    white-space: nowrap;
  }

  .nav01-mobile-quick a:active {
    color: var(--color-primary, #2f66ff);
    border-color: var(--color-primary, #2f66ff);
  }

  /* ---- 主内容区 ---- */
  .site-wrapper {
    padding-left: 0 !important;
  }

  .site-main {
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }

  .site-index .content > .row {
    margin-right: 0 !important;
  }

  /* 主题在 992px 隐藏热门站点，手机端恢复显示 */
  .hot-rank {
    display: block !important;
  }

  .index-sudoku {
    max-height: none !important;
    overflow: visible !important;
  }

  .index-sudoku .col-4 {
    padding-left: 4px;
    padding-right: 4px;
  }

  .card-header.d-flex.flex-nowrap {
    flex-wrap: wrap !important;
    row-gap: 8px;
  }

  .card-header .h4,
  .card-header h4,
  .card-header .h4 a {
    font-size: 1.05rem !important;
    max-width: 100%;
    white-space: normal;
    word-break: break-word;
  }

  .card-header .card-tab {
    flex: 1 1 100%;
    max-width: 100%;
    margin-top: 2px;
  }

  .card-header .card-tab .nav-link {
    padding-top: 6px;
    padding-bottom: 6px;
  }

  .list-grid .list-title,
  .list-grid .list-desc {
    white-space: normal;
    word-break: break-word;
  }

  .search-block .card-body {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .search-block .form-control {
    font-size: 16px;
  }

  /* ---- 友情链接 ---- */
  .friend {
    margin-top: 1.25rem;
    padding-left: 12px;
    padding-right: 12px;
  }

  .friend .h4 {
    text-align: center;
    font-size: 1rem;
    margin-bottom: 0.5rem;
  }

  .friend ul {
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 10px;
    margin: 0;
    padding: 0;
  }

  .friend ul li {
    margin: 0;
    list-style: none;
  }

  .friend ul li::before {
    display: none;
  }

  .friend ul li a {
    display: inline-block;
    padding: 4px 10px;
    font-size: 13px;
    border-radius: 14px;
    background: var(--bg-secondary, #f5f7fa);
    text-decoration: none;
  }

  /* ---- 页脚 ---- */
  .site-footer {
    padding-top: 1.5rem;
    padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
  }

  .site-footer .container-xl {
    padding-left: 12px;
    padding-right: 12px;
  }

  .site-footer .copyright {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
    line-height: 1.55;
    font-size: 12px;
  }

  .site-footer .copyright span.d-inline-block:nth-child(even) {
    display: none;
  }

  .site-footer .copyright a {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 16px;
    background: var(--bg-secondary, #f5f7fa);
    border: 1px solid var(--border-color, #dee2e6);
    color: var(--body-color, #212529) !important;
    text-decoration: none;
    white-space: nowrap;
  }

  .site-footer .copyright a:active {
    border-color: var(--color-primary, #2f66ff);
    color: var(--color-primary, #2f66ff) !important;
  }

  .site-footer .text-xs.text-muted.text-center.mt-1 {
    font-size: 11px;
    line-height: 1.5;
    padding: 0 8px;
    word-break: break-word;
  }

  /* ---- 回到顶部 ---- */
  .site-fixedmenu {
    right: calc(8px + env(safe-area-inset-right));
    bottom: calc(16px + env(safe-area-inset-bottom));
  }

  /* ---- 留言 / 提交收录 ---- */
  .nav-interact-wrap {
    padding-left: 4px;
    padding-right: 4px;
  }

  .nav-interact-panel {
    padding: 1rem 0.875rem 1.125rem;
  }

  .nav-interact-panel .row {
    flex-direction: column;
    gap: 0.625rem;
  }

  .nav-interact-panel .input-group,
  .nav-interact-panel .captcha-group {
    flex: 1 1 100% !important;
    min-width: 0 !important;
    width: 100%;
  }

  .nav-interact-panel .form-control.yzm {
    max-width: none;
  }

  .nav-interact-panel .form-group {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .nav-interact-panel .btn-submit {
    width: 100%;
  }

  .book-page-wrap {
    grid-template-columns: 1fr !important;
    gap: 1rem;
  }

  .book-page-wrap .bookadd,
  .book-page-wrap .booklist {
    position: static !important;
    width: 100% !important;
  }

  .book-page-wrap .bookadd .book-form-grid {
    grid-template-columns: 1fr !important;
  }

  .booklist .bcontent {
    margin-left: 0;
    padding-left: 52px;
  }

  .nav-recent-grid {
    grid-template-columns: 1fr;
  }

  /* ---- 资讯频道 nav-news ---- */
  body.news-page .site-main {
    padding-left: 8px !important;
    padding-right: 8px !important;
    padding-top: 12px !important;
  }

  .news-portal {
    max-width: 100%;
    overflow-x: hidden;
  }

  .news-portal__masthead {
    margin-bottom: 12px;
    padding: 0 2px;
  }

  .news-portal__crumb {
    font-size: 11px;
    line-height: 1.5;
    word-break: break-all;
  }

  .news-portal__crumb-current {
    max-width: none;
    white-space: normal;
    display: inline;
    vertical-align: baseline;
  }

  .news-portal__title {
    font-size: 1.15rem;
    line-height: 1.4;
    word-break: break-word;
  }

  .news-portal__title i {
    font-size: 1rem;
  }

  .news-portal__sub {
    font-size: 12px;
    line-height: 1.6;
    word-break: break-word;
  }

  .news-portal__tabs {
    margin-bottom: 14px;
    padding-bottom: 10px;
    margin-left: -2px;
    margin-right: -2px;
    padding-left: 2px;
    padding-right: 2px;
    scrollbar-width: none;
  }

  .news-portal__tabs::-webkit-scrollbar {
    display: none;
  }

  .news-portal__tab {
    padding: 6px 14px;
    font-size: 13px;
  }

  .news-portal__hotstrip {
    padding: 12px;
    margin-bottom: 14px;
  }

  .news-portal__hotstrip-hd {
    font-size: 13px;
  }

  .news-portal__layout {
    margin-left: 0;
    margin-right: 0;
  }

  .news-portal__layout > .col-lg-8,
  .news-portal__layout > .col-lg-4 {
    width: 100%;
    max-width: 100%;
    padding-left: 0;
    padding-right: 0;
  }

  .news-portal__main {
    order: 1;
  }

  .news-portal__layout > .col-lg-4 {
    order: 2;
    margin-top: 8px;
  }

  .news-portal__featured {
    margin-bottom: 14px;
    border-radius: 10px;
  }

  .news-portal__featured-media {
    min-height: 160px;
  }

  .news-portal__featured-media img {
    min-height: 160px;
  }

  .news-portal__featured-body {
    padding: 14px 14px 16px;
  }

  .news-portal__featured-body h2 {
    font-size: 1.05rem;
    line-height: 1.45;
    -webkit-line-clamp: 3;
    word-break: break-word;
  }

  .news-portal__featured-body p {
    font-size: 13px;
    -webkit-line-clamp: 3;
  }

  .news-portal__meta,
  .news-feed__meta {
    flex-wrap: wrap;
    gap: 6px 12px;
    font-size: 11px;
  }

  .news-feed__link {
    flex-direction: column;
    gap: 10px;
    padding: 14px 6px;
  }

  .news-feed__thumb {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
  }

  .news-feed__title {
    font-size: 1rem;
    line-height: 1.45;
    -webkit-line-clamp: 3;
    word-break: break-word;
  }

  .news-feed__desc {
    font-size: 12px;
    -webkit-line-clamp: 2;
    margin-bottom: 8px;
  }

  .news-feed__tag {
    font-size: 10px;
    margin-bottom: 4px;
  }

  .news-side {
    position: static !important;
  }

  .news-side__box {
    padding: 12px;
    margin-bottom: 12px;
    border-radius: 10px;
  }

  .news-side__title {
    font-size: 14px;
    margin-bottom: 10px;
    padding-bottom: 8px;
  }

  .news-side__rank li {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 10px 0;
  }

  .news-side__rank a {
    width: 100%;
  }

  .news-side__rank-txt {
    font-size: 13px;
    -webkit-line-clamp: 3;
    word-break: break-word;
  }

  .news-side__rank-meta {
    margin-left: 30px;
    white-space: normal;
  }

  .news-side__latest a {
    font-size: 13px;
    word-break: break-word;
    -webkit-line-clamp: 2;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .news-side__latest time {
    display: block;
    margin-top: 2px;
  }

  .nav01-pager,
  .gm06-pager {
    justify-content: center;
    gap: 6px;
    padding: 12px 0 4px;
  }

  .nav01-pager a,
  .gm06-pager a,
  .nav01-pager .current,
  .gm06-pager .current {
    min-width: 34px;
    text-align: center;
    padding: 6px 10px;
    font-size: 12px;
  }

  .nav01-pager-info,
  .gm06-pager-info {
    flex: 1 1 100%;
    text-align: center;
    margin: 4px 0 0 !important;
    font-size: 11px;
  }

  /* ---- 资讯页补充 ---- */
  .news-portal__layout .col-lg-8,
  .news-portal__layout .col-lg-4 {
    width: 100%;
  }

  .news-portal__article-body img,
  .news-view__content img,
  .news-article__bd img,
  .news-article__cover img {
    max-width: 100%;
    height: auto;
  }

  .news-article .card-body {
    padding: 14px 12px;
  }

  .news-article__title {
    font-size: 1.2rem;
    line-height: 1.4;
    word-break: break-word;
    -webkit-line-clamp: unset;
    display: block;
    overflow: visible;
  }

  .news-article__meta {
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
  }

  .news-article__bd {
    font-size: 15px;
    line-height: 1.75;
    word-break: break-word;
    overflow-x: auto;
  }

  .news-article__bd table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .news-article__toc {
    padding: 10px 12px;
    font-size: 13px;
  }

  .news-related__grid {
    grid-template-columns: 1fr !important;
  }

  .page-Link > ol {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
  }
}
