/* kechengdingzhi course detail page (e.g. /kechengdingzhi/110.html) mobile adaptation.
   Fixed top bar (logo left + hamburger right), accordion submenu, back-to-top are the
   same pattern as the zixun page; page-specific rules cover the product header,
   booking form, related course cards and side link lists.
   Desktop (>768px) keeps the original natural flow untouched. */

/* back-to-top floating button: bottom-right, circular, global (mobile + desktop) */
.backTopBtn {
  position: fixed;
  right: 20px;
  bottom: 88px;
  width: 44px;
  height: 44px;
  line-height: 44px;
  text-align: center;
  font-size: 22px;
  color: #fff;
  background: #4da0df;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
  cursor: pointer;
  z-index: 9999;
  user-select: none;
}
.backTopBtn:hover { background: #3b86c4; }
.backTopBtn:active { background: #2f6f9f; }

@media (max-width: 768px) {
  /* global: kill horizontal overflow */
  html, body { width: 100% !important; overflow-x: hidden !important; }
  body { margin: 0; }

  /* header: hide cert search box; logo/hotline scroll away (not fixed) */
  .top { height: auto !important; }
  .header { position: static !important; height: auto !important; padding: 10px 12px; background: #fff; }
  /* fixed top bar: logo left + hamburger right */
  .navBar {
    position: fixed !important; top: 0; left: 0; width: 100% !important; max-width: 100% !important;
    height: 56px; z-index: 999; background: #fff;
    box-sizing: border-box; display: flex; align-items: center; justify-content: space-between;
    padding: 0 12px; border-bottom: 1px solid #eee;
  }
  .navBarLogo { display: flex; align-items: center; }
  .navBarLogo img { display: block; height: 38px; width: auto; max-width: 62vw; }
  /* reserve space for the fixed 56px top bar */
  body { padding-top: 56px !important; }
  .header .logo { display: none !important; }
  .searchBox { display: none !important; }
  .header > div[style] {
    float: none !important; width: 100% !important; max-width: 100% !important; height: auto !important;
    margin: 8px 0 0 0 !important; clear: both; box-sizing: border-box;
  }
  .telephone { text-align: left !important; margin-top: 10px !important; font-size: 15px !important; }

  /* hamburger button: inside fixed top bar, right-aligned blue block */
  .navToggle {
    position: relative !important;
    display: flex !important; align-items: center; justify-content: center;
    width: 44px; height: 40px; background: #0063af; color: #fff;
    font-size: 17px; cursor: pointer; user-select: none; border-radius: 4px;
  }
  .navToggle .bars {
    margin-right: 0 !important; display: block; width: 22px; height: 2px; background: #fff; position: relative;
  }
  .navToggle .bars::before,
  .navToggle .bars::after {
    content: ""; position: absolute; left: 0; width: 22px; height: 2px; background: #fff;
  }
  .navToggle .bars::before { top: -6px; }
  .navToggle .bars::after { top: 6px; }
  .navToggle .navToggle-text { display: none; }

  /* nav: collapsed by default, tap toggle to open accordion */
  .topNav { height: auto !important; overflow: visible !important; }
  .navMain { width: 100% !important; opacity: 1 !important; display: none; }
  /* when open, pin the menu right below the fixed 56px top bar */
  .topNav.menu-open {
    position: fixed !important; top: 56px; left: 0; width: 100% !important;
    z-index: 998; max-height: calc(100vh - 56px); overflow-y: auto !important;
  }
  .topNav.menu-open .navMain { display: block; }
  .navIndex { height: auto !important; }
  .navIndex ul { margin: 0; padding: 0; }
  .navIndex li {
    float: none !important; width: 100% !important; height: 44px !important;
    line-height: 44px !important; text-align: left !important;
    border-bottom: 1px solid rgba(255,255,255,.18);
  }
  .navIndex a { height: 44px !important; line-height: 44px !important; padding-left: 16px; }
  /* right arrow for top-level items with submenu (script adds has-sub) */
  .navIndex li.has-sub > a::after {
    content: ""; float: right; margin: 18px 16px 0 0;
    width: 0; height: 0; border-left: 6px solid #fff;
    border-top: 5px solid transparent; border-bottom: 5px solid transparent;
    transition: transform .2s;
  }
  .navIndex li.has-sub.open > a::after { transform: rotate(90deg); }
  /* submenu: hidden by default, shown when its column opens */
  .navSub { display: none !important; width: 100% !important; height: auto !important; }
  .topNav.menu-open .navSub { display: block !important; }
  .navSub dl {
    float: none !important; width: 100% !important; height: auto !important;
    padding: 0 !important; text-indent: 0 !important; display: none;
  }
  .navSub dl.open { display: grid !important; grid-template-columns: 1fr 1fr; gap: 0 8px; padding: 6px 12px !important; box-sizing: border-box; }
  .navSub dl dt { display: none !important; }
  .navSub dd { position: relative !important; }
  .navSub dd a {
    display: block !important; width: 100% !important; height: 40px !important; line-height: 40px !important;
    padding: 0 10px !important; text-align: left !important; box-sizing: border-box;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px;
  }

  /* main: drop fixed 1000px width, single column stack */
  .main { width: 100% !important; padding: 0 12px !important; box-sizing: border-box; }
  /* breadcrumb row: hidden on mobile */
  .crumbs { display: none !important; }

  /* ===== course-detail page-specific rules ===== */
  /* two-column body (main2 left + right-panel right) collapses to one stack */
  .main2 { width: 100% !important; float: none !important; margin: 0 !important; }
  .right-panel { width: 100% !important; float: none !important; margin: 16px 0 0 0 !important; }
  .panel-pd { width: 100% !important; padding: 0 !important; }

  /* product header: image was absolutely positioned beside the description;
     stack image on top, description below, full width */
  .good_box { width: 100% !important; }
  .base-info { position: static !important; width: 100% !important; height: auto !important; overflow: hidden !important; }
  .img-wrap { position: static !important; width: 100% !important; height: auto !important; text-align: center !important; margin: 8px 0 !important; }
  .img-wrap .pd-img { max-width: 100% !important; height: auto !important; }
  .desc { width: 100% !important; margin: 0 !important; padding: 0 4px !important; box-sizing: border-box; }
  .desc h1 { font-size: 20px !important; padding: 8px 0 !important; line-height: 1.5 !important; }
  .desc p { margin: 6px 0 !important; font-size: 15px !important; line-height: 1.8 !important; }
  .desc .name, .desc .vbase { display: inline-block; min-width: 78px; }

  /* course intro block: full width, images scale, no first-line indent */
  .intro { width: 100% !important; margin-top: 16px !important; }
  .intro .title-box, .related-pd .title-box { padding: 10px 12px !important; }
  .intro-content { width: 100% !important; padding: 12px 4px !important; line-height: 1.8 !important; font-size: 15px; }
  .intro-content, .intro-content * { text-indent: 0 !important; }
  .intro-content img { max-width: 100% !important; height: auto !important; }
  .keylink { display: inline-block; margin: 4px 8px 4px 0 !important; }

  /* booking form: single column, label above, inputs full width */
  #myform { width: 100% !important; }
  #myform ul { margin: 0; padding: 0; list-style: none; }
  #myform li { width: 100% !important; height: auto !important; margin: 10px 0 !important; }
  #myform label { display: block !important; font-size: 14px !important; margin-bottom: 4px !important; }
  #myform input, #myform select {
    width: 100% !important; box-sizing: border-box !important;
    height: 38px !important; padding: 0 8px !important; font-size: 15px;
  }
  #myform #dosubmit {
    width: 100% !important; height: 42px !important; margin-top: 8px !important;
    font-size: 16px !important; border: none !important; cursor: pointer;
  }

  /* related course cards: full-width stacked rows, image left / info right */
  .related-pd { width: 100% !important; padding: 0 !important; margin: 16px 0 0 0 !important; }
  .related-pd-list { width: 100% !important; height: auto !important; margin: 0 0 10px 0 !important; }
  .p-list {
    float: none !important; width: 100% !important; display: flex !important;
    align-items: center; padding: 8px !important; box-sizing: border-box;
    border: 1px solid #eee; margin: 0 0 10px 0 !important;
  }
  .p-list .p-img { width: 96px !important; height: auto !important; flex: 0 0 96px; margin-right: 10px; }
  .p-list .meta { width: auto !important; flex: 1; padding: 0 !important; }
  .p-list .meta p { margin: 2px 0 !important; font-size: 13px !important; }

  /* side case / article link lists: full width stacked lines; override inline 228px */
  .list-S { width: 100% !important; padding: 8px 4px !important; }
  .list-S > div { width: 100% !important; }
  .list-S a {
    display: block !important; width: 100% !important; box-sizing: border-box !important;
    padding: 8px 4px !important; font-size: 14px !important; line-height: 1.6 !important;
    border-bottom: 1px dashed #eee;
  }

  /* footer: drop fixed width and inline floats, keep contacts only, small centered */
  body { margin: 0 !important; max-width: 100% !important; }
  .bottom { height: auto !important; }
  .footer { width: 100% !important; max-width: 100% !important; height: auto !important; padding: 18px 12px 14px !important; box-sizing: border-box; text-align: center; }
  .footer div {
    width: 100% !important; max-width: 100% !important; height: auto !important;
    float: none !important; position: static !important; left: auto !important; right: auto !important;
    margin: 0 auto !important; padding: 0 !important; box-sizing: border-box; text-align: center;
  }
  .footer img { max-width: 100% !important; height: auto !important; }
  /* hide phone/portrait icons and wechat qr */
  .footer img[src*="footer11_21"], .footer img[src*="footer11_18"], .footer img[src*="footer_15"] { display: none !important; }
  .footer div:has(> img[src*="footer11_21"]),
  .footer div:has(> img[src*="footer11_18"]) { display: none !important; }
  .erweima { display: none !important; }
  .footer > div[style] > div[style]:has(.erweima) { display: none !important; }

  /* contact lines: company+hotline / email+url, each centered on its row */
  .footer p { font-size: 10px !important; line-height: 2 !important; color: #ccc !important; text-align: center !important; margin: 2px 0 !important; clear: both !important; }
  .footer p span { font-size: 10px !important; color: #fff !important; }
  .footer p a { color: #ccc !important; }
  .footer p:has(a[href="https://www.lxgmgl.com/"]) { text-align: center !important; }

  /* bottom nav links: centered, wrap, even separators */
  .submenu { height: auto !important; line-height: 2 !important; text-align: center !important; margin: 10px 0 4px !important; }
  .submenu a { font-size: 10px !important; padding: 0 4px !important; color: #ccc !important; }
  /* copyright/ICP: one centered row */
  .footer p:has(a[href="https://beian.miit.gov.cn"]) { font-size: 10px !important; color: #888 !important; }
  .footer p:has(a[href="https://beian.miit.gov.cn"]) a { color: #888 !important; }
}

/* ===== Desktop (>768px): keep the original natural flow =====
   Header (LOGO/search/hotline) on top, blue nav bar below it, both scroll with
   the page; main2 left column + right-panel sidebar. Do NOT pin anything or
   inject the top bar on desktop. */
@media (min-width: 769px) {
  /* no fixed positioning, no body offset: leave desktop exactly as the original */
}
