/* ===== 服务器版新增样式（前台和后台共用） ===== */
/* 分类栏：一行，放不下时左右滑动；放得下时居中 */
.movie-categories,.admin-cat-tabs{flex-wrap:nowrap!important;overflow-x:auto;justify-content:flex-start!important;scrollbar-width:thin;-webkit-overflow-scrolling:touch;scroll-snap-type:x proximity}
.movie-categories>:first-child,.admin-cat-tabs>:first-child{margin-left:auto}
.movie-categories>:last-child,.admin-cat-tabs>:last-child{margin-right:auto}
.movie-category,.admin-cat-tab{flex:0 0 auto!important;white-space:nowrap;scroll-snap-align:start}
.movie-categories{padding:2px 2px 8px}
@media(max-width:460px){.movie-category{min-width:auto;padding:9px 16px}}
/* 加载更多 / 空状态 / 加载中 */
.load-more{display:flex;justify-content:center;margin:26px 0 0}
.load-more .btn{min-width:180px}
.loading-line{text-align:center;color:var(--muted);padding:30px 0}
.media-thumb.placeholder{display:grid;place-items:center;color:#8f88b3;font-size:34px;background:linear-gradient(130deg,#3a3155,#24304a)}
.video-frame{max-height:min(70vh,560px)}
.dialog.video-modal{max-width:900px}
.err-box{border:1px solid #6b3a48;background:#2a1820;color:#f5b6c0;border-radius:12px;padding:16px;text-align:center;margin:20px auto;max-width:520px}
/* 后台：登录 */
.login-wrap{min-height:calc(100vh - 60px);display:grid;place-items:center;padding:24px 16px}
.login-card{width:100%;max-width:380px}
.login-card h1{font-size:22px;text-align:center;margin:0 0 18px}
.login-card .btn{width:100%;margin-top:6px}
.login-err{color:#f5a0a8;font-size:13px;min-height:18px;text-align:center;margin-top:10px}
.header-right{display:flex;align-items:center;gap:8px}
.header-right .who{color:var(--muted);font-size:12px}
/* 后台：搜索、筛选、分页 */
.list-tools{display:flex;gap:8px;flex-wrap:wrap;justify-content:center;margin:0 0 14px}
.list-tools .input{max-width:260px;padding:10px 12px}
.list-tools .select{padding:10px}
.pager{display:flex;gap:6px;justify-content:center;align-items:center;flex-wrap:wrap;margin:16px 0 0}
.pager .btn{min-width:38px;padding:7px 10px;min-height:34px;font-size:13px}
.pager .btn.cur{background:var(--purple);border-color:var(--purple)}
.pager .info{color:var(--muted);font-size:12px;margin:0 6px}
/* 后台：上传进度 */
.progress{margin-top:10px;display:none}
.progress.on{display:block}
.progress .bar{height:10px;background:#10131d;border:1px solid #444860;border-radius:999px;overflow:hidden}
.progress .bar i{display:block;height:100%;width:0;background:linear-gradient(90deg,var(--purple),var(--purple2));transition:width .2s}
.progress .txt{font-size:12px;color:#cdd2e3;margin-top:6px;display:flex;justify-content:space-between;gap:8px;flex-wrap:wrap}
.form-msg{font-size:13px;color:#f5a0a8;min-height:18px;text-align:center;margin-top:8px}
.storage-note{font-size:12px;color:var(--muted);text-align:center;margin-top:10px}
td .muted-size{color:var(--muted);font-size:12px;white-space:nowrap}
.pill.off{background:#3c2b31;color:#f5b6c0}
/* 后台手机端：表格改为卡片，操作按钮不再被挤出屏幕 */
@media(max-width:640px){
  .admin-body .table-scroll{border:0;overflow:visible}
  .admin-body .table-scroll table{min-width:0}
  .admin-body .table-scroll thead{display:none}
  .admin-body .table-scroll tr{display:block;border:1px solid var(--line);border-radius:12px;background:var(--surface);margin-bottom:10px;padding:8px 10px}
  .admin-body .table-scroll td{display:flex;justify-content:space-between;align-items:center;gap:10px;border:0;padding:6px 2px;background:transparent;text-align:right!important}
  .admin-body .table-scroll td::before{content:attr(data-label);color:var(--muted);font-size:12px;flex:none;text-align:left}
  .admin-body .table-scroll td.cell-main{display:block;text-align:left!important}
  .admin-body .table-scroll td.cell-main::before{display:none}
  .admin-body .table-scroll td.cell-actions{display:block}
  .admin-body .table-scroll td.cell-actions::before{display:none}
  .admin-body .table-scroll td.cell-actions .inline-actions{justify-content:stretch}
  .admin-body .table-scroll td.cell-actions .btn{flex:1}
  .admin-body .overview-daily-table td,.admin-body .overview-daily-table th{text-align:right!important}
  .admin-bet-img{width:100%!important;max-width:none}
  .list-tools .input{max-width:none;flex:1 1 100%}
  .list-tools .select{flex:1}
  .header-right .who{display:none}
}
/* 手机上分类栏可以手指左右滑，不显示滚动条 */
@media(max-width:800px){.movie-categories,.admin-cat-tabs{scrollbar-width:none}.movie-categories::-webkit-scrollbar,.admin-cat-tabs::-webkit-scrollbar{display:none}}
/* ===== 点击排行 ===== */
.movie-category.rank-chip{border-color:#8a6a3a;color:#f3d39b}
.movie-category.rank-chip.active,.movie-category.rank-chip:hover{background:linear-gradient(135deg,#d9a14e,#b9693a);border-color:#e6b569;color:#fff}
.art-card{position:relative}
.art-card .views{font-size:12px;color:var(--muted);margin:-2px 0 10px;text-align:center}
.rank-badge{position:absolute;top:20px;left:20px;z-index:2;min-width:32px;height:32px;padding:0 8px;border-radius:9px;display:grid;place-items:center;font-weight:900;font-size:15px;background:#000a;color:#fff;border:1px solid #fff3;box-shadow:0 4px 14px #0007}
.rank-badge.top1{background:linear-gradient(135deg,#ffd76a,#e09a1f);color:#3a2400;border-color:#ffe7a3}
.rank-badge.top2{background:linear-gradient(135deg,#eef1f6,#a9b1c0);color:#2a2f3a;border-color:#fff}
.rank-badge.top3{background:linear-gradient(135deg,#f0b27a,#b8682f);color:#3a1d06;border-color:#f6cba3}
.rank-card.art-card:has(.top1){border-color:#c99a3c}
.rank-num{display:inline-grid;place-items:center;min-width:26px;height:26px;border-radius:7px;background:#2b3043;font-weight:800}
.rank-num.top1{background:#e0a531;color:#2a1a00}.rank-num.top2{background:#b9c0cc;color:#20242c}.rank-num.top3{background:#c47a3e;color:#2a1405}
.views-num{color:#f3d39b}
@media(max-width:520px){.rank-badge{top:14px;left:14px;min-width:28px;height:28px;font-size:13px}}
.cell-actions [data-reset-views]{white-space:nowrap}
@media(max-width:640px){.admin-body .table-scroll td.cell-actions .inline-actions{flex-wrap:wrap}.admin-body .table-scroll td.cell-actions [data-reset-views]{flex:1 1 100%}}
@media(max-width:640px){.admin-body .table-scroll td[colspan]{display:block;text-align:center!important}.admin-body .table-scroll td[colspan]::before{display:none}}

/* 中转模式：传到服务器后转存到云端 */
.progress.transfer .bar i{background:linear-gradient(90deg,#2fb4a0,#5ee0c8)}
.progress.transfer .txt span:first-child{color:#7ff0dc;font-weight:600}
.progress.transfer .detail{color:#ffd98a}
.progress.done .bar i{background:#2fb4a0}
.progress.done .txt span:first-child{color:#7ff0dc}

/* 前台：片名搜索 */
.movie-search{display:flex;gap:8px;max-width:560px;margin:0 auto 16px}
.movie-search input{flex:1;min-width:0;padding:11px 18px;border-radius:999px;border:1px solid #444860;background:#10131d;color:#f7f6fc;font-size:15px;outline:none}
.movie-search input:focus{border-color:var(--purple);box-shadow:0 0 0 3px rgba(123,86,224,.25)}
.movie-search .btn{border-radius:999px;white-space:nowrap}
.search-info{text-align:center;color:#b8bdd3;font-size:13px;margin:-10px 0 14px}
.search-empty{line-height:1.8}
.video-modal .actions{gap:10px;flex-wrap:wrap}

/* 后台：视频格式提示 */
.format-warn{margin-top:8px;padding:8px 10px;border-radius:10px;background:rgba(255,190,80,.12);border:1px solid rgba(255,190,80,.45);color:#ffd98a;font-size:12px;line-height:1.6;width:100%}
.format-ok{margin-top:6px;color:#7ff0dc;font-size:12px}

/* 后台：批量上传 */
.batch-opts{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.batch-list{display:flex;flex-direction:column;gap:10px;margin-top:12px;max-height:52vh;overflow:auto;padding-right:2px}
.batch-item{display:grid;grid-template-columns:112px 1fr;gap:10px;padding:10px;border:1px solid #444860;border-radius:12px;background:#151824}
.batch-item.err{border-color:#d9667a}.batch-item.ok{border-color:#2fb4a0}
.batch-thumb{width:112px;aspect-ratio:16/9;border-radius:8px;object-fit:cover;background:#10131d}
.batch-main{min-width:0;display:flex;flex-direction:column;gap:6px}
.batch-main input{width:100%;box-sizing:border-box}
.batch-meta{font-size:12px;color:#b8bdd3;display:flex;justify-content:space-between;gap:8px;flex-wrap:wrap}
.batch-state{font-weight:600}.batch-state.ok{color:#7ff0dc}.batch-state.err{color:#ff9aaa}
.batch-item .progress{margin-top:2px}
.batch-actions{display:flex;gap:6px;flex-wrap:wrap}
.batch-actions .btn{padding:5px 10px;font-size:12px}
.batch-summary{margin-top:10px;font-size:13px;color:#cdd2e3}
@media(max-width:560px){.batch-opts{grid-template-columns:1fr}.batch-list{max-height:none;overflow:visible}.batch-item{grid-template-columns:84px 1fr}.batch-thumb{width:84px}}
.copy-fallback{width:100%;box-sizing:border-box;margin-top:12px;padding:10px 14px;border-radius:10px;border:1px solid var(--purple);background:#10131d;color:#f7f6fc;font-size:13px}

/* 长片名（比如直接用文件名 The.Matrix.1999.1080p…）自动换行，不撑宽页面 */
.grid>*,.art-card,.dialog,.batch-main,.admin-media-row,.admin-media-row span,.cat-admin-name,.batch-meta span{min-width:0}
.art-card .title{overflow-wrap:anywhere;word-break:break-word;white-space:normal;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.dialog h2,.cell-main span,.admin-media-row span,td[data-label="电影"],.cat-admin-name strong,.batch-meta span,.batch-state,.bet-name,.who{overflow-wrap:anywhere;word-break:break-word}
.modal-overlay .dialog{max-width:calc(100vw - 18px)}

/* 所有显示用户输入文字的地方（片名、游戏名、网址、分类名、搜索词、提示、文件名）都自动换行，不撑宽页面 */
.search-info,.search-empty,.empty,.err-box,.dialog p,.dialog .small,.form-msg,.login-err,.toast,#toast,.bet-name,.who,.title,.cat-admin-name strong,.admin-body td,.batch-meta span,.batch-state,.format-warn,.format-ok,.hintline,.upload-notice,.upload-media-preview .small{overflow-wrap:anywhere;word-break:break-word}
.admin-body td>*{min-width:0}
.pill,.btn,.admin-cat-tab,.movie-category,th,.views-num,.rank-num{overflow-wrap:normal;word-break:normal}
/* 状态标签、表头、数字不拆行 */
.admin-body .pill,.admin-body th,.admin-body .views-num,.admin-body .muted-size{white-space:nowrap}

/* 后台勾选电影后的批量操作条 */
.batch-bar{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:0 0 14px;padding:10px 12px;background:var(--surface2);border:1px solid var(--line);border-radius:12px}
.batch-bar>span{font-weight:700}
.sel-all{display:inline-flex;align-items:center;gap:8px;cursor:pointer;white-space:nowrap}
.admin-media-row input[type=checkbox]{flex:none;width:18px;height:18px;accent-color:var(--purple)}
.sel-all input[type=checkbox]{width:16px;height:16px;accent-color:var(--purple)}
@media(max-width:640px){.batch-bar{position:sticky;bottom:8px;z-index:5}}
