/*
 * 全局边框系统
 *
 * 这张样式表在通用页面样式之后加载，弹窗等专用样式仍可在它之后加载。
 * 只处理边框的线重和中性颜色，不改变布局、圆角、阴影、
 * 字体或业务颜色。选中态、告警态、成功/失败态、品牌装饰线和合计层级线继续由各页面
 * 样式负责，以免把有业务含义的强调线冲淡。
 */
:root {
  --ui-border-shell: #b8c7d9;
  --ui-border-control: #b8c7d9;
  --ui-border-divider: #c5d1df;
  --ui-border-soft: #d2dbe6;
  --ui-table-border-shell: #aebed1;
  --ui-table-border-control: #b5c4d5;
  --ui-table-border-divider: #c2cedc;
  --ui-border-focus: #7da7df;
  --ui-total-surface: #f5f8fc;

  /* 将旧页面仍在使用的公共变量收口到同一套中性边框。 */
  --line: var(--ui-border-shell);
  --reference-line: var(--ui-border-shell);
  --reference-soft-line: var(--ui-border-divider);
}

/* 表格页局部声明过 --business-line，使用 important 保证所有业务表统一到同一线重。 */
#app .project-workbench {
  --business-line: var(--ui-border-shell) !important;
}

/* 主体、设置内容、税务、规划、模拟和收口页的中性外框：统一为清晰但克制的 1px。 */
#app :is(
  .panel,
  .user-panel,
  .settings-list,
  .settings-editor,
  .settings-single,
  .settings-list-full,
  .settings-integrated-table-card,
  .account-service-section,
  .license-status-panel,
  .hcr-card,
  .branding-asset-card,
  .company-branding-panel:not(.branding-assets-grid),
  .project-home-panel,
  .project-home-security-panel,
  .project-home-quick-panel,
  .project-home-quick-card,
  .project-list-ledger,
  .project-list-detail,
  .project-empty-guide,
  .project-rules-panel,
  .rule-section-panel,
  .rule-mode-panel,
  .management-plan,
  .business-live-ledger,
  .business-live-entry,
  .business-live-summary,
  .business-group-summary,
  .business-entry-accordion,
  .ledger-entry-accordion-body,
  .balance-summary-card:not(.primary),
  .balance-calculation-panel,
  .tax-entry-panel,
  .tax-reference-form-card,
  .tax-reference-main,
  .tax-reference-side,
  .tax-calculation-card:not(.tax-total-card),
  .tax-process-card,
  .tax-side-card,
  .planning-panel,
  .planning-reserve-panel,
  .planning-material-panel,
  .planning-material-recommendation-panel,
  .planning-material-source-panel,
  .planning-scheme-panel,
  .planning-tree-panel,
  .simulation-ticket-section,
  .simulation-process,
  .simulation-supplement,
  .independent-result-card,
  .independent-payment-panel,
  .independent-condition-card,
  .independent-calculation-panel,
  .independent-tax-detail,
  .closure-overview-lower > div,
  .overview-panel,
  .overview-metric,
  .overview-entry,
  .stat-card,
  .filter-panel,
  .table-panel,
  .form-panel:not(.business-workspace),
  .entry-panel,
  .tax-card:not(.tax-total-card),
  .tax-summary-reconciliation,
  .ledger-summary,
  .project-list-metrics article,
  .tax-summary-metric:not(.total),
  .contract-record-detail,
  .invoice-record-detail,
  .receipt-record-detail,
  .settlement-record-detail,
  .downstream-contract-record-detail
) {
  border-width: 1px !important;
  border-style: solid !important;
  border-color: var(--ui-border-shell) !important;
}

/* 同类独立统计卡统一四边线重，包括对上业务页。 */
#app .project-workbench.project-workbench :is(
  .business-ledger-metrics,
  .contract-ledger-metrics,
  .downstream-contract-ledger-metrics,
  .settlement-ledger-metrics,
  .invoice-ledger-metrics,
  .receipt-ledger-metrics,
  .guarantee-metrics,
  .balance-ledger-metrics,
  .tax-summary-ledger-metrics,
  .tax-summary-metrics,
  .tax-vat-metrics,
  .tax-surcharge-metrics,
  .tax-income-metrics,
  .tax-burden-metrics
) article {
  border-width: 1px !important;
  border-style: solid !important;
  border-color: var(--ui-border-shell) !important;
}

/* 新版八个业务页的统计卡也采用同一四边线，不让页面局部浅色边框覆盖。 */
#app .project-workbench.project-workbench .business-ledger-metrics-standard.business-ledger-metrics-standard article {
  border: 1px solid var(--ui-border-shell) !important;
}

/* 这些容器存在明确的色彩语义，保留原有边框颜色和强调线，只收口普通边的线重。 */
#app :is(
  .tax-reference-result-box,
  .tax-total-card,
  .tax-summary-total,
  .simulation-conclusion,
  .closure-status-card,
  .notice,
  .tip,
  .empty-state,
  .demo-data-panel,
  .demo-sandbox,
  .planning-xlsx-import,
  .planning-clear-assignment,
  .settlement-calculation-panel,
  .simulation-mode-intro
) {
  border-width: 1px;
}

/* 业务弹窗、详情抽屉和全局设置弹窗使用同一外框线重。 */
#app :is(
  .contract-entry-modal,
  .downstream-contract-entry-modal,
  .invoice-entry-modal,
  .receipt-entry-modal,
  .settlement-entry-modal,
  .tax-prepayment-entry-modal,
  .ticket-tax-calculation-modal,
  .actual-balance-calculation-modal,
  .closure-balance-calculation-modal,
  .independent-receipt-calculation-modal,
  .planning-current-list-modal,
  .planning-import-modal,
  .planning-material-confirm-modal,
  .tax-burden-process-modal,
  .admin-transfer-modal,
  .employee-initial-password-modal,
  .dialog-interactive-modal,
  .recovery-confirm-modal,
  .software-confirm-modal,
  .record-detail-dialog-panel,
  .record-detail-panel,
  .business-detail-drawer,
  .company-logo-crop-dialog,
  .company-logo-crop-panel,
  .simulation-modal
) {
  border-width: 1px !important;
  border-style: solid !important;
  border-color: var(--ui-border-shell) !important;
}

/* 启动、公司选择和激活界面的实体卡片也纳入同一套边框；登录桌面态的 auth-card 继续保持透明。 */
#app :is(
  .activation-card,
  .startup-card,
  .license-status-panel
) {
  border-width: 1px !important;
  border-style: solid !important;
  border-color: var(--ui-border-shell) !important;
}

/* 所有业务页面的文字输入、下拉和文本域统一为 1px 控件线。 */
#app :is(
  .input,
  input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]),
  select,
  textarea
):not(.desktop-password-toggle) {
  border-width: 1px !important;
  border-style: solid !important;
  border-color: var(--ui-border-control) !important;
}

#app :is(
  .input,
  input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]),
  select,
  textarea
):not(.desktop-password-toggle):focus {
  border-color: var(--ui-border-focus) !important;
}

/* 普通按钮使用控件线；主按钮和危险/成功/警告按钮继续使用各自的语义样式。 */
#app :is(.project-workbench, .status-page, .auth-shell, .settings-shell) .btn:not(.primary):not(.danger):not(.success):not(.warn):not(.warning):not(.active):not(.selected):not([aria-pressed="true"]):not([aria-current="page"]) {
  border-width: 1px !important;
  border-style: solid !important;
  border-color: var(--ui-border-control) !important;
}

/* 统一常见表格容器的外框，但不向已由业务面板承载的无框 business-record-table 里再套一层框。 */
#app :is(
  .table-wrap:not(.business-record-table):not(.project-list-table-wrap),
  .tax-reference-table-wrap,
  .tax-summary-table,
  .stamp-group-list,
  .project-list-ledger,
  .account-service-table,
  .settings-unit-table
) {
  border-width: 1px !important;
  border-style: solid !important;
  border-color: var(--ui-table-border-shell) !important;
}

/* 下列 table-wrap 是由外层内容框承载的无框内部滚动区，保持原来的无框结构。 */
#app .planning-panel .table-wrap,
#app .ticket-tax-calculation-table-shell > .table-wrap {
  border-width: 0 !important;
  border-style: none !important;
  border-color: transparent !important;
}

/* 备份记录已由外层区域承载边框，内部表格保持无框，避免出现重复套框。 */
#app .account-service-safety-records .account-service-table {
  border-width: 0 !important;
  border-style: none !important;
  border-color: transparent !important;
}

/* 表头线比正文分隔线略清晰，正文继续使用轻分隔线；不改变已有边的方向和存在性。 */
#app :is(
  .business-record-table,
  .ledger-record-table,
  .special-ledger-table,
  .business-table,
  .independent-payment-table,
  .tax-record-table,
  .core-table,
  .data-table,
  .invoice-table,
  .balance-table,
  .tax-reference-table-wrap,
  .tax-summary-table,
  .table-wrap
) thead :is(th, td) {
  border-color: var(--ui-table-border-control) !important;
}

#app :is(
  .business-record-table,
  .ledger-record-table,
  .special-ledger-table,
  .business-table,
  .independent-payment-table,
  .tax-record-table,
  .core-table,
  .data-table,
  .invoice-table,
  .balance-table,
  .tax-reference-table-wrap,
  .tax-summary-table,
  .table-wrap
) table {
  border-color: var(--ui-table-border-shell) !important;
}

#app :is(
  .business-record-table,
  .ledger-record-table,
  .special-ledger-table,
  .business-table,
  .independent-payment-table,
  .tax-record-table,
  .core-table,
  .data-table,
  .invoice-table,
  .balance-table,
  .tax-reference-table-wrap,
  .tax-summary-table,
  .table-wrap
) tbody :is(th, td),
#app :is(
  .business-record-table,
  .ledger-record-table,
  .special-ledger-table,
  .business-table,
  .independent-payment-table,
  .tax-record-table,
  .core-table,
  .data-table,
  .invoice-table,
  .balance-table,
  .tax-reference-table-wrap,
  .tax-summary-table,
  .table-wrap
) tfoot :is(th, td) {
  border-color: var(--ui-table-border-divider) !important;
}

/* 合计行使用1px表头线色和既有浅色底纹保留层级感。 */
#app :is(
  .business-total-row,
  .table-total-row,
  .total-row,
  .tax-summary-total
) > :is(th, td) {
  border-top-color: var(--ui-table-border-control) !important;
}

/* 页面头部和面板标题的已有分隔线统一颜色，不给原本无分隔线的标题强行增加新线。 */
#app :is(
  .topbar,
  .project-top,
  .work-top,
  .global-header,
  .global-context-bar,
  .panel-title,
  .panel-head,
  .project-home-panel-head,
  .project-list-titlebar,
  .project-list-detail-head,
  .simulation-modal-head,
  .simulation-section-head,
  .tax-calculation-head,
  .closure-section-head,
  .settings-title,
  .table-titlebar
) {
  border-color: var(--ui-border-divider) !important;
}

/* 常见列表分隔线保持轻量但可辨识，避免出现“有的深、有的几乎看不到”的跳变。 */
#app :is(
  .detail,
  .details,
  .confirmation-setting-row,
  .project-access-row,
  .record-detail-row,
  .record-detail-item,
  .business-entry-row,
  .tax-process-step,
  .simulation-process-row,
  .account-safety-row
) {
  border-color: var(--ui-border-soft) !important;
}

/* 语义强调线明确保留：导航/选中/收口状态/品牌线不被全局中性规则改写。 */
#app :is(.closure-status-card.passed, .closure-status-card.pending) {
  border-top-width: 3px !important;
}

#app .closure-status-card.passed {
  border-top-color: #20a36a !important;
}

#app .closure-status-card.pending {
  border-top-color: #e6a23c !important;
}

#app :is(.business-record-selected, .project-list-selected) > :first-child {
  border-left-width: 3px !important;
}

#app :is(.btn.primary, .btn.danger, .btn.success, .btn.warn, .btn.warning, .text-btn) {
  /* 仅提高规则优先级的可读性，具体颜色/是否无框仍由页面语义样式决定。 */
  box-sizing: border-box;
}

/* 合计行视觉收口：保留汇总层级，但不再用高饱和底色和强线制造断层。 */
#app .project-workbench :is(
  .table-wrap.business-record-table,
  .table-wrap.special-ledger-table,
  .table-wrap.planning-block-table,
  .table-wrap.project-list-table-wrap
) > table > tfoot > tr.business-total-row > td {
  background: var(--ui-total-surface) !important;
  border-top: 1px solid var(--ui-table-border-control) !important;
  border-right: 1px solid var(--ui-table-border-divider) !important;
  border-bottom: 0 !important;
  border-left: 0 !important;
  color: #2d4159 !important;
}

#app .project-workbench :is(
  .table-wrap.business-record-table,
  .table-wrap.special-ledger-table,
  .table-wrap.planning-block-table,
  .table-wrap.project-list-table-wrap
) > table > tfoot > tr.business-total-row > td:last-child {
  border-right: 0 !important;
}

/* 合计行中没有数值的占位符（—）居中；金额单元格继续沿用财务表格右对齐。 */
#app .project-workbench :is(
  .table-wrap.business-record-table,
  .table-wrap.special-ledger-table,
  .table-wrap.planning-block-table,
  .table-wrap.project-list-table-wrap
) > table > tfoot > tr.business-total-row > td:not(.right):not(.cell-money) {
  text-align: center !important;
}

#app .project-workbench :is(
  .table-wrap.business-record-table,
  .table-wrap.special-ledger-table,
  .table-wrap.planning-block-table,
  .table-wrap.project-list-table-wrap
) > table > tfoot > tr.business-total-row > td:is(.right, .cell-money) {
  text-align: right !important;
}

/* 合计行全部恢复正常字重，包括历史模板中的 b 标签；数值、标签和短横线保持同一视觉层级。 */
#app :is(
  .business-total-row,
  .table-total-row,
  .total-row,
  .tax-summary-total
) > :is(th, td),
#app :is(
  .business-total-row,
  .table-total-row,
  .total-row,
  .tax-summary-total
) > :is(th, td) * {
  font-weight: 400 !important;
}

/* 分页器和其下方的规则说明属于两个信息区块，保持明确的呼吸空间。 */
#app .project-workbench .tax-prepayment-ledger + .tax-reference-info,
#app .project-workbench .tax-summary-ledger + .tax-reference-info {
  margin-top: 16px !important;
}

/* 对上合同日期筛选：外观收纳为一个控件，内部仍保留两个原生日期输入。 */
#app .project-workbench.upstream-contract-page .upstream-contract-ledger-filter {
  align-items: center;
}

#app .project-workbench.upstream-contract-page .business-filter-label {
  color: var(--business-text) !important;
  font-size: 13px;
  white-space: nowrap;
}

#app .project-workbench.business-filter-standardized .business-date-range {
  position: relative;
  display: flex;
  align-items: center;
  width: 258px;
  min-width: 258px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--business-line) !important;
  background: #fff !important;
  color: var(--business-text);
  box-sizing: border-box;
}

#app .project-workbench.business-filter-standardized .business-date-range:focus-within {
  border-color: #8eaddb !important;
}

#app .project-workbench.business-filter-standardized .business-date-range-empty {
  position: absolute;
  left: 10px;
  color: #7c8798;
  font-size: 13px;
  pointer-events: none;
  white-space: nowrap;
}

#app .project-workbench.business-filter-standardized .business-date-range-values {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  opacity: 0;
}

#app .project-workbench.business-filter-standardized .business-date-range.has-value .business-date-range-values {
  opacity: 1;
}

#app .project-workbench.business-filter-standardized .business-date-range.has-value .business-date-range-empty {
  display: none;
}

#app .project-workbench.business-filter-standardized .business-date-range-part {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 0;
  min-width: 0;
  height: 30px;
  color: #425168;
  font-size: 12px;
  cursor: pointer;
}

#app .project-workbench.business-filter-standardized .business-date-range-part > span {
  overflow: hidden;
  max-width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#app .project-workbench.business-filter-standardized .business-date-range-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
}

#app .project-workbench.business-filter-standardized .business-date-range-separator {
  flex: 0 0 auto;
  margin: 0 8px;
  color: #7c8798;
  font-size: 12px;
}

#app .project-workbench.business-filter-standardized .business-date-range-icon {
  flex: 0 0 auto;
  margin-left: 8px;
  color: var(--business-primary);
  font-size: 14px;
  line-height: 1;
}

/* 清除筛选是当前页的轻量辅助动作：默认无底色，仅在可用时提供明确的 hover 反馈。 */
#app .project-workbench.business-filter-standardized .business-filter-clear {
  flex: 0 0 auto;
  width: auto !important;
  min-width: 64px;
  height: 30px !important;
  min-height: 30px !important;
  margin: 0;
  padding: 0 6px !important;
  border: 1px solid transparent !important;
  background: transparent !important;
  color: #7a8ba3 !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  cursor: pointer;
}

#app .project-workbench.business-filter-standardized .business-filter-clear:not(:disabled):hover,
#app .project-workbench.business-filter-standardized .business-filter-clear:not(:disabled):focus-visible {
  border-color: #d8e0eb !important;
  background: #f7f9fc !important;
  color: var(--business-primary) !important;
}

#app .project-workbench.business-filter-standardized .business-filter-clear:disabled {
  color: #b7c1cf !important;
  cursor: default;
}

/* 八个对上/对下业务台账的合计行：保留汇总底色与边界，但不以粗体制造视觉断层。 */
#app .project-workbench.business-filter-standardized .business-total-row > :is(th, td),
#app .project-workbench.business-filter-standardized .business-total-row > :is(th, td) * {
  font-weight: 400 !important;
}

#app .project-workbench.business-filter-standardized .business-total-row > :is(th, td) {
  background: var(--business-surface) !important;
  border-top: 1px solid var(--business-line) !important;
  color: var(--business-text) !important;
}

@media (max-width: 1500px) {
  #app .project-workbench.business-filter-standardized .business-date-range {
    width: 210px;
    min-width: 210px;
  }

  #app .project-workbench.business-filter-standardized.downstream-ledger-page :is(#business-contract, #business-transfer-method) {
    width: 118px !important;
  }

  #app .project-workbench.business-filter-standardized .business-date-range-part {
    font-size: 11px;
  }
}

@media (max-width: 1250px) {
  #app .project-workbench.business-filter-standardized .business-date-range {
    width: 200px;
    min-width: 200px;
  }

  #app .project-workbench.business-filter-standardized .business-date-range-part {
    font-size: 11px;
  }
}

/* 窄屏时将右侧的导出/新增动作换到下一行，避免清除筛选被压缩或遮挡。 */
@media (max-width: 1320px) {
  #app .project-workbench.business-filter-standardized :is(
    .ledger-prototype-toolbar,
    .invoice-table-toolbar,
    .receipt-ledger-toolbar,
    .downstream-contract-ledger-toolbar
  ) {
    flex-wrap: wrap;
    row-gap: 8px;
  }

  #app .project-workbench.business-filter-standardized :is(
    .ledger-prototype-filter,
    .upstream-contract-ledger-filter,
    .invoice-filter-lite,
    .receipt-ledger-filter,
    .downstream-contract-ledger-filter
  ) {
    flex: 1 1 100%;
    min-width: 100%;
  }

  #app .project-workbench.business-filter-standardized :is(
    .ledger-prototype-actions,
    .v5-upstream-page-actions,
    .invoice-table-actions,
    .receipt-ledger-actions,
    .downstream-contract-ledger-actions
  ) {
    flex: 0 0 auto;
    margin-left: auto;
  }
}

/* 其他主软件台账沿用相同的轻量筛选表达；与八个对上/对下页面分开命名，便于局部接入。 */
#app .project-workbench.table-filter-standardized .business-date-range,
#app .project-workbench.date-filter-standardized .business-date-range {
  position: relative;
  display: flex;
  align-items: center;
  width: 232px;
  min-width: 232px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--business-line) !important;
  background: #fff !important;
  color: #425168;
  box-sizing: border-box;
}

#app .project-workbench.table-filter-standardized .business-date-range:focus-within,
#app .project-workbench.date-filter-standardized .business-date-range:focus-within {
  border-color: #8eaddb !important;
}

#app .project-workbench.table-filter-standardized .business-date-range-empty,
#app .project-workbench.date-filter-standardized .business-date-range-empty {
  position: absolute;
  left: 10px;
  color: #7c8798;
  font-size: 13px;
  pointer-events: none;
  white-space: nowrap;
}

#app .project-workbench.table-filter-standardized .business-date-range-values,
#app .project-workbench.date-filter-standardized .business-date-range-values {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  opacity: 0;
}

#app .project-workbench.table-filter-standardized .business-date-range.has-value .business-date-range-values,
#app .project-workbench.date-filter-standardized .business-date-range.has-value .business-date-range-values {
  opacity: 1;
}

#app .project-workbench.table-filter-standardized .business-date-range.has-value .business-date-range-empty,
#app .project-workbench.date-filter-standardized .business-date-range.has-value .business-date-range-empty {
  display: none;
}

#app .project-workbench.table-filter-standardized .business-date-range-part,
#app .project-workbench.date-filter-standardized .business-date-range-part {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 0;
  min-width: 0;
  height: 30px;
  color: #425168;
  font-size: 12px;
  cursor: pointer;
}

#app .project-workbench.table-filter-standardized .business-date-range-part > span,
#app .project-workbench.date-filter-standardized .business-date-range-part > span {
  overflow: hidden;
  max-width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#app .project-workbench.table-filter-standardized .business-date-range-input,
#app .project-workbench.date-filter-standardized .business-date-range-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
}

#app .project-workbench.table-filter-standardized .business-date-range-separator,
#app .project-workbench.date-filter-standardized .business-date-range-separator {
  flex: 0 0 auto;
  margin: 0 8px;
  color: #7c8798;
  font-size: 12px;
}

#app .project-workbench.table-filter-standardized .business-date-range-icon,
#app .project-workbench.date-filter-standardized .business-date-range-icon {
  flex: 0 0 auto;
  margin-left: 8px;
  color: #1554b5;
  font-size: 14px;
  line-height: 1;
}

#app .project-workbench.table-filter-standardized .table-filter-clear {
  flex: 0 0 auto;
  width: auto !important;
  min-width: 64px;
  height: 30px !important;
  min-height: 30px !important;
  margin: 0;
  padding: 0 6px !important;
  border: 1px solid transparent !important;
  background: transparent !important;
  color: #7a8ba3 !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  cursor: pointer;
}

#app .project-workbench.table-filter-standardized .table-filter-clear:not(:disabled):hover,
#app .project-workbench.table-filter-standardized .table-filter-clear:not(:disabled):focus-visible {
  border-color: #d8e0eb !important;
  background: #f7f9fc !important;
  color: #1554b5 !important;
}

#app .project-workbench.table-filter-standardized .table-filter-clear:disabled {
  color: #b7c1cf !important;
  cursor: default;
}

/* 统一接入的表格仍保留合计层级，但合计文字与数值均采用普通字重。 */
#app .project-workbench.table-filter-standardized :is(
  .business-total-row,
  .table-total-row,
  .total-row,
  .tax-summary-total
) :is(th, td, b, strong, span) {
  font-weight: 400 !important;
}

@media (max-width: 1500px) {
  #app .project-workbench.table-filter-standardized .business-date-range {
    width: 210px;
    min-width: 210px;
  }
}

@media (max-width: 1250px) {
  #app .project-workbench.table-filter-standardized .business-date-range {
    width: 200px;
    min-width: 200px;
  }
}

@media (max-width: 1320px) {
  #app .project-workbench.table-filter-standardized :is(
    .ledger-prototype-toolbar,
    .invoice-table-toolbar,
    .receipt-ledger-toolbar,
    .downstream-contract-ledger-toolbar
  ) {
    flex-wrap: wrap;
    row-gap: 8px;
  }

  #app .project-workbench.table-filter-standardized :is(
    .ledger-prototype-filter,
    .invoice-filter-lite,
    .receipt-ledger-filter,
    .downstream-contract-ledger-filter
  ) {
    flex: 1 1 100%;
    min-width: 100%;
  }

  #app .project-workbench.table-filter-standardized :is(
    .ledger-prototype-actions,
    .invoice-table-actions,
    .receipt-ledger-actions,
    .downstream-contract-ledger-actions
  ) {
    flex: 0 0 auto;
    margin-left: auto;
  }
}

@media (max-width: 900px) {
  #app .project-workbench.table-filter-standardized .invoice-filter-lite {
    flex-wrap: wrap;
  }
}

/* 固定金额规则由外层设置卡片承载层级，计划表本身不再叠加第二层装饰容器。 */
#app .project-rule-standard-page [data-rule-section="guarantee"] .rule-mode-panel[data-choice-panel="固定金额"] .management-plan,
#app .project-rule-standard-page [data-rule-section="management_fee"] .rule-mode-panel[data-choice-panel="固定金额"] .management-plan {
  border: 0 !important;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

/* 分期金额默认按表格数据呈现，悬停或编辑时再恢复控件边框。 */
#app .project-workbench.project-rule-standard-page [data-rule-installment] .rule-installment-plan td .input[data-plan-amount] {
  border-width: 0 !important;
  border-style: none !important;
  border-color: transparent !important;
}

#app .project-workbench.project-rule-standard-page [data-rule-installment] .rule-installment-plan td .input[data-plan-amount]:hover {
  border-width: 1px !important;
  border-style: solid !important;
  border-color: var(--ui-border-control) !important;
}

#app .project-workbench.project-rule-standard-page [data-rule-installment] .rule-installment-plan td .input[data-plan-amount]:focus {
  border-width: 1px !important;
  border-style: solid !important;
  border-color: var(--ui-border-focus) !important;
}

/* 普通多行输入框统一使用可读的字号、行距和内边距；各业务页面仍可保留自己的最小高度。 */
#app textarea.input {
  height: auto;
  min-height: 92px;
  padding: 12px 14px;
  color: #173a70;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.65;
  caret-color: #173a70;
  resize: vertical;
}

/* 复核中心与修改记录沿用业务台账的日期范围；原生输入只负责选择，文字格式固定。 */
#app .project-workbench.date-filter-standardized :is(.approval-filter-dates, .project-change-dates) .business-date-range {
  width: 258px;
  min-width: 258px;
  max-width: 100%;
  height: 34px;
  border-radius: 5px;
}
#app .project-workbench.date-filter-standardized :is(.approval-filter-dates, .project-change-dates) .business-date-range-input {
  width: 100% !important;
  min-width: 0 !important;
  height: 100% !important;
  min-height: 0 !important;
  flex: none !important;
}
#app .project-workbench.date-filter-standardized .business-date-range.is-disabled {
  opacity: .6;
  cursor: default;
}

/* 税费预缴台账有更高优先级的历史边框声明，单独收口到同一套线色。 */
#app .project-workbench.tax-prepayment-page :is(.tax-prepayment-ledger, .tax-company-prepayment-ledger) .business-record-table thead :is(th, td) {
  border-color: var(--ui-table-border-control) !important;
}
#app .project-workbench.tax-prepayment-page :is(.tax-prepayment-ledger, .tax-company-prepayment-ledger) .business-record-table tbody :is(th, td) {
  border-color: var(--ui-table-border-divider) !important;
}
#app .project-workbench.tax-prepayment-page :is(.tax-prepayment-ledger, .tax-company-prepayment-ledger) .business-record-table tfoot :is(th, td) {
  border-color: var(--ui-table-border-divider) !important;
}
#app .project-workbench.tax-prepayment-page :is(.tax-prepayment-ledger, .tax-company-prepayment-ledger) .business-record-table .business-total-row > :is(th, td) {
  border-top-color: var(--ui-table-border-control) !important;
}
