:root{--bg:#f4f6f8;--panel:#fff;--text:#172033;--muted:#667085;--line:#e4e7ec;--dark:#111827;--soft:#eef2f6}
*{box-sizing:border-box}html,body{margin:0;background:var(--bg);color:var(--text);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans TC",sans-serif}
button,input,textarea{font:inherit}button{cursor:pointer}.topbar{position:sticky;top:0;z-index:20;display:flex;justify-content:space-between;align-items:center;padding:14px max(16px,calc((100% - 1180px)/2));background:rgba(255,255,255,.94);backdrop-filter:blur(12px);border-bottom:1px solid var(--line)}
h1,h2,h3,p{margin-top:0}.topbar h1{font-size:20px;margin:2px 0 0}.eyebrow{font-size:11px;font-weight:800;letter-spacing:.14em;color:var(--muted)}
main{max-width:1180px;margin:0 auto;padding:22px 16px 64px}.hero{display:flex;justify-content:space-between;align-items:center;gap:18px;padding:22px;background:var(--dark);color:#fff;border-radius:20px;margin-bottom:16px}
.hero h2{font-size:26px;margin-bottom:8px}.hero p{color:#cbd5e1;margin:0;max-width:700px}.cameraButton,.primary,.secondary,.ghost{border-radius:12px;padding:12px 15px;font-weight:800;border:1px solid transparent}
.cameraButton{background:#fff;color:#111827;min-width:190px;text-align:center}.cameraButton input{display:none}.primary{background:var(--dark);color:#fff}.secondary,.ghost{background:#fff;color:var(--text);border-color:#d0d5dd}
.grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}.panel{background:var(--panel);border:1px solid var(--line);border-radius:18px;padding:18px;box-shadow:0 3px 14px rgba(16,24,40,.04)}
.panelTitle{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}.panelTitle h3{margin-bottom:4px}.sub{font-size:13px;color:var(--muted);margin:0}.pill{font-size:12px;padding:6px 9px;background:var(--soft);border-radius:999px;color:var(--muted)}
.previewBox{margin:14px 0;min-height:300px;background:#f8fafc;border:1px dashed #cbd5e1;border-radius:14px;display:flex;align-items:center;justify-content:center;overflow:hidden}.previewBox img{width:100%;height:auto;max-height:520px;object-fit:contain;display:none}
.placeholder{text-align:center;color:var(--muted)}.placeholderIcon{font-size:40px;margin-bottom:8px}.actionRow,.saveBar,.searchRow,.dialogActions{display:flex;gap:10px}.actionRow button,.saveBar button{flex:1}
.formGrid{display:grid;grid-template-columns:1fr 1fr;gap:12px}label{display:flex;flex-direction:column;gap:6px;font-size:13px;font-weight:800;color:#344054}input,textarea{width:100%;border:1px solid #d0d5dd;border-radius:10px;padding:11px 12px;background:#fff;color:var(--text)}
textarea{resize:vertical}.span2{grid-column:1/-1}.saveBar{margin-top:14px}.listPanel{margin-top:16px}.searchRow{margin:14px 0}.searchRow input{flex:1}.customerList{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:10px}
.customer{border:1px solid var(--line);border-radius:14px;padding:13px;background:#fff}.customer .company{font-size:13px;color:var(--muted);font-weight:700}.customer .name{font-size:18px;font-weight:850;margin:3px 0}.customer a{display:block;color:#344054;text-decoration:none;font-size:13px;margin-top:4px}
.empty{padding:30px;text-align:center;color:var(--muted);grid-column:1/-1}dialog{border:0;border-radius:18px;padding:0;width:min(620px,calc(100% - 24px));box-shadow:0 30px 80px rgba(0,0,0,.25)}dialog::backdrop{background:rgba(15,23,42,.5)}
.settingsCard{padding:20px}.dialogHeader{display:flex;justify-content:space-between;align-items:flex-start}.iconBtn{border:0;background:transparent;font-size:20px}.notice{padding:10px 12px;background:#fffaeb;border:1px solid #fedf89;border-radius:10px;color:#7a2e0e;font-size:13px}
.settingsCard label{margin-top:12px}.dialogActions{margin-top:16px}.dialogActions button{flex:1}.configStatus{font-size:13px;margin-top:10px;color:var(--muted)}.toast{position:fixed;left:50%;bottom:22px;transform:translateX(-50%) translateY(20px);opacity:0;background:#111827;color:#fff;padding:11px 15px;border-radius:999px;transition:.2s;z-index:50;pointer-events:none}.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}
@media(max-width:760px){.hero{flex-direction:column;align-items:stretch}.hero h2{font-size:22px}.cameraButton{width:100%}.grid{grid-template-columns:1fr}.formGrid{grid-template-columns:1fr}.span2{grid-column:auto}.previewBox{min-height:220px}.topbar{padding:12px 14px}.topbar h1{font-size:17px}.searchRow{flex-direction:column}}

.topActions{display:flex;gap:8px;align-items:center;flex-wrap:wrap;justify-content:flex-end}
.userBadge{font-size:12px;color:var(--muted);max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.lockedNotice{background:#fff;border:1px solid var(--line);border-radius:18px;padding:34px;text-align:center;max-width:620px;margin:45px auto}
.lockedNotice h2{margin-bottom:8px}.lockedNotice p{color:var(--muted);margin-bottom:18px}
.locked #appContent{display:none}.locked #lockedNotice{display:block}
#appMain:not(.locked) #lockedNotice{display:none}
@media(max-width:760px){.topActions{gap:5px}.topActions button{padding:9px 10px}.userBadge{display:none}}
