:root{font:16px/1.5 "Segoe UI","Microsoft YaHei",sans-serif;color:#19352b;background:#f6f5f0;color-scheme:light}
*{box-sizing:border-box}[hidden]{display:none!important}body{margin:0}header{background:#173e32;color:white;padding:14px max(16px,calc((100vw - 760px)/2));display:flex;justify-content:space-between;align-items:center}header span{font-weight:750;letter-spacing:.13em}header b{font-weight:400}nav,.split,.actions,.top-actions,.section-title,.total,.choices{display:flex;gap:10px;align-items:center;flex-wrap:wrap}nav a,nav button{color:#fff;font-size:.9rem}nav button{background:transparent}main{max-width:790px;margin:auto;padding:16px 14px 40px}h1{font-size:clamp(1.7rem,5vw,2.4rem);margin:.4em 0}h1 small{font-family:Georgia,serif;font-weight:400;font-size:.56em;color:#567268}h2{font-size:1.13rem;margin:0 0 12px}.section-title,.total,.top-actions{justify-content:space-between}.section-title h2{margin:0}.section-title{margin-bottom:12px}
section,#login{background:#fff;border:1px solid #d5ded6;border-radius:12px;padding:16px;margin:12px 0}#login{max-width:450px}label,small{display:block;color:#486155}label{font-size:.88rem;margin-bottom:8px}input,select,textarea{width:100%;margin-top:4px;padding:9px 10px;min-height:44px;background:white;border:1px solid #aebfb2;border-radius:6px;color:#182f25;font:inherit;font-size:16px}button,.picker{min-height:44px;padding:9px 14px;border:0;border-radius:7px;background:#1f5141;color:white;font:inherit;font-weight:600;cursor:pointer}button:disabled,fieldset:disabled .picker{opacity:.5;cursor:default}.secondary,.picker{background:#edf3ed;color:#244a38}.text{background:transparent;color:#225c47}.picker{position:relative;display:grid;align-items:center;margin:0}.picker input{position:absolute;width:100%;height:100%;inset:0;opacity:0;margin:0;cursor:pointer}
form:not(#login){display:flex;gap:8px;align-items:end;margin:0 0 12px}form:not(#login) label{flex:1;min-width:0;margin:0}fieldset{margin:0;padding:0;border:0;min-width:0}#feedback:not(:empty),#receipt:not(:empty){border-left:4px solid #7d9057;padding:8px 12px;background:#ecf0e2;white-space:pre-line}.error:not(:empty){border-color:#b3493b!important;background:#fff0eb!important;color:#812c22}.line{padding:12px 0;border-top:1px solid #dce5dc}.line strong{overflow-wrap:anywhere}.fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px 10px}.line-tools{display:flex;gap:6px;justify-content:flex-end}.draft{display:block;width:100%;text-align:left;background:#f4f6f2;color:#23483c;margin:.4rem 0}.total{padding:12px 0}.total strong{font-size:1.4rem}small{font-size:.78rem}#selectedPhotos,#customer{display:block;margin:8px 0}.choices button{margin:3px 0}.top-actions>span{font-size:.9rem;color:#486155}
@media(min-width:650px){main{padding:24px}.fields{grid-template-columns:repeat(3,minmax(0,1fr))}section{padding:20px}}
.label-photo{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:10px;padding:8px 0;border-bottom:1px solid #d5ded6}
.photo-preview{width:68px;padding:2px;color:#244a38;background:#edf3ed}
.photo-preview img{display:block;width:64px;height:64px;object-fit:contain;background:#f6f5f0;border-radius:4px}
.photo-preview small{line-height:1.55}
.label-photo span,.label-photo small,#photoFeedback{overflow-wrap:anywhere}
#photoFeedback:not(:empty){margin-top:8px}
.crop-link{display:block;color:#1f5141;text-decoration:underline;background:transparent;padding:3px 0;font-size:.88rem}
#cropDialog,#codeDialog{width:min(94vw,560px);max-height:92vh;overflow:auto;border:1px solid #aebfb2;border-radius:12px;padding:14px;color:#182f25}
#cropDialog::backdrop,#codeDialog::backdrop{background:rgba(12,28,21,.58)}
#cropDialog p{margin:8px 0}
#cropCanvas{display:block;max-width:100%;max-height:54vh;width:auto;height:auto;margin:8px auto;cursor:crosshair;touch-action:manipulation}
.crop-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:6px;margin-top:8px}
#codeDialog form{display:block}
.check-image-frame{width:100%;height:min(40vh,350px);margin:8px 0 12px;background:#f6f5f0;border-radius:6px;overflow:auto}
#checkImage{display:block;width:100%;height:100%;object-fit:contain}
.check-image-frame.zoomed #checkImage{width:200%;height:auto}
#codeDialog h2{margin-bottom:4px}
#photoCounts{margin:8px 0}
#addMatched{display:block;width:100%}
#candidates{list-style:none;padding:0;margin:0}
.photo-result{padding:8px 0;border-bottom:1px solid #d5ded6}
.result-heading,.result-code{display:flex;justify-content:space-between;align-items:center;gap:8px}
.result-heading>span,.result-code>div{min-width:0;overflow-wrap:anywhere}
.result-heading>span{font-size:.875rem;color:#486155}
.result-heading button,.result-code>small{flex-shrink:0}
.result-heading .crop-link{margin:0}
.photo-links{display:flex;flex-wrap:wrap;gap:0 12px}
