/* 复核详情最终覆盖层：加载顺序必须位于业务模块样式之后。 */
#app .record-detail-dialog-panel :is(
  .business-record-detail-head,
  .contract-detail-head,
  .downstream-contract-detail-head,
  .settlement-detail-head,
  .receipt-detail-head,
  .invoice-detail-head,
  .stamp-detail-head,
  .project-list-detail-head
) {
  display: block !important;
  min-height: 58px;
  padding: 18px 68px 18px 22px !important;
  border-bottom: 1px solid #e4eaf2 !important;
  background: #fff !important;
}

#app .record-detail-dialog-panel :is(
  .business-record-detail-head,
  .contract-detail-head,
  .downstream-contract-detail-head,
  .settlement-detail-head,
  .receipt-detail-head,
  .invoice-detail-head,
  .stamp-detail-head,
  .project-list-detail-head
) > p {
  margin: 6px 0 0 !important;
}

#app .record-detail-dialog-panel :is(
  .business-record-detail-head,
  .contract-detail-head,
  .downstream-contract-detail-head,
  .settlement-detail-head,
  .receipt-detail-head,
  .invoice-detail-head,
  .stamp-detail-head,
  .project-list-detail-head
) h2,
#app .project-creation-detail-modal .simulation-modal-head h2 {
  margin: 0;
  color: #1f2937;
  font-size: 18px;
  font-weight: 400 !important;
  line-height: 1.4;
}

#app .record-detail-dialog-panel.record-detail-dialog-movable {
  position: fixed !important;
  margin: 0 !important;
  max-width: none !important;
}

/* 弹窗圆角最终统一：详情外框与标准业务弹窗均按 10px，内容层随外框裁切。 */
#app .record-detail-dialog-panel,
#app .project-workbench :is(
  .contract-entry-modal,
  .downstream-contract-entry-modal,
  .settlement-entry-modal,
  .invoice-entry-modal,
  .receipt-entry-modal,
  .tax-prepayment-entry-modal,
  .simulation-modal
) {
  border-radius: 10px !important;
}

#app .record-detail-dialog-panel > :is(
  aside,
  .contract-record-detail,
  .invoice-record-detail,
  .settlement-record-detail,
  .receipt-record-detail,
  .downstream-contract-record-detail,
  .project-list-detail
) {
  border-radius: inherit !important;
}

#app .record-detail-dialog-panel :is(
  .contract-detail-body,
  .downstream-contract-detail-body,
  .settlement-detail-body,
  .receipt-detail-body,
  .invoice-detail-body,
  .project-list-detail-body
) {
  padding: 8px 22px 14px !important;
}

#app .record-detail-dialog-panel :is(
  .contract-detail-body,
  .downstream-contract-detail-body,
  .settlement-detail-body,
  .receipt-detail-body,
  .invoice-detail-body,
  .project-list-detail-body
) dl > div,
#app .project-creation-detail-field {
  display: grid;
  padding: 12px 0;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 20px;
  border-bottom: 1px solid #edf1f6;
}

#app .record-detail-dialog-panel :is(
  .business-record-detail-actions,
  .contract-detail-actions,
  .downstream-contract-detail-actions,
  .settlement-detail-actions,
  .receipt-detail-actions,
  .invoice-detail-actions,
  .project-list-detail-actions
),
#app .project-creation-detail-actions {
  display: flex !important;
  min-height: 64px;
  margin: 0 !important;
  padding: 14px 22px !important;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  border-top: 1px solid #e4eaf2;
  background: #fafbfd;
}

#app .record-detail-dialog-panel :is(
  .business-record-detail-actions,
  .contract-detail-actions,
  .downstream-contract-detail-actions,
  .settlement-detail-actions,
  .receipt-detail-actions,
  .invoice-detail-actions,
  .project-list-detail-actions
) .btn,
#app .project-creation-detail-actions .btn {
  width: auto !important;
  min-width: 76px;
  min-height: 34px;
  flex: 0 0 auto !important;
  padding: 0 16px !important;
  border-radius: 5px !important;
  font-size: 13px;
  font-weight: 400;
  box-shadow: none;
}

/* 对上旧侧栏把按钮设成 2px；详情弹窗内按对下的 5px 覆盖它。 */
#app .project-workbench .record-detail-dialog-panel .business-detail-drawer .business-record-detail-actions .btn {
  border-radius: 5px !important;
}

/* 对上、对下实际共用的详情按钮保持 5px；聚焦环跟随按钮圆角。 */
#app .record-detail-dialog-panel .business-record-detail-actions .btn:focus-visible {
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(23, 105, 232, .28) !important;
}

/* 各台账详情的操作栏贴齐弹窗两侧与底边。 */
#app .record-detail-dialog-panel :is(
  .invoice-detail-body,
  .contract-detail-body,
  .downstream-contract-detail-body,
  .settlement-detail-body,
  .receipt-detail-body
) > :is(
  .invoice-detail-actions,
  .contract-detail-actions,
  .downstream-contract-detail-actions,
  .settlement-detail-actions,
  .receipt-detail-actions
) {
  margin: 0 -22px -14px !important;
  padding: 14px 22px !important;
  border-top-color: #e4eaf2 !important;
}

#app .project-workbench.project-closure-page .closure-record-detail-dialog:is(
  [data-closure-detail-type="archive"],
  [data-closure-detail-type="exception"],
  [data-closure-detail-type="check"]
) .record-detail-dialog-panel :is(.invoice-detail-body, .contract-detail-body) > :is(.invoice-detail-actions, .contract-detail-actions) {
  margin: 0 -22px -14px !important;
  padding: 14px 22px !important;
  border-top-color: #e4eaf2 !important;
}

#app .tax-prepayment-entry-modal .tax-field-heading {
  display: inline-flex;
  align-items: center;
  width: max-content;
}

#app .tax-prepayment-entry-modal .tax-field-help::after {
  width: 280px;
  max-width: min(280px, calc(100vw - 64px));
  right: 0;
  left: auto;
}

/* 问号提示向弹窗内展开，表单控件保持在各自网格列内。 */
#app .tax-prepayment-entry-modal .dialog-interactive-content {
  overflow-x: hidden;
  overflow-y: auto;
}

#app .tax-prepayment-entry-modal .form-grid > label,
#app .tax-prepayment-entry-modal .form-grid .input {
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 620px) {
  #app .project-creation-detail-field {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}
