/* Copyright (c) 2026 印广云。适用根 LICENSE；正常开发与授权审计不受限制。 */
#photoPackModes, #documentPackModes { max-height: 240px; overflow-y: auto; }
.pack-card-preview.fill-pack { grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(3, 1fr); }
.pack-card-preview.quantity-pack { grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(2, 1fr); }
.pack-card-preview.quantity-pack i:first-child { grid-row: span 2; }
.layout-workflow-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.stats-row { flex-wrap: wrap; }
.layout-template-thumb { position: relative; }
.layout-template-thumb > small { position: absolute; right: 0; bottom: 0; background: #fff; color: #555; padding: 1px 3px; border-radius: 3px; }
.layout-template-slot { display: flex; align-items: center; justify-content: center; font-size: 9px; font-style: normal; color: #7a3b0a; }
.legacy-source-size { display: none !important; }
.source-inline-group + .source-inline-group { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 4px; }
.source-context-menu .source-inline-remove { float: right; width: 24px; padding: 0; text-align: center; }
#sourceContextMenu { max-height: calc(100vh - 16px); overflow-y: auto; }
#photoLayoutTemplateSize { display: none !important; }
.layout-modified-hint { font-size: 11px; color: #97511d; margin-inline: 6px; }
.source-layout-groups-card { width: min(940px, calc(100vw - 32px)); max-height: calc(100vh - 48px); display: flex; flex-direction: column; }
.source-layout-groups-rows { overflow: auto; min-height: 0; padding: 4px; }
.source-layout-group-row { display: grid; grid-template-columns: 48px minmax(92px, 1.2fr) repeat(3, minmax(65px, 1fr)) 82px 80px 46px 46px; gap: 8px; align-items: end; border-bottom: 1px solid #e5e5e5; padding: 12px 0; }
.source-layout-group-row > strong { align-self: center; font-size: 12px; }
.source-layout-group-row label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; min-width: 0; }
.source-layout-group-row input, .source-layout-group-row select { width: 100%; min-width: 0; height: 32px; box-sizing: border-box; }
.source-layout-group-row .source-group-fill { flex-direction: row; align-items: center; align-self: center; }
.source-group-fill input { width: 14px; }
.source-layout-groups-actions { display: flex; gap: 8px; justify-content: flex-end; padding-top: 12px; }
.source-layout-groups-actions > :first-child { margin-right: auto; }
#sourceLayoutGroupsError { color: #b02a25; font-size: 13px; margin: 8px 0 0; }
.layout-replace-dialog { border: 1px solid #ddd; border-radius: 12px; padding: 20px; width: min(440px, calc(100vw - 40px)); }
.layout-replace-dialog::backdrop { background: #0005; }
.layout-replace-dialog label { display: grid; gap: 8px; }
.layout-replace-dialog select { height: 36px; }
.layout-replace-dialog .btn { margin-right: 8px; }
@media (max-width: 780px) {
  .source-layout-group-row { grid-template-columns: 48px repeat(3, minmax(65px, 1fr)); }
  .layout-modified-hint { max-width: 130px; }
}
.pointer-sortable { touch-action: none; cursor: grab; user-select: none; }
.pointer-sortable.sort-editing { animation: button-sort-wiggle .24s ease-in-out infinite alternate; }
.pointer-sortable.sort-editing:nth-child(even) { animation-delay: -.17s; animation-direction: alternate-reverse; }
.pointer-sortable.sort-placeholder { opacity: 0 !important; animation: none; }
.button-sort-active, .button-sort-active * { cursor: grabbing !important; user-select: none !important; }
@keyframes button-sort-wiggle { from { rotate: -1.5deg; } to { rotate: 1.5deg; } }
@media (prefers-reduced-motion: reduce) {
  .pointer-sortable.sort-editing { animation: none; outline: 1px solid #ff684a; }
}
.print-copies-bar { display: flex; align-items: center; justify-content: center; flex-wrap: nowrap; gap: 8px; min-width: 0; padding: 4px 0; margin: 4px 0 6px; font: 500 11px/1.2 "Microsoft YaHei", sans-serif; }
.print-copies-title { font-size: 11px; color: #8895a7; white-space: nowrap; }
.print-copies-presets { display: flex; flex: 0 1 216px; align-items: center; gap: 1px; min-width: 0; padding: 2px; border: 1px solid var(--border); border-radius: 8px; background: #f1f5f9; }
.print-copies-bar button { min-width: 0; height: 23px; padding: 0; border: 0; border-radius: 5px; background: transparent; color: #65758c; cursor: pointer; font: 500 11px/1.2 "Microsoft YaHei", sans-serif; transition: background .15s, color .15s, box-shadow .15s; }
.print-copies-presets > button { flex: 1; }
.print-copies-bar button:hover { color: var(--primary, #ff684a); background: #ffffff80; }
.print-copies-bar button.active { color: var(--primary, #ff684a); background: #fff; box-shadow: 0 2px 6px #26344b12; }
.print-copies-custom { display: flex; flex: 0 0 auto; align-items: center; gap: 1px; margin-left: 3px; padding: 0 1px 0 4px; height: 23px; box-sizing: border-box; border-left: 1px solid #e3e9f0; color: #8895a7; }
.print-copies-custom:focus-within { border-left-color: #e3e9f0; }
.print-copies-custom input { box-sizing: border-box; width: 21px; height: 23px; min-width: 0; padding: 0; text-align: center; border: 0; border-radius: 5px; background: #fff; color: #53627a; font: 500 11px/1.2 "Microsoft YaHei", sans-serif; }
#printCopiesBar :focus-visible { outline: 1px solid rgba(255, 111, 79, .32); outline-offset: 0; box-shadow: none; }
.print-copies-steppers { display: flex; flex-direction: column; gap: 1px; }
.print-copies-steppers button { flex: none; width: 14px; height: 11px; font: 11px/10px sans-serif; border-radius: 3px; }
.ai-inline-panel .ai-print-row .ai-generate-button { display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 4px; height: 38px; }
.ai-generate-button .ai-processing-cost { flex: 0 0 auto; font-size: 11px; line-height: 1.2; font-weight: 400; color: inherit; opacity: .85; }

.layout-template-slot, .layout-template-slot.mirrored { border:1px solid #c8d2df; background:rgba(226,232,240,.15); box-shadow:none; }
.layout-template-slot::after { display:none; }

#layoutTemplateDetails { box-sizing:border-box; width:min(640px,92vw); max-height:85vh; overflow:auto; padding:22px; border:1px solid #e1e7ef; border-radius:16px; color:#25354b; box-shadow:0 20px 60px #172b4d30; }
#layoutTemplateDetails::backdrop { background:#172b4d55; }
.template-details-header { display:flex; align-items:center; gap:16px; }
.template-details-header h3 { margin:0 0 8px; overflow-wrap:anywhere; }
.template-details-header p { margin:0; color:#728198; font-size:13px; }
.template-details-header .layout-template-thumb { flex-shrink:0; }
.template-details-spacing { padding:12px; background:#f4f7fb; border-radius:8px; font-size:13px; line-height:1.7; }
.template-details-body section { margin:16px 0; }
.template-details-body h4 { margin:0 0 8px; font-size:13px; color:#728198; }
.template-details-spec { margin:6px 0; font-size:14px; line-height:1.7; }
.template-details-body details { border-top:1px solid #e5eaf1; padding-top:12px; overflow:auto; }
.template-details-body summary { cursor:pointer; color:#526781; font-size:13px; }
.template-details-body table { width:100%; margin-top:12px; border-collapse:collapse; font-size:12px; white-space:nowrap; }
.template-details-body caption { text-align:left; padding:8px 0; color:#728198; }
.template-details-body th,.template-details-body td { padding:8px; border-bottom:1px solid #edf1f6; text-align:left; }
.template-details-footer { display:flex; justify-content:flex-end; margin-top:18px; }
