/* Shared viewport safeguards for phones, tablets and wide desktop screens. */
html,body{max-width:100%;overflow-x:hidden}img,video,iframe{max-width:100%}button,input,select,textarea{max-width:100%}
@media (max-width:1180px){.hh-topbar{padding-left:22px;padding-right:22px}.container,.contact-main{max-width:100%;}}
@media (max-width:980px){.hh-nav{gap:14px}.hh-brand strong{font-size:15px}.hh-actions{gap:6px}.index-courseware-grid,.courseware-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.profile .container{padding-left:18px;padding-right:18px}}
@media (max-width:760px){.hh-topbar{padding-left:13px;padding-right:13px}.hh-brand{min-width:0}.hh-brand strong{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.hh-actions{flex:0 0 auto}.hh-actions .hh-admin,.hh-actions .hh-logout{display:none}.hh-nav{display:none}.contact-main{padding-top:24px}.page-contact-card{margin-top:16px}
  /* ⚠️ 客服卡片的宽度上限必须按**挂件的实际 right** 反推，不能写死魔数。
     卡片是 `.hh-contact`（position:fixed）里的绝对定位子元素：
        卡片右边缘 = 100vw − 挂件 right − 卡片 right = 100vw − 32 − 104 = 100vw − 136
     留出左侧安全边距后：width ≤ 100vw − 136 − 24 = calc(100vw - 160px)。
     原来写的是 `calc(100vw - 120px)`，那是**按挂件 right:12px 推的**（12 + 104 + 4 = 120）——
     但 `theme3.css` 用 `.hh-contact{right:32px!important}` 把移动端的 `right:12px` 压掉了，
     实际 right 是 32px → 卡片左边缘恒为 **−16px**（≤760px 的每个宽度都是 −16，与视口无关，
     因为宽度和偏移都随 vw 缩放）。实测 375px：卡片 x=−16、右边缘 239、宽 255。
     再留 24px 抵消 `100vw` 含滚动条而布局视口不含的差（桌面窄窗口有 15px 滚动条）。 */
  .hh-contact-card{max-width:calc(100vw - 160px)}
  .grid,.courseware-grid,.index-courseware-grid{grid-template-columns:1fr!important}.form-grid,.detail-grid{grid-template-columns:1fr!important}.modal-bg{padding:10px}.modal{max-height:calc(100vh - 20px)}
  .toolbar{width:100%}.toolbar .control{min-width:0}.table-item{min-width:0;word-break:break-word}.item{min-width:0}.item h3,.meta{overflow-wrap:anywhere}
}
@media (max-width:480px){.hh-brand strong{max-width:145px}.hh-login,.hh-profile{padding:8px 10px}.contact-main{padding-left:13px;padding-right:13px}.hero h1{font-size:25px}.page-contact-box{width:100%}.hh-contact{right:10px}.hh-contact-card{right:88px;width:min(226px,calc(100vw - 112px))}.hh-contact-card .hh-qr{width:150px;height:150px}.hh-pay-box{padding:24px 16px}.hh-pay-box img{width:210px;height:210px}}
/* ⚠️ 2026-09-21 第九轮：这里原有的 `.container,.contact-main{max-width:1280px}` 已删除，
   它**两边都是死代码**：
     · 对 `.container` —— theme3.css 的 `.container{max-width:var(--hh-content)!important}`
       无条件胜出（`!important` 压过普通声明，与源码顺序无关）；
     · 对 `.contact-main` —— `contact.html` 页内 `<style>` 的 `max-width:1040px` 在源码顺序上
       压过本文件（`@media` 不加特异性，同特异性下后者胜）。
   实测 2560 下这两者的计算值是 **2080px** 与 **1040px**，从来不是 1280px。
   大屏内容列宽度现在统一由 theme3.css 的 `--hh-content`（列表页，上限 2080）
   与 `--hh-content-narrow`（联系页，上限 1500）管理 —— 改宽度去那里改，别改这里。
   下面 `.hh-topbar` 的内边距那条**是生效的**（`100%` = 侧栏宽 248px，算式恒为负 → 取 30px），保留。 */
@media (min-width:1600px){.hh-topbar{padding-left:max(30px,calc((100% - 1280px)/2));padding-right:max(30px,calc((100% - 1280px)/2))}}
