/* ===================================================================
   录播库 · 响应式：手机端适配 + 全站 toast
   =================================================================== */
/* 手机端 */
.tabbar{display:none}
@media(max-width:900px){
  .nav{display:none}
  .g4{grid-template-columns:repeat(3,minmax(0,1fr))}
  .g3{grid-template-columns:repeat(2,minmax(0,1fr))}
  .statgrid{grid-template-columns:repeat(2,1fr)}
  .admin{grid-template-columns:minmax(0,1fr);gap:13px}
  /* 后台侧栏 → 分类导航: 第一行大分类, 第二行当前分类的面板(各自行内横滑) */
  .aside{position:static;flex-direction:column;gap:6px;padding:7px;border-radius:12px}
  .aside::-webkit-scrollbar{display:none}
  .aside .grp{display:none}
  .ai{display:none}
  .acats,.asub{display:flex;flex-direction:row;gap:6px;overflow-x:auto;-webkit-overflow-scrolling:touch;scrollbar-width:none;padding:1px}
  .acats::-webkit-scrollbar,.asub::-webkit-scrollbar{display:none}
  .acat{flex:none;padding:7px 15px;border-radius:20px;font-size:13.5px;font-weight:680;color:var(--dim);background:var(--sf3);cursor:pointer;user-select:none;white-space:nowrap}
  .acat.on{background:var(--brand);color:#fff}
  .asub-i{flex:none;display:inline-flex;align-items:center;gap:6px;padding:7px 13px;border-radius:9px;font-size:13.5px;font-weight:560;color:var(--dim);background:var(--sf2);border:1px solid var(--line);cursor:pointer;user-select:none;white-space:nowrap}
  .asub-i.on{color:var(--brand);border-color:var(--brand);background:var(--brand-soft);font-weight:680}
  .asub-i i{font-style:normal;font-size:11px;font-weight:750;background:var(--sf3);color:var(--dim2);padding:0 6px;border-radius:20px}
  .asub-i.on i{background:var(--brand);color:#fff}
  .ahead h1{font-size:20px}
  .apanel{padding:13px}
  table.tb{font-size:12.5px}
  /* 后台表格：隐藏次要列，避免横向溢出 */
  .tb-dash th:nth-child(3),.tb-dash td:nth-child(3),
  .tb-dash th:nth-child(4),.tb-dash td:nth-child(4),
  .tb-links th:nth-child(3),.tb-links td:nth-child(3),
  .tb-once th:nth-child(3),.tb-once td:nth-child(3),
  .tb-tasks th:nth-child(3),.tb-tasks td:nth-child(3),
  .tb-tasks th:nth-child(4),.tb-tasks td:nth-child(4),
  .tb-videos th:nth-child(3),.tb-videos td:nth-child(3),
  .tb-videos th:nth-child(4),.tb-videos td:nth-child(4),
  .tb-storage th:nth-child(3),.tb-storage td:nth-child(3),
  .tb-storage th:nth-child(4),.tb-storage td:nth-child(4),
  .tb-users th:nth-child(6),.tb-users td:nth-child(6),
  .tb-users th:nth-child(7),.tb-users td:nth-child(7){display:none}
  .tb-users .sw{width:32px;height:19px}
  .tb-users .sw::after{width:15px;height:15px;top:2px;left:2px}
  .tb-users .sw.on::after{left:15px}
  .tb-users th:nth-child(2),.tb-users td:nth-child(2),
  .tb-users th:nth-child(3),.tb-users td:nth-child(3),
  .tb-users th:nth-child(4),.tb-users td:nth-child(4),
  .tb-users th:nth-child(5),.tb-users td:nth-child(5){padding-left:3px;padding-right:3px}
  .tb-users th:nth-child(1),.tb-users td:nth-child(1),.tb-users th:last-child,.tb-users td:last-child{padding-left:8px;padding-right:8px}
  /* 手机上「改密 / 删除」收进「编辑」弹窗里 */
  .tb-users .us-pw,.tb-users .us-del{display:none}
  .tb-users .lastlog{display:none}
  /* 录制中心表格: 手机上隐藏「本场时长 / 最近场次」(操作列必须完整可见), 主播名单行省略 */
  .tb-rec .c-dur,.tb-rec .c-last{display:none}
  .tb-rec td:first-child b{display:block;max-width:96px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .tb-rec .badge{padding:2px 8px;font-size:11px}
  .tb-rec td:last-child .btn.sm{padding:0 8px;font-size:12px}
  .tb-rec td:last-child .btn.sm + .btn.sm{margin-left:4px}
  /* 下载中心表格: 隐藏「有效期 / 分享码」两列(有效期改到文件名下方显示), 操作列只留 下载/删除 */
  .tb-dl .c-exp,.tb-dl .c-code{display:none}
  .tb-dl .m-exp{display:flex;flex-wrap:wrap;gap:7px;align-items:center;margin-top:7px}
  .tb-dl .ftitle{display:block;max-width:min(128px,34vw);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .tb-dl .fsize{white-space:nowrap}
  .tb-dl td:last-child .btn.sm{padding:0 8px;font-size:12px}
  /* 页头: 手机上标题独占一行, 按钮均分一行 */
  .phead{align-items:center}
  .phead-t{flex:1 0 100%;min-width:0}
  .phead>.btn{flex:1}
  .tb-users td:last-child .btn.sm{padding:0 8px;font-size:12px}
  .tb-users th:last-child,.tb-users td:last-child{padding-right:6px}
  .stat .v small{font-size:11px;display:block;margin:3px 0 0;line-height:1.4}
  .tb .btn.sm{padding:0 10px}
  .vtitle{max-width:min(132px,34vw);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .tb .uid{display:none}
  .tb-tasks td:first-child .tiny,.tb-videos td:first-child .tiny{white-space:normal}
  table.tb th,table.tb td{padding:9px 10px}
  .lrow .th{width:140px}
  #loginView{grid-template-columns:minmax(0,1fr)}
  #loginView .left{display:none}
  #loginView .right{padding:20px}
  .capbox img{height:44px;width:auto;max-width:42vw}
  .tabbar{display:flex;position:fixed;left:0;right:0;bottom:0;z-index:80;
    background:color-mix(in srgb,var(--sf) 92%,transparent);backdrop-filter:blur(18px);
    border-top:1px solid var(--line);padding:5px 4px calc(5px + env(safe-area-inset-bottom))}
  .tabbar a{flex:1;display:flex;flex-direction:column;align-items:center;gap:3px;padding:7px 0 4px;color:var(--dim2);font-size:10.5px;font-weight:600}
  .tabbar a.on{color:var(--brand)}
  body{padding-bottom:calc(62px + env(safe-area-inset-bottom))}
  body[data-screen="login"]{padding-bottom:0}
  .wrap{padding:14px 14px 34px}
  .g4,.g3{grid-template-columns:repeat(2,minmax(0,1fr));gap:13px 11px}
  .f2,.f3{grid-template-columns:1fr;gap:11px}
  .lrow{display:grid;grid-template-columns:104px minmax(0,1fr);gap:11px;padding:10px}
  .lrow.plain{display:flex;padding:14px 15px}
  .lrow.plain .info{flex:1}
  .lrow.plain .info .t{white-space:normal}
  .lrow.plain .info .m{display:block;margin-top:4px;line-height:1.6}
  .lrow .th{width:104px}
  .lrow .info .t{white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
  .lrow .end{grid-column:1/-1;justify-content:flex-end}
  .topbar{height:56px;padding:0 12px;gap:9px}
  .brand{font-size:16px}
  .uchip .nm{display:none}
  .pgrid{grid-template-columns:minmax(0,1fr);gap:18px}
  /* 手机上底部控件条常显且可点，免得以为没有控制条（桌面保持自动隐藏） */
  .pstage .art-video-player .art-bottom{opacity:1 !important;visibility:visible !important;pointer-events:auto !important}
  .pstage .art-video-player .art-progress{bottom:40px !important}
  .pstage .art-video-player .art-bottom{background:linear-gradient(transparent,rgba(0,0,0,.65)) !important}
  /* 播放器不再通栏(2026-10-06 用户反馈「左右两边有点顶边」): 恢复版心内边距+圆角卡片 */
  .pstage{border-radius:14px;width:100%;margin-left:0;margin-right:0}
  .ptitle{font-size:18px}
  .pbar .btn{flex:1}
  /* 输入框 16px: iOS Safari 对 <16px 的输入框聚焦时会整页放大, 这是防缩放的标准做法 */
  .fld input,.capbox input,.f input,.f select,.f textarea{font-size:16px}
  /* 私信页(2026-10-06): 聊天页撑满视口剩余高度, 输入框贴住 tabbar 顶边(微信式布局) */
  body[data-screen="chat"] .wrap{padding-bottom:10px}
  .chat-page{height:calc(100vh - 150px);height:calc(100dvh - 150px - env(safe-area-inset-bottom));min-height:300px}
  .chat-page .tiny{text-align:center}
  /* 弹窗: 手机上贴底弹出(类 bottom-sheet), 按钮整行更好按, 避开小黑条 */
  .modal-mask{place-items:end center;padding:0}
  .modal-panel{max-height:88dvh;padding:16px 16px calc(16px + env(safe-area-inset-bottom));
    border-radius:18px 18px 0 0;width:100%}
  #modalBtns{gap:8px}
  #modalBtns .btn{flex:1;min-height:42px}
}
#toast{position:fixed;left:50%;bottom:90px;transform:translateX(-50%) translateY(20px);z-index:300;
  background:rgba(20,24,33,.96);color:#fff;padding:11px 20px;border-radius:12px;font-size:14px;
  opacity:0;pointer-events:none;transition:.25s;max-width:80vw;text-align:center}
#toast.on{opacity:1;transform:translateX(-50%) translateY(0)}


/* ---- 小屏手机档(≤480px): 再收一档密度 ---- */
@media(max-width:480px){
  .wrap{padding:12px 12px 30px}
  .topbar{height:54px;padding:0 10px}
  .statgrid{gap:10px}
  .stat{padding:12px 13px}
  table.tb th,table.tb td{padding:8px}
  #toast{bottom:calc(80px + env(safe-area-inset-bottom));max-width:88vw;font-size:13px;padding:10px 16px}
  /* 私信页微调: 输入框+说明行整体沉底, 聊天页底边几乎贴住 tabbar 顶(差值≈说明行高) */
  .chat-page{height:calc(100vh - 148px);height:calc(100dvh - 148px - env(safe-area-inset-bottom));min-height:280px}
  .chat-head{padding:8px 10px}
  .chat-msgs{padding:12px 10px;gap:8px}
  .chat-input{padding:8px 10px;gap:7px}
  .bub{max-width:82%;font-size:14px}
}

/* ---- 超小屏手机档(≤360px): 录播卡单列 + 更紧的密度(2026-10-06) ---- */
@media(max-width:360px){
  .wrap{padding:11px 10px 26px}
  .topbar{height:52px;padding:0 8px;gap:7px}
  .brand{font-size:15px}
  /* 观看页录播卡: 320~360 宽下两列每张不足 165px, 文字全挤没了 → 单列 */
  .g4{grid-template-columns:minmax(0,1fr)}
  .statgrid{gap:8px}
  .stat{padding:10px 11px}
  .stat .v{font-size:19px}
  .tabbar a{font-size:9.5px;gap:2px}
  .tabbar a svg{width:19px;height:19px}
  .lrow .th{width:96px}
  /* 私信页再收一档 */
  .chat-head{padding:8px}
  .chat-msgs{padding:10px 8px}
  .chat-input{padding:8px}
  .bub{max-width:84%;font-size:14px}
  .modal-panel{padding:14px 13px calc(14px + env(safe-area-inset-bottom))}
}

/* ---- 桌面档(>900px): 环境光背景 + 更宽的版心 ---- */
@media(min-width:901px){
  .wrap{max-width:1320px}
  body{background-image:
    radial-gradient(1200px 560px at 12% -8%,color-mix(in srgb,var(--brand) 5%,transparent),transparent),
    radial-gradient(900px 500px at 108% 108%,color-mix(in srgb,#7c5cff 5%,transparent),transparent)}
}
