/* ============================================================
   德宇教育 · 微信内 H5 / 手机优先层
   只在 760px 以下生效；桌面保持原设计。
   ============================================================ */

/* 桌面不显示移动专用组件 */
.mobile-cta,
.cohort-list,
.calendar-cards,
.my-cards { display: none; }

@media (max-width: 760px) {
  html { -webkit-text-size-adjust: 100%; }
  body { font-size: 15px; }
  a, button { -webkit-tap-highlight-color: rgba(185, 138, 75, .18); }
  .wrap { padding-left: 16px; padding-right: 16px; }
  .link-arrow { white-space: nowrap; }

  /* 顶栏：更矮、更轻、更易点 */
  .announce { font-size: 10.5px; }
  .announce .wrap { min-height: 30px; }
  .site-header .wrap { min-height: 58px; gap: 10px; }
  .brand { gap: 9px; }
  .brand img { width: 32px; height: 32px; }
  .brand-name { font-size: 20px; letter-spacing: .1em; }
  .brand-en { font-size: 8px; letter-spacing: .24em; margin-top: 3px; }
  .menu-toggle { border: 0; padding: 0; min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; color: var(--ink); }
  .site-nav { top: 58px; padding: 6px 16px 14px; box-shadow: 0 18px 30px -24px rgba(11, 26, 42, .5); }
  .site-nav .nav-link { width: 100%; padding: 13px 0; font-size: 14px; }
  .header-tools .btn { display: none; }
  .header-tools .link-quiet { font-size: 12px; padding: 10px 0; }

  /* 首页 Hero：手机阅读节奏 */
  .hero-grid { padding: 34px 0 26px; gap: 24px; }
  .hero-eyebrow { font-size: 9.5px; letter-spacing: .22em; margin-bottom: 16px; }
  .hero-eyebrow::before { width: 22px; }
  .hero-title { font-size: 34px; line-height: 1.2; margin-bottom: 15px; }
  .hero-lead { font-size: 14px; line-height: 1.85; margin-bottom: 20px; }
  .hero-actions { gap: 10px; margin-bottom: 16px; }
  .hero-actions .btn { min-height: 48px; }
  .hero-note { font-size: 10.5px; gap: 12px; }
  .hero-panel { padding: 16px 15px 10px; }
  .event-row { grid-template-columns: 46px 1fr; gap: 9px; padding: 11px 0; align-items: start; }
  .event-name { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.45; }
  .event-tag { display: none; }
  .hero-panel .event-row:nth-child(5) { display: none; }
  .event-date { font-size: 18px; }
  .event-name { font-size: 12.5px; }
  .event-sub { font-size: 10.5px; }
  .event-tag { font-size: 9px; padding: 2px 6px; }
  .hero-stats { padding: 16px 0 20px; }
  .stat-value { font-size: 21px; }
  .stat-label { font-size: 9.5px; }

  /* 区块 */
  .section { padding: 50px 0; }
  .section.tight { padding: 28px 0; }
  .section-head { margin-bottom: 24px; }
  .section-head.split { gap: 10px; flex-direction: column; align-items: flex-start; }
  .eyebrow { font-size: 9.5px; letter-spacing: .2em; margin-bottom: 9px; }
  .h2 { font-size: 27px; line-height: 1.3; }
  .lead { font-size: 14px; line-height: 1.8; margin-top: 9px; }

  /* 四板块：2×2，短卡片 */
  .line-grid { grid-template-columns: 1fr 1fr; }
  .line-card { min-height: 188px; padding: 17px 15px 13px; }
  .line-card:nth-child(2) { border-left: 1px solid var(--line); }
  .line-card:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
  .line-card:nth-child(4) { border-left: 1px solid var(--line); border-top: 1px solid var(--line); }
  .line-en { display: none; }
  .line-name { font-size: 25px; margin: 16px 0 6px; letter-spacing: .04em; }
  .line-desc { font-size: 12px; line-height: 1.7; min-height: 41px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .line-foot { margin-top: 12px; padding-top: 9px; font-size: 10px; }
  .line-foot .link-arrow { font-size: 10px; }
  .line-count b { font-size: 14px; }

  /* 文章列表 */
  .article-row { grid-template-columns: 1fr; gap: 5px; padding: 16px 0; }
  .article-date { display: flex; align-items: baseline; gap: 6px; color: var(--muted); font-size: 12px; }
  .article-date small { display: inline; margin: 0; font-size: 10px; }
  .article-title { font-size: 17px; line-height: 1.55; }
  .article-summary { font-size: 12px; -webkit-line-clamp: 2; }
  .article-arrow { display: none; }
  .article-tags { gap: 6px; margin-top: 8px; }

  /* 课程 / 师资：横向滑动，减少页面长度 */
  .course-grid.carousel,
  .teacher-grid.carousel {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    margin-right: -16px;
    padding-right: 16px;
    scrollbar-width: none;
  }
  .course-grid.carousel::-webkit-scrollbar,
  .teacher-grid.carousel::-webkit-scrollbar { display: none; }
  .course-grid.carousel .course-card { flex: 0 0 82%; scroll-snap-align: start; }
  .teacher-grid.carousel .teacher-card { flex: 0 0 64%; scroll-snap-align: start; }
  .course-grid.two { grid-template-columns: 1fr; }
  .course-card:hover { transform: none; box-shadow: none; }
  .course-body { padding: 16px; }
  .course-title { font-size: 19px; }
  .course-summary { font-size: 12px; }

  .teacher-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .teacher-card { padding: 16px 12px; }
  .monogram { width: 50px; height: 50px; font-size: 20px; margin-bottom: 10px; }
  .teacher-name { font-size: 16px; }
  .teacher-role { font-size: 10px; }
  .teacher-desc { font-size: 11px; line-height: 1.7; }

  .feature-grid { grid-template-columns: 1fr; border-top: 0; }
  .feature { border-right: 0; border-top: 1px solid var(--line); padding: 22px 0; }
  .feature h3 { font-size: 20px; }
  .feature p { font-size: 12.5px; }

  .cta-band { padding: 40px 0; }
  .cta-copy h2 { font-size: 26px; }
  .cta-actions { width: 100%; }
  .cta-actions .btn { flex: 1; min-height: 48px; }

  /* 内页 */
  .page-hero { padding: 36px 0 30px; }
  .page-hero h1 { font-size: 30px; }
  .page-hero .lead { font-size: 14px; }
  .breadcrumb { font-size: 10px; margin-bottom: 14px; }

  .filter-bar { gap: 10px; padding: 12px 0; }
  .chips { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: 0 0 auto; min-height: 36px; display: inline-flex; align-items: center; }
  .search { width: 100%; }
  .search input { flex: 1; width: auto; font-size: 16px; }

  .split { grid-template-columns: 1fr; gap: 24px; }
  .side-card { padding: 18px; }
  .side-card .btn { min-height: 46px; }
  .side-card[style*="sticky"] { position: static !important; }

  /* 文章详情 */
  .prose { font-size: 16px; line-height: 1.95; }
  .prose p { margin-bottom: 16px; }
  .article-cover { margin-bottom: 18px; }
  .article-gallery { grid-template-columns: 1fr 1fr; }
  .source-note { padding: 14px; font-size: 11px; }

  /* 表单 */
  .form-card { padding: 20px 16px; }
  .form-grid { grid-template-columns: 1fr; gap: 14px; }
  .input, .select, .textarea { font-size: 16px; min-height: 46px; }
  .textarea { min-height: 120px; }
  .form-actions { flex-direction: column-reverse; align-items: stretch; }
  .form-actions .btn { width: 100%; min-height: 48px; }
  .summary-list div { font-size: 12px; }

  /* 课程详情：表格改卡片 */
  .course-hero { grid-template-columns: 1fr; gap: 22px; }
  .cohort-table { display: none; }
  .cohort-list { display: grid; gap: 10px; }
  .cohort-card { border: 1px solid var(--line); background: var(--surface); padding: 15px; }
  .cohort-card__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
  .cohort-card__head b { font-size: 14px; line-height: 1.5; }
  .cohort-card__meta { font-size: 12px; color: var(--muted); margin-top: 5px; }
  .cohort-card__foot { display: flex; justify-content: flex-end; margin-top: 12px; }

  /* 日历：表格改卡片 */
  .calendar-table { display: none; }
  .calendar-cards { display: grid; gap: 10px; }
  .calendar-card { border: 1px solid var(--line); background: var(--surface); padding: 15px; }
  .calendar-card__top { display: flex; justify-content: space-between; gap: 10px; }
  .calendar-card__date { font-family: var(--serif); color: var(--gold); font-size: 18px; white-space: nowrap; }
  .calendar-card__name { font-size: 14px; font-weight: 600; line-height: 1.5; }
  .calendar-card__meta { font-size: 11.5px; color: var(--muted); margin-top: 6px; }

  /* 我的报名：表格改卡片 */
  .table { display: none; }
  .my-cards { display: grid; gap: 10px; }
  .my-card { border: 1px solid var(--line); background: var(--surface); padding: 15px; }
  .my-card__top { display: flex; justify-content: space-between; gap: 10px; }
  .my-card__title { font-size: 14px; font-weight: 600; }
  .my-card__meta { font-size: 11.5px; color: var(--muted); margin-top: 5px; }

  /* 页脚 */
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px 18px; padding-bottom: 26px; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-brand p { max-width: none; }
  .site-footer { padding: 38px 0 calc(26px + env(safe-area-inset-bottom, 0px)); }
  .footer-bottom { font-size: 10px; line-height: 1.8; }
  .footer-bottom span:last-child { display: block; }
  .footer-col a, .footer-col span { padding: 8px 0; }

  /* 底部操作条：微信内拇指可达 */
  .mobile-cta {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 70;
    gap: 8px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    background: rgba(247, 244, 237, .96);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
  }
  .mobile-cta__ghost,
  .mobile-cta__primary {
    flex: 1;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    border-radius: 2px;
  }
  .mobile-cta__ghost { border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); }
  .mobile-cta__primary { border: 1px solid var(--gold); background: var(--gold); color: #fff; }
  body.has-mobile-cta { padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px)); }
  body.has-mobile-cta .site-footer { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
  body.has-mobile-cta .consult-fab { display: none; }
  .home-page .consult-fab { display: none; }
  .home-page .consult-fab.fab-visible { display: flex; }

  /* 悬浮客服：手机变底部面板 */
  .consult-fab { bottom: calc(18px + env(safe-area-inset-bottom, 0px)); padding: 11px 16px; font-size: 13px; }
  .consult-panel {
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-height: 86vh;
    max-height: 86dvh;
    border-radius: 12px 12px 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .consult-head { padding: 14px 16px; }
  .consult-log { padding: 14px; }
  .consult-form input { font-size: 16px; }
  .consult-note { padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }

  /* 登录 */
  body.consult-open { overflow: hidden; }
  .login-form { padding: 28px 20px; }
  .login-card h2 { font-size: 24px; }
  .login-card .input { font-size: 16px; }
}

@media (max-width: 380px) {
  .hero-title { font-size: 30px; }
  .line-card { min-height: 196px; }
  .line-name { font-size: 22px; }
  .brand-name { font-size: 18px; }
  .mobile-cta__ghost,
  .mobile-cta__primary { font-size: 13px; }
}
