:root{font-family:Inter,"Microsoft YaHei",system-ui,sans-serif;color:#1b293c;background:#f3f5f8;font-size:16px;--red:#dc343d;--line:#e4e8ed;--muted:#68768a}*{box-sizing:border-box}body{margin:0}button,input,select{font:inherit}button,a,label.import{cursor:pointer}button{border:1px solid var(--line);background:white;border-radius:7px;padding:8px 12px;color:inherit}button:hover{border-color:#dc343d;color:#c3212b}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #8cafe8;outline-offset:2px}aside{position:fixed;width:232px;inset:0 auto 0 0;background:#152338;color:#fff;padding:30px 22px;display:flex;flex-direction:column}.brand{display:flex;gap:11px;align-items:center;font-weight:700}.brand>span{display:grid;place-items:center;background:var(--red);width:40px;height:40px;border-radius:10px;font-size:23px}.brand small{display:block;font-size:13px;color:#9eacc0;margin-top:6px;font-weight:400}nav{margin-top:44px}nav a{display:block;color:#fff;text-decoration:none;background:#2a374b;padding:14px 12px;border-radius:8px;font-size:15px}.aside-foot{margin-top:auto;color:#b4bfd0;font-size:14px;line-height:1.7}.aside-foot strong{color:white;font-size:17px}.aside-foot button,.import{display:block;background:transparent;color:white;border:1px solid #536176;padding:9px 12px;text-align:center;margin-top:12px;border-radius:7px;font-size:14px;width:100%}.import input{display:none}main{margin-left:232px;padding:32px 38px 60px;max-width:1800px}header{display:flex;align-items:center;justify-content:space-between}header small{color:var(--muted);font-size:14px}h1{font-size:28px;margin:9px 0 26px;letter-spacing:-.6px}.local{border:1px solid #d3dce7;padding:7px 12px;border-radius:20px;font-size:14px;color:#5a6a81}.summary{display:grid;grid-template-columns:repeat(4,1fr);gap:18px;margin-bottom:28px}.stat{background:white;border:1px solid var(--line);padding:19px 22px;border-radius:10px}.stat span{font-size:14px;color:var(--muted)}.stat strong{display:block;font-size:30px;margin-top:10px;font-weight:600;font-variant-numeric:tabular-nums}.stat small{font-size:14px;font-weight:400;color:var(--muted);margin-left:5px}.toolbar{display:flex;gap:12px;align-items:center;margin-bottom:20px}.toolbar input{width:400px;max-width:100%}input,select{padding:11px 12px;border:1px solid #d5dce5;border-radius:7px;background:#fff;color:inherit;min-width:0}.toolbar span{margin-left:auto;color:var(--muted);font-size:14px}.products{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:20px}.product{background:#fff;border:1px solid var(--line);border-radius:12px;overflow:hidden;display:flex;flex-direction:column}.photo{height:208px;position:relative;background:#eef0f3;overflow:hidden}.photo img{width:100%;height:100%;object-fit:contain}.rank{position:absolute;left:13px;top:13px;background:#17263ae8;color:white;border-radius:5px;padding:5px 9px;font-size:14px}.product-body{padding:19px;display:flex;flex-direction:column;flex:1}.shop{font-size:13px;color:var(--muted);margin-bottom:8px}.product h2{font-size:16px;line-height:1.65;margin:0 0 12px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;min-height:53px}.price-line{display:flex;align-items:center;justify-content:space-between;margin:5px 0 16px}.price{font-size:25px;font-weight:650;color:#cb2834}.price small{font-size:14px;font-weight:400}.sales{font-size:13px;color:var(--muted)}.product-foot{border-top:1px solid var(--line);padding-top:15px;display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:auto;font-size:14px}.product-foot button{background:#fff1f1;color:#bc2530;border:0;font-weight:600}.muted{color:var(--muted);font-size:13px;line-height:1.7}.tag{font-size:12px;padding:5px 8px;border-radius:5px;background:#f0f3f7;color:#637187}.warn{color:#a86716}.good{color:#17755d}.negative{color:#c82c39}dialog{border:0;border-radius:14px;padding:25px;box-shadow:0 22px 90px #06101e55;color:inherit}dialog::backdrop{background:#0c172b8f}#detail{width:min(1440px,96vw);max-height:94vh}.detail-top{display:flex;gap:20px;justify-content:space-between;align-items:flex-start;border-bottom:1px solid var(--line);padding-bottom:18px}.detail-top h2{font-size:18px;line-height:1.6;margin:6px 0;max-width:1000px}.detail-top small{color:var(--muted);font-size:14px}.detail-layout{display:grid;grid-template-columns:minmax(260px,.8fr) minmax(480px,1.6fr);gap:28px;margin-top:22px}#config-tabs{display:flex;gap:7px;flex-wrap:wrap;margin-bottom:14px}#config-tabs button{font-size:14px}#config-tabs .selected{background:#1c2c43;color:#fff}.image-button{padding:0;border:1px solid var(--line);width:100%;background:#f6f7f9;overflow:hidden}.image-button img{width:100%;display:block;max-height:650px;object-fit:contain;object-position:top}.section-heading{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:14px}.section-heading h3{font-size:17px;margin:0}.section-heading button{font-size:13px}.inputs{display:grid;grid-template-columns:repeat(3,1fr);gap:13px;margin-bottom:28px}.inputs label{font-size:13px;color:var(--muted)}.inputs input{display:block;width:100%;margin-top:7px}.table-scroll{overflow-x:auto}table{border-collapse:collapse;width:100%;font-size:14px}th{text-align:left;color:var(--muted);background:#f5f7fa;font-weight:500;padding:12px 10px}td{border-bottom:1px solid var(--line);padding:13px 10px;vertical-align:top}td:first-child{width:32%}.part-desc{font-size:12px;line-height:1.6;color:var(--muted);margin-top:5px;max-width:260px}.warehouse-code{font-size:12px;line-height:1.5;word-break:break-word}.match-button{font-size:12px;padding:5px 8px;margin-top:6px}td input{width:60px;padding:6px;font-size:14px}td:last-child{white-space:nowrap;font-variant-numeric:tabular-nums}.profits{margin-top:22px;background:#f5f7fa;border-radius:10px;padding:18px;display:grid;grid-template-columns:repeat(3,1fr);gap:18px}.profit-item span{display:block;font-size:13px;color:var(--muted);margin-bottom:8px}.profit-item strong{font-size:22px;font-weight:600}.profit-warning{grid-column:1/-1;color:#a46619;font-size:13px;margin:0}.formula{font-size:13px;color:var(--muted);margin-top:20px;line-height:1.7}#picker{width:740px;max-width:94vw}#picker h2{font-size:20px}#part-search{width:100%;margin:10px 0}#candidate-list{max-height:48vh;overflow:auto;margin:10px 0 20px}.candidate{display:flex;width:100%;text-align:left;align-items:center;justify-content:space-between;gap:15px;padding:14px;margin-bottom:7px}.candidate span{font-size:14px;line-height:1.6}.candidate small{display:block;font-size:12px;color:var(--muted)}.candidate strong{white-space:nowrap}#image-dialog{max-width:95vw;max-height:96vh}#image-dialog img{display:block;max-width:100%;margin-top:15px}#image-dialog button{position:sticky;top:0}#notice{font-size:14px;color:#a46619;margin-bottom:12px}.empty{padding:60px;text-align:center;background:white;border-radius:10px;grid-column:1/-1;color:var(--muted)}@media(min-width:1600px){.products{grid-template-columns:repeat(5,minmax(0,1fr))}}@media(max-width:1150px){aside{width:190px;padding:25px 15px}main{margin-left:190px;padding:25px}.products{grid-template-columns:repeat(2,minmax(0,1fr))}.detail-layout{grid-template-columns:1fr}.config-side{display:grid;grid-template-columns:1fr 1fr;gap:15px}.config-side .muted{display:none}.image-button img{max-height:330px}}@media(max-width:700px){aside{position:static;width:auto;padding:15px 20px;display:block}aside nav,.aside-foot{display:none}.brand small{display:none}main{margin:0;padding:22px 16px}.summary{grid-template-columns:repeat(2,1fr);gap:10px}.stat{padding:15px}.toolbar{flex-wrap:wrap}.toolbar input{width:100%}.toolbar span{margin-left:0}.products{grid-template-columns:1fr}.photo{height:250px}.inputs{grid-template-columns:repeat(2,1fr)}.profits{grid-template-columns:repeat(2,1fr)}dialog{padding:16px}.detail-layout{gap:15px}.config-side{display:block}.image-button img{max-height:340px}.profit-item strong{font-size:18px}}
.product-profit{display:flex;justify-content:space-between;margin-bottom:14px;padding:10px 0;color:#68768a;font-size:13px}.product-profit strong{color:#25364c;font-weight:600}
/* Desktop worksheet: image and all cost/profit controls share one screen. */
@media(min-width:1000px){
 #detail{width:calc(100vw - 20px);max-width:1800px;height:calc(100dvh - 20px);max-height:none;padding:12px 16px;overflow:auto}
 #detail[open]{display:flex;flex-direction:column}
 .detail-top{gap:12px;padding-bottom:8px;flex:none;align-items:center}
 .detail-top h2{font-size:15px;line-height:1.35;margin:3px 0;max-width:none}
 .detail-top small{font-size:12px}.detail-top button{padding:6px 10px}
 .detail-layout{grid-template-columns:minmax(230px,.7fr) minmax(640px,1.6fr);gap:18px;margin-top:10px;flex:1;min-height:0}
 .config-side{display:flex;flex-direction:column;min-height:0;gap:0}
 #config-tabs{gap:4px;margin-bottom:7px;flex:none}#config-tabs button{font-size:12px;padding:6px 8px}
 .image-button{min-height:0;flex:1;display:flex;align-items:center;justify-content:center}
 .image-button img{height:100%;max-height:100%;width:100%;object-fit:contain;object-position:center}
 .config-side>.muted{display:block;font-size:11px;margin:5px 0 0;flex:none}
 .profit-side{min-width:0}.profit-side .section-heading{margin-bottom:5px;gap:6px}
 .profit-side .section-heading h3{font-size:14px}.section-heading button{font-size:11px;padding:4px 7px}
 #selection-note{display:flex;align-items:center;gap:4px;margin-bottom:6px}
 #detail #selection-note p{font-size:11px;line-height:1.35;margin:0}
 #selection-note .flame,#selection-note .sold,#selection-note .fallback{font-size:11px;padding:3px 5px;white-space:nowrap;margin-right:2px}
 .tag{font-size:10px;padding:3px 6px}
 .inputs{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-bottom:9px}
 .inputs label{font-size:11px}.inputs input{padding:6px 8px;margin-top:3px;font-size:13px}
 #detail table{table-layout:fixed;font-size:12px}#detail th{padding:5px 6px;font-size:11px}
 #detail td{padding:5px 6px;vertical-align:middle}#detail th:first-child,#detail td:first-child{width:38%}
 #detail th:nth-child(2){width:43%}#detail th:nth-child(3){width:8%}#detail th:last-child{width:11%}
 #detail .part-desc{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:none;font-size:11px;line-height:1.4;margin-top:2px}
 #detail .warehouse-code{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:11px;line-height:1.4}
 #parts td:nth-child(2){position:relative;padding-right:57px}#parts td:nth-child(2)>.good,#parts td:nth-child(2)>.warn{font-size:11px;line-height:1.4}
 #detail .match-button{position:absolute;right:4px;top:50%;transform:translateY(-50%);font-size:10px;padding:3px 4px;margin:0;width:48px;line-height:1.3}
 #detail td input{width:100%;max-width:48px;padding:4px;font-size:12px}
 .profits{grid-template-columns:repeat(6,minmax(0,1fr));gap:7px;margin-top:8px;padding:9px}
 .profit-item span{font-size:11px;margin-bottom:3px}.profit-item strong{font-size:17px}
 .profit-warning{font-size:11px;line-height:1.4}.formula{font-size:11px;margin-top:5px;line-height:1.4}
 #save-status{font-size:10px;line-height:1.3;margin:4px 0 0}
 #read-only-config td{line-height:1.4}.readonly-price{font-size:13px;padding:6px 0}
 body:has(#detail[open]){overflow:hidden}
}
[hidden]{display:none!important}.flame,.sold,.fallback{display:inline-block;padding:5px 9px;border-radius:5px;font-size:13px;margin-right:7px}.flame{background:#fff0ed;color:#c72e1c}.sold{background:#eceef1;color:#697383}.fallback{background:#edf3fc;color:#35628f}.sold-tab{color:#7d8795}#selection-note p{font-size:14px;line-height:1.6;color:#65748a;margin:12px 0 20px}.readonly-price{padding:14px 0;color:#6a778a;font-size:15px}.product-profit-list{margin-bottom:12px}.product-profit-list .product-profit{margin:0;padding:7px 0;border-bottom:1px dashed #edf0f3}.toolbar{flex-wrap:wrap}.toolbar button{white-space:nowrap}#read-only-config table td:first-child{width:80px}#read-only-config td{line-height:1.7}.stat strong{font-size:27px}

.date-filter{display:flex;align-items:center;gap:12px;flex-wrap:wrap;background:#fff;border:1px solid var(--line);border-radius:10px;padding:18px 20px;margin-bottom:20px}.date-filter strong{margin-right:8px}.date-filter label{color:var(--muted);font-size:14px;margin-left:8px}.date-filter button{padding:9px 22px}.date-filter button.selected{background:#253c5b;color:#fff;border-color:#253c5b}.date-filter input{padding:8px 12px}

.aside-foot[hidden]{display:none}

main{margin-left:0;max-width:none;padding:24px 30px 50px}.page-brand{margin-bottom:20px}.page-brand .brand{color:#1b293c}.page-brand .brand>span{color:#fff}.page-brand .brand small{color:var(--muted)}@media(max-width:700px){main{margin:0;padding:18px 16px}.page-brand{margin-bottom:16px}}

.sku-profit{padding:10px 0;border-top:1px dashed var(--line)}.sku-profit-name{font-size:13px;color:var(--muted);margin-bottom:9px}.sku-profit-values{display:grid;grid-template-columns:1fr 1fr .85fr;gap:6px}.sku-profit-values span{display:block;font-size:12px;color:var(--muted);margin-bottom:5px}.sku-profit-values strong{font-size:14px;font-variant-numeric:tabular-nums;white-space:nowrap}.product-profit-list{margin-bottom:14px}

.sku-profit{display:flex;align-items:center;gap:8px;padding:11px 0}.sku-profit-name{margin:0;white-space:nowrap;font-size:12px}.sku-profit-values{flex:1;min-width:0;grid-template-columns:1.2fr 1fr .8fr;gap:5px;text-align:right}.sku-profit-values span{display:none}.sku-profit-values strong{font-size:12px}

.product-heading{display:flex;align-items:center;justify-content:space-between;gap:6px;margin-bottom:10px}.product-heading .shop{margin:0;min-width:0;font-size:12px}.product-detail-button{flex-shrink:0;background:#fff1f1;color:#bc2530;border:0;font-size:11px;padding:7px 6px;font-weight:600}.product-profit-list{margin-bottom:0}

button.photo{display:block;width:100%;padding:0;border:0;border-radius:0;color:inherit;flex-shrink:0}button.photo:focus-visible{outline:3px solid #8cafe8;outline-offset:-3px}

#config-image-frame{cursor:default;border:1px solid var(--line);border-radius:7px;padding:0}

#detail-title{color:inherit;text-decoration:none}#detail-title:hover{text-decoration:underline;color:#2c609a}

.detail-title-row{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.detail-title-row h2{margin:0}#open-product-link{display:inline-block;flex-shrink:0;padding:5px 10px;border:1px solid #afc5e3;border-radius:4px;background:#f7faff;color:#2c609a;font-size:12px;font-weight:400;line-height:1.5;text-decoration:none;white-space:nowrap}#open-product-link:hover{background:#e6effa;border-color:#2c609a}

.page-brand{display:flex;align-items:center;gap:14px;flex-wrap:wrap}#open-ranking-link{padding:6px 12px;border:1px solid #afc5e3;border-radius:5px;background:#fff;color:#2c609a;font-size:13px;line-height:1.5;text-decoration:none;white-space:nowrap}#open-ranking-link:hover{background:#e6effa;border-color:#2c609a}

/* One product per row, with aligned identity and SKU results. */
#products{grid-template-columns:minmax(0,1fr);gap:10px}
#products .product{flex-direction:row;align-items:stretch;border-radius:8px}
#products button.photo{width:124px;height:124px;align-self:center;margin:10px;background:#f4f6f8;border-radius:5px}
#products .rank{left:5px;top:5px;padding:3px 6px;font-size:11px}
#products .product-body{display:grid;grid-template-columns:minmax(220px,1fr) minmax(420px,.85fr);grid-template-rows:auto auto auto;column-gap:28px;row-gap:5px;padding:13px 18px;min-width:0}
#products .product-heading{grid-column:1;grid-row:1;margin:0;justify-content:flex-start;gap:18px}
#products .shop{font-size:13px;font-weight:600}
#products h2{grid-column:1;grid-row:2;min-height:0;margin:0;font-size:14px;line-height:1.5;-webkit-line-clamp:2}
#products .price-line{grid-column:1;grid-row:3;margin:0;justify-content:flex-start;gap:20px}
#products .price{font-size:19px}
#products .product-profit-list,#products .product-profit{grid-column:2;grid-row:1/4;align-self:center;margin:0;min-width:0}
#products .sku-profit{padding:7px 0;gap:16px}
#products .sku-profit:first-child{border-top:0}
#products .sku-profit-name{width:90px;flex-shrink:0}
#products .sku-profit-values{grid-template-columns:1fr 1fr .8fr;gap:18px}
#products .sku-profit-values span{display:block;font-size:11px;margin-bottom:3px}
#products .sku-profit-values strong{font-size:14px}
@media(max-width:900px){
 #products button.photo{width:90px;height:90px;margin:8px}
 #products .product-body{grid-template-columns:minmax(0,1fr);padding:10px;gap:6px}
 #products .product-profit-list,#products .product-profit{grid-column:1;grid-row:4}
 #products .product-heading{flex-wrap:wrap;gap:6px}
 #products .sku-profit-values{gap:8px}
}

.product-columns{display:flex;align-items:center;background:#eaf0f7;border:1px solid var(--line);border-radius:6px;padding:10px 0;margin-bottom:10px;font-size:12px;color:#536b88;position:sticky;top:0;z-index:2}
.columns-photo{width:144px;flex-shrink:0;text-align:center}
.columns-body{flex:1;min-width:0;padding:0 18px;display:grid;grid-template-columns:minmax(220px,1fr) minmax(420px,.85fr);gap:28px}
.columns-results{display:flex;gap:16px;min-width:0}
.columns-sku{width:90px;flex-shrink:0}
.columns-values{flex:1;display:grid;grid-template-columns:1fr 1fr .8fr;gap:18px;text-align:right}
#products .sku-profit-values span{display:none}
@media(max-width:900px){.columns-photo{width:106px}.columns-body{grid-template-columns:1fr;padding:0 10px;gap:6px}.columns-body>span{display:none}.columns-values{gap:8px}}

/* Full captured SKU names share the same width as the column heading. */
#products .sku-profit-name,.columns-sku{width:clamp(160px,18vw,340px);white-space:normal;overflow-wrap:anywhere;line-height:1.5}
#products .product-body,.columns-body{grid-template-columns:minmax(220px,1fr) minmax(580px,1.25fr)}
#config-tabs button{white-space:normal;text-align:left;line-height:1.5}
@media(max-width:1100px){#products .product-body,.columns-body{grid-template-columns:minmax(0,1fr)}#products .product-profit-list,#products .product-profit{grid-column:1;grid-row:4}.columns-body>span{display:none}}
@media(max-width:600px){#products .sku-profit-name,.columns-sku{width:130px}}

#parts td:nth-child(2){padding-right:6px}

#products .product-detail-button{min-height:40px;padding:10px 18px;font-size:14px;font-weight:700;line-height:1.4;background:#cf2936;color:#fff;border:1px solid #bc2330;border-radius:7px;box-shadow:0 2px 5px #cf293626}
#products .product-detail-button:hover{background:#b71f2c;border-color:#a51b27;color:#fff;box-shadow:0 3px 8px #cf293633}
#products .product-detail-button:focus-visible{outline:3px solid #f6a8af;outline-offset:3px}
#products .product-heading{flex-wrap:wrap}

#products .product-heading{row-gap:8px}
#products .shop-skus{flex-basis:100%;min-width:0;color:#344b68;font-size:13px;line-height:1.6}
#products .shop-sku{overflow-wrap:anywhere}

#products .product-detail-button,#products .product-link-button{box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;min-height:24px;height:24px;padding:2px 12px;font-size:12px;line-height:18px;font-weight:600;border-radius:4px;white-space:nowrap;text-decoration:none;box-shadow:none}
#products .product-link-button{color:#bc2530;background:#fff1f1;border:1px solid #edb4ba;margin-left:-10px}
#products .product-link-button:hover{background:#ffe2e5;border-color:#cf2936}
#products .product-link-button:focus-visible{outline:3px solid #f6a8af;outline-offset:2px}
@media(max-width:900px){#products .product-link-button{margin-left:0}}

#products .sku-config-card{display:block;text-align:left;padding:10px 12px;border:1px solid #d5dfec;border-radius:7px;background:#f7f9fc;color:#344b68;font-size:12px;cursor:pointer;box-shadow:0 1px 3px #2034510a}
#products .sku-config-card:hover{border-color:#cf2936;background:#fff5f5;color:#b8202d}
#products .sku-config-card:focus-visible{outline:3px solid #f6a8af;outline-offset:2px}
