.pd-modal { position: fixed; inset: 0; z-index: 120; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(15, 23, 42, .48); color: #1f2937; }
.pd-modal *, .pd-modal *::before, .pd-modal *::after { box-sizing: border-box; }
.pd-modal .pd-shell { display: flex; flex-direction: column; width: min(1080px, 100%); height: min(760px, calc(100dvh - 48px)); max-height: none; min-width: 0; background: #fff; border: 1px solid #dce4e8; border-radius: 16px; box-shadow: 0 24px 80px rgba(15, 23, 42, .25); overflow: hidden; }
.pd-modal .pd-header { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 24px 16px; }
.pd-modal .pd-header > div { min-width: 0; }
.pd-modal h2 { margin: 0; font-size: 20px; line-height: 1.5; }
.pd-modal h3 { margin: 0; font-size: 16px; line-height: 1.5; overflow-wrap: anywhere; }
.pd-modal .pd-header p { margin: 4px 0 0; color: #64748b; font-size: 13px; overflow-wrap: anywhere; }
.pd-modal .pd-button { display: inline-flex; width: auto; min-height: 34px; align-items: center; justify-content: center; padding: 7px 13px; margin: 0; flex: 0 0 auto; border: 1px solid #cbd5e1; border-radius: 7px; background: #fff; color: #334155; font-size: 13px; font-weight: 500; line-height: 1.3; cursor: pointer; }
.pd-modal .pd-button:hover { background: #f1f5f9; }
.pd-modal .pd-primary { background: #0f766e; border-color: #0f766e; color: #fff; }
.pd-modal .pd-primary:hover { background: #115e59; }
.pd-modal .pd-quiet { background: #fff; }
.pd-modal .pd-close { border-color: #d5dce4; }
.pd-modal button:disabled { opacity: .5; cursor: wait; }
.pd-modal button:focus-visible, .pd-modal input:focus-visible, .pd-modal select:focus-visible, .pd-modal textarea:focus-visible { outline: 2px solid #0f766e; outline-offset: 2px; }
.pd-modal .pd-tabs { display: flex; flex: 0 0 auto; gap: 20px; padding: 0 24px; border-bottom: 1px solid #e2e8f0; background: #fff; }
.pd-modal .pd-tab { width: auto; margin: 0; padding: 12px 3px; border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: transparent; color: #64748b; font-size: 14px; cursor: pointer; }
.pd-modal .pd-tab.is-active { border-bottom-color: #0f766e; color: #0f766e; font-weight: 700; }
.pd-modal .pd-content { min-height: 200px; overflow-y: auto; overflow-x: hidden; padding: 20px 24px 24px; overscroll-behavior: contain; }
.pd-modal .pd-page-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.pd-modal .pd-page-heading > div { min-width: 0; }
.pd-modal .pd-page-heading h3 + .pd-status { margin-top: 7px; }
.pd-modal .pd-muted { color: #64748b; font-size: 12px; line-height: 1.7; margin: 5px 0 0; font-weight: 400; overflow-wrap: anywhere; }
.pd-modal .pd-notice { padding: 12px 14px; margin-bottom: 18px; border: 1px solid #d7e9e6; border-radius: 8px; background: #f2faf8; color: #45635d; font-size: 13px; line-height: 1.8; overflow-wrap: anywhere; }
.pd-modal .pd-message { padding: 11px 13px; margin-bottom: 16px; border: 1px solid #a7d7c8; border-radius: 7px; background: #effaf6; color: #145e46; font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
.pd-modal .pd-message.pd-error { background: #fff7ed; border-color: #fed7aa; color: #9a3412; }
.pd-modal [hidden] { display: none !important; }
.pd-modal .pd-table-wrap { width: 100%; border: 1px solid #e2e8f0; border-radius: 9px; overflow: hidden; }
.pd-modal .pd-table { width: 100%; table-layout: fixed; border-collapse: collapse; margin: 0; font-size: 13px; }
.pd-modal .pd-table th, .pd-modal .pd-table td { padding: 13px 12px; border: 0; border-bottom: 1px solid #edf1f5; text-align: left; white-space: normal; overflow-wrap: anywhere; vertical-align: middle; }
.pd-modal .pd-table th { background: #f8fafc; color: #64748b; font-size: 12px; font-weight: 500; }
.pd-modal .pd-table th:first-child { width: 30%; }
.pd-modal .pd-table th:nth-child(2) { width: 19%; }
.pd-modal .pd-table th:nth-child(3) { width: 14%; }
.pd-modal .pd-table th:nth-child(4) { width: 23%; }
.pd-modal .pd-table th:last-child { width: 14%; }
.pd-modal .pd-table tr:last-child td { border-bottom: 0; }
.pd-modal .pd-table td strong { font-weight: 600; }
.pd-modal .pd-status { display: inline-block; padding: 3px 8px; border-radius: 5px; background: #f1f5f9; color: #64748b; font-size: 12px; line-height: 1.5; white-space: nowrap; }
.pd-modal .pd-status-submitted, .pd-modal .pd-status-pending { background: #fff5d9; color: #996800; }
.pd-modal .pd-status-approved, .pd-modal .pd-status-accepted { background: #e6f6ef; color: #14764f; }
.pd-modal .pd-status-rejected, .pd-modal .pd-status-returned { background: #fff0e8; color: #ae512b; }
.pd-modal .pd-empty { padding: 52px 16px; text-align: center; color: #64748b; font-size: 14px; line-height: 1.8; }
.pd-modal .pd-form-grid, .pd-modal .pd-details { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px 22px; }
.pd-modal .pd-field { display: flex; flex-direction: column; gap: 7px; margin: 0; min-width: 0; font-size: 13px; font-weight: 500; }
.pd-modal .pd-wide { grid-column: 1 / -1; }
.pd-modal input, .pd-modal select, .pd-modal textarea { width: 100%; min-width: 0; min-height: 36px; margin: 0; padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 7px; background: #fff; color: #1f2937; font: inherit; font-size: 13px; line-height: 1.5; }
.pd-modal textarea { resize: vertical; min-height: 78px; }
.pd-modal .pd-section { padding-top: 18px; margin-top: 4px; border-top: 1px solid #e5eaf0; min-width: 0; }
.pd-modal .pd-section > h3, .pd-modal .pd-section-heading { margin-bottom: 8px; }
.pd-modal .pd-section > .pd-form-grid { margin-top: 12px; }
.pd-modal .pd-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pd-modal .pd-check-list { display: flex; flex-direction: column; gap: 8px; max-height: 144px; overflow-y: auto; padding: 10px 12px; border: 1px solid #e2e8f0; border-radius: 7px; }
.pd-modal .pd-check { display: flex; align-items: flex-start; gap: 7px; margin: 0; min-width: 0; color: #475569; font-size: 13px; font-weight: 400; }
.pd-modal .pd-check input { width: 15px; min-width: 15px; min-height: 15px; height: 15px; margin: 3px 0 0; padding: 0; accent-color: #0f766e; }
.pd-modal .pd-check span { overflow-wrap: anywhere; }
.pd-modal .pd-deliverable { display: grid; grid-template-columns: minmax(0, 1fr) 80px minmax(0, 1fr) auto; align-items: center; gap: 10px; margin-top: 10px; }
.pd-modal .pd-form-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 24px; padding-top: 18px; border-top: 1px solid #e5eaf0; }
.pd-modal .pd-action-summary { grid-column: 1 / -1; margin: 0; font-size: 15px; line-height: 1.8; overflow-wrap: anywhere; }
.pd-modal .pd-form-grid > .pd-notice { grid-column: 1 / -1; margin: 0; }
.pd-modal .pd-details { margin: 18px 0 22px; font-size: 13px; }
.pd-modal .pd-details > div { min-width: 0; }
.pd-modal .pd-details dt { margin-bottom: 6px; color: #64748b; }
.pd-modal .pd-details dd { margin: 0; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.pd-modal .pd-money { font-weight: 700; font-size: 18px; }
.pd-modal .pd-delivered-list { display: flex; flex-direction: column; gap: 10px; list-style: none; padding: 0; margin: 12px 0 20px; }
.pd-modal .pd-delivered-list li { display: grid; grid-template-columns: 60px minmax(0, 1fr) minmax(0, 1fr); gap: 12px; font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
.pd-modal .pd-delivered-list .pd-muted { margin: 0; }
.pd-modal .pd-done { color: #14764f; }
.pd-modal .pd-history { list-style: none; margin: 12px 0 0; padding: 0; font-size: 12px; }
.pd-modal .pd-history li { padding: 10px 0; border-bottom: 1px solid #edf1f5; overflow-wrap: anywhere; }
.pd-modal .pd-history strong { margin-right: 12px; font-weight: 600; }
.pd-modal .pd-history span { color: #64748b; }
.pd-modal .pd-history p { white-space: pre-wrap; margin: 5px 0 0; line-height: 1.7; }
.pd-modal .pd-reload { margin-top: 16px; }
.pd-modal .pd-new-modes { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.pd-modal .pd-extra-confirmation { padding: 14px 16px; margin-top: 12px; border: 1px solid #e2e8f0; border-radius: 8px; background: #f8fafc; }
.pd-modal .pd-extra-confirmation .pd-details { margin-bottom: 0; gap: 12px 20px; }
.pd-modal .pd-extra-confirmation .pd-section-heading { align-items: flex-start; flex-wrap: wrap; }
.pd-modal [data-pd-extra-source-info] .pd-button { margin-left: 5px; min-height: 28px; padding: 4px 8px; font-size: 12px; }
@media (max-width: 1100px) { .pd-modal { padding: 18px; } .pd-modal .pd-shell { height: calc(100dvh - 36px); } .pd-modal .pd-header { padding: 18px 20px 14px; } .pd-modal .pd-tabs { padding: 0 20px; } .pd-modal .pd-content { padding: 18px 20px 22px; } .pd-modal .pd-table th, .pd-modal .pd-table td { padding: 12px 9px; } }
@media (max-width: 700px) { .pd-modal { padding: 8px; } .pd-modal .pd-shell { height: calc(100dvh - 16px); border-radius: 10px; } .pd-modal .pd-content { padding: 16px; } .pd-modal .pd-form-grid, .pd-modal .pd-details { grid-template-columns: minmax(0, 1fr); } .pd-modal .pd-deliverable { grid-template-columns: minmax(0, 1fr) 80px; } .pd-modal .pd-table { font-size: 12px; } .pd-modal .pd-table th:nth-child(4), .pd-modal .pd-table td:nth-child(4) { display: none; } .pd-modal .pd-table th:last-child { width: 24%; } .pd-modal .pd-table .pd-button { padding: 6px; font-size: 12px; } }

/* 手机端统一交付弹窗的尺寸、表单和列表行为。 */
@media (max-width:768px) {
  .pd-modal { padding:8px; align-items:flex-end; }
  .pd-modal .pd-shell { width:100%; height:calc(100dvh - 16px); border-radius:10px 10px 0 0; }
  .pd-modal .pd-header { align-items:flex-start; flex-wrap:wrap; gap:10px; padding:14px 16px 12px; }
  .pd-modal .pd-header > div { flex:1 1 100%; }
  .pd-modal .pd-header .pd-close { position:absolute; top:12px; right:12px; }
  .pd-modal h2 { padding-right:52px; font-size:18px; }
  .pd-modal .pd-tabs { gap:14px; padding:0 16px; overflow-x:auto; white-space:nowrap; }
  .pd-modal .pd-tab { flex:0 0 auto; padding:10px 2px; font-size:13px; }
  .pd-modal .pd-content { padding:14px 16px 20px; }
  .pd-modal .pd-page-heading,
  .pd-modal .pd-section-heading { align-items:flex-start; flex-wrap:wrap; gap:8px; }
  .pd-modal .pd-page-heading > div { flex:1 1 100%; }
  .pd-modal .pd-form-grid,
  .pd-modal .pd-details { grid-template-columns:minmax(0,1fr); gap:12px; }
  .pd-modal .pd-field,
  .pd-modal .pd-form-grid > *,
  .pd-modal .pd-details > * { min-width:0; }
  .pd-modal .pd-deliverable { grid-template-columns:minmax(0,1fr); gap:8px; }
  .pd-modal .pd-form-footer { align-items:stretch; flex-direction:column; }
  .pd-modal .pd-form-footer .pd-button { width:100%; }
  .pd-modal .pd-table-wrap { overflow-x:auto; max-width:100%; -webkit-overflow-scrolling:touch; }
  .pd-modal .pd-table { width:620px; min-width:620px; table-layout:fixed; font-size:12px; }
  .pd-modal .pd-table th,
  .pd-modal .pd-table td { padding:10px 8px; white-space:normal; overflow-wrap:anywhere; }
  .pd-modal .pd-table th:nth-child(4),
  .pd-modal .pd-table td:nth-child(4) { display:none; }
  .pd-modal .pd-table th:last-child { width:22%; }
  .pd-modal .pd-table .pd-button { padding:6px 7px; font-size:12px; }
  .pd-modal .pd-delivered-list li { grid-template-columns:minmax(0,1fr); gap:2px; }
  .pd-modal .pd-details dd { overflow-wrap:anywhere; }
}
.project-delivery-entry { display: none; }
@media (min-width: 769px) {
  body.pc-ui-preview .project-delivery-entry { display: block; margin: 16px 0; padding: 12px 14px; border: 1px solid #dce4e8; border-radius: 8px; background: #fff; }
  body.pc-ui-preview .project-delivery-entry > summary { cursor: pointer; font-weight: 600; }
  body.pc-ui-preview .project-delivery-entry-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding-top: 12px; }
  body.pc-ui-preview .project-delivery-entry-actions button { width: auto; margin: 0; }
}

/* Keep project task / acceptance actions usable with one hand. */
@media (max-width: 700px) {
  .pd-modal { padding: 0; align-items: flex-end; }
  .pd-modal .pd-shell { width: 100%; height: 95dvh; max-height: 95dvh; border-radius: 14px 14px 0 0; }
  .pd-modal .pd-header { align-items: flex-start; padding: 16px 16px 12px; }
  .pd-modal .pd-tabs { gap: 16px; padding: 0 16px; overflow-x: auto; }
  .pd-modal .pd-tab { min-height: 42px; white-space: nowrap; }
  .pd-modal .pd-content { padding: 15px 16px calc(20px + env(safe-area-inset-bottom)); }
  .pd-modal .pd-button { min-height: 42px; padding: 9px 12px; touch-action: manipulation; }
  .pd-modal .pd-page-heading { align-items: flex-start; }
  .pd-modal .pd-form-footer { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pd-modal .pd-form-footer .pd-button { width: 100%; }
  .pd-modal .pd-check { min-height: 38px; align-items: center; }
  .pd-modal .pd-check input { width: 19px; min-width: 19px; min-height: 19px; height: 19px; }
}
