/* recommendations.js 专用样式（2026-10-12 界面改版）。通用组件和设计变量在 app.css；这里只放本页独有的类，覆盖通用类时用 [data-view=…] 限定。 */

/* 卡片头的频道下拉用 app.css 的小号控件；编辑推荐的下拉在有未保存修改时选项变成“男频（未保存）”，按最长的选项给最小宽度，
   宽度不随保存状态跳动（为你推荐预览的频道下拉同宽） */
[data-view=recommendations] .card-header>select{min-width:132px}

/* 推荐效果：合计行浅底加粗；数字列靠右、等宽，便于上下对比（与收款核验、运营数据的日报表一致） */
.rec-daily td{font-variant-numeric:tabular-nums}
.rec-daily td:first-child{white-space:nowrap}
.rec-daily :is(th,td):not(:first-child){text-align:right;white-space:nowrap}
.rec-daily tbody tr:first-child>td{background:var(--surface-2);font-weight:600;color:var(--text)}
.rec-daily-note{padding-top:12px;padding-bottom:12px}
.rec-daily-note .form-hint{margin:0}

/* 运营推荐位：多行单元格顶端对齐；修改/取消并排不叠成两行 */
.rec-slots td{vertical-align:top;text-wrap-style:pretty}
.rec-slots td .badge{margin-top:1px}
.rec-slots td.rec-slot-book{min-width:184px}
/* 时间的起止两端（.rec-when）各自不断行，只在“至”前后换行 */
.rec-slots td.rec-slot-place{white-space:nowrap}
.rec-slots td.rec-slot-when{min-width:184px;font-variant-numeric:tabular-nums}
.rec-when{white-space:nowrap}
.rec-slots td.rec-slot-note{min-width:180px}
.rec-slots td:is(.rec-slot-state,.rec-slot-actions){white-space:nowrap}
.rec-slots td .table-actions{flex-wrap:nowrap}
/* 屏蔽名单（2026-11-11）：一行标题（部数、前几本书名、展开）；展开后搜索框在上，列表在卡片里滚动（.long-list）。
   置顶表在上面时用一条细线隔开 */
.rec-blocks{border-top:1px solid var(--separator)}
.rec-slot-lists>.rec-blocks:first-child{border-top:0}
.rec-blocks-head{display:flex;align-items:center;gap:10px;padding:12px 20px;min-width:0}
.rec-blocks-head>strong{color:var(--text);white-space:nowrap}
.rec-blocks-sub{font-size:12px;color:var(--muted);white-space:nowrap}
.rec-blocks-titles{flex:1;min-width:0;font-size:13px;color:var(--text-2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rec-blocks-head>.button{margin-left:auto;flex-shrink:0}
.rec-blocks-tools{display:flex;align-items:center;gap:12px;padding:0 20px 12px}
.rec-blocks-tools input{max-width:320px;margin:0}
.rec-blocks-found{font-size:12px;color:var(--muted);white-space:nowrap}
.rec-blocks-none{margin:0;padding:4px 20px 16px;font-size:13px;color:var(--muted)}
.rec-blocks-body>.table-scroll{border-top:1px solid var(--separator)}
@media (max-width:760px){.rec-blocks-head{flex-wrap:wrap}.rec-blocks-titles{flex-basis:100%;order:3;white-space:normal}}

/* 编辑推荐：表格嵌在卡片内容区里，一圈细线、12px 圆角收边（2026-11-24 iOS 风格，同 .ios-list 的描边）；空状态是灰色填充块，不再是虚线框 */
.rec-editor .card-body>.toolbar{margin-bottom:14px}
.rec-editor .card-body>.table-scroll{border:0;border-radius:12px;box-shadow:0 0 0 1px var(--separator)}
.rec-editor .card-body>.empty{padding:28px 20px;border:0;border-radius:12px;background:var(--field-bg)}
.rec-editor .card-body>.notice{margin:0 0 12px}
.rec-editor td:nth-child(1){width:64px;color:var(--muted);font-variant-numeric:tabular-nums}
.rec-editor td:nth-child(2){min-width:220px}
.rec-editor td:nth-child(3){white-space:nowrap}
.rec-editor td:nth-child(3) .table-actions{flex-wrap:nowrap}
.rec-editor td:nth-child(4){min-width:240px}
.rec-editor td:nth-child(5) .table-actions{flex-wrap:nowrap}
/* 读者当前看到的：浅底分区，和上面可编辑的列表区分开 */
.rec-shown{margin-top:20px;padding:16px 18px;border:0;border-radius:14px;background:var(--field-bg)}
.rec-shown>h3{margin:0 0 4px}
.rec-shown>.form-hint{margin:0 0 10px}
.rec-shown>.preview-list{margin:0}
.rec-shown>.muted{margin:0}

/* 官网精选（2026-10-15）：与编辑推荐同样的版式，表格嵌在卡片内容区里，加细边框和圆角收边；四列（顺序、作品、状态、操作），
   状态列的“上架/未上架”“无封面”两个标签并排不换行 */
[data-view=recommendations] .rec-site .card-body>.toolbar{margin-bottom:14px}
[data-view=recommendations] .rec-site .card-body>.table-scroll{border:0;border-radius:12px;box-shadow:0 0 0 1px var(--separator)}
[data-view=recommendations] .rec-site .card-body>.empty{padding:28px 20px;border:0;border-radius:12px;background:var(--field-bg)}
[data-view=recommendations] .rec-site .card-body>.notice{margin:0 0 12px}
[data-view=recommendations] .rec-site td:nth-child(1){width:64px;color:var(--muted);font-variant-numeric:tabular-nums}
[data-view=recommendations] .rec-site td:nth-child(2){min-width:220px}
[data-view=recommendations] .rec-site td:nth-child(3){white-space:nowrap}
[data-view=recommendations] .rec-site td:nth-child(n+3) .table-actions{flex-wrap:nowrap}
/* 2026-11-12：电脑上运营推荐位、编辑推荐、官网精选三张表的操作列都只占按钮的宽度、靠在表格右边，多出来的宽度给前面的列；
   原来各列平分，宽屏上按钮悬在表格中间，三张表的按钮也不在一条线上 */
@media (min-width:761px){
  [data-view=recommendations] .rec-site :is(th,td):nth-child(4),.rec-editor :is(th,td):nth-child(5),.rec-slots .rec-slot-lists :is(th,td):last-child{width:1%}
}

/* 为你推荐预览：每一批之间分隔线，“第 N 批”做成小标签 */
.rec-preview .preview-batch{padding:16px 20px}
.rec-preview .preview-batch+.preview-batch{border-top:1px solid var(--separator)}
.rec-preview .preview-batch h4{display:inline-block;margin:0 0 8px;padding:1px 10px;border-radius:999px;background:var(--fill);color:var(--text-2);font-size:12px;font-weight:600;line-height:1.7}
.rec-preview .preview-list li,.rec-shown .preview-list li{color:var(--muted)}
.rec-preview .preview-list strong,.rec-shown .preview-list strong{color:var(--text)}

/* 作品推荐分：13 列，表头允许换行、列内边距收紧，桌面不必横向滚动 */
/* 2026-10-25 起每页 20 本、服务端查找和排序（book-picker.js 的查找表）：13 列（作品、推荐分、转化、七项排位、30 天展示/点击、标记、操作）。
   表格嵌在卡片内容区里，加细边框和圆角收边，不用查找表在弹窗里的限高；操作列固定在右侧（同 app.css 的 .sticky-actions） */
.rec-books .book-picker-table{max-height:none;border:0;border-radius:12px;box-shadow:0 0 0 1px var(--separator)}
/* 2026-11-12（docs/admin-page-layout.md）：一页 20 本有一千四百多像素高，下面还压着推荐效果、预览、AI 找书和算法参数四张卡片。电脑上
   表格在卡片里滚动、表头不动（同 app.css 的 .long-list，高度一样），翻页和下面的卡片不用滚很远；手机上不套两层滚动。行距也收紧一些 */
@media (min-width:761px){
  .rec-books .book-picker-table{max-height:560px}
  .rec-books .book-picker-table thead th{position:sticky;top:0;z-index:2}
  .rec-books .book-picker-table thead th:last-child{z-index:3}
}
.rec-books .book-picker-table td{padding-top:9px;padding-bottom:9px}
.rec-books th:nth-child(-n+3),.rec-books th:nth-child(n+11){white-space:nowrap}
.rec-books th,.rec-books td{padding-left:10px;padding-right:10px}
.rec-books th:first-child,.rec-books td:first-child{padding-left:16px;min-width:192px}
.rec-books td:first-child{overflow-wrap:anywhere}
.rec-books th:last-child,.rec-books td:last-child{padding-right:16px}
.rec-books td{font-variant-numeric:tabular-nums}
/* 七项排位列收窄、灰字，表头允许换行 */
.rec-books th:nth-child(n+4):nth-child(-n+10){min-width:62px;white-space:normal;text-wrap:balance;line-height:1.35;vertical-align:bottom}
.rec-books td:nth-child(n+4):nth-child(-n+10){color:var(--muted)}
.rec-books td:nth-child(11),.rec-books td:nth-child(13){white-space:nowrap}
.rec-books .book-picker-table :is(th,td):last-child{position:sticky;right:0;z-index:1}
.rec-books .book-picker-table td:last-child{background:var(--surface)}
.rec-books .book-picker-table tbody tr:hover>td:last-child{background:var(--row-hover)}
.rec-books .card-body>.notice{margin:0 0 14px}

/* 选书（2026-10-25）：查找表的标记一格内换行排开；转化下方小字“高于/低于平均”，推荐分下方小字“加权后”（2026-11-02，有流量包时，与“流量包”标记同色）；对话框里“作品”小标题与其他字段的标签同样式 */
.rec-marks{display:flex;flex-wrap:wrap;gap:4px;max-width:220px}
.rec-conversion,.rec-score{white-space:nowrap}
.rec-conversion>strong,.rec-score>strong{display:block}
.rec-conversion>.table-sub,.rec-score>.table-sub{white-space:nowrap}
.rec-score .rec-boosted{color:var(--info)}
.rec-conversion .rec-above{color:var(--success)}
.rec-conversion .rec-below{color:var(--muted)}
/* 作品更新状态（2026-11-15，docs/admin-book-update-status.md）：查找表多“更新”一列，推荐位、编辑推荐、官网精选的每一行带状态标签（样式在 book-picker.css 的 .book-update）；正在推荐却很久没更新的作品列在页面最上面的提醒卡片里。 */
.rec-field-label{display:block;margin-bottom:6px;font-size:13px;line-height:var(--label-h);color:var(--text-2);font-weight:600}
.rec-book-field{display:grid;grid-template-columns:minmax(0,1fr);gap:12px;min-width:0}
.rec-book-field>.rec-field-label{margin-bottom:-6px}
.rec-tool select{width:100%}
/* 作品管理的作品详情里“推荐”一行（management.js bookRecommend）：三个按钮并排，窄屏换行 */
.book-recommend{display:inline-flex;flex-wrap:wrap;align-items:center;gap:8px}

/* AI 挑书（2026-10-25）：浅底分区，标题与按钮一行；说明小字；结果表三列（作品与 AI 理由、关键数字、操作），关键数字两列小字 */
.rec-ai{display:grid;grid-template-columns:minmax(0,1fr);gap:10px;padding:14px 16px;border:0;border-radius:14px;background:var(--field-bg);min-width:0}
.rec-ai-head{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px 14px}
.rec-ai .rec-ai-head>h3{margin:0;font-size:15px}
.rec-ai>.rec-ai-note{margin:0;text-wrap-style:pretty}
.rec-ai-status:empty,.rec-ai-results:empty{display:none}
.rec-ai-status>.notice{margin:0}
.rec-ai-status>.loading-line{padding:14px}
.rec-ai-summary{margin:0;color:var(--text-2);font-size:13px}
.rec-ai .rec-ai-ranked{margin:10px 0 0;font-size:13px;color:var(--text-2)}
.rec-ai-results>.table-scroll{border:0;border-radius:12px;background-color:var(--surface)}
.rec-ai-results .table-scroll table{min-width:560px}
.rec-ai-book{min-width:220px}
.rec-ai-reason{margin:6px 0 0;color:var(--text);font-size:13px;line-height:1.6;max-width:420px;text-wrap-style:pretty}
.rec-ai-grounds{display:flex;flex-wrap:wrap;align-items:center;gap:4px;margin-top:6px;color:var(--muted);font-size:12px}
.rec-ai-figures{display:grid;grid-template-columns:max-content max-content;justify-content:start;gap:2px 12px;margin:0;font-size:12px;font-variant-numeric:tabular-nums;white-space:nowrap}
.rec-ai-figures dt{color:var(--muted);font-weight:400}
.rec-ai-figures dd{margin:0;color:var(--text)}
.rec-ai-action{white-space:nowrap}
.rec-ai-action .table-sub{white-space:normal;max-width:120px}

/* 算法参数：表单直接作为卡片内容，需要自己的内边距。2026-11-24 iOS 风格：总开关一组，其余每组一个 iOS 分组列表（glass.css .ios-list），
   组名是列表上方的小标题，权重的说明在列表下面 */
[data-view=recommendations] .card>.settings-form,[data-view=recommendations] .card>.fold-body>.settings-form{padding:20px}
.rec-settings-form>.form-hint{margin:8px 4px 0}
/* 数字组（.ios-list.cols-2）宽屏两项一行，在 glass.css */
.rec-settings-form>.form-actions{margin-top:18px}

/* 推荐位排期（2026-10-22）：编辑推荐、官网精选每一行书名下方一行排期摘要（“排期 N 段”蓝标签 + 现在展示/下一段），
   列表下方的说明与提示和上面的表格隔开 */
.rec-rotation-line{margin-top:6px;color:var(--text-2);font-size:13px;line-height:1.55;text-wrap-style:pretty}
.rec-rotation-line .button.link{margin-left:2px;font-size:13px}
/* 排期开始后这一行显示当天生效的书，原来挑的那本写在下面一行（2026-10-26） */
.rec-picked-line{margin-top:4px;color:var(--muted);font-size:12px;line-height:1.5;overflow-wrap:anywhere}
:is(.rec-editor,.rec-site) .card-body>.rec-rotation-hint{margin:12px 0 0}
/* 排期弹窗：说明、时间线表格（嵌细边框；日期列不换行，重叠的段浅红底）、表格下“之后一直展示”的小字、添加/修改一段的表单
   （开始与结束日期两两并排，上方分隔线），“完成”在吸底的 .dialog-footer 里（app.css） */
.rec-rotation>.form-hint:first-child{margin:0 0 14px;text-wrap-style:pretty}
.rec-rotation>.table-scroll{border:0;border-radius:12px;box-shadow:0 0 0 1px var(--separator)}
.rec-rotation>.empty{padding:24px 20px;border:0;border-radius:12px;background:var(--field-bg)}
.rec-rotation>.rec-rotation-after{margin:8px 0 0}
.rec-rotation>.notice{margin:14px 0 0}
.rec-rotation>.table-scroll td:first-child{white-space:nowrap;font-variant-numeric:tabular-nums}
.rec-rotation>.table-scroll td:nth-child(2){min-width:180px}
/* 这些只管时间线表格（.rec-rotation>.table-scroll），不管下面表单里的查找表。推荐语列不窄于一行短语；状态列（“生效中（接着展示）”和“无封面”等标签）不换行，免得钻到固定在右侧的操作列下面 */
.rec-rotation>.table-scroll td.rec-rotation-note{min-width:128px}
.rec-rotation>.table-scroll td.rec-rotation-state{white-space:nowrap}
.rec-rotation>.table-scroll td .table-actions{flex-wrap:nowrap}
.rec-rotation>.table-scroll tr.rec-conflict>td{background:var(--danger-soft)}
.rec-rotation-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 18px;align-items:start;margin-top:20px;padding-top:18px;border-top:1px solid var(--separator)}
.rec-rotation-form>*{grid-column:1/-1;margin:0}
.rec-rotation-form>.grid-two{display:contents}
.rec-rotation-form>.grid-two>label{grid-column:auto}
.rec-rotation-form>h3{margin:0}
.rec-rotation>.dialog-footer{align-items:center}
.rec-rotation>.dialog-footer>.form-hint{margin:0 auto 0 0}

/* 新增/修改推荐位弹窗：方式与置顶位置、开始与结束时间两两并排；选“屏蔽”时方式占满整行 */
.rec-slot-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 18px;align-items:start}
.rec-slot-form>*{grid-column:1/-1;margin:0}
.rec-slot-form>.grid-two{display:contents}
.rec-slot-form>.grid-two>label,.rec-slot-form>label:nth-child(2),.rec-slot-form>label:nth-child(3){grid-column:auto}
.rec-slot-form>label:nth-child(2):has(+label[hidden]){grid-column:1/-1}
.rec-slot-form>.form-actions{margin-top:6px}

/* 添加编辑推荐/官网精选弹窗（2026-10-25 起 1120px 宽）：AI 推荐在最上面，下面是已选数量和查找表（book-picker.js：结果多时表格自己滚动，
   查找框留在表格上方）；“完成”在吸底的 .dialog-footer 里（app.css） */
.rec-add{display:grid;grid-template-columns:minmax(0,1fr);gap:14px;min-width:0}
.rec-add>.form-hint{margin:0;text-wrap-style:pretty}
.rec-add>.rec-add-legend{font-size:12px}
.rec-add .book-picker-table{border:0;border-radius:12px;box-shadow:0 0 0 1px var(--separator)}
.rec-add .book-picker-table table{min-width:900px}
.rec-add .book-picker-table td:nth-child(n+2):nth-child(-n+7){white-space:nowrap}
.rec-add .empty{padding:28px 20px;border:0;border-radius:12px;background:var(--field-bg)}
/* 运营推荐位、排期弹窗里的查找表列少一些 */
:is(.rec-slot-form,.rec-rotation-form) .book-picker-table table{min-width:640px}
:is(.rec-slot-form,.rec-rotation-form) .book-picker-table td:nth-child(n+2):nth-child(-n+5){white-space:nowrap}

/* 1280 以下推荐位、作品推荐分（最小约 970px）、编辑推荐和官网精选几张表要横向滑动：表格外层加了 .sticky-actions（recommendations.js），
   上移/下移/移除、修改/取消、置顶/屏蔽所在的操作列固定在右侧（app.css） */
@media(max-width:1080px){
  /* 卡片头的频道下拉是 app.css 的小号控件（30px、宽度随内容）；平板宽度下本页说明文字很长：下拉换到说明下方，不把说明挤成一条窄列 */
  [data-view=recommendations] .card-header:has(>select){flex-wrap:wrap}
}
@media(max-width:760px){
  /* 手机上频道下拉在说明下方占满整行（app.css 卡片头控件默认宽度随内容） */
  [data-view=recommendations] .card-header>select{width:100%}
  [data-view=recommendations] .card>.settings-form,[data-view=recommendations] .card>.fold-body>.settings-form{padding:16px}
  .rec-slot-form,.rec-rotation-form{grid-template-columns:minmax(0,1fr)}
  /* 排期弹窗的时间线在手机上不横向滚动：不用 app.css 表格的最小宽度，日期在“至”前后换行，书名换行，状态标签和操作按钮可换行 */
  .rec-rotation>.table-scroll table{min-width:0}
  .rec-rotation>.table-scroll :is(th,td){padding-left:8px;padding-right:8px}
  .rec-rotation>.table-scroll :is(th,td):first-child{padding-left:12px}
  .rec-rotation>.table-scroll td:first-child{white-space:normal;min-width:64px}
  .rec-rotation>.table-scroll td:nth-child(2){min-width:72px;overflow-wrap:anywhere}
  .rec-rotation>.table-scroll td.rec-rotation-note{min-width:0}
  .rec-rotation>.table-scroll td.rec-rotation-state{white-space:normal}
  .rec-rotation>.table-scroll td .table-actions{flex-wrap:wrap}
  .rec-rotation>.table-scroll td .badge{white-space:normal;border-radius:8px}
  .rec-shown{padding:14px}
  .rec-preview .preview-batch{padding:14px 16px}
  /* 很长的推荐理由标签在手机上允许换行，不撑出屏幕 */
  .rec-preview .preview-list .badge,.rec-shown .preview-list .badge{white-space:normal;border-radius:8px}
  /* AI 挑书在手机上：内边距收窄，按钮在标题下方占满一行 */
  .rec-ai{padding:12px}
  .rec-ai-head>.button{width:100%}
  /* 手机上编辑推荐表：顺序列收窄；固定在右侧的操作列按钮排两行，少占可视宽度 */
  .rec-editor th:first-child,.rec-editor td:first-child{width:44px;padding-left:14px;padding-right:6px}
  .rec-editor td:nth-child(5) .table-actions{flex-wrap:wrap}
  .rec-editor td:nth-child(5){min-width:116px}
  /* 官网精选表只有四列，手机上不用 app.css 表格的 760px 最小宽度：顺序列收窄，作品列不再要求 220px，状态的两个标签上下排，
     操作列按钮换行，整表尽量放进屏幕，状态列不被固定在右侧的操作列盖住 */
  [data-view=recommendations] .rec-site .table-scroll table{min-width:0}
  [data-view=recommendations] .rec-site :is(th,td):first-child{width:36px;padding-left:12px;padding-right:4px}
  [data-view=recommendations] .rec-site :is(th,td):nth-child(n+2){padding-left:8px;padding-right:8px}
  [data-view=recommendations] .rec-site td:nth-child(2){min-width:96px;overflow-wrap:anywhere}
  [data-view=recommendations] .rec-site td:nth-child(3) .table-actions,[data-view=recommendations] .rec-site td:nth-child(4) .table-actions{flex-wrap:wrap}
  [data-view=recommendations] .rec-site td:nth-child(4){width:1%;min-width:104px}
  /* 手机上查找表在框内横向滑动（“添加”“选择”所在的操作列固定在右侧，book-picker.js 加了 .sticky-actions），列内边距收紧 */
  :is(.rec-add,.rec-slot-form,.rec-rotation-form,.rec-books) .book-picker-table :is(th,td){padding-left:8px;padding-right:8px}
  :is(.rec-add,.rec-slot-form,.rec-rotation-form,.rec-books) .book-picker-table :is(th,td):first-child{padding-left:12px;min-width:150px}
  /* AI 挑书的结果只有三列：手机上整表放进屏幕，不横向滑动，书名和理由换行 */
  .rec-ai-results .table-scroll table{min-width:0}
  .rec-ai-results :is(th,td){padding-left:8px;padding-right:8px}
  .rec-ai-results :is(th,td):first-child{padding-left:12px}
  .rec-ai-book{min-width:0;overflow-wrap:anywhere}
  .rec-ai-figures{gap:1px 6px}
}
