/* 页面专属样式（03 §2.1）：代理列表 .pg-agents、代理详情 .pg-agent、对账单详情 .pg-statement，以及代理弹窗内容 .dlg-ag
   （弹窗渲染在页面根元素之外，所以用弹窗内容自己的根类）。归属 WP-F7。只用令牌变量；不写颜色值；不写 prefers-color-scheme。 */

/* el-alert type="error" 的底色用 --el-color-error-light-9，ep-theme.css 只映射了 danger 系列（深色下会是浅粉底），
   在本域根元素上补齐 error 系列映射（只引用令牌；见 WP-F7 交接说明对 WP-F1 的请求） */
.pg-agents, .pg-agent, .pg-statement, .dlg-ag {
  --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);
}

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

/* ================================================================ 代理列表 */
.pg-agents .dl, .pg-agent .dl, .pg-statement .dl, .dlg-ag .dl { margin: 0; }
.pg-agents .ag-cell, .pg-agent .ag-cell { min-width: 0; line-height: 1.4; gap: 2px; }
.pg-agents .ag-cell.text-right { align-items: flex-end; }
.pg-agents .ag-actions, .pg-agent .ag-actions { justify-content: flex-end; flex-wrap: nowrap; }
.pg-agents .ag-push-fail { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c-danger); flex-shrink: 0; }

/* ================================================================ 代理详情 */
.pg-agent .card-head, .pg-statement .card-head { flex-wrap: wrap; }
.pg-agent .card-head h3, .pg-statement .card-head h3 { flex-shrink: 0; white-space: nowrap; }   /* 长说明换行时标题不被挤成两行 */
.pg-agent .ag-offset .el-alert__content { width: 100%; }
.pg-agent .ag-foot { padding: var(--sp-2) var(--sp-4) var(--sp-3); margin-top: 0; border-top: 1px solid var(--c-border); }
.pg-agent .page-tabs .el-tabs__nav-wrap { max-width: 100%; }
.pg-agent .table-foot .el-button + .el-button { margin-left: 0; }
/* 按钮组用 gap 间距：去掉 EP 相邻按钮的 margin-left，换行后首个按钮不缩进 */
.pg-agents .page-head .actions .el-button + .el-button,
.pg-agent .detail-actions .el-button + .el-button, .pg-statement .detail-actions .el-button + .el-button { margin-left: 0; }
.pg-agent .c-money-input { width: 100%; max-width: 180px; }
.pg-agent .detail-meta .el-button.is-link { padding: 0; height: auto; }

/* ================================================================ 对账单详情 */
.pg-statement .st-note { max-width: 320px; }
.pg-statement .st-pay-note { white-space: pre-wrap; line-height: 1.7; color: var(--c-text-2); }
.pg-statement .c-statement-view + .card { margin-top: var(--sp-4); }
/* 页头已有「打印」：隐藏 <statement-view> 底部的同名按钮（WP-F2 组件无开关，见 WP-F7 交接说明请求）；日期列不折行 */
.pg-statement .c-statement-view > .flex > .el-button.no-print { display: none; }
.pg-statement .c-statement-view .el-table td:first-child .cell { white-space: nowrap; }

@media (max-width: 900px) {
  /* page-head 的标题块是 .grow（flex-basis 0），窄屏时按钮组独占一行，避免标题被挤成一字一行 */
  .pg-agents .page-head .actions { width: 100%; margin-left: 0; justify-content: flex-start; }
  .pg-statement .st-note { max-width: 100%; }
  .pg-agent .c-money-input { max-width: none; }
}

@media print {
  .pg-statement .detail-actions { display: none; }
  .pg-statement .c-page-head a { display: none; }
}

/* ================================================================ 代理弹窗（.dlg-ag：agent-form / remittance / adjustment / statement-issue / prices / portal / push / archive） */
.dlg-ag { min-width: 0; }
.dlg-ag .el-input-number { width: 160px; max-width: 100%; }
.dlg-ag-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 2px; color: var(--c-text-2); }
.dlg-ag .fx-row .text-right { white-space: nowrap; }
