/* 页面专属样式（03 §2.1）：售后首页 .pg-aftersale、事件详情 .pg-incident、理赔单详情 .pg-claim，以及售后弹窗内容 .dlg-as
   （弹窗渲染在页面根元素之外，所以用弹窗内容自己的根类；企业转移向导的 el-dialog 带 .c-transfer-wizard）。归属 WP-F7。
   只用令牌变量；不写颜色值；不写 prefers-color-scheme（主题只由令牌切换）。 */

/* el-alert type="error" 的底色用 --el-color-error-light-9，ep-theme.css 只映射了 danger 系列（深色下会是浅粉底），
   在本域根元素上补齐 error 系列映射（只引用令牌；见 WP-F7 交接说明对 WP-F1 的请求） */
.pg-aftersale, .pg-incident, .pg-claim, .dlg-as {
  --el-color-error-light-3: var(--el-color-danger-light-3); --el-color-error-light-5: var(--el-color-danger-light-5);
  --el-color-error-light-7: var(--el-color-danger-light-7); --el-color-error-light-8: var(--el-color-danger-light-8);
  --el-color-error-light-9: var(--c-danger-soft); --el-color-error-dark-2: var(--c-danger-ink);
}

/* ================================================================ 共用 */
.pg-aftersale .dl, .pg-incident .dl, .pg-claim .dl, .dlg-as .dl { margin: 0; }
.pg-aftersale .as-cell, .pg-incident .as-cell { min-width: 0; line-height: 1.4; gap: 2px; }
.pg-aftersale .as-cell > .pill, .pg-incident .as-cell .pill { align-self: flex-start; }   /* 列内胶囊不随 flex-col 拉伸 */
.pg-aftersale .as-suggest, .pg-incident .as-suggest { color: var(--c-text-3); font-weight: 400; }
.pg-incident .as-col, .pg-claim .as-col { min-width: 0; }
/* 按钮组用 gap 间距：去掉 EP 相邻按钮的 margin-left，换行后首个按钮不缩进 */
.pg-aftersale .page-head .actions .el-button + .el-button,
.pg-incident .detail-actions .el-button + .el-button, .pg-claim .detail-actions .el-button + .el-button { margin-left: 0; }
.pg-incident .as-col > .card + .card, .pg-claim .as-col > .card + .card { margin-top: 0; }

/* 分段控件（视图切换、筛选栏状态 seg、弹窗内单选）窄屏时横向滚动，不把每个选项挤成两行 */
.pg-aftersale .seg, .pg-incident .seg, .pg-claim .seg, .dlg-as .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.pg-aftersale .seg::-webkit-scrollbar, .pg-incident .seg::-webkit-scrollbar, .pg-claim .seg::-webkit-scrollbar,
.dlg-as .seg::-webkit-scrollbar { display: none; }
.pg-aftersale .seg button, .pg-incident .seg button, .pg-claim .seg button, .dlg-as .seg button { white-space: nowrap; flex-shrink: 0; }

/* ================================================================ 售后首页 */
.pg-aftersale .as-tabs { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.pg-aftersale .as-tabs::-webkit-scrollbar { display: none; }
.pg-aftersale .as-tabs .seg { width: max-content; }
.pg-aftersale .as-queue > .card + .card { margin-top: 0; }
.pg-aftersale .as-queue .queue-head h3 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.pg-aftersale .as-queue .queue-head .actions { flex-wrap: wrap; justify-content: flex-end; min-width: 0; }
.pg-aftersale .as-head-actions { justify-content: flex-end; }
.pg-aftersale .as-head-actions .el-button + .el-button { margin-left: 0; }   /* 间距由 gap 提供；换行后首个按钮不缩进 */
.pg-aftersale .as-queue .q-title .t { min-width: 0; }
.pg-aftersale .as-queue .q-amount { line-height: 1.5; }
.pg-aftersale .as-pager { justify-content: center; padding: var(--sp-2) 0; }

@media (max-width: 900px) {
  /* page-head 的标题块是 .grow（flex-basis 0），窄屏时按钮组独占一行，避免标题被挤成一字一行 */
  .pg-aftersale .page-head .actions { width: 100%; margin-left: 0; justify-content: flex-start; }
  .pg-aftersale .as-queue .queue-head { flex-wrap: wrap; }
  .pg-aftersale .as-queue .queue-head h3 { white-space: normal; flex: 1 1 calc(100% - 80px); }
  .pg-aftersale .as-queue .queue-head .actions { margin-left: 0; width: 100%; justify-content: flex-start; flex-wrap: nowrap; align-items: flex-start; }
  .pg-aftersale .as-head-actions { justify-content: flex-start; flex: 1; min-width: 0; }
  .pg-aftersale .as-queue .q-amount { text-align: left; white-space: normal; grid-column: 2 / -1; }
}

/* ================================================================ 事件详情 */
.pg-incident .card-head h3, .pg-claim .card-head h3 { flex-shrink: 0; white-space: nowrap; }   /* 长说明换行时标题不被挤成两行 */
.pg-claim .card-head { flex-wrap: wrap; }
.pg-incident .as-seg .card-head { flex-wrap: wrap; }
.pg-incident .as-seg-rules {
  padding: var(--sp-2) var(--sp-4); background: var(--c-surface-2); color: var(--c-text-2); border-bottom: 1px solid var(--c-border);
  line-height: 1.6;
}
.pg-incident .as-gap { margin-left: var(--sp-2); }
.pg-incident .as-segs > .card + .card, .pg-incident .as-bottom > .card + .card { margin-top: 0; }
.pg-incident .as-bottom { align-items: start; }
.pg-incident .as-note { max-width: 360px; }

/* ================================================================ 理赔单详情 */
.pg-claim .as-rules { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: var(--sp-1); font-size: var(--fs-md); line-height: 1.6; }
.pg-claim .as-equations { border-top: 1px dashed var(--c-border); padding-top: var(--sp-3); }
.pg-claim .as-equations .form-section-title { margin-top: 0; }
.pg-claim .as-review { background: var(--c-warn-soft); border-color: var(--c-warn-soft); }
.pg-claim .as-review .card-head { border-bottom-color: var(--c-border); }
.pg-claim .as-review .card-head h3, .pg-claim .as-review .strong { color: var(--c-warn-ink); }
.pg-claim .as-review .fs-sm { color: var(--c-text-2); line-height: 1.6; }
.pg-claim .as-self-start { align-self: flex-start; }
.pg-claim .as-entry { min-width: 0; }
.pg-claim .as-v1 { border: 0; }
.pg-claim .as-v1 .el-collapse-item__header { padding: 0 var(--sp-4); font-size: var(--fs-md); color: var(--c-text-2); border-bottom-color: var(--c-border); }
.pg-claim .as-v1 .el-collapse-item__wrap { border-bottom: 0; }
.pg-claim .as-v1 .el-collapse-item__content { padding: var(--sp-3) var(--sp-4) var(--sp-4); }

/* ================================================================ 售后弹窗（.dlg-as：claim-resolve / seat-ban / ws-ban / claim-batch / claim-recompute / transfer-wizard） */
.dlg-as { min-width: 0; }
.dlg-as .kpis, .dlg-as-kpis { margin-bottom: 0; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.dlg-as-kpis .kpi { padding: 10px 12px; box-shadow: none; }
.dlg-as-kpis .kpi-value { font-size: var(--fs-xl); }
.dlg-as-summary {
  padding: var(--sp-3); border: 1px solid var(--c-border); border-radius: var(--r-md); background: var(--c-surface-2); min-width: 0;
}
.dlg-as-reasons { margin: var(--sp-1) 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 2px; }
.dlg-as-actions .alt-card { display: flex; flex-direction: column; gap: 4px; }
.dlg-as-actions .alt-card:disabled { cursor: not-allowed; background: var(--c-surface-2); color: var(--c-text-3); }
.dlg-as-actions .alt-card:not(:disabled):hover { border-color: var(--c-border-strong); }
.dlg-as-actions .alt-card .el-icon { color: var(--c-brand); }
.dlg-as-actions .alt-card:disabled .el-icon { color: var(--c-text-4); }
.dlg-as-fields { min-width: 0; }
.dlg-as-sub { border-left: 2px solid var(--c-border); padding-left: var(--sp-3); margin: 0 0 var(--sp-3); }
.dlg-as-action-select { width: 260px; max-width: 100%; }

/* 重算快照的差异表 */
.dlg-as-diff { width: 100%; border-collapse: collapse; font-size: var(--fs-md); border: 1px solid var(--c-border); border-radius: var(--r-md); }
.dlg-as-diff th, .dlg-as-diff td { padding: 8px 12px; border-bottom: 1px solid var(--c-border); text-align: left; vertical-align: top; }
.dlg-as-diff thead th { background: var(--c-surface-2); color: var(--c-text-3); font-size: var(--fs-sm); font-weight: 500; }
.dlg-as-diff tbody th { color: var(--c-text-2); font-weight: 500; white-space: nowrap; }
.dlg-as-diff tbody tr:last-child th, .dlg-as-diff tbody tr:last-child td { border-bottom: 0; }
.dlg-as-diff tr.is-changed th { color: var(--c-text); }

/* 企业转移向导 */
.dlg-as-steps { margin-bottom: var(--sp-2); }
.dlg-as-tw-list { overflow: hidden; }
.dlg-as-tw-pick, .dlg-as-tw-row, .dlg-as-tw-prow {
  display: flex; align-items: center; gap: var(--sp-3); padding: 8px 12px; border-bottom: 1px solid var(--c-border); min-width: 0;
}
.dlg-as-tw-pick:last-child, .dlg-as-tw-row:last-child, .dlg-as-tw-prow:last-child { border-bottom: 0; }
.dlg-as-tw-pick .el-checkbox { min-width: 0; margin-right: 0; }
.dlg-as-tw-row { display: grid; grid-template-columns: minmax(0, 200px) minmax(0, 2fr) minmax(0, 1.4fr) 150px; align-items: start; }
.dlg-as-tw-row .el-form-item { margin-bottom: 0; }
.dlg-as-tw-headrow { padding-top: 6px; padding-bottom: 6px; background: var(--c-surface-2); color: var(--c-text-3); font-size: var(--fs-sm); font-weight: 500; }
.dlg-as-tw-email { padding-top: 6px; }
.dlg-as-tw-cell { min-width: 0; }
.dlg-as-tw-target { width: 280px; max-width: 100%; }
.dlg-as-tw-prow.is-off { background: var(--c-surface-2); color: var(--c-text-3); }
.dlg-as-tw-prow .text-right { align-items: flex-end; }
.dlg-as-tw-err { max-width: 50%; text-align: right; }
.dlg-as-short { background: var(--c-warn-soft); color: var(--c-warn-ink); }
.c-transfer-wizard .el-dialog__body { padding-top: var(--sp-2); }

@media (max-width: 900px) {
  .dlg-as-action-select { width: 100%; }
  .dlg-as-tw-row { grid-template-columns: minmax(0, 1fr); gap: var(--sp-2); }
  .dlg-as-tw-headrow { display: none; }
  .dlg-as-tw-email { padding-top: 0; }
  .dlg-as-tw-prow { flex-wrap: wrap; }
  .dlg-as-tw-err { max-width: 100%; text-align: left; }
  .dlg-as-diff th, .dlg-as-diff td { padding: 6px 8px; }
}
