:root{font-family:Inter,"Microsoft YaHei",sans-serif;color:#17283f;background:#f3f6fb;font-size:14px}*{box-sizing:border-box}body{margin:0}header{height:76px;background:#fff;border-bottom:1px solid #e0e7ef;display:flex;align-items:center;justify-content:space-between;padding:0 32px}.brand{font-size:22px;font-weight:800;letter-spacing:1px}.brand b{color:#2764e7}.tag{font-size:12px;color:#76869a;margin-top:4px}a{color:#2764e7;text-decoration:none}button,input,select,textarea{font:inherit}button{cursor:pointer;border:1px solid #dce3ee;border-radius:9px;background:white;padding:10px 14px;color:#263d59}button:hover{border-color:#2764e7}button.primary{background:#2764e7;color:white;border-color:#2764e7}button:disabled{opacity:.5;cursor:wait}input,select,textarea{width:100%;padding:10px;border:1px solid #dce3ee;border-radius:8px;background:#fff;color:#17283f}label{display:block;margin:13px 0 6px;color:#697b92;font-size:12px}.layout{display:grid;grid-template-columns:260px minmax(350px,1fr) 300px;gap:20px;max-width:1600px;margin:auto;padding:24px}.panel{background:white;border:1px solid #e0e7ef;border-radius:14px;padding:20px}h2{font-size:16px;margin:0 0 16px}h3{font-size:13px;margin:22px 0 8px}.products{display:grid;gap:9px}.product{text-align:left;padding:14px}.product.active{border-color:#2764e7;background:#eef4ff;color:#2764e7}.product small{display:block;color:#8390a2;margin-top:6px}.stage{background:radial-gradient(ellipse at center,#fff,#e9eff7);min-height:530px;display:flex;align-items:center;justify-content:center;border-radius:12px;overflow:hidden;position:relative}.mock{position:relative;box-shadow:0 22px 36px #293f6220;background:#fff;padding:28px;max-width:92%;border-radius:20px}.mock.tshirt{padding:65px 70px;border-radius:60px 60px 22px 22px;background:#e4eaf0}.mock.mug{padding:20px 28px;border-radius:22px;border-right:20px solid #dbe2eb}.mock.magnet{padding:10px;border-radius:12px;border:3px solid #fff}.mock canvas{max-width:100%;height:auto;display:block;touch-action:none;background:white;background-image:linear-gradient(45deg,#f8f9fb 25%,transparent 25%),linear-gradient(-45deg,#f8f9fb 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#f8f9fb 75%),linear-gradient(-45deg,transparent 75%,#f8f9fb 75%);background-size:20px 20px}.toolbar{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:14px}.hint{font-size:12px;color:#8390a2;line-height:1.7}.row{display:flex;gap:8px}.row>*{flex:1}.layers{display:grid;gap:6px;max-height:190px;overflow:auto}.layer{text-align:left;padding:8px;font-size:12px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.layer.active{background:#eef4ff;border-color:#2764e7}.notice{margin:12px 0;padding:12px;background:#eef4ff;border-radius:9px;color:#315e9e;line-height:1.7}.error{background:#fff0ef;color:#ba3d32}.toast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%);max-width:90%;padding:13px 22px;border-radius:12px;background:#17283f;color:white;z-index:9;box-shadow:0 8px 30px #17283f30}.hidden{display:none!important}.admin-wrap{max-width:1300px;margin:24px auto;padding:0 24px}.tabs{display:flex;gap:10px;margin:20px 0}.cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:16px}.card{background:#fff;border:1px solid #e0e7ef;border-radius:12px;padding:18px}.card img{width:100%;max-height:180px;object-fit:contain;background:#f4f6fa}.card .qr{max-height:260px}pre{white-space:pre-wrap;word-break:break-word}.badge{font-size:12px;background:#eef4ff;color:#2764e7;border-radius:5px;padding:4px 8px}.login{max-width:400px;margin:70px auto}.stats{display:flex;gap:16px}.stats .card{flex:1}.stats strong{font-size:28px;display:block;margin-top:10px}details{margin-top:14px}summary{cursor:pointer;color:#2764e7}.full{width:100%;margin-top:12px}.topline{display:flex;justify-content:space-between;align-items:center;margin-bottom:15px}.topline span{color:#8390a2;font-size:12px}@media(max-width:1050px){.layout{grid-template-columns:220px 1fr}.settings{grid-column:1/-1;display:grid;grid-template-columns:1fr 1fr;gap:25px}}@media(max-width:650px){header{height:68px;padding:0 18px}.brand{font-size:18px}.layout{display:flex;flex-direction:column;padding:12px;gap:12px}.catalog-panel{order:0}.design-panel{order:1}.settings{order:2;display:block}.products{display:flex;overflow:auto}.product{min-width:130px}.panel{padding:16px}.stage{min-height:320px}.mock.tshirt{padding:35px}.mock{max-width:96%}.stats{flex-wrap:wrap}.stats .card{min-width:100px}.admin-wrap{padding:0 12px}}
:root .template-preview{display:block;width:180px;height:180px;object-fit:contain;margin:12px 0;border:1px solid #dce3ee;background:repeating-conic-gradient(#edf2fa 0% 25%,white 0% 50%) 0/16px 16px}.template-config{padding:12px 0;border-top:1px solid #e0e7ef;margin-top:16px}.mock.custom{padding:0;border-radius:0;background:transparent;box-shadow:none}

.machine-list{grid-column:1/-1;width:100%;box-sizing:border-box}.machine-scroll{overflow-x:auto}.machine-table{width:100%;border-collapse:collapse;min-width:850px}.machine-table th,.machine-table td{text-align:left;padding:14px 12px;border-bottom:1px solid #dde5ef;vertical-align:top}.machine-table th{background:#f4f7fc;white-space:nowrap}.machine-status{display:inline-block;border-radius:20px;padding:5px 10px;white-space:nowrap}.machine-status.online{background:#dcfce7;color:#166534}.machine-status.offline{background:#edf0f5;color:#475569}.machine-table td div{margin-top:5px;color:#64748b;font-size:13px}

.text-dialog{width:min(520px,calc(100% - 24px));max-height:90vh;max-height:90dvh;overflow-y:auto;padding:20px;border:1px solid #dce3ee;border-radius:18px;color:#17283f;box-shadow:0 20px 70px #17283f35}.text-dialog::backdrop{background:#17283f80}.text-dialog-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}.text-dialog-heading h2{margin:0}.text-dialog-heading button{font-size:24px;line-height:1;padding:5px 12px}.text-live-preview{display:flex;justify-content:center;align-items:center;background:#f1f5fb;border-radius:12px;padding:10px;height:180px;overflow:hidden}.text-live-preview canvas{width:auto;height:auto;max-width:100%;max-height:160px;background:repeating-conic-gradient(#edf2fa 0% 25%,white 0% 50%) 0/16px 16px}.text-dialog input[type=color]{height:42px;padding:4px}.text-dialog input[type=range]{padding:10px 0}.text-dialog textarea{resize:vertical;min-height:64px}.text-dialog-actions{position:sticky;bottom:-20px;background:white;padding:12px 0;margin-top:6px}.text-error{color:#b42318;font-size:13px;min-height:18px;margin:8px 0 0}.text-dialog-open{overflow:hidden}@media(max-width:650px){.text-dialog{padding:16px}.text-live-preview{height:140px}.text-live-preview canvas{max-height:120px}.text-dialog-actions{bottom:-16px}}

/* Scan-to-design page: creation, AI and submission in the reference order. */
.customer-layout{max-width:660px;margin:0 auto;padding:16px;display:flex;flex-direction:column;gap:12px}.customer-layout .panel{padding:20px;border-radius:16px}.customer-layout h2{font-size:18px;margin-bottom:18px}.customer-layout .products{display:flex;gap:10px;overflow-x:auto;padding:2px 0 4px;scrollbar-width:none}.customer-layout .products::-webkit-scrollbar{display:none}.customer-layout .product{flex:0 0 145px;min-height:90px;white-space:normal}.customer-layout .product:disabled{cursor:default;opacity:.55}.customer-layout .product.active{opacity:1;color:#2764e7}.customer-layout h3{font-size:16px;margin:24px 0 10px}.customer-layout input,.customer-layout select,.customer-layout textarea{font-size:16px;padding:13px;border-radius:11px}.customer-layout button{font-size:16px;padding:12px;border-radius:11px}.customer-layout #addText{margin-top:16px}.canvas-area{position:relative;margin-top:16px}.customer-layout .stage{min-height:0;max-height:620px;background:#eef2f7;padding:14px;border-radius:18px;align-items:center;justify-content:center}.customer-layout .mock,.customer-layout .mock.magnet,.customer-layout .mock.mug,.customer-layout .mock.tshirt{padding:12px;border:0;border-radius:12px;background:white;box-shadow:0 8px 18px #293f6212;max-width:100%;width:100%;height:100%;display:flex;justify-content:center;align-items:center}.customer-layout .mock.custom{padding:0;background:transparent;box-shadow:none;border-radius:0}.customer-layout .mock canvas{max-width:100%;max-height:100%;width:100%!important;object-fit:contain;background-size:24px 24px}.upload-slot{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:72%;background:#ffffffc9;padding:8px;border-radius:10px}.upload-slot label{margin:0 0 6px;font-size:12px}.customer-layout .upload-slot input{padding:6px;font-size:12px;border-radius:5px}.upload-slot.has-artwork{position:static;transform:none;width:100%;margin-top:10px;padding:0;background:transparent}.canvas-hint{font-size:13px;margin:16px 0;line-height:1.9}.customer-layout .notice{font-size:15px;margin-bottom:8px;padding:14px}.extra-design-tools{margin-top:12px;font-size:12px}.extra-design-tools summary{font-size:12px;color:#7c8da4}.extra-design-tools .toolbar{margin-top:12px}.customer-layout .ai-card textarea,.customer-layout .submit-card textarea{min-height:100px;resize:vertical}.customer-layout .ai-card .hint,.customer-layout .submit-card .hint{font-size:13px;line-height:1.9;margin:14px 0 0}.customer-layout .submit-card label{font-size:14px;margin-top:16px}.customer-layout #submit{background:#0669ed;border-color:#0669ed;margin-top:16px}.customer-layout .submit-card{margin-bottom:12px}@media(max-width:650px){.customer-layout{padding:12px;gap:12px}.customer-layout .panel{padding:16px}.customer-layout .stage{padding:12px}.customer-layout .product{flex-basis:138px}.customer-layout h2{font-size:17px}.customer-layout .mock{padding:12px}}

.customer-layout .preview-tools{display:flex;flex-wrap:wrap;gap:6px;margin-top:12px}.customer-layout .preview-tools button{font-size:12px;padding:7px 9px;border-radius:7px;line-height:1.3;min-height:32px}.customer-layout .preview-tools+.canvas-area{margin-top:10px}
.customer-layout .mock canvas{background-color:#fff;background-image:repeating-conic-gradient(#e2e2e2 0% 25%,#fff 0% 50%);background-position:0 0;background-size:16px 16px}

/* Mobile reference layout: describe the design directly beneath the preview. */
.customer-layout .creation-card #prompt{display:block;margin-top:10px;min-height:110px;resize:vertical}
.customer-layout .creation-card label[for=aiMode]{font-size:14px;margin-top:16px}
.customer-layout .upload-slot.has-artwork{display:none}
.customer-layout .ai-card #aiUpload{font-size:14px;padding:8px}
.customer-layout .ai-card .canvas-hint{margin:18px 0}

.review-artwork{display:flex;align-items:center;justify-content:center;min-height:180px;max-height:48vh;padding:10px;border-radius:10px;background:repeating-conic-gradient(#ddd 0% 25%,#fff 0% 50%) 0/16px 16px}
.review-artwork img{display:block;max-width:100%;max-height:44vh;object-fit:contain}
.review-artwork.white{background:#fff;border:1px solid #ddd}.review-artwork.dark{background:#242936}
#qualityConsentLabel{font-size:14px;line-height:1.7;color:#9c4510}#qualityConsent{width:auto;margin-right:6px}#reviewQuality{line-height:1.7}#draftState{margin:8px 0;color:#697b92}
.style-library{margin:14px 0;padding:12px;border:1px solid #e0e7ef;border-radius:12px;background:#fafcff}.style-library summary{font-size:14px;font-weight:600}.customer-layout .style-filters{margin-top:12px}.customer-layout .style-filters select{font-size:13px;padding:9px;min-width:0}.style-cards{display:flex;gap:10px;overflow-x:auto;margin-top:12px;padding-bottom:6px;scroll-snap-type:x proximity}.customer-layout .style-card{flex:0 0 132px;padding:7px;text-align:left;scroll-snap-align:start}.style-card.active{border:2px solid #2764e7;background:#eef4ff}.style-card img{width:116px;height:116px;object-fit:contain;background:repeating-conic-gradient(#edf0f4 0% 25%,#fff 0% 50%) 0/12px 12px;border-radius:6px}.style-card strong{display:block;font-size:13px;margin-top:6px}.style-card small{display:block;font-size:11px;color:#697b92;margin-top:4px}.style-library .hint{margin:8px 0 0;font-size:12px}.style-library .preview-tools button{font-size:12px}

.tabs{flex-wrap:wrap}.order-filters-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:8px;margin-bottom:12px}#orderFilters{margin-bottom:16px}#paymentLaunch{display:block;text-align:center;background:#2764e7;color:white;padding:12px;border-radius:10px}
