/* ============================================================
   Responsive — 移动端/平板适配 (Desktop-First)
   断点: 1400px / 1200px / 1024px / 768px / 480px
   ============================================================ */

/* === 1400px — 大屏微调 === */
@media (max-width: 1400px) {
  .v2-floating-widget {
    right: 12px;
  }
}

/* === 1200px — 平板横屏/小桌面 === */
@media (max-width: 1200px) {
  .v2-container {
    padding-left: 20px;
    padding-right: 20px;
  }

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

  .v2-trust-bar {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
  }

  .v2-mega-menu {
    min-width: auto;
    width: 90vw;
    left: 5vw;
    transform: none;
  }

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

  .v2-lead-form-inline .v2-input,
  .v2-lead-form-inline .v2-select {
    width: 150px;
  }
}

/* === 1024px — 平板竖屏 === */
@media (max-width: 1024px) {
  :root {
    --text-5xl: 36px;
    --text-4xl: 28px;
    --text-2xl: 20px;
    --space-4xl: 64px;
  }

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

  .v2-floating-widget {
    right: 8px;
    gap: 8px;
  }

  .v2-floating-widget__btn {
    width: 44px;
    height: 44px;
  }

  .v2-floating-widget__btn svg {
    width: 18px;
    height: 18px;
  }
}

/* === 768px — 手机横屏/大屏手机 === */
@media (max-width: 768px) {
  :root {
    --text-5xl: 32px;
    --text-4xl: 24px;
    --text-2xl: 18px;
    --text-xl: 16px;
    --space-4xl: 48px;
    --space-3xl: 40px;
    --space-2xl: 32px;
  }

  .v2-container {
    padding-left: 16px;
    padding-right: 16px;
  }

  /* 隐藏 PC 端悬浮组件 */
  .v2-floating-widget {
    display: none;
  }

  /* 显示移动端底部 CTA */
  .v2-mobile-cta-bar {
    display: flex;
  }

  /* 底部线索栏适配 */
  .v2-fixed-lead-bar .v2-container {
    flex-direction: column;
    gap: var(--space-sm);
  }

  .v2-fixed-lead-bar .v2-lead-title {
    margin-right: 0;
    font-size: var(--text-base);
  }

  .v2-fixed-lead-bar .v2-input,
  .v2-fixed-lead-bar .v2-select {
    width: 100%;
  }

  /* 网格全变单列 */
  .v2-grid-2,
  .v2-grid-3,
  .v2-grid-4 {
    grid-template-columns: 1fr;
  }

  /* 信任数据条 */
  .v2-trust-bar {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
    padding: var(--space-xl) 0;
  }

  .v2-trust-bar__number {
    font-size: var(--text-4xl);
  }

  .v2-trust-bar__label {
    font-size: var(--text-sm);
  }

  /* Mega Menu */
  .v2-mega-menu {
    position: static;
    width: 100%;
    box-shadow: none;
    border-radius: 0;
    padding: var(--space-md);
  }

  .v2-mega-menu__grid {
    grid-template-columns: 1fr;
  }

  /* 顶部工具条 */
  .v2-topbar {
    height: auto;
    padding: 8px 0;
  }

  .v2-topbar .v2-container {
    flex-direction: column;
    gap: 4px;
  }

  /* 内联线索表单 */
  .v2-lead-form-inline {
    flex-direction: column;
    width: 100%;
  }

  .v2-lead-form-inline .v2-input,
  .v2-lead-form-inline .v2-select {
    width: 100%;
  }

  /* 按钮全宽 */
  .v2-btn--lg {
    width: 100%;
    justify-content: center;
  }

  /* Hero 区域 */
  .v2-hero__content {
    flex-direction: column;
    text-align: center;
  }

  .v2-hero__cta {
    justify-content: center;
  }

  /* 面包屑 */
  .v2-breadcrumb {
    padding: var(--space-sm) 0;
    font-size: var(--text-xs);
  }
}

/* === 处理旧版固定宽度元素 === */
@media (max-width: 768px) {
  body > main > section {
    min-width: auto;
  }

  .section-container,
  .section-content {
    width: 100% !important;
    padding-left: 16px;
    padding-right: 16px;
  }

  /* 教师区域旧版卡片兼容 */
  .teacher-panel {
    width: 100% !important;
    left: 0 !important;
    right: 0 !important;
    position: relative !important;
    transform: none !important;
    margin-bottom: 24px;
  }

  .teacher-male .teacher-info,
  .teacher-female .teacher-info {
    position: relative;
    left: 0;
    right: 0;
    padding: 20px 16px !important;
  }

  .teacher-male .teacher-avatar,
  .teacher-female .teacher-avatar {
    position: relative;
    left: auto;
    right: auto;
    margin: 0 auto;
    display: block;
  }

  .teacher-name {
    position: relative;
    top: auto;
    left: auto !important;
    right: auto !important;
    text-align: center;
    margin-bottom: 16px;
  }

  .section-four {
    height: auto !important;
  }

  .section-four .section-info {
    position: relative;
    top: auto;
    right: auto;
    text-align: center;
  }

  /* 校区地图兼容 */
  .schoolList_map {
    padding-left: 0 !important;
    padding-right: 0 !important;
    background-size: contain !important;
  }

  .section-nine .schoolList_map {
    height: 400px !important;
  }

  /* 学员评价兼容 */
  .student {
    padding: 20px 16px !important;
    height: auto !important;
  }

  .student:nth-of-type(1) .student-letter,
  .student:nth-of-type(2) .student-letter {
    width: 100% !important;
    float: none !important;
  }

  .student:nth-of-type(1) .student-video,
  .student:nth-of-type(2) .student-video {
    width: 100% !important;
    float: none !important;
    margin-top: 16px;
  }

  .student-info {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    text-align: center;
    margin-bottom: 16px;
  }

  .student:nth-of-type(1) .student-avatar,
  .student:nth-of-type(2) .student-avatar {
    position: relative;
    left: auto !important;
    right: auto !important;
    margin: 0 auto;
  }

  .student:nth-of-type(2) .student-name,
  .student:nth-of-type(2) .student-duration {
    text-align: center;
  }

  /* 课程列表旧版兼容 */
  .course-list {
    width: 100% !important;
    height: auto !important;
  }

  .course-list .course-item {
    position: relative !important;
    width: 100% !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    margin-bottom: 16px;
  }

  /* Breadcrumb 适配 */
  .v2-breadcrumb {
    padding: 12px 16px;
  }

  /* 旧版三大区域 */
  .section-three .advantage,
  .section-three .chart {
    position: relative !important;
    width: 100% !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
  }

  .section-three .section-container {
    height: auto !important;
  }

  .section-three h3 {
    padding-top: 32px;
  }

  /* 大事记旧版兼容 */
  .section-eight .xmw_photoList {
    width: 100% !important;
    height: auto !important;
  }

  .section-eight .xmw_photoList li {
    float: none;
    margin-right: 0;
    margin-bottom: 12px;
  }

  .section-eight .xmw_photoList li img {
    width: 100%;
    height: auto;
  }

  /* 页脚兼容 */
  footer {
    min-width: auto !important;
  }

  .contact-panel {
    width: 100% !important;
    padding-left: 16px !important;
    height: auto !important;
  }
}

/* === 480px — 小屏手机 === */
@media (max-width: 480px) {
  :root {
    --text-5xl: 28px;
    --text-4xl: 22px;
    --space-4xl: 40px;
  }

  .v2-trust-bar {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-xs);
  }

  .v2-trust-bar__item {
    padding: var(--space-md);
  }

  .v2-trust-bar__number {
    font-size: var(--text-3xl);
  }

  .v2-modal {
    padding: var(--space-lg);
    width: 95%;
  }
}
