/**
 * 全站响应式与 viewport 适配
 * 断点: 576px / 768px / 992px / 1200px（与 Bootstrap 一致）
 */

/* ---------- 基础：防止横向滚动、媒体自适应 ---------- */
html {
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  overflow-x: hidden;
  min-width: 320px;
}

img,
video,
iframe,
embed,
object {
  max-width: 100%;
  height: auto;
}

img {
  vertical-align: middle;
}

/* 表格在小屏可横向滚动 */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ---------- 安全区域（刘海屏/圆角屏） ---------- */
.header.style-2,
.footer-top,
.footer-bottom,
.scrollToTop {
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
}

.header.style-2 {
  padding-top: env(safe-area-inset-top, 0);
}

.scrollToTop {
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
}

/* ---------- 容器内边距 ---------- */
@media (max-width: 991px) {
  .container,
  .container-fluid {
    padding-left: 15px;
    padding-right: 15px;
    max-width: 100%;
  }
}

@media (max-width: 575px) {
  .container,
  .container-fluid {
    padding-left: 12px;
    padding-right: 12px;
  }
}

/* ---------- 页头：Logo、搜索、汉堡菜单 ---------- */
@media (max-width: 991px) {
  .header__content {
    padding-left: 15px;
    padding-right: 15px;
  }

  .header__logo img {
    max-width: 140px;
    width: auto;
    height: auto;
    max-height: 36px;
  }
}

@media (max-width: 575px) {
  .header__logo img {
    max-width: 120px;
    max-height: 32px;
  }

  .header__action--profile .dropdown-toggle .d-none.d-md-inline {
    display: none !important;
  }
}

/* 移动端导航菜单宽度与安全区 */
@media (max-width: 991px) {
  .header__menu {
    width: min(280px, 85vw);
    padding-left: max(25px, env(safe-area-inset-right));
    padding-right: max(25px, env(safe-area-inset-right));
  }
}

/* ---------- Banner 首屏 ---------- */
@media (max-width: 991px) {
  .banner-section.style-2 .banner-wrapper {
    padding-top: 80px;
    padding-bottom: 60px;
  }

  .banner-content h1 {
    font-size: clamp(28px, 6vw, 48px) !important;
  }

  .banner-content h2 {
    font-size: clamp(20px, 4vw, 36px) !important;
  }

  .banner-content p {
    font-size: 15px;
    padding-left: 10px;
    padding-right: 10px;
  }

  .banner-btns {
    gap: 12px;
  }

  .banner-btns .default-btn {
    padding: 12px 24px;
    font-size: 15px;
  }
}

@media (max-width: 575px) {
  .banner-section.style-2 .banner-wrapper {
    padding-top: 50px;
    padding-bottom: 40px;
  }

  .banner-content h1 {
    font-size: clamp(22px, 5.5vw, 32px) !important;
  }

  .banner-content h2 {
    font-size: clamp(18px, 3.5vw, 26px) !important;
  }

  .banner-btns {
    flex-direction: column;
    width: 100%;
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
  }

  .banner-btns .default-btn {
    width: 100%;
  }
}

/* ---------- 区块内边距 ---------- */
@media (max-width: 991px) {
  .padding-top {
    padding-top: 60px;
  }

  .padding-bottom {
    padding-bottom: 60px;
  }

  .section-header.style-2 h3 {
    font-size: 1.5rem;
    padding-inline: 1rem;
  }
}

@media (max-width: 575px) {
  .padding-top {
    padding-top: 40px;
  }

  .padding-bottom {
    padding-bottom: 40px;
  }

  .section-header.style-2 h3 {
    font-size: 1.25rem;
  }
}

/* ---------- 分类/卡片网格 ---------- */
@media (max-width: 575px) {
  .category-section .row.g-4,
  .section-wrapper .row.g-4 {
    --bs-gutter-x: 12px;
    --bs-gutter-y: 12px;
  }

  .nft-item.cat-item .nft-content,
  .nft-item.cat-item .nft-inner > div[style*="font-size"] {
    font-size: 14px !important;
  }

  .nft-item.cat-item .nft-content {
    flex-wrap: wrap;
    gap: 8px;
  }

  .nft-item.cat-item .follow-part .btn-follow a {
    font-size: 13px;
    padding: 6px 12px;
  }
}

/* ---------- 页脚 ---------- */
@media (max-width: 991px) {
  .footer-top .row [class*="col-"] {
    margin-bottom: 24px;
  }

  .footer-top .row > [class*="col-"]:last-child {
    margin-bottom: 0;
  }

  .footer-top .col-lg-9[style*="border-left"] {
    border-left: none !important;
    padding-left: 0 !important;
    padding-top: 12px !important;
  }
}

@media (max-width: 575px) {
  .footer-top {
    padding-top: 40px;
    padding-bottom: 24px;
  }

  .footer-top .row {
    text-align: left;
  }

  .footer-top ul li {
    flex-wrap: wrap;
    gap: 12px;
    padding: 8px 0 !important;
  }

  .footer-top ul li span:first-of-type {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
  }

  .footer-top .col-lg-9 [style*="max-width"] {
    max-width: 100% !important;
  }

  .footer-top .col-lg-9 div {
    font-size: 14px;
  }

  .footer-bottom {
    padding-left: 12px;
    padding-right: 12px;
  }

  .footer-bottom .py-4 {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
    font-size: 13px;
  }
}

/* ---------- 通用按钮与间距 ---------- */
@media (max-width: 575px) {
  .default-btn {
    padding: 10px 20px;
    font-size: 14px;
  }

  .section-header .header-title h3 {
    font-size: 1.25rem;
  }
}

/* ---------- 防止固定宽导致溢出 ---------- */
@media (max-width: 991px) {
  .header__search input {
    min-width: 0;
  }
}

/* ---------- 弹层/固定元素在窄屏的适配 ---------- */
@media (max-width: 575px) {
  .header__search--active .header__search {
    left: 10px;
    right: 10px;
    width: auto;
  }
}
