/* ==========================================================================
   responsive.css —— 4 档断点响应式适配。
     · 第 1 档  ≥1440px   ：保留原稿 @media(max-width:1920px) 的收缩规则（已删除 body
                            固定最小宽度），为桌面主形态；>1920px 走 base.css/layout.css 默认值。
     · 第 2 档  1024–1439 ：卡片降列、导航收紧、侧边栏可折叠。
     · 第 3 档  768–1023  ：单列化、隐藏次级下拉、搜索框收窄。
     · 第 4 档  <768px    ：导航折叠为汉堡菜单、侧边栏默认折叠、全站单列。
   ========================================================================== */

/* ============ 第 1 档：≥1440px（含原稿 max-width:1920px 的收缩规则） ============ */
@media screen and (max-width: 1920px) {
  .nav > li {
    padding: 0 12px;
    font-size: 15px;
  }

  .search input {
    width: 200px;
  }

  .search input:focus {
    width: 250px;
  }

  .card {
    width: calc(33.333% - 13.333px);
  }

  .card.card-33 {
    width: calc(50% - 10px);
  }

  .banner h2 {
    font-size: 32px;
  }

  .banner .data-tag {
    gap: 30px;
  }
}

/* ============ 第 2 档：1024px ~ 1439px ============ */
@media screen and (min-width: 1024px) and (max-width: 1439px) {
  .container {
    width: 96%;
  }

  .header-right {
    width: 320px;
  }

  .search input {
    width: 160px;
  }

  .search input:focus {
    width: 200px;
  }

  .nav > li {
    padding: 0 8px;
    font-size: 14px;
  }

  .section-title {
    font-size: 28px;
  }

  /* 卡片降为两列 */
  .card,
  .card.card-33 {
    width: calc(50% - 10px);
  }

  .banner {
    height: 560px;
  }

  .banner h2 {
    font-size: 28px;
  }

  .banner .data-tag {
    gap: 24px;
    flex-wrap: wrap;
  }

  .ai-tool-section {
    gap: 24px;
  }

  .ai-tool-left {
    width: 36%;
  }

  .ai-tool-right {
    width: 64%;
  }

  .advantage-section,
  .merchant-section {
    padding: 30px;
  }

  .merchant-package {
    width: 280px;
  }

  .partner-logo {
    width: 88px;
    height: 88px;
  }
}

/* ============ 第 3 档：768px ~ 1023px ============ */
@media screen and (min-width: 768px) and (max-width: 1023px) {
  .container {
    width: 96%;
  }

  .header .container {
    flex-wrap: nowrap;
  }

  .header-right {
    width: auto;
    flex: none;
  }

  /* 导航仅保留一级，隐藏多级下拉避免溢出 */
  .nav {
    margin: 0 8px;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .nav > li {
    padding: 0 8px;
    font-size: 13px;
  }

  .nav .subnav2,
  .nav .subnav3,
  .nav .subnav4,
  .nav .subnav5 {
    display: none !important;
  }

  .search input {
    width: 120px;
  }

  .search input:focus {
    width: 160px;
  }

  .user-center a {
    margin: 0 6px;
    font-size: 13px;
  }

  /* 侧边栏默认收窄为图标条 */
  .sidebar {
    width: 60px;
  }

  .sidebar .sidebar-menu > li {
    padding: 0;
    justify-content: center;
  }

  .sidebar .sidebar-menu > li span {
    display: none;
  }

  .sidebar .sidebar-menu > li i {
    margin-right: 0;
  }

  .sidebar .sidebar-sub {
    display: none !important;
  }

  .content {
    margin-left: 60px;
  }

  .banner {
    height: 480px;
  }

  .banner h2 {
    font-size: 24px;
  }

  .banner p {
    font-size: 15px;
    margin-bottom: 24px;
  }

  .banner .banner-btns .btn {
    font-size: 14px;
    padding: 10px 18px;
    margin: 4px;
  }

  .banner .data-tag {
    gap: 18px;
    flex-wrap: wrap;
  }

  .banner .data-tag .tag-item h3 {
    font-size: 18px;
  }

  .section-title {
    font-size: 24px;
    margin-bottom: 20px;
  }

  /* 卡片单列 */
  .card,
  .card.card-33,
  .card.card-50 {
    width: 100%;
  }

  .core-functions {
    flex-direction: column;
  }

  .ai-tool-section {
    flex-direction: column;
    align-items: stretch;
  }

  .ai-tool-left,
  .ai-tool-right {
    width: 100%;
  }

  .ai-tool-right .ai-icons {
    position: static;
    width: 100%;
    margin-top: 16px;
  }

  .advantage-content {
    flex-direction: column;
  }

  .advantage-left,
  .advantage-right {
    width: 100%;
  }

  .merchant-packages {
    flex-wrap: wrap;
  }

  .merchant-package {
    width: 100%;
    max-width: 420px;
  }

  .footer-content {
    flex-wrap: wrap;
    gap: 20px;
  }

  .footer-column {
    width: 46%;
  }
}

/* ============ 第 4 档：<768px（手机版） ============ */
@media screen and (max-width: 767px) {
  .container {
    width: 94%;
  }

  /* 顶部：显示汉堡按钮，导航折叠为下拉面板 */
  .nav-toggle {
    display: flex;
  }

  .logo {
    width: auto;
    margin-right: 8px;
  }

  .logo .logo-svg {
    height: 32px;
  }

  .header .container {
    position: relative;
    flex-wrap: wrap;
  }

  .nav {
    position: absolute;
    top: 80px;
    left: 0;
    width: 100%;
    max-height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    overflow-y: auto;
    flex-direction: column;
    background-color: var(--white);
    box-shadow: var(--shadow);
    transition: max-height 0.3s ease;
    z-index: 998;
  }

  .header.scroll .nav {
    top: 60px;
  }

  .nav.is-open {
    max-height: calc(100vh - 80px);
  }

  .nav > li {
    line-height: 44px;
    padding: 0 16px;
    font-size: 14px;
    border-bottom: 1px solid #F5F7FA;
  }

  .header.scroll .nav > li {
    line-height: 44px;
  }

  .nav > li:hover {
    transform: none;
  }

  /* 手机版下拉菜单改为静态展开，不再浮层定位 */
  .nav .subnav2,
  .nav .subnav3,
  .nav .subnav4,
  .nav .subnav5 {
    position: static;
    width: 100%;
    display: none;
    opacity: 1;
    transform: none;
    box-shadow: none;
    border-top: none;
  }

  .nav > li.is-active .subnav2,
  .nav .subnav2 > li.is-active .subnav3,
  .nav .subnav3 > li.is-active .subnav4,
  .nav .subnav4 > li.is-active .subnav5 {
    display: block;
  }

  .nav .subnav2 > li {
    line-height: 40px;
    padding: 0 12px 0 28px;
    font-size: 13px;
  }

  .nav .subnav2 > li:hover {
    padding-left: 28px;
  }

  .nav .subnav3 > li,
  .nav .subnav4 > li,
  .nav .subnav5 > li {
    padding: 0 12px 0 44px;
    line-height: 36px;
    font-size: 13px;
  }

  .header-right {
    width: auto;
    flex: none;
  }

  .search {
    margin-right: 8px;
  }

  .search input {
    width: 110px;
  }

  .search input:focus {
    width: 140px;
  }

  .user-center a {
    margin: 0 4px;
    font-size: 12px;
  }

  /* 侧边栏：默认折叠为图标条（JS 亦会在该断点补 .fold 类） */
  .sidebar {
    width: 60px;
    bottom: 0;
  }

  .sidebar .sidebar-menu > li {
    padding: 0;
    justify-content: center;
  }

  .sidebar .sidebar-menu > li span {
    display: none;
  }

  .sidebar .sidebar-menu > li i {
    margin-right: 0;
  }

  .sidebar.fold .sidebar-menu > li {
    padding: 0;
  }

  .sidebar .sidebar-sub {
    display: none !important;
  }

  .content {
    margin-left: 60px;
  }

  .main {
    margin-top: 80px;
  }

  .content-section {
    padding: 16px 0;
  }

  .banner {
    height: 420px;
    padding: 0 12px;
  }

  .banner h2 {
    font-size: 20px;
    line-height: 1.4;
  }

  .banner p {
    font-size: 13px;
    margin-bottom: 20px;
  }

  .banner .banner-btns .btn {
    display: block;
    width: 100%;
    max-width: 280px;
    margin: 8px auto;
    font-size: 14px;
    padding: 10px 16px;
  }

  .banner .data-tag {
    position: static;
    margin-top: 24px;
    gap: 16px;
    flex-wrap: wrap;
    animation: none;
  }

  .banner .data-tag .tag-item h3 {
    font-size: 17px;
  }

  .banner .data-tag .tag-item p {
    font-size: 12px;
  }

  .section-title {
    font-size: 22px;
    margin-bottom: 16px;
  }

  .section-desc {
    font-size: 13px;
    margin-bottom: 20px;
  }

  .card,
  .card.card-33,
  .card.card-50 {
    width: 100%;
  }

  .core-functions {
    flex-direction: column;
  }

  .function-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .ai-tool-section {
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
    gap: 20px;
  }

  .ai-tool-left,
  .ai-tool-right {
    width: 100%;
  }

  .ai-tool-right h2 {
    font-size: 22px;
  }

  .ai-tool-right .free-badge {
    display: block;
    margin: 8px 0 0;
    font-size: 12px;
    text-align: center;
  }

  .ai-tool-right .ai-icons {
    position: static;
    width: 100%;
    margin-top: 14px;
    gap: 14px;
  }

  .ai-tool-right .ai-icons i {
    font-size: 36px;
  }

  .advantage-section {
    padding: 20px;
  }

  .advantage-content {
    flex-direction: column;
    gap: 20px;
  }

  .advantage-left,
  .advantage-right {
    width: 100%;
  }

  .advantage-left .advantage-card {
    min-width: 140px;
  }

  .partner-logos {
    gap: 14px;
  }

  .partner-logo {
    width: 72px;
    height: 72px;
  }

  .partner-logo .partner-svg {
    width: 52px;
    height: 52px;
  }

  .merchant-section {
    padding: 24px 16px;
  }

  .merchant-section h3 {
    font-size: 22px;
  }

  .merchant-section .desc {
    font-size: 14px;
  }

  .merchant-buttons .btn {
    font-size: 13px;
    padding: 8px 14px;
  }

  .merchant-packages {
    flex-direction: column;
    align-items: center;
  }

  .merchant-package {
    width: 100%;
    max-width: 380px;
  }

  .footer {
    padding: 30px 0 16px;
  }

  .footer-content {
    flex-direction: column;
    gap: 24px;
  }

  .footer-column {
    width: 100%;
  }

  .footer-links {
    flex-wrap: wrap;
    gap: 12px;
  }

  .footer-copyright {
    font-size: 12px;
  }

  /* 头像下拉菜单在小屏贴边 */
  .avatar-dropdown {
    right: 8px !important;
    top: 72px !important;
    width: 160px !important;
  }
}
