/* ===== 双端适配：PC (≥993px) / 手机 (≤992px) ===== */

body.nav-open {
  overflow: hidden;
}

@media (max-width: 992px) {
  html,
  body,
  .site-header,
  .register-page,
  .register-shell {
    min-width: 0 !important;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .container,
  .about-container,
  .quant-container,
  .question-container {
    width: 100%;
    max-width: calc(100% - 24px);
  }

  .about-container,
  .quant-container,
  .question-container {
    margin-left: auto;
    margin-right: auto;
  }

  .stats-panel {
    width: 100%;
    transform: none;
    margin-left: auto;
    margin-right: auto;
  }

  .advantage-grid,
  .contact-card-wrap {
    width: 100%;
  }

  .hero-swiper .hero-pagination,
  .hero-swiper .hero-pagination.swiper-pagination-bullets.swiper-pagination-horizontal {
    width: auto;
    left: 20px;
    right: 20px;
    justify-content: center;
  }

  .code-box,
  .code-banner {
    width: 100%;
    flex: 1 1 auto;
  }

  .exchange {
    width: 100%;
  }

  .register-page {
    max-height: none;
    overflow-x: hidden;
    overflow-y: auto;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 16px 12px 32px;
  }

  .register-shell {
    width: 100%;
    max-width: 100%;
    padding: 0;
    overflow: visible;
  }

  .register-content {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  :root {
    --header-h: 56px;
  }

  .page-scrollbar {
    display: none !important;
  }

  /* ----- Mobile fixed header ----- */
  .site-header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100vw !important;
    height: calc(var(--header-h) + env(safe-area-inset-top, 0px));
    padding-top: env(safe-area-inset-top, 0px);
    z-index: 1000;
    overflow: visible;
    background: rgba(14, 20, 33, 0.96) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    transform: none !important;
  }

  .site-header.light {
    background: #fff !important;
    border-bottom-color: #eef0f3;
  }

  .site-header .container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0 16px;
    gap: 12px;
    min-width: 0;
    overflow: visible;
  }

  .site-header .logo {
    flex: 0 1 auto;
    min-width: 0;
    z-index: 1002;
  }

  .logo .logo-mark {
    width: 120px;
    max-width: 100%;
    height: auto;
  }

  .header-end {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    margin-left: auto;
    z-index: 1002;
  }

  /* 顶栏只保留汉堡按钮，其余操作放进抽屉 */
  .header-end > .header-actions {
    display: none !important;
  }

  .nav-toggle {
    display: flex !important;
    flex: 0 0 auto;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.1);
  }

  .site-header.light .nav-toggle {
    border-color: #e0e0e0;
    background: #f5f5f5;
  }

  .nav-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
  }

  .site-header.light .nav-toggle span {
    background: #101727;
  }

  body.nav-open .nav-toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  body.nav-open .nav-toggle span:nth-child(2) {
    opacity: 0;
  }

  body.nav-open .nav-toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  /* ----- Mobile drawer（独立组件，不影响 PC 导航） ----- */
  .site-header .main-nav {
    display: none !important;
  }

  .nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 998;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.28s ease, visibility 0.28s ease;
  }

  body.nav-open .nav-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .mobile-nav-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(300px, 86vw);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    padding: calc(var(--header-h) + env(safe-area-inset-top, 0px) + 12px) 20px calc(24px + env(safe-area-inset-bottom, 0px));
    background: var(--c-dark);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.25);
    transform: translateX(100%);
    transition: transform 0.28s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  body.nav-open .mobile-nav-drawer {
    transform: translateX(0);
  }

  body.has-light-header .mobile-nav-drawer {
    background: #fff;
  }

  .mobile-nav-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: 0;
  }

  .mobile-nav-list .nav-item,
  .mobile-nav-list > a {
    height: auto;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  body.has-light-header .mobile-nav-list .nav-item,
  body.has-light-header .mobile-nav-list > a {
    border-bottom-color: #eef0f3;
  }

  .mobile-nav-list .nav-item > a,
  .mobile-nav-list > a {
    display: block;
    padding: 14px 0;
    font-size: 16px;
    color: #d9d9d9;
  }

  body.has-light-header .mobile-nav-list a {
    color: #101727;
  }

  body.has-light-header .mobile-nav-list a:hover,
  body.has-light-header .mobile-nav-list a.is-active {
    color: var(--c-amber);
  }

  /* 移动端不展示 Quant Data 下拉子菜单 */
  .mobile-nav-drawer .nav-mega {
    display: none !important;
  }

  .mobile-nav-actions {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  body.has-light-header .mobile-nav-actions {
    border-top-color: #eef0f3;
  }

  .mobile-nav-actions .lang-btn {
    width: 100%;
    height: 40px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
  }

  body.has-light-header .mobile-nav-actions .lang-btn {
    background: #f5f5f5;
    color: #101727;
    border: 1px solid #e0e0e0;
  }

  .mobile-nav-actions .btn-amber {
    width: 100%;
    height: 42px;
    font-size: 15px;
  }

  .mobile-nav-actions .sign-in {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 42px;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 8px;
    background: transparent !important;
    line-height: 1.2;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
  }

  body.has-light-header .mobile-nav-actions .sign-in {
    color: #101727;
    border-color: #e0e0e0;
    background: transparent !important;
  }

  /* ----- Typography ----- */
  .section {
    padding: 56px 0;
  }

  .section-head {
    margin-bottom: 36px;
  }

  .section-head h2,
  .quant-section-head h2,
  .about-advantages h2,
  .about-contact-info h2,
  .about-contact-form h2 {
    font-size: 26px;
  }

  .section-head p,
  .quant-section-head p {
    font-size: 16px;
  }

  /* ----- Hero ----- */
  .hero {
    min-height: 520px;
  }

  .hero-swiper {
    min-height: 520px;
    height: 520px;
  }

  .hero-swiper .swiper-wrapper,
  .hero-swiper .swiper-slide {
    height: 100%;
  }

  .hero-swiper .swiper-slide {
    height: 100%;
    display: flex;
    align-items: center;
    box-sizing: border-box;
    padding-top: calc(var(--header-h) + env(safe-area-inset-top, 0px));
    padding-bottom: 56px;
  }

  .hero-inner {
    width: 100%;
    min-height: 0;
    height: auto;
    padding-top: 0;
    padding-bottom: 0;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    box-sizing: border-box;
  }

  .hero-visual {
    display: none;
  }

  .hero-copy h1,
  .quant-hero-copy h1,
  .about-hero h1,
  .question-hero-copy h1 {
    font-size: 28px;
  }

  .hero-copy .hero-sub,
  .hero-copy .hero-desc,
  .hero-copy p,
  .quant-hero-copy p {
    font-size: 16px;
  }

  .about-hero p {
    width: 100%;
    font-size: 16px;
  }

  .about-title {
    font-size: 36px;
    margin-bottom: 28px;
  }

  /* ----- Grids（手机单列） ----- */
  .feature-grid,
  .market-grid,
  .platform-grid,
  .pricing-grid,
  .why-grid,
  .exchange-grid,
  .stats-bar,
  .stats-panel {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .audience-grid,
  .quant-page .audience-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .stats-bar {
    padding: 24px 20px;
    gap: 20px;
  }

  .stat {
    padding-left: 0;
    text-align: center;
  }

  .stats-panel {
    padding: 24px 16px;
    margin-top: 48px;
  }

  .intro-layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .intro-visual {
    height: 220px;
  }

  .intro-visual .visual-small {
    top: -16px;
    width: 140px;
    height: 140px;
  }

  .intro-visual .visual-large {
    right: 0;
    bottom: 0;
    width: 200px;
    height: 180px;
  }

  .about-hero,
  .about-hero-inner {
    min-height: 280px;
    height: auto;
  }

  .about-hero h1 {
    font-size: 32px;
    margin-bottom: 16px;
  }

  .about-intro {
    padding: 56px 0 48px;
  }

  .stat-item strong {
    font-size: 28px;
  }

  .quant-section {
    padding: 56px 0;
  }

  .audience-head h2 {
    font-size: 28px;
  }

  .price-card {
    min-height: auto;
  }

  .builders::before {
    display: none;
  }

  .builders-inner {
    flex-direction: column;
    gap: 32px;
  }

  .builders-copy {
    max-width: none;
  }

  .advantage-grid {
    grid-template-columns: 1fr;
    gap: 32px;
    margin: 48px auto;
  }

  .quant-hero-inner {
    grid-template-columns: 1fr;
    gap: 24px;
    min-height: auto;
    padding-bottom: 40px;
  }

  .quant-hero-visual {
    order: -1;
    max-width: 320px;
    margin: 0 auto;
  }

  .contact-row {
    grid-template-columns: 1fr;
  }

  .cta-inner {
    flex-direction: column;
    text-align: center;
    padding: 32px 24px;
  }

  .cta-inner h2 {
    font-size: 22px;
  }

  .footer-top {
    flex-direction: column;
    gap: 32px;
  }

  .footer-brand {
    flex: none;
    max-width: none;
    padding-right: 0;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    padding-bottom: 28px;
  }

  .footer-cols {
    flex-wrap: wrap;
    gap: 24px 32px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }

  .insights-wrap {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .insights-swiper {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  .insights-swiper .swiper-slide {
    height: auto;
  }

  .ins-card {
    display: flex;
    flex-direction: column;
    height: 100%;
  }

  .ins-thumb {
    height: 160px;
    background: #fff8ee;
    overflow: hidden;
  }

  .ins-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
  }

  .ins-body h3 {
    font-size: 15px;
    line-height: 1.5;
  }

  .insights-pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 4px;
  }

  .insights-pagination .swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d9dee7;
    opacity: 1;
    margin: 0 !important;
    transition: background 0.2s ease, transform 0.2s ease;
  }

  .insights-pagination .swiper-pagination-bullet-active {
    background: var(--c-amber);
    transform: scale(1.15);
  }

  .ins-nav {
    display: none;
  }

  /* 内页留出固定顶栏高度 */
  .about-page main,
  .question-page main {
    margin-top: calc(var(--header-h) + env(safe-area-inset-top, 0px));
  }

  .quant-page .quant-hero {
    padding-top: calc(var(--header-h) + env(safe-area-inset-top, 0px));
  }

  /* ----- Question page ----- */
  .question-hero {
    min-height: 240px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: stretch !important;
    padding: 24px 0 !important;
    box-sizing: border-box;
  }

  .question-hero-inner {
    min-height: unset !important;
    flex: none !important;
    width: 100%;
    padding: 0;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: center !important;
    box-sizing: border-box;
  }

  .question-hero-copy {
    width: 100%;
  }

  .question-hero-copy h1 {
    font-size: 32px;
    margin-bottom: 12px;
  }

  .question-hero-copy p {
    font-size: 16px;
    margin-bottom: 20px;
  }

  .question-search {
    width: 100%;
  }

  .question-hero-visual {
    display: none !important;
  }

  .question-layout {
    grid-template-columns: 1fr;
    transform: none;
  }

  /* ----- Register page ----- */
  .register-top {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
  }

  .register-logo {
    flex: 0 1 auto;
    min-width: 0;
  }

  .register-logo img {
    width: 120px;
    max-width: 100%;
    height: auto;
  }

  .register-actions {
    flex: 0 0 auto;
    flex-wrap: nowrap;
    gap: 8px;
  }

  .register-actions .lang-btn {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }

  .register-actions .sign-in {
    height: 32px;
    padding: 0 10px;
    font-size: 12px;
    white-space: nowrap;
  }

  .register-intro {
    display: none;
  }

  .register-panel {
    order: -1;
  }

  .register-panel h2 {
    font-size: 22px;
    margin-bottom: 20px;
    text-align: center;
  }

  .register-field label {
    font-size: 15px;
  }

  .register-field input {
    height: 44px;
    font-size: 14px;
  }

  .register-check {
    font-size: 12px;
    line-height: 1.5;
  }

  .register-submit {
    height: 44px;
    font-size: 16px;
  }

  .code-field {
    grid-template-columns: 1fr;
  }

  .code-send {
    width: 100%;
    height: 44px;
    font-size: 14px;
  }

  .btn-lg {
    height: 44px;
    padding: 0 24px;
    font-size: 16px;
  }

  .question-article {
    padding: 20px 16px;
  }

  .question-pager {
    flex-direction: column;
    gap: 12px;
  }

  .stub-main {
    padding: calc(var(--header-h) + 48px) 20px 64px;
  }

  .stub-inner h1 {
    font-size: 28px;
  }

  /* ----- Login / modals ----- */
  .modal-overlay {
    align-items: flex-start;
    overflow-y: auto;
    padding: 12px;
    -webkit-overflow-scrolling: touch;
  }

  .modal-overlay.open {
    display: flex;
  }

  .login-modal {
    width: 100%;
    max-width: 420px;
    min-height: auto;
    margin: auto;
    padding: 40px 18px 24px;
    border-radius: 16px;
  }

  .login-close {
    top: 16px;
    right: 16px;
    font-size: 28px;
  }

  .login-logo {
    width: 120px;
    margin-bottom: 24px;
  }

  .login-modal h2 {
    font-size: 20px;
    margin-bottom: 24px;
  }

  .login-field input {
    height: 44px;
    font-size: 14px;
  }

  .login-submit {
    height: 44px;
  }

  .modal {
    width: 100%;
    max-width: 100%;
    min-height: auto;
    margin: auto;
    padding: 24px 20px 28px;
  }

  .modal-head {
    gap: 16px;
    flex-wrap: wrap;
  }

  .modal-tab {
    font-size: 16px;
  }

  .opt-grid {
    grid-template-columns: 1fr;
  }

  .fc-head h3 {
    font-size: 28px;
  }

  .feature-card p {
    height: auto;
  }
}

@media (min-width: 993px) {
  .nav-toggle,
  .nav-backdrop,
  .mobile-nav-drawer {
    display: none !important;
  }

  .insights-pagination {
    display: none !important;
  }

  body.nav-open {
    overflow: auto;
  }

  .header-end {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
  }

  .main-nav {
    position: static !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    transform: none !important;
    padding: 0;
    margin-left: auto;
    margin-right: 36px;
    height: var(--header-h);
    width: auto;
    overflow: visible;
    background: transparent;
    box-shadow: none;
  }

  .main-nav .mobile-nav-actions {
    display: none !important;
  }

  .main-nav .nav-item,
  .main-nav > a {
    display: inline-flex !important;
    align-items: center !important;
    height: var(--header-h) !important;
    border-bottom: none;
    padding: 0;
    font-size: 16px;
  }

  .main-nav .nav-item > a {
    height: 100% !important;
  }
}
