/* contract-terminations.js（合同解约，2026-11-04）专用样式。通用组件和设计变量在 app.css；这里只放本页独有的类，覆盖通用类时用 [data-view=contract-terminations] 限定。 */

/* ── 列表：卡片里的筛选和表格贴边；当前筛选的统计卡高亮 ── */
.card-body.ct-filters-body{padding-bottom:0}
.ct-filters{margin-bottom:14px}
.ct-table .mono{font-family:var(--mono);font-size:12px}
.ct-table th:nth-child(1){min-width:190px}
.ct-table th:nth-child(2){min-width:170px}
.ct-table th:nth-child(4){min-width:170px}
.ct-table th:nth-child(5){min-width:130px}
.ct-table td:nth-child(3){white-space:nowrap}
.ct-table th:nth-child(6){min-width:120px}
.ct-warning-text{color:var(--warning-ink)}
/* 2026-11-24：统计卡没有边框了，当前筛选的那张用一圈紫色描边标出 */
.ct-stats .stat-card.is-current{box-shadow:0 0 0 2px var(--primary-border),var(--shadow-md)}
/* 要人处理的行（待审核、到期执行失败）排在最前：左边一条红线 */
.ct-table tr.ct-needs-person>td:first-child{box-shadow:inset 3px 0 0 var(--danger)}
/* 逐页整理（2026-11-12，docs/admin-page-layout.md）：一条解约两三行字高。合同名称、邮箱各放得下一行；长书名最多两行、
   长笔名和发起人一行，放不下的用省略号（全文在悬停提示和详情页）。原来窄列把它们折成四五行，一页 20 条有 4000px 高 */
.ct-table th:nth-child(1){min-width:204px}
.ct-table th:nth-child(5){min-width:164px}
.ct-table td:nth-child(2) .table-title{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
/* 笔名一行：width:0 + min-width:100% 让它不参与列宽计算，再长也不把列撑宽 */
.ct-table td:nth-child(2) .table-sub{width:0;min-width:100%;max-width:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ct-table td:nth-child(5) .table-sub{white-space:nowrap}
.ct-table td:nth-child(6){max-width:176px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ct-table td:nth-child(6) .table-sub{font-variant-numeric:tabular-nums}
/* 解约资料：上传时间和大小同一行，五种资料不占太高；查看资料在卡片标题栏 */
.ct-materials td .table-sub{display:inline;margin:0 0 0 8px}
.ct-materials .card-body>.notice{margin:0 0 14px}
.ct-materials .card-body>.ct-revealed{margin:0 0 14px}

/* ── 流程：一排圆点和连线，手机上竖排 ── */
.ct-steps{display:flex;list-style:none;margin:0 0 20px;padding:16px 18px;border:0;border-radius:var(--radius);background:var(--surface);box-shadow:var(--shadow-sm)}
.ct-step{position:relative;flex:1 1 0;min-width:0;display:flex;flex-direction:column;gap:2px;padding:18px 8px 0 0;font-size:13px;color:var(--muted)}
.ct-step strong{font-weight:600;color:inherit}
.ct-step-sub{font-size:12px;color:var(--muted);overflow-wrap:anywhere}
.ct-step-dot{position:absolute;top:2px;left:0;width:10px;height:10px;border-radius:50%;background:var(--surface-3);border:2px solid var(--border)}
.ct-step::after{content:"";position:absolute;top:7px;left:14px;right:4px;height:2px;background:var(--border)}
.ct-step:last-child::after{display:none}
.ct-step.is-done{color:var(--text)}
.ct-step.is-done .ct-step-dot{background:var(--success);border-color:var(--success)}
.ct-step.is-done::after{background:var(--success)}
.ct-step.is-current{color:var(--primary-text)}
.ct-step.is-current .ct-step-dot{background:var(--surface);border-color:var(--primary)}
.ct-step.is-current strong{font-weight:700}
.ct-step.is-withdrawn{color:var(--danger)}
.ct-step.is-withdrawn .ct-step-dot{background:var(--danger);border-color:var(--danger)}

/* ── 详情：两列卡片、卡片内的操作行和提示间距 ── */
.ct-columns{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;align-items:start}
.ct-columns>.card{margin:0}
.ct-columns+.card{margin-top:20px}
[data-view=contract-terminations] .metadata{grid-template-columns:128px minmax(0,1fr)}
.ct-pre{white-space:pre-wrap;overflow-wrap:anywhere}
.ct-inline-badge{margin-left:8px}
.ct-card-actions{margin-top:16px}
.ct-card-actions>.form-hint{margin:0 auto 0 0}
.ct-decision{margin-top:0;justify-content:flex-start}
.ct-no-form{margin:12px 0 0;font-size:13px}
.ct-section-title{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 10px;margin:0 0 10px;font-size:14px;color:var(--text)}
[data-view=contract-terminations] .card-body>.notice+.table-scroll,[data-view=contract-terminations] .card-body>.metadata+.notice,[data-view=contract-terminations] .card-body>.metadata+.notice+.notice{margin-top:12px}
[data-view=contract-terminations] .card-body>.notice:first-child{margin-top:0;margin-bottom:12px}

/* ── 发到哪里：两行固定的收件方式，浅底，一眼看清 ── */
.ct-channels{display:grid;gap:6px;margin:0 0 14px;padding:10px 14px;border:0;border-radius:12px;background:var(--field-bg);font-size:13px}
.ct-channel{display:flex;flex-wrap:wrap;gap:4px 6px}
.ct-channel-name{min-width:48px;color:var(--muted)}
.ct-channels .mono{font-family:var(--mono);font-size:12.5px}
.ct-channels-hint{margin:-6px 0 14px}

/* ── 筛选栏在白色卡片和弹窗里：输入框照常用灰色填充（2026-11-24；app.css 给 .filters 的白底加阴影是给页面灰底用的） ── */
[data-view=contract-terminations] :is(.card,.dialog-body) .filters :is(input:not([type=checkbox],[type=radio],[type=file],[type=range]),select){background-color:var(--field-bg);box-shadow:none}
[data-view=contract-terminations] :is(.card,.dialog-body) .filters :is(input:not([type=checkbox],[type=radio],[type=file],[type=range]),select):focus{background-color:var(--surface);box-shadow:var(--focus)}

/* ── 发起对话框：查找结果不把表单挤出屏幕 ── */
.ct-finder{margin-bottom:10px}
.ct-candidates{margin-bottom:16px}
.ct-candidates>.muted{margin:0;font-size:13px}
.ct-candidates .table-scroll{max-height:240px;overflow:auto}
.ct-start-fields{margin-bottom:14px}

/* ── 查看资料：表单和照片，照片点开放大；只在放行期内显示 ── */
.ct-revealed:empty{display:none}
.ct-revealed{margin-top:16px}
.ct-revealed-box{padding:14px 16px;border:1px solid var(--warning-border);border-radius:14px;background:var(--field-bg)}
.ct-until{font-size:12px;font-weight:500;color:var(--warning-ink)}
.ct-photos{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:12px;margin-top:14px}
.ct-photo{margin:0;min-width:0}
.ct-photo.is-large{grid-column:1/-1}
.ct-photo figcaption{margin-top:6px;font-size:12.5px;color:var(--text-2)}
.ct-photo-frame{display:flex;align-items:center;justify-content:center;min-height:120px;border:0;border-radius:12px;background:var(--surface);box-shadow:0 0 0 1px var(--separator);overflow:hidden}
.ct-photo-open{display:block;width:100%;padding:0;border:0;background:none;cursor:zoom-in}
.ct-photo-open img{display:block;width:100%;max-height:220px;object-fit:contain}
.ct-photo.is-large .ct-photo-open{cursor:zoom-out}
.ct-photo.is-large .ct-photo-open img{max-height:none}
.ct-photo-error{display:flex;flex-direction:column;align-items:flex-start;gap:8px;padding:10px;width:100%}
.ct-photo-error .notice{margin:0;align-self:stretch}

@media (max-width:1080px){
  .ct-columns{grid-template-columns:minmax(0,1fr)}
}
@media (max-width:760px){
  .ct-steps{flex-direction:column;gap:10px}
  .ct-step{padding:0 0 0 18px}
  .ct-step::after{top:14px;left:4px;right:auto;bottom:-10px;width:2px;height:auto}
  [data-view=contract-terminations] .metadata{grid-template-columns:96px minmax(0,1fr)}
  .ct-card-actions>.form-hint{flex-basis:100%}
}
