/* =============================================
   途藤教育 - 移动端响应式适配
   覆盖全站: 导航/布局/footer/卡片/表格/弹窗
   ============================================= */

/* ===== 平板端 (768px - 1024px) ===== */
@media (max-width: 1024px) {

  /* ---- 容器 ---- */
  .container,
  .fn-container,
  .fn-footContent {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 20px;
    padding-right: 20px;
    box-sizing: border-box;
  }

  .dropdown-grid {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 20px;
    box-sizing: border-box;
  }

  /* ---- 导航（769-1024 仅微调头部文字，折叠逻辑见 <=1200 块） ---- */
  .fn-logo a {
    font-size: 22px;
  }
  .fn-slogan {
    font-size: 11px;
  }
  .fn-telLink {
    font-size: 15px;
  }

  /* ---- Footer ---- */
  .fn-footContent {
    flex-wrap: wrap;
    gap: 24px;
  }
  .fn-footContent ul {
    height: auto;
  }
  .foot-meta {
    height: auto;
    flex-wrap: wrap;
  }
  .foot-meta img {
    width: 110px;
    height: 110px;
  }
  .super-code:last-of-type {
    margin-left: 10px;
  }
  .foot-copy {
    margin-top: 24px;
  }

  /* ---- 侧边导航栏 ---- */
  .side-nav {
    gap: 8px;
    border-radius: 6px 0 0 6px;
  }
  .nav-item {
    width: 46px;
    height: 46px;
    margin: 6px auto;
    border-radius: 4px;
  }
  .nav-item i {
    font-size: 18px;
  }
  .nav-content {
    width: 200px;
    right: 60px;
    padding: 14px;
  }

  /* ---- 校区信息 ---- */
  .fn-areaMain {
    gap: 12px;
  }
  .fn-areaName {
    flex: 0 0 48%;
    height: 80px;
    line-height: 74px;
    font-size: 20px;
  }
  .fn-addressCon {
    flex-direction: column;
    gap: 16px;
    padding: 16px 20px;
  }
  .fn-addressLayout,
  .fn-areaImage {
    width: 100%;
  }

  /* ---- 弹窗 ---- */
  .modal-content {
    max-width: 90vw;
    height: auto;
    min-height: 360px;
  }

  /* ---- 侧边固定导航 ---- */
  .fixed-nav {
    display: none !important;
  }
  .side-nav {
    right: 4px;
  }
}

/* ===== 导航折叠 (<= 1200px 折叠为汉堡菜单，桌面宽屏 >1200 显示完整菜单) ===== */
@media (max-width: 1200px) {
  /* 汉堡按钮显示 */
  .fn-hamburger {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 36px;
    height: 36px;
    cursor: pointer;
    z-index: 10000;
    gap: 5px;
    margin-left: 12px;
  }
  .fn-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: #235b8a;
    border-radius: 2px;
    transition: all .3s ease;
  }
  .fn-hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  .fn-hamburger.active span:nth-child(2) {
    opacity: 0;
  }
  .fn-hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  /* 导航列表折叠为全屏遮罩菜单 */
  nav ul {
    display: none;
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 20px;
    z-index: 9999;
    overflow-y: auto;
    gap: 0;
    width: 100% !important;
  }
  nav ul.show {
    display: flex;
  }
  nav ul li {
    width: 100%;
    border-bottom: 1px solid #f0f0f0;
  }
  nav ul li:last-child {
    border-bottom: none;
  }
  nav ul li a {
    padding: 14px 0;
    font-size: 16px;
    width: 100%;
    color: #333;
  }
  nav ul li a::after {
    display: none;
  }

  /* 移动端菜单内文字不随滚动后的 fn-headerBg 变白 */
  .fn-headerBg nav ul li a {
    color: #333 !important;
  }
  .fn-headerBg nav ul li a:hover {
    color: #235b8a;
  }

  /* 折叠态下的下拉（关于我们 -> 师资力量） */
  .dropdown-content {
    position: static;
    width: 100% !important;
    box-shadow: none;
    height: auto !important;
    opacity: 1;
    visibility: visible;
    padding-top: 0;
    display: none;
    background: #f8f8f8;
    border-radius: 0 0 8px 8px;
  }
  .dropdown-content.show {
    display: block;
    height: auto !important;
  }
  .dropdown-content a {
    color: #333 !important;
  }
  nav ul li.dropdown > a.dropbtn::before {
    content: '\25BC';
    position: absolute;
    right: 0;
    font-size: 10px;
    color: #235b8a;
    transition: transform .3s ease;
  }
  nav ul li.dropdown.open > a.dropbtn::before {
    transform: rotate(180deg);
  }
}

/* ===== 手机端 (<= 768px) ===== */
@media (max-width: 768px) {

  /* ---- 容器 ---- */
  .container,
  .fn-container,
  .fn-footContent {
    padding-left: 16px;
    padding-right: 16px;
  }

  section {
    padding: 30px 0;
  }

  /* ---- Header 导航 ---- */
  header {
    height: 56px;
  }

  .fn-logo a {
    font-size: 20px;
  }
  .fn-slogan {
    font-size: 10px;
  }

  /* 隐藏桌面导航 */
  nav ul {
    display: none;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 20px;
    z-index: 9999;
    overflow-y: auto;
    gap: 0;
    width: 100% !important;
  }
  nav ul.show {
    display: flex;
  }
  nav ul li {
    width: 100%;
    border-bottom: 1px solid #f0f0f0;
  }
  nav ul li:last-child {
    border-bottom: none;
  }
  nav ul li a {
    padding: 14px 0;
    font-size: 16px;
    width: 100%;
    color: #333;
  }
  nav ul li a::after {
    display: none;
  }

  /* 移动端菜单内文字不随滚动后的 fn-headerBg 变白 */
  .fn-headerBg nav ul li a {
    color: #333 !important;
  }
  .fn-headerBg nav ul li a:hover {
    color: #235b8a;
  }

  /* 汉堡按钮 */
  .fn-hamburger {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 36px;
    height: 36px;
    cursor: pointer;
    z-index: 10000;
    gap: 5px;
    margin-left: 12px;
  }
  .fn-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: #235b8a;
    border-radius: 2px;
    transition: all .3s ease;
  }
  .fn-hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  .fn-hamburger.active span:nth-child(2) {
    opacity: 0;
  }
  .fn-hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  /* 手机端下拉菜单 */
  .dropdown-content {
    position: static;
    width: 100% !important;
    box-shadow: none;
    height: auto !important;
    opacity: 1;
    visibility: visible;
    padding-top: 0;
    display: none;
    background: #f8f8f8;
    border-radius: 0 0 8px 8px;
  }
  .dropdown-content.show {
    display: block;
    height: auto !important;
  }
  .dropdown-content a {
    color: #333 !important;
  }
  .dropdown-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
  }
  .dropdown-grid a {
    text-align: left;
    border: none;
    border-bottom: 1px solid #eee;
    border-radius: 0;
    padding: 12px 20px;
    font-size: 14px;
  }
  .dropdown-grid a:last-child {
    border-bottom: none;
  }

  /* 语言培训下拉触发器 - 手机端可点击 */
  nav ul li.dropdown > a.dropbtn {
    position: relative;
  }
  nav ul li.dropdown > a.dropbtn::before {
    content: '\25BC';
    position: absolute;
    right: 0;
    font-size: 10px;
    color: #235b8a;
    transition: transform .3s ease;
  }
  nav ul li.dropdown.open > a.dropbtn::before {
    transform: rotate(180deg);
  }

  /* 手机端电话 */
  .fn-telLink {
    font-size: 14px;
    padding-right: 4px;
  }

  /* ---- 轮播图 ---- */
  .swiper-slide img {
    height: auto;
    min-height: 200px;
    object-fit: contain;
  }
  .hero {
    padding: 20px 0;
  }

  /* ---- h2/h3 ---- */
  h2 {
    font-size: 22px;
  }
  h3 {
    font-size: 18px;
  }

  /* ---- Footer ---- */
  footer {
    padding: 30px 0 16px;
  }
  .fn-footContent {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .fn-footContent h3 {
    position: static;
    font-size: 16px;
  }
  .fn-footContent > div > p {
    margin: 16px 0 8px;
  }
  .fn-footContent ul {
    height: auto;
    font-size: 13px;
    line-height: 1.8;
  }
  .foot-rightLi {
    width: 100%;
  }
  .foot-meta {
    height: auto;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 12px;
  }
  .foot-meta img {
    width: 90px;
    height: 90px;
  }
  .super-code:last-of-type {
    margin-left: 0;
  }
  .fn-addressCon {
    flex-direction: column;
    gap: 12px;
    padding: 12px 14px;
    margin-top: 16px;
  }
  .fn-addressLayout,
  .fn-areaImage {
    width: 100%;
  }
  .fn-addressLayout {
    line-height: 1.8;
  }
  .fn-addressName {
    font-size: 18px;
  }

  /* ---- 校区卡片 ---- */
  .fn-areaMain {
    gap: 8px;
    margin-top: 24px;
  }
  .fn-areaName {
    flex: 0 0 100%;
    height: 60px;
    line-height: 56px;
    font-size: 17px;
    border-radius: 14px;
  }
  .fn-areaBg {
    height: 32px;
    background-size: contain;
  }

  /* ---- 侧边导航栏 ---- */
  .side-nav {
    right: 2px;
    gap: 6px;
    border-radius: 4px 0 0 4px;
  }
  .nav-item {
    width: 38px;
    height: 38px;
    margin: 4px auto;
  }
  .nav-item i {
    font-size: 16px;
  }
  .nav-content {
    width: 170px;
    right: 48px;
    padding: 10px;
    font-size: 12px;
  }

  /* ---- 弹窗 ---- */
  .modal-content {
    max-width: 95vw;
    padding: 16px;
    border-radius: 12px;
  }
  .modal-content h3 {
    font-size: 18px;
    margin-bottom: 16px;
  }
  .form-group {
    margin-bottom: 12px;
  }
  input,
  select {
    padding: 8px;
    font-size: 14px;
  }
  .submit-btn {
    padding: 10px;
    font-size: 15px;
  }
  .close {
    right: 12px;
    top: 10px;
    font-size: 20px;
  }

  /* ---- 通用: 图片不溢出 ---- */
  img {
    max-width: 100%;
    height: auto;
  }
  .fn-banner img,
  .hero img,
  section img {
    max-width: 100%;
    height: auto;
  }

  /* ---- 统计数字区 ---- */
  .fn-statistics {
    flex-wrap: wrap;
    gap: 16px;
  }

  /* ---- 固定侧边导航 ---- */
  .fixed-nav {
    display: none !important;
  }

  /* ---- news.css 图片修复 ---- */
  .news-detail-ctaInner img,
  .news-ctaInner img {
    width: 100% !important;
    max-width: 100% !important;
  }
  .fn-container img.news-footerbanner {
    width: 100% !important;
  }

  /* ---- newsDetail 修复 ---- */
  .news-detailBody img {
    width: 100% !important;
    height: auto !important;
  }

  /* ===== 首页核心课程 - 移动端优化 ===== */
  .fn-courseTitlt {
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 10px;
    margin-top: 20px;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 6px;
  }
  .fn-courseTitlt::-webkit-scrollbar {
    display: none;
  }
  .fn-courseLoyout {
    flex: 0 0 auto;
    width: 108px;
    margin-left: 0 !important;
  }
  .fn-courseBtn {
    font-size: 14px;
    height: 34px;
    margin-top: 0;
    line-height: 34px;
  }
  .fn-courseDelCon {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 24px;
  }
  .fn-courseBg {
    padding: 24px 18px;
  }
  .fn-classTitle {
    min-height: auto;
    padding-bottom: 12px;
  }
  .fn-className {
    font-size: 22px;
    line-height: 1.3;
  }
  .fn-courseName {
    font-size: 14px;
  }
  .fn-statusCon {
    height: auto;
    min-height: 70px;
    margin-top: 12px;
    font-size: 13px;
    line-height: 1.6;
  }
  .fn-statusTitle {
    font-size: 15px;
  }

  /* ===== 留学规划 - 移动端1列 ===== */
  .fn-abroadTitlt {
    flex-direction: column;
    gap: 20px;
    margin-top: 30px;
  }
  .fn-abroadLoyout {
    width: 100%;
  }
  .fn-abroadCon {
    padding: 44px 18px 18px;
  }
  .fn-abroadCon li > div {
    min-height: auto;
    line-height: 1.8;
    font-size: 14px;
  }
  .fn-abroadBtn {
    font-size: 16px;
  }
  .fn-abroadCon .btn {
    position: static;
    display: block;
    width: 100%;
    margin-top: 16px;
    text-align: center;
  }

  /* ===== 国际课程页面课程卡片 - 移动端优化 ===== */
  .fn-abroadTitlt.fn-container {
    gap: 24px;
    padding: 0 16px;
  }
  .fn-abroadTitlt.fn-container .fn-abroadLoyout {
    width: 100%;
  }
  .image-container {
    height: auto !important;
    min-height: 180px;
    position: relative;
    overflow: hidden;
    border-radius: 12px;
  }
  .image-container img {
    width: 100%;
    height: auto;
    min-height: 180px;
    object-fit: cover;
    display: block;
  }
  .image-title {
    font-size: 17px !important;
    padding: 12px 16px !important;
    bottom: 0 !important;
  }
  /* 移动端隐藏hover遮罩层，避免布局异常 */
  .mask {
    display: none;
  }

  /* ===== 教学服务 - 移动端纵向排列 ===== */
  .fn-teachingMain {
    padding: 24px 16px;
    margin-top: 30px;
  }
  .fn-teachingCon {
    flex-direction: column;
    height: auto;
    gap: 12px;
  }
  .fn-teachingCenter {
    flex-direction: row;
    gap: 12px;
    height: auto;
    width: 100%;
    box-sizing: border-box;
  }
  .fn-teachingCenter > img {
    flex: 1;
    min-width: 0;
    width: auto;
    height: auto;
    object-fit: cover;
  }
  .fn-publicImg {
    width: 100%;
  }
  .fn-publicImg img {
    width: 100%;
    height: auto;
    display: block;
  }

  /* ===== 学术支持 - 移动端纵向排列 ===== */
  .fn-academicTitle {
    flex-wrap: wrap;
    gap: 10px 16px;
    font-size: 16px;
    justify-content: center;
  }
  .fn-academicCon {
    flex-direction: column;
    height: auto;
    gap: 12px;
    margin-top: 30px;
  }
  .fn-academicCenter {
    flex-direction: row;
    gap: 12px;
    height: auto;
    width: 100%;
    box-sizing: border-box;
  }
  .fn-academicCenter > img {
    flex: 1;
    min-width: 0;
    width: auto;
    height: auto;
    object-fit: cover;
  }
  .fn-academicImg {
    width: 100%;
  }

  /* ===== 通用按钮全宽优化 ===== */
  .fn-academicBtn,
  .fn-sealedBtn {
    width: 100%;
    padding: 12px 20px !important;
    box-sizing: border-box;
    margin-top: 24px;
  }

  /* ===== 权威奖项区域 ===== */
  .home-gradient-text {
    font-size: 24px !important;
    padding: 0 16px;
    line-height: 1.3;
  }
  .fn-honorMain {
    padding: 30px 0;
    margin-top: 30px;
  }

  /* ===== 右侧悬浮导航 - 移动端隐藏 ===== */
  .side-nav {
    display: none !important;
  }

  /* ===== 南京校区标题 ===== */
  .fn-nanjingCampus .fn-nanjingTitle {
    font-size: 22px;
    margin-bottom: 20px;
  }

  /* ===== 培训页面(雅思/托福)移动端修复 ===== */
  /* 课程费用班型选择 - flex换行，避免横向溢出 */
  .fn-constCon {
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-start;
  }
  .fn-constCon > div {
    flex: 0 0 calc(50% - 6px);
    width: calc(50% - 6px);
  }
  .fn-costSonTitle {
    width: 100% !important;
    margin-top: 0;
  }
  /* tooltip提示文字 */
  .tooltip {
    width: 100%;
  }
  .tooltip-text {
    width: 100% !important;
    left: 0;
    right: 0;
    box-sizing: border-box;
  }
  /* 备考解答区域 - 纵向排列 */
  .fn-preparationCon {
    flex-direction: column;
    gap: 16px;
  }
  .fn-preparationDetail {
    width: 100% !important;
    box-sizing: border-box;
    padding: 15px 16px 30px !important;
  }
  /* 咨询表单区域 */
  .fn-consultMain {
    flex-direction: column;
    gap: 12px;
  }
  .fn-consultMain > * {
    width: 100% !important;
  }
  /* 固定宽度标题按钮自适应 */
  .fn-costTitle,
  .fn-preparationTitle {
    width: 100% !important;
    max-width: 200px;
  }
  /* 培训页面课程卡片 - 移动端1列（用fn-container类区分首页标签栏） */
  .fn-courseTitlt.fn-container {
    flex-direction: column;
    overflow-x: visible;
    flex-wrap: wrap;
    gap: 16px;
  }
  .fn-courseTitlt.fn-container .fn-courseLoyout {
    width: 100%;
    flex: 0 0 100%;
    margin-left: 0 !important;
  }
  .fn-courseCons {
    min-height: auto !important;
  }
  /* 通用：防止表格溢出 */
  table {
    max-width: 100%;
    display: block;
    overflow-x: auto;
  }

  /* ===== 专题页面(原版阅读/辩论演讲/KET-PET)移动端修复 ===== */
  .topic-hero {
    aspect-ratio: auto !important;
    min-height: auto !important;
    height: auto !important;
    width: 100% !important;
    padding: 50px 0;
  }
  .topic-heroInner {
    max-width: 100% !important;
    padding: 0 16px !important;
    box-sizing: border-box;
  }
  .topic-heroTitle {
    font-size: 26px !important;
  }
  .topic-heroDesc {
    max-width: 100% !important;
  }
  /* 专题页面卡片网格 - 移动端1列 */
  .topic-grid,
  .topic-infoGrid,
  .topic-grid--3 {
    grid-template-columns: 1fr !important;
  }
  /* 专题页面列表项 - 移动端纵向排列 */
  .topic-listItem {
    flex-direction: column;
  }
  .topic-listItem img {
    width: 100%;
    height: auto;
  }
  /* 专题页面表格 - 横向滚动 */
  .topic-tableWrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  table.topic-table {
    min-width: 640px;
  }

  /* ===== 新闻列表分页 - 移动端换行适配 ===== */
  .news-pagination {
    flex-wrap: wrap;
    gap: 10px;
    padding: 0 16px;
    box-sizing: border-box;
  }
  .news-pageInfo {
    width: 100%;
    text-align: center;
    margin-right: 0;
    white-space: normal;
  }
  .news-pageJump {
    margin-left: 0;
  }

  /* ===== 培训页面tooltip提示文字 - 移动端居中 ===== */
  .tooltip-text {
    left: 50% !important;
    transform: translateX(-50%);
    width: auto !important;
    max-width: 90vw;
    white-space: normal;
  }

  /* ===== 咨询服务页数字装饰 - 移动端防溢出 ===== */
  .number-box {
    left: 0 !important;
    transform: none;
  }
}

/* ===== 小屏手机 (<= 480px) ===== */
@media (max-width: 480px) {

  .container,
  .fn-container,
  .fn-footContent {
    padding-left: 12px;
    padding-right: 12px;
  }

  header {
    height: 50px;
  }
  .fn-logo a {
    font-size: 18px;
  }
  .fn-slogan {
    font-size: 9px;
  }
  .fn-telLink {
    font-size: 12px;
  }
  .fn-hamburger {
    width: 30px;
    height: 30px;
    gap: 4px;
    margin-left: 8px;
  }
  .fn-hamburger span {
    width: 20px;
  }

  nav ul {
    top: 50px;
    padding: 12px 16px;
  }
  nav ul li a {
    padding: 12px 0;
    font-size: 15px;
  }

  section {
    padding: 24px 0;
  }
  h2 {
    font-size: 20px;
  }

  .fn-areaName {
    font-size: 15px;
    height: 50px;
    line-height: 46px;
  }
  .fn-footContent ul {
    font-size: 12px;
  }
  .foot-meta img {
    width: 76px;
    height: 76px;
  }
  .foot-copy {
    font-size: 11px;
  }
  .modal-content {
    min-height: 300px;
  }
}

/* ===== 大屏: 默认隐藏汉堡按钮 ===== */
.fn-hamburger {
  display: none;
}
