:root{font-family:"Microsoft YaHei",sans-serif;color:#172033;background:#eef1f5}*{box-sizing:border-box}body{margin:0;min-width:760px}button{font:inherit;cursor:pointer;border:0;border-radius:10px}header{height:64px;padding:0 22px;display:flex;align-items:center;justify-content:space-between;background:#20242a;color:white}header strong{font-size:22px}header span{margin-left:18px;color:#cbd1da}header nav{display:flex;align-items:center;gap:18px}header nav span{margin:0}header nav button{padding:8px 14px;background:#3a414c;color:white}main{display:grid;grid-template-columns:110px 1fr 360px;height:calc(100vh - 64px)}aside{background:white}.category{padding:22px 8px;text-align:center;cursor:pointer}.category.active{color:#0969da;background:#edf5ff;font-weight:700}#products{padding:20px;display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));grid-auto-rows:120px;gap:14px;align-content:start;overflow:auto}.product{padding:16px;display:flex;flex-direction:column;justify-content:space-between;text-align:left;background:white;box-shadow:0 4px 16px #20242a12}.product strong{font-size:17px}.product span{color:#d9480f}.cart{padding:20px;display:flex;flex-direction:column;background:white}.cart h2{margin:0 0 12px}.cart #cart{flex:1;overflow:auto}.empty{padding-top:80px;text-align:center;color:#8a929e}.cart-item{padding:14px 0;border-bottom:1px solid #edf0f3}.item-line,.qty,.total,.due,.change{display:flex;align-items:center;justify-content:space-between}.qty{margin-top:10px;justify-content:flex-end;gap:12px}.qty button{width:34px;height:30px;background:#eef1f5}.total{padding:18px 0;font-size:23px}.actions,.dialog-actions{display:flex;gap:12px}.actions button,.dialog-actions button{flex:1;height:50px}.minor{background:#eef1f5}.primary{background:#0969da!important;color:white}.primary:disabled,.minor:disabled{opacity:.45;cursor:not-allowed}dialog{width:min(520px,90vw);padding:0;border:0;border-radius:18px;box-shadow:0 24px 80px #0005}dialog::backdrop{background:#11182799}dialog form{padding:30px}.close{float:right;font-size:26px;background:transparent}.due{margin:24px 0;font-size:20px}label{display:block;color:#636b76}input{width:100%;height:58px;margin:8px 0 14px;padding:0 14px;border:2px solid #0969da;border-radius:10px;font-size:28px}.quick{display:flex;gap:8px}.quick button{flex:1;padding:10px;background:#eef1f5}.change{margin:22px 0;padding:18px;background:#edf5ff;border-radius:10px;font-size:20px}#result{text-align:center}#result p{font-size:25px}#result button{width:100%;height:48px}@media(max-width:900px){main{grid-template-columns:90px 1fr 320px}header span{display:none}#products{grid-template-columns:repeat(auto-fill,minmax(130px,1fr));padding:12px}.cart{padding:14px}}
:root{font-family:"Microsoft YaHei",sans-serif;color:#172033;background:#eef1f5}*{box-sizing:border-box}body{margin:0;min-width:760px}button{font:inherit;cursor:pointer;border:0;border-radius:10px}header{height:64px;padding:0 22px;display:flex;align-items:center;justify-content:space-between;background:#20242a;color:white}header strong{font-size:22px}header span{margin-left:18px;color:#cbd1da}header nav{display:flex;align-items:center;gap:18px}header nav span{margin:0}header nav #pending.has-pending{padding:5px 9px;border-radius:12px;background:#fff3bf;color:#8a5a00;font-weight:700}header nav button{padding:8px 14px;background:#3a414c;color:white}main{display:grid;grid-template-columns:110px 1fr 360px;height:calc(100vh - 64px)}aside{background:white}.category{padding:22px 8px;text-align:center;cursor:pointer}.category.active{color:#0969da;background:#edf5ff;font-weight:700}#products{padding:20px;display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));grid-auto-rows:120px;gap:14px;align-content:start;overflow:auto}.product{padding:16px;display:flex;flex-direction:column;justify-content:space-between;text-align:left;background:white;box-shadow:0 4px 16px #20242a12}.product strong{font-size:17px}.product span{color:#d9480f}.cart{padding:20px;display:flex;flex-direction:column;background:white}.cart h2{margin:0 0 12px}.cart #cart{flex:1;overflow:auto}.empty{padding-top:80px;text-align:center;color:#8a929e}.cart-item{padding:14px 0;border-bottom:1px solid #edf0f3}.item-line,.qty,.total,.due,.change{display:flex;align-items:center;justify-content:space-between}.qty{margin-top:10px;justify-content:flex-end;gap:12px}.qty button{width:34px;height:30px;background:#eef1f5}.total{padding:18px 0;font-size:23px}.actions,.dialog-actions{display:flex;gap:12px}.actions button,.dialog-actions button{flex:1;height:50px}.minor{background:#eef1f5}.primary{background:#0969da!important;color:white}.primary:disabled,.minor:disabled{opacity:.45;cursor:not-allowed}dialog{width:min(520px,90vw);padding:0;border:0;border-radius:18px;box-shadow:0 24px 80px #0005}dialog::backdrop{background:#11182799}dialog form{padding:30px}.close{float:right;font-size:26px;background:transparent}.due{margin:24px 0;font-size:20px}label{display:block;color:#636b76}input{width:100%;height:58px;margin:8px 0 14px;padding:0 14px;border:2px solid #0969da;border-radius:10px;font-size:28px}.quick{display:flex;gap:8px}.quick button{flex:1;padding:10px;background:#eef1f5}.change{margin:22px 0;padding:18px;background:#edf5ff;border-radius:10px;font-size:20px}#result{text-align:center}#result p{font-size:25px}#result button{width:100%;height:48px}@media(max-width:900px){main{grid-template-columns:90px 1fr 320px}header span{display:none}#products{grid-template-columns:repeat(auto-fill,minmax(130px,1fr));padding:12px}.cart{padding:14px}}
.print-card{margin:10px 0;padding:14px;border:1px solid #e4e8ee;border-radius:10px}.print-card>div{display:flex;justify-content:space-between;gap:12px}.print-card span,.print-card small{color:#6b7280}.print-card p{margin:10px 0;color:#d93025}.print-card.failed{border-color:#ffc9c9;background:#fff5f5}.print-card.printed{border-color:#b7ebc6;background:#f2fbf5}.print-card button{margin-top:10px;padding:9px 13px;background:#0969da;color:white}.empty.compact{padding:30px}.history-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:10px}.history-actions button{padding:8px 12px;background:#eef1f5}.history-actions .audit-action{background:#fff0f0;color:#c92a2a}
.reference-control{display:flex;gap:8px}.reference-control input{flex:1}.reference-control button{width:94px;height:58px;margin-top:8px;background:#edf5ff;color:#0969da;font-weight:700}.reference-control button:disabled{opacity:.45;cursor:not-allowed}.table-legend{display:flex;gap:18px;margin:12px 0 18px;color:#6b7280}.table-legend span{display:flex;align-items:center;gap:6px}.table-legend i{width:10px;height:10px;border-radius:50%}.table-legend .free{background:#2f9e44}.table-legend .occupied{background:#f59f00}.table-legend .current{background:#1971c2}.table-picker-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;max-height:430px;overflow:auto}.table-card{padding:14px;text-align:left;border:2px solid #b7ebc6;background:#f2fbf5}.table-card strong,.table-card span,.table-card small{display:block}.table-card strong{font-size:18px}.table-card span,.table-card small{margin-top:5px;color:#6b7280}.table-card.occupied{border-color:#ffd8a8;background:#fff9f0}.table-card.current{border-color:#a5d8ff;background:#edf7ff}.table-card .table-status{font-weight:700;color:#2b8a3e}.table-card.occupied .table-status{color:#d9480f}.table-card.current .table-status{color:#1971c2}
.dining-details{display:grid;grid-template-columns:minmax(0,1fr) 88px;gap:10px}.guest-count-field input{font-size:22px;text-align:center}.reference-field small{display:block;margin-top:-8px;color:#d9480f}.reference-field small[hidden]{display:none}.dining-details.single{grid-template-columns:1fr}.guest-count-field[hidden]{display:none}
.payment-progress{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:20px 0}.payment-progress>div{padding:13px;border-radius:10px;background:#f5f7fa}.payment-progress span,.payment-progress strong{display:block}.payment-progress span{color:#6b7280;font-size:13px}.payment-progress strong{margin-top:7px;font-size:19px}.payment-progress .remaining{background:#fff3bf}.payment-progress .remaining strong{color:#c2410c}.payment-guide{color:#6b7280;line-height:1.5}.payment-records{max-height:120px;overflow:auto}.payment-record{display:flex;justify-content:space-between;padding:8px 10px;border-bottom:1px solid #edf0f3;color:#4b5563}.payment-record strong{color:#172033}
.product.with-image{padding:0 0 12px;overflow:hidden}.product.with-image img{width:100%;height:68px;object-fit:cover}.product.with-image strong,.product.with-image span{padding:0 12px}.shared-order-list{margin:16px 0}.shared-order{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:13px;border-bottom:1px solid #edf0f3}.shared-order strong,.shared-order span{display:block}.shared-order span,.shared-order small{margin-top:4px;color:#6b7280}.shared-order button{padding:9px 12px;background:#edf5ff;color:#0969da}.shared-order-list+.full{margin-bottom:10px}
.product.sold-out{position:relative;opacity:.62;cursor:not-allowed;filter:grayscale(.45)}.product .sold-out-badge{position:absolute;right:8px;top:8px;padding:4px 8px;border-radius:10px;background:#e5484d;color:#fff;font-size:12px}.product.with-image .sold-out-badge{padding:4px 8px}
.item-note{display:block;margin-top:5px;color:#b45309;font-size:12px}.qty .item-note-button{width:auto;padding:0 9px;color:#0969da;background:#edf5ff}.qty .item-note-button:disabled{color:#9ca3af;background:#f1f3f5;cursor:not-allowed}
.option-group{margin:14px 0}.option-group h3{margin:0 0 9px}.option-group h3 small{color:#6b7280;font-size:12px;font-weight:400}.option-choices{display:flex;flex-wrap:wrap;gap:8px}.option-choices button{padding:10px 13px;background:#eef1f5}.option-choices button.active{background:#0969da;color:#fff}.option-total{display:flex;justify-content:space-between;margin:20px 0;padding:14px;background:#edf5ff;border-radius:8px}
.cash-difference-approval{margin:14px 0;padding:16px;border:1px solid #ffc9c9;border-radius:10px;background:#fff5f5}.cash-difference-approval>strong{display:block;margin-bottom:10px;color:#c92a2a}.cash-difference-approval input{height:48px;margin-bottom:10px;font-size:17px}
.gift-item{width:auto!important;padding:0 10px!important;background:#fff3bf!important;color:#8a5a00}.gift-item:disabled{opacity:.5;cursor:not-allowed}.gift-badge{display:inline-block;margin-left:6px;padding:2px 7px;border-radius:10px;background:#fff3bf;color:#8a5a00;font-weight:700}
#refundFields select{width:100%;height:48px;margin:8px 0 10px;padding:0 12px;border:1px solid #cfd6df;border-radius:10px;background:white;font-size:17px}.field-hint{display:block;margin:-4px 0 12px;color:#636b76}
.sync-pending{color:#d9480f}.sync-done{color:#087f5b}
.product-search{position:fixed;z-index:4;top:10px;left:360px;width:280px;display:flex;gap:6px}.product-search input{height:44px;margin:0;padding:0 12px;border:0;border-radius:9px;font-size:16px}.product-search button{padding:0 10px;background:#eef1f5;color:#495057}@media(max-width:1150px){.product-search{left:260px;width:220px}}

/* 收银顶栏：操作按钮保持独立尺寸，窄屏自动换行，避免互相覆盖。 */
header{height:auto;min-height:72px;padding:8px 14px;gap:12px;align-items:center}header>div{flex:0 1 230px;min-width:180px}header>div strong,header>div span{display:block;white-space:nowrap}header>div span{margin:3px 0 0;font-size:13px}header nav{min-width:0;flex:1;justify-content:flex-end;gap:7px;flex-wrap:wrap}header nav span{font-size:13px;white-space:nowrap}header nav button{min-height:38px;padding:7px 10px;font-size:14px;line-height:1.15;white-space:nowrap}header nav b{min-width:19px;margin-left:3px;padding:1px 5px;font-size:12px}main{height:calc(100vh - 72px)}.product-search{top:80px;left:130px;width:min(300px,calc(100vw - 500px))}#products{padding-top:68px}@media(max-width:1100px){header{align-items:flex-start}header>div{flex-basis:190px}header nav{gap:5px}header nav button{padding:6px 8px;font-size:13px}.product-search{left:110px;width:230px}}@media(max-width:880px){header{min-height:112px;display:grid;grid-template-columns:1fr}header>div{display:flex;align-items:center;gap:10px}header>div span{margin:0}header nav{justify-content:flex-start}main{height:calc(100vh - 112px)}.product-search{top:120px;left:100px;width:210px}#products{padding-top:66px}}
.language-switcher{position:static;display:flex;align-items:center;gap:6px;min-height:38px;padding:4px 7px;border:1px solid #ffffff3d;border-radius:9px;background:#ffffff14;color:#fff;font-size:13px;white-space:nowrap}.language-switcher select{height:32px;max-width:145px;padding:0 7px;border:1px solid #cbd5e1;border-radius:7px;background:#fff;color:#172033;font:inherit}
/* Legacy Android WebView dialog fallback */
.legacy-dialog dialog{display:none}.legacy-dialog dialog[open]{display:block;position:fixed;z-index:1001;left:50%;top:50%;transform:translate(-50%,-50%);max-height:92vh;overflow:auto;margin:0}.legacy-dialog body:after{content:"";display:none;position:fixed;z-index:1000;inset:0;background:#11182799}.legacy-dialog.dialog-open body:after{display:block}.legacy-dialog.dialog-open body{overflow:hidden}
/* Android device profile: screen layout is selected from the measured usable area. */
html[data-screen-profile="compact"] main{grid-template-columns:90px minmax(360px,1fr) 310px}html[data-screen-profile="compact"] #products{grid-template-columns:repeat(auto-fill,minmax(125px,1fr));padding-left:10px;padding-right:10px;gap:9px}html[data-screen-profile="compact"] .cart{padding:12px}html[data-screen-profile="wide"] main{grid-template-columns:130px minmax(680px,1fr) 420px}html[data-screen-profile="wide"] #products{grid-template-columns:repeat(auto-fill,minmax(180px,1fr));grid-auto-rows:138px}html[data-device-compatibility="block"] body:before{content:"此设备未通过营业兼容检查，请联系运营中心";position:fixed;z-index:2000;inset:0 0 auto;padding:12px;text-align:center;background:#c92a2a;color:#fff;font-weight:700}
button{min-height:44px!important;touch-action:manipulation}button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid #1769d247;outline-offset:2px}


/* POS workbench UI v4: stable header, non-blocking device notice, visible checkout area. */
header{position:relative;min-height:142px;padding:10px 14px;align-items:flex-start;overflow:visible}
header>div{flex:0 0 215px;padding-top:4px}
header nav{align-content:flex-start;justify-content:flex-end;gap:6px;max-height:84px;overflow:visible}
header nav button{min-height:38px!important;padding:6px 9px;font-size:13px}
.language-switcher{min-height:38px;padding:3px 6px}
.language-switcher select{height:30px;max-width:132px}
main{height:calc(100vh - 142px);min-height:0}
.product-search{position:fixed;top:150px;left:130px;width:min(300px,calc(100vw - 510px))}
#products{padding-top:68px;min-height:0}
.cart{min-height:0;overflow:auto;overscroll-behavior:contain}
.cart #cart{min-height:76px}
.cart .actions{position:sticky;bottom:0;padding-top:8px;background:#fff;z-index:2}
html[data-device-compatibility="block"] body:before{content:"设备需要检查 · 请在设备检测中查看";inset:auto auto 12px 12px;width:auto;max-width:360px;padding:9px 13px;border-radius:10px;background:#9c2f2f;box-shadow:0 8px 28px #0003;font-size:13px;text-align:left;pointer-events:none}
@media(max-width:1100px){header{min-height:142px}header>div{flex-basis:185px}header nav button{padding:5px 7px;font-size:12px}.product-search{top:150px;left:110px;width:230px}main{height:calc(100vh - 142px)}}
@media(max-width:880px){header{min-height:176px}header>div{padding-top:0}header nav{max-height:none;justify-content:flex-start}.product-search{top:184px;left:100px;width:210px}main{height:calc(100vh - 176px)}}

/* POS_TOUCH_TARGETS_V16 */
.qty button[data-minus],.qty button[data-plus]{width:44px;min-width:44px;height:44px;padding:0;font-size:20px}


/* Final terminal touch targets: loaded last so compact and portrait rules cannot shrink key actions. */
header nav button{min-height:44px!important;padding-top:7px;padding-bottom:7px}
.language-switcher{min-height:44px!important}
.language-switcher select{height:44px!important;min-height:44px}
@media (orientation:portrait){header nav button{min-height:44px!important}.language-switcher{min-height:44px!important}}

/* Keep the dine-in table selector and guest count on one visual baseline. */
.dining-details{display:grid;grid-template-columns:minmax(0,1fr) 88px;align-items:start;gap:10px}
.reference-field,.guest-count-field{display:block;min-width:0;font-size:13px;line-height:20px}
.reference-control{display:grid;grid-template-columns:minmax(0,1fr) 94px;gap:8px;margin-top:6px}
.reference-control input,.reference-control button,.guest-count-field input{height:48px!important;min-height:48px;margin:0!important;box-sizing:border-box}
.reference-control input{width:100%;min-width:0;padding:0 10px}
.reference-control button{width:94px;padding:0 10px}
.guest-count-field input{display:block;width:100%;margin-top:6px!important;font-size:22px;text-align:center}
.reference-field small{display:block;min-height:20px;margin-top:6px!important;line-height:20px;color:#d9480f}
.reference-field small[hidden]{display:none}
@media(max-width:420px){.dining-details{grid-template-columns:minmax(0,1fr) 78px;gap:8px}.reference-control{grid-template-columns:minmax(0,1fr) 86px;gap:6px}.reference-control button{width:86px;padding:0 8px}}
/* Responsive safety net: no terminal is forced to desktop width. */
body{min-width:320px;overflow-x:hidden}
main{grid-template-columns:clamp(76px,9vw,110px) minmax(0,1fr) clamp(280px,28vw,380px)}
@media(max-width:760px){header{height:auto;min-height:64px;padding:8px 12px;gap:8px;flex-wrap:wrap}header nav{gap:6px;flex-wrap:wrap}main{height:calc(100vh - 82px);grid-template-columns:72px minmax(0,1fr) minmax(250px,38vw)}#products{grid-template-columns:repeat(auto-fill,minmax(112px,1fr));padding:8px;gap:8px}.cart{padding:10px}.actions{flex-wrap:wrap}.actions button{min-width:110px}}

/* NIAGAKING_RESPONSIVE_FINAL */
*{box-sizing:border-box}
.terminal-brand,.language-switcher,.product-search,.cart{min-width:0}
@media (max-width:900px){
  body{overflow-x:hidden}
  body.pos-terminal main{height:auto;min-height:calc(100vh - 216px);grid-template-columns:minmax(116px,24vw) minmax(0,1fr);grid-template-rows:auto auto}
  .terminal-brand{grid-column:1/-1;flex-wrap:wrap;gap:8px;padding-right:12px}
  .language-switcher{position:static;margin-left:auto;max-width:100%}
  body.pos-terminal .product-search{position:relative;inset:auto!important;top:auto!important;left:auto!important;width:100%;padding:10px 12px;z-index:2}
  .product-search input{width:100%;min-width:0}
  body.pos-terminal main>aside{grid-column:1;grid-row:1}
  body.pos-terminal #products{grid-column:2;grid-row:1;padding-top:12px}
  body.pos-terminal .cart{grid-column:1/-1;grid-row:2;width:100%;min-height:360px}
}
@media (max-width:640px){
  .pos-terminal{display:flex;flex-direction:column;min-height:100dvh}
  .terminal-brand{position:relative;width:100%;align-items:flex-start}
  .language-switcher{width:100%;margin:4px 0 0}
  .language-switcher select{width:100%;height:44px!important;min-height:44px}
  .product-search{order:2;width:100%;padding:8px 10px}
  .categories{order:3;display:flex!important;overflow-x:auto;width:100%;padding:0 8px;gap:6px;scrollbar-width:thin}
  .categories button{flex:0 0 auto;min-width:96px;min-height:44px}
  .products{order:4;grid-template-columns:repeat(2,minmax(0,1fr))!important;padding:10px;gap:10px}
  .product-card{min-width:0}
  .cart{order:5;padding:12px}
  button,input,select{min-height:44px}
  .dialog{width:min(94vw,560px);max-height:90dvh;overflow:auto}
}
@media (max-width:390px){.products{grid-template-columns:1fr!important}}

/* POS V2 ordering workspace: products and a reviewable order remain visible together. */
body.pos-terminal main{grid-template-columns:clamp(88px,8vw,112px) minmax(360px,1fr) clamp(430px,38vw,560px)}
body.pos-terminal .cart{overflow:hidden;padding:16px 18px;border-left:1px solid #e1e6ec}
.cart-heading{flex:0 0 auto}
.cart #cart{min-height:0;overflow-y:auto;overscroll-behavior:contain;padding-right:5px;scrollbar-gutter:stable}
.cart-item{padding:12px 0}
.cart-item .item-line{align-items:flex-start;gap:14px}
.cart-item-name{min-width:0;line-height:1.35;font-weight:700;overflow-wrap:anywhere}
.cart-item-prices{flex:0 0 128px;text-align:right}
.cart-item-prices small,.cart-item-prices strong{display:block;white-space:nowrap}
.cart-item-prices small{margin-bottom:4px;color:#6b7280;font-size:12px;font-weight:400}
.cart-item .qty{justify-content:space-between;gap:7px;flex-wrap:wrap}
.cart-item .qty button{min-width:44px;height:44px}
.cart-item .qty .item-note-button,.cart-item .qty .gift-item,.cart-item .qty .void-kitchen{width:auto;min-width:64px}
.quantity-value{min-width:28px;text-align:center;font-size:17px}
.cart .total,.cart .actions,.cart .kitchen-button,.cart .kitchen-actions,.cart .discount-button{flex:0 0 auto}
@media(max-width:1180px){
  body.pos-terminal main{grid-template-columns:88px minmax(300px,1fr) minmax(400px,44vw)}
  body.pos-terminal #products{grid-template-columns:repeat(auto-fill,minmax(132px,1fr));padding-left:10px;padding-right:10px}
  body.pos-terminal .cart{padding:12px}
}
@media(max-width:900px){
  body.pos-terminal main{height:calc(100vh - 176px);min-height:0;grid-template-columns:78px minmax(250px,1fr) minmax(360px,46vw);grid-template-rows:1fr}
  body.pos-terminal main>aside{grid-column:1;grid-row:1}
  body.pos-terminal #products{grid-column:2;grid-row:1;padding-top:66px}
  body.pos-terminal .cart{grid-column:3;grid-row:1;width:auto;min-height:0}
  body.pos-terminal .product-search{position:fixed;top:184px;left:86px;width:210px;padding:0}
}
