/* signing.js 专用样式（2026-10-12 界面改版）。通用组件和设计变量在 app.css；这里只放本页独有的类，覆盖通用类时用 [data-view=…] 限定。 */

/* 列表：单元格行数差别大，统一顶端对齐便于横向扫读；按内容给最小列宽，避免“芋/头”这种逐字换行 */
/* text-wrap-style:pretty 让窄列换行时不剩一两个字孤行（只改换行位置，不影响各列的 nowrap） */
.signing-applications td,.signing-offers td,.signing-contracts td{vertical-align:top;text-wrap-style:pretty}
.signing-applications td .badge,.signing-offers td .badge,.signing-contracts td .badge{margin-top:1px}
/* 最小列宽合计约 1050px（1360px 以下约 940px）：1440、1280 宽的屏幕上 8 列都不用横向滚动，多出的宽度由表格按内容分配 */
.signing-applications td:nth-child(1){min-width:140px}
.signing-applications td:nth-child(2){min-width:132px}
.signing-applications td:nth-child(3),.signing-applications td:nth-child(4){white-space:nowrap}
.signing-applications .signing-words{white-space:nowrap}
.signing-applications td:nth-child(5){min-width:148px;max-width:340px}
.signing-applications td:nth-child(5) .readable-note{display:block;font-size:13px;line-height:1.7;color:var(--text-2)}
.signing-applications td:nth-child(6){min-width:100px;color:var(--muted);font-variant-numeric:tabular-nums}
.signing-applications td:nth-child(7){min-width:176px}
/* 操作列放得下“由编辑“青梧”处理”一行；更长的编辑名换行时由上面的 pretty 避免孤字 */
.signing-applications td:nth-child(8){min-width:128px}
.signing-applications td:nth-child(8) .table-sub{max-width:120px}

/* 第 5 列“电子签”（2026-10-16）：状态和君子签 APL 编号（等宽字，在任意处换行）；发起、签署时间在悬停提示里 */
.signing-offers td:nth-child(1){min-width:116px}
.signing-offers td:nth-child(2){min-width:176px}
.signing-offers td:nth-child(3),.signing-offers td:nth-child(4),.signing-offers td:nth-child(10){white-space:nowrap}
.signing-offers td:nth-child(5){min-width:108px}
.signing-offers td:nth-child(5) .mono{word-break:break-all;max-width:160px}
.signing-offers td:nth-child(6),.signing-offers td:nth-child(7),.signing-offers td:nth-child(8){min-width:96px;font-variant-numeric:tabular-nums}
.signing-offers td:nth-child(7),.signing-offers td:nth-child(8){color:var(--muted)}
.signing-offers td:nth-child(9){min-width:136px}
.signing-offers td:nth-child(9) .readable-note{display:block;font-size:13px;line-height:1.7}
/* 操作列“立即查询”和“撤回”上下排，不把表格撑宽 */
.signing-offers td:nth-child(10) .table-actions{flex-direction:column;align-items:flex-start}

/* 电子签需处理（2026-10-16）：5 列；说明列两段（发生了什么、怎么处理），合同编号、APL 编号和电子签记录编号用等宽字、任意处换行 */
.signing-attention td{vertical-align:top;text-wrap-style:pretty}
.signing-attention td .badge{margin-top:1px}
.signing-attention td:nth-child(1){min-width:120px}
.signing-attention td:nth-child(2){min-width:150px}
.signing-attention td:nth-child(3){min-width:280px;max-width:460px}
.signing-attention td:nth-child(3) .readable-note{display:block;line-height:1.7}
.signing-attention td:nth-child(3) .signing-attention-todo{margin-top:6px;color:var(--text)}
.signing-attention td:nth-child(4){min-width:170px}
.signing-attention td:nth-child(4) .mono{word-break:break-all;max-width:220px}
/* 操作列“标记已处理”和“立即查询”上下排，不把表格撑宽 */
.signing-attention td:nth-child(5){white-space:nowrap}
.signing-attention td:nth-child(5) .table-actions{flex-direction:column;align-items:flex-start}
.signing-attention td:nth-child(5) .table-sub{white-space:normal;max-width:112px}
/* 邀请列表“电子签”列、已签合同“签约方式”列里的“需处理”标记另起一行 */
.signing-attention-flag{display:block;margin-top:4px}
.signing-resolve-form textarea{min-height:96px}

/* 合同编号用等宽字，便于核对 */
.signing-contracts td:nth-child(1){font-family:var(--mono);font-size:12px;white-space:nowrap;color:var(--text)}
.signing-contracts td:nth-child(2){min-width:104px}
.signing-contracts td:nth-child(3){min-width:176px}
/* 第 4 列“签约方式”（2026-10-16）：勾选同意或电子签名（APL 编号在合同全文弹窗里） */
.signing-contracts td:nth-child(4){white-space:nowrap}
.signing-contracts td:nth-child(5),.signing-contracts td:nth-child(6),.signing-contracts td:nth-child(7),.signing-contracts td:nth-child(9),.signing-contracts td:nth-child(10){white-space:nowrap}
.signing-contracts td:nth-child(5){font-variant-numeric:tabular-nums}
.signing-contracts td:nth-child(8){min-width:140px;font-variant-numeric:tabular-nums}
/* 操作列：“查看全文”“下载签署文件”并排；未保全时的说明换行显示在按钮下 */
.signing-contracts td:nth-child(10) .table-sub{white-space:normal;max-width:132px}
/* 作者自助签约（2026-10-20）：状态列“终止于”的时间换行显示，不把表格撑宽；只有超级管理员能看全文时的说明给足宽度，不逐字换行 */
.signing-contracts td:nth-child(9) .table-sub{white-space:normal;max-width:120px}
.signing-contracts .signing-contract-locked{min-width:88px}
/* 申请列表作品列下的“已签非独家（自助）”：内边距收一点，1366 宽时不把作品列撑宽 */
.signing-applications [data-book-contract]{padding:1px 7px}

/* 投稿编辑：只有 4 个短列，不需要通用表格的 760px 最小宽度（手机上直接放下）；操作列收窄，状态列不换行 */
/* 实习编辑的 A 类提签申请（2026-11-02） */
.signing-approvals-title{margin:16px 20px 8px;font-size:14px;font-weight:600;color:var(--text-2)}
.signing-approvals td:last-child{width:1%;white-space:nowrap}
.signing-editors .table-scroll table{min-width:0}
.signing-editors td:nth-child(3){white-space:nowrap}
.signing-editors th:last-child,.signing-editors td:last-child{width:1%;white-space:nowrap}
/* 联系编辑（2026-11-02）：“修改”“联系方式”并排，卡片右上角“我的联系方式”“新增编辑”一行；联系方式列的种类另起一行 */
.signing-editors .row-actions{display:flex;flex-wrap:wrap;align-items:center;gap:6px}
.signing-editors td .table-sub{display:block}

/* 签约条款：表单直接作为卡片内容，需要自己的内边距 */
[data-view=signing] .card>.settings-form,[data-view=signing] .card>.fold-body>.settings-form{padding:20px}
/* 2026-11-24 iOS 风格：三组 iOS 分组列表（glass.css .ios-list：名称在左、输入框和开关在右、说明在下）——这里改的签约字数、合同管理里改的只读条款、
   开关和审稿模型；组下面的说明是小字（同 iOS 设置里分组下的脚注），组与组之间留 16px */
.signing-terms-form>.form-hint{margin:8px 4px 0}
.signing-terms-form>.form-hint+.form-hint{margin-top:6px}
.signing-terms-form>:is(.ios-list,.form-hint)+.ios-list{margin-top:16px}
.signing-terms-form>.form-actions{margin-top:18px}
/* 开关一行里的“现在没有运行”另起一行，在开关说明下面 */
.signing-terms-form .signing-ai-reason{margin-top:4px}

/* 提签弹窗：说明与合同类型并排；合同预览在按钮上方；按钮栏是吸底的 .dialog-footer，“预览合同”放左侧与提交按钮分开 */
.signing-offer-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 18px;align-items:start}
.signing-offer-form>*{grid-column:1/-1}
/* 网格行距代替各项自带的外边距；吸底按钮栏保留 .dialog-footer 撑满弹窗的左右负边距，上边距按网格行距减去（16 + 6 ≈ 通用的 22px） */
.signing-offer-form>:not(.dialog-footer){margin:0}
.signing-offer-form>.dialog-footer{margin-top:6px}
.signing-offer-form>label{grid-column:auto}
.signing-offer-form>p{font-size:13.5px;line-height:1.75;color:var(--text-2)}
.signing-offer-actions>.button:first-child{margin-right:auto}
/* 预览框与上方表单项之间只用网格间距，不再叠加下面合同全文框自带的上边距 */
.signing-offer-form>.submission-content.contract-preview{max-height:360px;margin:0}

/* 电子签卡片（2026-10-16）：配置与企业认证用通用 .metadata 两列；说明在上、操作按钮在下，按钮靠左排成一行 */
.signing-esign .card-body>.notice{margin:0 0 16px}
.signing-esign .metadata dd .badge{margin-right:6px;vertical-align:1px}
.signing-esign .metadata dd .table-sub{max-width:none}
.signing-esign-actions{justify-content:flex-start;margin-top:20px;padding-top:16px;border-top:1px solid var(--separator)}
/* 企业实名认证链接：长链接用等宽字、任意处换行，只读文本框便于手动选中复制 */
.signing-esign-link{font-family:var(--mono);font-size:12px;line-height:1.6;word-break:break-all;min-height:0}
.signing-esign-form>.notice{margin:18px 0 0}
.signing-contract-actions{justify-content:flex-start;margin:0 0 14px}

/* 合同全文：像一页纸的浅底文档框；单独查看合同时不再嵌套滚动，由弹窗内容区整体滚动（2026-11-24 iOS 风格：灰色填充、不要边框，同弹窗里的信息块） */
.submission-content.contract-preview{margin:16px 0 0;padding:18px 22px;border:0;border-radius:14px;background:var(--field-bg);font-size:13.5px;line-height:1.9;color:var(--text-2);overflow-wrap:anywhere}
.signing-contract-meta{margin:0 0 14px;font-size:13px;line-height:1.7;overflow-wrap:anywhere}
.signing-contract-meta .mono{display:block;margin-top:2px;color:var(--text-2);word-break:break-all}
.signing-contract .contract-preview,.dialog-body>.contract-preview{max-height:none;overflow:visible}
.signing-contract .contract-preview{margin:0}
.dialog-body>.submission-content.contract-preview{margin:0}

@media(max-width:1360px){
  /* 1280 一档：字数只在“草稿 / 已发布”后换行，合同编号在连字符处换行，其余列收紧，给 8 列腾出宽度 */
  .signing-applications td:nth-child(1){min-width:128px}
  .signing-applications td:nth-child(4){white-space:normal;min-width:104px}
  .signing-applications td:nth-child(5){min-width:128px}
  .signing-applications td:nth-child(7){min-width:136px}
  .signing-contracts td:nth-child(1){white-space:normal;min-width:124px}
}
/* 1280 以下申请、邀请、合同三张表要横向滑动（最小约 940–1080px）：表格外层加了 .sticky-actions（signing.js），操作列固定在右侧（app.css） */
@media(max-width:1080px){
  /* 卡片头的状态筛选是 app.css 的小号控件（30px、宽度随内容）；平板宽度下本页说明文字很长：筛选下拉换到说明下方，不把说明挤成一条窄列 */
  [data-view=signing] .card-header:has(>select){flex-wrap:wrap}
}
@media(max-width:760px){
  /* 手机上筛选下拉在说明下方占满整行（app.css 卡片头控件默认宽度随内容） */
  [data-view=signing] .card-header>select{width:100%}
  [data-view=signing] .card>.settings-form,[data-view=signing] .card>.fold-body>.settings-form{padding:16px}
  .signing-offer-form{grid-template-columns:minmax(0,1fr)}
  .submission-content.contract-preview{padding:14px 16px;font-size:13px}
  /* 弹窗内容区本身可滚动，提签弹窗里的合同预览不再嵌一层滚动 */
  .signing-offer-form>.submission-content.contract-preview{max-height:none;overflow:visible}
  .signing-applications td:nth-child(8){min-width:120px}
  /* 电子签卡片：说明列收窄，按钮占满一行 */
  .signing-esign .metadata{grid-template-columns:96px minmax(0,1fr)}
  .signing-esign-actions>.button{flex:1 1 auto}
  /* 投稿编辑表直接放下：表头只在括号前断开（“编辑名 / （作者看到）”），列间距收紧到 10px */
  .signing-editors th{white-space:normal;word-break:keep-all}
  .signing-editors th,.signing-editors td{padding-left:10px;padding-right:10px}
  .signing-editors th:first-child,.signing-editors td:first-child{padding-left:14px}
  .signing-editors th:last-child,.signing-editors td:last-child{padding-right:14px}
}

/* AI 建议列（2026-10-21，docs/ai-editor-assist.md 8.1）：插在“字数”后，后面各列后移一位；卡片头的状态、AI 建议、排序三个下拉 */
.signing-filters{display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-end}
.signing-has-ai td:nth-child(5){min-width:112px;max-width:180px}
.signing-has-ai td:nth-child(6){min-width:148px;max-width:340px;color:inherit;font-variant-numeric:normal}
.signing-has-ai td:nth-child(6) .readable-note{display:block;font-size:13px;line-height:1.7;color:var(--text-2)}
.signing-has-ai td:nth-child(7){min-width:100px;color:var(--muted);font-variant-numeric:tabular-nums}
.signing-has-ai td:nth-child(8){min-width:176px}
.signing-has-ai td:nth-child(8) .table-sub{max-width:none}
.signing-has-ai td:nth-child(9){min-width:128px}
.signing-has-ai td:nth-child(9) .table-sub{max-width:120px}
.signing-ai-cell .badge{white-space:nowrap}
.signing-ai-cell .signing-ai-flag{display:inline-block;margin:4px 4px 0 0}
.signing-ai-reason{display:block;color:var(--warning)}
@media(max-width:1360px){
  .signing-has-ai td:nth-child(5){min-width:104px}
  .signing-has-ai td:nth-child(6){min-width:128px}
  .signing-has-ai td:nth-child(7){min-width:100px}
  .signing-has-ai td:nth-child(8){min-width:136px}
}
@media(max-width:1080px){
  [data-view=signing] .card-header:has(>.signing-filters){flex-wrap:wrap}
}
@media(max-width:760px){
  .signing-filters{width:100%;justify-content:stretch}
  .signing-filters>select{flex:1 1 30%;min-width:0}
  .signing-has-ai td:nth-child(9){min-width:120px}
}

/* 三张列表的查找框与分页（2026-10-25，docs/book-signing.md 第 11 节）：查找框排在筛选最前面；读取新一页时旧表格变淡，读到再换上 */
[data-view=signing] .card-header:has(>.signing-filters){flex-wrap:wrap}
[data-view=signing] .card-header>.signing-filters{flex:1 1 100%;justify-content:flex-start}
.card-header .signing-filters>input[type=search]{width:240px}
[data-view=signing] .card[aria-busy=true] .table-scroll{opacity:.55;transition:opacity .2s}
.signing-list-note .notice{margin:0}
@media(max-width:760px){
  .card-header .signing-filters>input[type=search]{flex:1 1 100%;width:auto;min-width:0}
}

/* 页面布局约定（2026-11-07，docs/admin-page-layout.md）：页面最上面的红黄提示与一行说明；三张列表的规则在卡片头里一行，点开看全文；
   折叠的列表（签约邀请、已签合同）的查找框在折叠区里，和列表放在一起 */
[data-testid=signing-notes]>.notice{margin:0 0 16px}
/* 规则收成一行后，大屏上查找和筛选放回标题右边，少占一行；电子签需处理的说明铺开，一条记录矮一些 */
@media(min-width:1500px){
  .signing-attention td:nth-child(3){max-width:none}
  [data-view=signing] .card-header:has(>.signing-filters){flex-wrap:nowrap}
  [data-view=signing] .card-header:has(>.signing-filters)>div:first-child{flex:1 1 0;min-width:0}
  [data-view=signing] .card-header>.signing-filters{flex:0 0 auto;flex-wrap:nowrap;justify-content:flex-end}
}
.card-header .help-note.signing-rules{margin:2px 0 0;border:0;background:none;box-shadow:none}
.fold-card:not(.is-open)>.card-header .help-note.signing-rules{display:none}
.card-header .help-note.signing-rules>summary{padding:0;font-size:13px;line-height:1.6}
.card-header .help-note.signing-rules>.help-note-body{padding:6px 0 0;font-size:13px;line-height:1.75;color:var(--muted);white-space:normal}
.signing-filter-row{padding-top:12px;padding-bottom:12px}
.signing-filter-row .signing-filters{justify-content:flex-start}
.signing-filter-row .signing-filters>input[type=search]{width:240px}
/* 列表里的意向合同、退回原因、说明只占一行，全文在悬停提示和审稿页 */
.signing-applications .signing-note-line{max-width:170px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
@media(min-width:1500px){.signing-applications .signing-note-line{max-width:280px}}
.review-outcome .signing-note-line{white-space:normal}
.signing-fold-note{padding-top:12px;padding-bottom:12px}
.signing-fold-note .form-hint{margin:0}
.signing-esign .card-body>.signing-esign-about{margin:0 0 16px}
@media(max-width:760px){
  .signing-filter-row .signing-filters>input[type=search]{flex:1 1 100%;width:auto;min-width:0}
}

/* 签约条款里只读的合同条款（2026-10-24 起在合同管理里改，超级管理员、动态码） */
.signing-terms-form input[data-locked]{cursor:default}
.signing-terms-form .signing-terms-locked a{font-weight:600}

/* 逐页整理（2026-11-12，docs/admin-page-layout.md） */
/* 申请列表加了“AI 建议”后是 9 列：1440、1536 宽的屏幕上表格比卡片宽一百多像素，“处理记录”有一半压在固定的操作列下面，要横向滑才看得到状态。
   1600 以下把列间距收到 12px（1400 以下 10px）、字数在“草稿 / 已发布”后换行、意向和退回原因那一行收到 132px，1366 到 1599 宽 9 列正好放下，不用横向滑动；
   1280 宽仍要滑一点（操作列固定在右侧），但少滑一百像素 */
@media(max-width:1599px){
  .signing-has-ai :is(th,td):not(:first-child){padding-left:12px}
  .signing-has-ai :is(th,td):not(:last-child){padding-right:12px}
  .signing-has-ai .signing-note-line{max-width:132px}
}
@media(min-width:1361px) and (max-width:1599px){
  .signing-has-ai td:nth-child(4){white-space:normal;min-width:96px}
  .signing-has-ai td:nth-child(6){min-width:120px}
  .signing-has-ai td:nth-child(8){min-width:156px}
  .signing-has-ai td:nth-child(9){min-width:112px}
}
@media(max-width:1400px){
  .signing-has-ai :is(th,td):not(:first-child){padding-left:10px}
  .signing-has-ai :is(th,td):not(:last-child){padding-right:10px}
  .signing-has-ai td:nth-child(6){min-width:112px}
  .signing-has-ai td:nth-child(9){min-width:104px}
}
@media(min-width:1361px) and (max-width:1400px){
  .signing-has-ai td:nth-child(8){min-width:148px}
  /* 2026-11-24：iOS 风格的胶囊按钮和徽标宽了一点，1366 宽时 9 列多出 14px 要横向滑；作品列收到和 1280 一档一样的 128px、操作列 100px */
  .signing-has-ai td:nth-child(1){min-width:128px}
  .signing-has-ai td:nth-child(9){min-width:100px}
}
/* 2026-11-24：1440、1536 宽时处理记录里“编辑 · 日期 时间”要 152px 才不折行（折了一条退回的记录就是四行字高）；这一列给到 180px，别的列还有余量 */
@media(min-width:1401px) and (max-width:1599px){
  .signing-has-ai td:nth-child(8){min-width:180px}
}
/* 作者留言、邀请的说明最多三行：很长的留言不把一行撑成一屏，全文在悬停提示和审稿页里 */
.signing-applications td:nth-child(n) .readable-note,.signing-offers td:nth-child(n) .readable-note{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden;white-space:normal;overflow-wrap:anywhere}
/* 签约邀请、已签合同折叠后，查找框和“来源”下拉挪到了卡片正文里：那里的下拉默认占满整行，掉到查找框下面单独一行。
   和卡片头里的控件一样用小号（30px、宽度随内容），两个排在同一行 */
.signing-filter-row .signing-filters>:is(input,select){width:auto;min-height:var(--control-h-sm);margin:0;padding-top:4px;padding-bottom:4px;font-size:13px}
.signing-filter-row .signing-filters>select{padding-right:30px;background-position:right 9px center}
/* 这两张都是 10 列的密表：列间距收到 12px；1440 以上发出时间、签约时间各放得下一行，“查看全文”“发起解约”排成一行
   （再多一个“下载签署文件”时照旧折行），一条记录从四行字高降到两三行。更窄的屏幕放不下这些下限，照旧折行 */
:is(.signing-offers,.signing-contracts) :is(th,td):not(:first-child){padding-left:12px}
:is(.signing-offers,.signing-contracts) :is(th,td):not(:last-child){padding-right:12px}
@media(min-width:1440px){
  .signing-offers td:nth-child(6){min-width:152px}
  .signing-contracts td:nth-child(8){min-width:180px}
  .signing-contracts td:nth-child(10) .table-actions:not(:has(>:nth-child(3))){flex-wrap:nowrap}
}
/* 投稿编辑的“修改”“联系方式”、待我同意的“同意”“退回”：电脑上排成一行（操作列宽度按内容，原来被压成上下两个，一行 93px）；按钮之间留 6px */
.signing-approvals .row-actions{display:flex;flex-wrap:wrap;align-items:center;gap:6px}
@media(min-width:761px){
  .signing-editors td .row-actions,.signing-approvals td .row-actions{flex-wrap:nowrap}
}
/* 三张列表卡片头里的规则：和页头说明一样，一句完整的话后面跟“展开规则”，不用三角和括号里的提示 */
.card-header .help-note.signing-rules>summary{display:flex;flex-wrap:wrap;align-items:baseline;gap:2px 10px;list-style:none}
.card-header .help-note.signing-rules>summary::-webkit-details-marker{display:none}
.card-header .help-note.signing-rules>summary::after{content:"展开规则";flex:none;color:var(--primary-text);font-size:12.5px;font-weight:600}
.card-header .help-note.signing-rules[open]>summary::after{content:"收起规则"}
.card-header .help-note.signing-rules>summary:hover::after{text-decoration:underline;text-underline-offset:3px}

/* 自动提签（2026-11-23，docs/auto-offer.md 3.4） */
/* 列表“方式”一栏：标签跟在“意向”同一行，不另占一行（一条记录不超过约三行字高）。意向放不下时用省略号收短（全文在悬停提示里），
   标签不折行；意向那一格最小宽度为 0，不把这一列撑宽 */
.signing-applications .signing-intent-line{display:grid;grid-template-columns:minmax(0,max-content) auto;align-items:center;column-gap:6px;max-width:none}
.signing-applications .signing-intent-line>.badge{justify-self:start}
/* 有标签时这一列至少放得下“意向：B类”和最长的“正在自动提签”，以及第一行的“申请签约 系统自动申请”（不折成两行把记录撑高） */
.signing-applications td:has(>.signing-intent-line){min-width:180px}
/* 处理记录里“不自动提签：原因”只占一行，铺满这一列但不把它撑宽（宽度 0、最小 100%），全文在悬停提示里 */
.signing-applications td .signing-auto-reason{width:0;min-width:100%;max-width:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
/* 设置卡片：开关和门槛是一组 iOS 分组列表（2026-11-24，glass.css .ios-list），条件说明在下面 */
.signing-auto-form>.notice{margin:0 0 16px}
.signing-auto-form>.help-note{margin:16px 0 0;background:var(--field-bg);box-shadow:none}
.signing-auto-form>.form-hint{margin:12px 0 0}
.signing-auto-rules{margin:0 0 6px;padding-left:20px;white-space:normal}
.signing-auto-rules>li+li{margin-top:2px}
.signing-auto-form .help-note-body>p{margin:0;white-space:normal}
