/* 官方商城：366×744 设计板，按背包方式等比例缩放。 */
#gameScreen .os-overlay,
.os-overlay{
  --os-panel-scale:1;
  position:absolute !important;
  z-index:3200 !important;
  inset:0 !important;
  width:390px !important;
  max-width:100% !important;
  height:100% !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  padding:52px 8px 12px !important;
  overflow:hidden !important;
  box-sizing:border-box !important;
  background:radial-gradient(circle at 50% 35%,rgba(58,42,23,.26),rgba(14,10,8,.72));
  -webkit-backdrop-filter:none;
  backdrop-filter:none;
  font-family:"Noto Sans SC",Inter,system-ui,sans-serif;
}
#gameScreen .os-fit,
.os-fit{
  position:relative !important;
  flex:none !important;
  width:calc(366px * var(--os-panel-scale,1)) !important;
  height:calc(744px * var(--os-panel-scale,1)) !important;
}
#gameScreen .os-panel,
.os-panel{
  position:absolute !important;
  left:50% !important;
  top:50% !important;
  width:366px !important;
  height:744px !important;
  max-width:none !important;
  max-height:none !important;
  min-width:366px !important;
  min-height:744px !important;
  margin:0 !important;
  overflow:hidden !important;
  color:#452914;
  border:5px solid #603514;
  border-radius:28px;
  background:
    radial-gradient(120% 55% at 50% 0,rgba(255,239,177,.72),transparent 48%),
    linear-gradient(180deg,#ffeec0 0,#f6d998 54%,#dcaa5c 100%);
  box-shadow:
    inset 0 0 0 3px #f9d77e,
    inset 0 0 0 7px #8f541e,
    0 18px 30px rgba(19,9,4,.52);
  transform:translate(-50%,-50%) scale(var(--os-panel-scale,1)) !important;
  transform-origin:center center !important;
  box-sizing:border-box !important;
}
.os-panel,.os-panel *{box-sizing:border-box}

.os-panel:before{
  content:"";
  position:absolute;
  z-index:0;
  inset:10px;
  border:1px solid rgba(255,245,202,.74);
  border-radius:19px;
  pointer-events:none;
}

.os-panel:after{
  content:"";
  position:absolute;
  z-index:0;
  left:22px;
  right:22px;
  bottom:7px;
  height:8px;
  border-radius:50%;
  background:rgba(95,45,12,.22);
  filter:blur(4px);
  pointer-events:none;
}

/* 木牌式标题区 */
.os-header{
  position:absolute;
  z-index:2;
  left:13px;
  top:11px;
  width:330px;
  height:58px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:9px;
  padding:0 49px 0 42px;
  border:3px solid #704017;
  border-radius:18px 18px 14px 14px;
  background:
    linear-gradient(90deg,transparent 0 7%,rgba(255,221,124,.18) 7% 8%,transparent 8% 92%,rgba(255,221,124,.18) 92% 93%,transparent 93%),
    linear-gradient(180deg,#a96025,#6e3514);
  box-shadow:inset 0 2px #d99746,inset 0 -3px #4d260f,0 3px 0 #b97930;
  color:#fff0b5;
  text-align:left;
}

.os-header:before,.os-header:after{
  content:"";
  position:absolute;
  top:50%;
  width:7px;
  height:7px;
  border:2px solid #6a360f;
  border-radius:50%;
  background:#f4bd49;
  box-shadow:inset 0 1px #fff2a4;
  transform:translateY(-50%);
}
.os-header:before{left:9px}.os-header:after{right:9px}

.os-header>img{
  width:38px;
  height:38px;
  flex:0 0 38px;
  padding:5px;
  object-fit:contain;
  border:2px solid #f3c45e;
  border-radius:50%;
  background:linear-gradient(#fff4bd,#e8a735);
  filter:drop-shadow(0 2px 2px rgba(45,17,4,.5));
}

.os-header>div{min-width:0}
.os-title{
  margin:0;
  color:#fff2be;
  font-size:21px;
  line-height:23px;
  font-weight:950;
  letter-spacing:.08em;
  white-space:nowrap;
  text-shadow:0 2px 0 #4b210c,0 3px 4px rgba(36,14,5,.48);
}
.os-subtitle{
  display:block;
  margin-top:1px;
  color:#f6cb79;
  font-size:8px;
  line-height:10px;
  font-weight:800;
  letter-spacing:.08em;
  white-space:nowrap;
}

.os-close{
  position:absolute;
  z-index:5;
  right:17px;
  top:20px;
  width:35px;
  height:35px;
  padding:0 0 3px;
  border:3px solid #742319;
  border-radius:50%;
  background:linear-gradient(#ff6f52,#cf3028);
  color:#fff9df;
  font:900 22px/29px system-ui,sans-serif;
  box-shadow:inset 0 2px #ffb098,0 3px 0 #7d211a,0 4px 7px rgba(62,19,10,.42);
  text-shadow:0 2px #86241b;
  cursor:pointer;
}
.os-close:active{transform:translateY(2px);box-shadow:inset 0 2px #ffb098,0 1px 0 #7d211a}

/* 顶部只展示钻石/金币，不再显示栏位或扩建。 */
.os-wallet{
  position:absolute;
  z-index:2;
  left:17px;
  top:78px;
  width:322px;
  height:46px;
  display:grid;
  grid-template-columns:1fr;
  gap:7px;
}

.os-chip{
  min-width:0;
  height:46px;
  display:flex;
  align-items:center;
  gap:8px;
  padding:6px 11px;
  border:2px solid #194a67;
  border-radius:14px;
  color:#f7fdff;
  background:linear-gradient(180deg,#3b7998,#1e4e6b);
  box-shadow:inset 0 2px rgba(255,255,255,.2),0 3px 0 #12394f;
}
.os-chip--gold{border-color:#7b4b15;background:linear-gradient(180deg,#e4ae42,#a76618);box-shadow:inset 0 2px rgba(255,239,174,.46),0 3px 0 #75450f}
.os-chip--diamond{border-color:#176da2;background:linear-gradient(180deg,#54d8f4,#1d88c9);box-shadow:inset 0 2px rgba(223,252,255,.6),0 3px 0 #12638f}
.os-chip__icon{width:27px;height:27px;flex:0 0 27px;object-fit:contain;filter:drop-shadow(0 2px 2px rgba(8,30,60,.35))}
.os-chip small{display:block;color:#d8edf4;font-size:8px;line-height:10px;font-weight:800;white-space:nowrap}
.os-chip b{display:block;color:#fff;font-size:15px;line-height:18px;font-weight:950;white-space:nowrap;text-shadow:0 1px rgba(0,0,0,.25)}
.os-chip--gold small,.os-chip--diamond small{color:#effcff}

/* 六个分类一次完整显示，不横向滚动。 */
.os-tabs{
  position:absolute;
  z-index:2;
  left:17px;
  top:134px;
  width:322px;
  height:36px;
  display:flex;
  gap:4px;
  overflow:visible;
}
.os-tab{
  min-width:0;
  height:34px;
  flex:1 1 0;
  padding:0 2px;
  border:2px solid #966126;
  border-radius:10px;
  background:linear-gradient(#fff0bd,#dda75a);
  color:#603917;
  font-size:10px;
  font-weight:900;
  white-space:nowrap;
  box-shadow:inset 0 2px #fff8da,0 2px 0 #9d6427;
  cursor:pointer;
}
.os-tab[aria-selected="true"]{
  border-color:#5c8d25;
  background:linear-gradient(#99df53,#4ca72f);
  color:#fffdf0;
  text-shadow:0 1px #316e20;
  box-shadow:inset 0 2px #d8ff9a,0 2px 0 #347b25,0 0 8px rgba(91,171,50,.35);
}

/* 3×3 商品陈列，图标和名称比旧四列布局更清晰。 */
.os-grid{
  position:absolute;
  z-index:2;
  left:17px;
  top:179px;
  width:322px;
  height:359px;
  display:grid;
  grid-template-columns:repeat(3,1fr);
  grid-template-rows:repeat(3,1fr);
  gap:7px;
  padding:9px;
  overflow:hidden;
  border:3px solid #a76927;
  border-radius:18px;
  background:
    radial-gradient(circle at 50% 0,rgba(255,250,213,.65),transparent 48%),
    linear-gradient(180deg,#f8e8bd,#e7c57f);
  box-shadow:inset 0 2px #fff5cf,inset 0 0 16px rgba(113,58,12,.13),0 3px 0 #8a4d1d;
}

.os-slot{
  position:relative;
  min-width:0;
  min-height:0;
  display:flex;
  flex-direction:column;
  align-items:center;
  padding:6px 4px 8px;
  overflow:hidden;
  border:2px solid #b77a35;
  border-radius:14px;
  background:radial-gradient(120% 88% at 50% 18%,#fffdf6,#f3d8a6 70%,#ddae65);
  box-shadow:inset 0 2px #fff8df,0 2px 0 #8c571f;
  color:#563317;
  cursor:pointer;
}
.os-slot:active{transform:translateY(1px)}
.os-slot--empty{border-color:#ca9b58;background:linear-gradient(#eeddb3,#dfc58d);box-shadow:inset 0 0 0 1px rgba(255,247,213,.42)}
.os-slot[aria-selected="true"]{border-color:#5b9e2e;box-shadow:inset 0 0 0 2px #e7ffac,0 0 0 2px #397b22,0 0 11px rgba(83,159,43,.48)}
.os-slot--locked{filter:saturate(.58) brightness(.94)}
.os-slot--equipped{border-color:#2697c7;box-shadow:inset 0 0 0 2px #b9f2ff,0 0 0 2px #1976a2,0 0 10px rgba(26,142,193,.42)}

.os-slot__icon{
  position:relative;
  flex:1 1 0;
  width:74%;
  min-height:0;
  max-height:56%;
  object-fit:contain;
  pointer-events:none;
  filter:drop-shadow(0 3px 2px rgba(78,42,13,.25));
}
.os-slot--skin .os-slot__icon{width:88%;object-fit:cover;border:2px solid #d3a257;border-radius:10px;filter:none}
.os-slot__name{
  position:relative;
  z-index:1;
  flex:none;
  width:100%;
  margin:0 0 8px;
  padding:0 2px;
  min-height:14px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:#573416;
  font-size:10px;
  line-height:14px;
  font-weight:900;
  text-align:center;
  text-shadow:0 1px #fff4d1;
}

.os-slot__price{
  position:relative;
  z-index:1;
  flex:none;
  min-width:42px;
  max-width:96%;
  height:16px;
  margin:0 auto;
  padding:0 6px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:3px;
  overflow:hidden;
  border-radius:9px;
  background:linear-gradient(#79e3ff,#2994d8);
  color:#073d66;
  font-size:9px;
  line-height:13px;
  font-weight:950;
  white-space:nowrap;
  box-shadow:inset 0 1px #dbfaff,0 1px 0 #1375ad;
}
.os-slot__price img{width:11px;height:11px;flex:0 0 11px;object-fit:contain}
.os-slot__price--own{background:linear-gradient(#8ce85b,#47a82c);color:#fffef2;box-shadow:inset 0 1px #d8ffa6,0 1px 0 #347d21}
.os-slot__price--gold{background:linear-gradient(#ffd75a,#d8941f);color:#54320d;box-shadow:inset 0 1px #fff0a2,0 1px 0 #9c6717}

.os-slot__tag,.os-slot__vip{
  position:absolute;
  z-index:2;
  left:-1px;
  top:-1px;
  min-width:32px;
  padding:2px 6px 3px;
  border-radius:12px 0 10px 0;
  color:#fff;
  font-size:8px;
  line-height:10px;
  font-weight:950;
  text-align:center;
  text-shadow:0 1px rgba(79,24,5,.55);
}
.os-slot__tag{background:linear-gradient(#ff963c,#df5119);box-shadow:inset 0 1px #ffc87a}
.os-slot__vip{background:linear-gradient(#a36be0,#63329e);box-shadow:inset 0 1px #dec0ff}

.os-page{
  position:absolute;
  z-index:2;
  left:111px;
  top:545px;
  width:134px;
  height:27px;
  display:grid;
  place-items:center;
  border:1px solid #b47a35;
  border-radius:14px;
  background:rgba(255,239,197,.8);
  color:#75481f;
  font-size:11px;
  font-weight:900;
  cursor:pointer;
  user-select:none;
  box-shadow:inset 0 1px #fff7dc;
}

/* 大详情区：选中后展示完整名称、标签、说明、价格和操作。 */
.os-detail{
  position:absolute;
  z-index:2;
  left:17px;
  top:579px;
  width:322px;
  height:150px;
  display:grid;
  grid-template-columns:98px minmax(0,1fr);
  gap:10px;
  padding:10px;
  overflow:hidden;
  border:3px solid #bd7b31;
  border-radius:18px;
  background:linear-gradient(145deg,#fffaf0,#ffe8b7);
  box-shadow:inset 0 2px #fffdf2,0 3px 0 #92551f;
}
.os-detail[hidden]{display:none}
.os-detail__visual{display:grid;place-items:center;overflow:hidden;border:2px solid #d49a45;border-radius:14px;background:radial-gradient(circle at 50% 30%,#fffdf8,#edc879);box-shadow:inset 0 2px #fff2c5}
.os-detail__visual img{width:88%;height:82%;object-fit:contain;filter:drop-shadow(0 3px 2px rgba(73,38,11,.25))}
.os-detail__visual--skin img{width:92%;height:90%;object-fit:cover;border-radius:10px;filter:none}
.os-detail>div:last-child{min-width:0;display:flex;flex-direction:column}
.os-detail__name{margin:0 0 3px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#482911;font-size:15px;line-height:19px;font-weight:950}
.os-detail__meta{height:18px;display:flex;align-items:center;gap:4px;margin-bottom:3px;overflow:hidden}
.os-badge{display:inline-block;flex:0 0 auto;padding:2px 7px;border-radius:9px;background:#7a49b1;color:#fff;font-size:8px;line-height:12px;font-weight:850}.os-badge--ok{background:#5b9f31}.os-badge--hot{background:#e7651d}.os-badge--lock{background:#8a5a32}
.os-detail__desc{height:42px;margin:0 0 5px;overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;color:#6b4a27;font-size:9px;line-height:14px}
.os-overlay.os-has-qty .os-grid{height:323px}
.os-overlay.os-has-qty .os-page{top:509px}
.os-overlay.os-has-qty .os-detail{top:543px;height:186px}
.os-overlay.os-has-qty .os-detail__desc{height:28px;-webkit-line-clamp:2;margin-bottom:4px}
.os-qty{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:6px;
  margin:0 0 6px;
  min-height:30px;
}
.os-qty[hidden]{display:none}
.os-stepper{display:flex;align-items:center;height:30px;flex:none}
.os-stepper button,.os-stepper input{
  height:30px;
  border:1px solid #af7735;
  background:#fff8e6;
  color:#5f3a19;
  font-size:12px;
  font-weight:900;
  text-align:center;
}
.os-stepper button{width:28px;padding:0;cursor:pointer}
.os-stepper button:first-child{border-radius:10px 0 0 10px}
.os-stepper input{width:36px;border-left:0;border-right:0;outline:0}
.os-stepper input::-webkit-inner-spin-button,.os-stepper input::-webkit-outer-spin-button{display:none}
.os-qty-max{width:36px;margin-left:3px;border-radius:9px !important;background:#f1d08d;font-size:8px}
.os-stepper button:disabled,.os-stepper input:disabled{opacity:.5}
.os-total{min-width:0;display:flex;flex-direction:column;align-items:flex-end;gap:1px}
.os-total__label{color:#8a5a2c;font-size:8px;font-weight:800;line-height:10px}
.os-total__value{display:flex;align-items:center;gap:3px;color:#b42318;font-size:14px;line-height:16px;font-weight:950;white-space:nowrap}
.os-total__value img{width:16px;height:16px;flex:0 0 16px;object-fit:contain}
.os-detail__footer{height:35px;margin-top:auto;display:flex;align-items:center;justify-content:space-between;gap:6px}
.os-detail__price{min-width:0;display:flex;align-items:center;gap:4px;overflow:hidden;color:#1471ad;font-size:12px;line-height:18px;font-weight:950;white-space:nowrap}.os-detail__price img{width:17px;height:17px;flex:0 0 17px;object-fit:contain}.os-detail__price--own{color:#347d20}
.os-buy{min-width:86px;height:34px;padding:0 12px;border:2px solid #2b7621;border-radius:18px;background:linear-gradient(#8ee758,#43aa2d);color:#fffdf2;font-size:13px;font-weight:950;text-shadow:0 1px #245816;box-shadow:inset 0 2px #d6ffa2,0 2px 0 #2a6d1c;cursor:pointer}.os-buy:disabled{filter:grayscale(.78);opacity:.65}.os-buy:not(:disabled):active{transform:translateY(1px)}
.os-empty{grid-column:1/-1;display:grid;place-items:center;color:#8a6840;font-size:12px;font-weight:850}

@media(prefers-reduced-motion:reduce){.os-slot,.os-close,.os-buy{transition:none}}
