/* Pixio Pets · 控件规范（和拍卖行同一套设计语言）
   窗口外框、标题栏、像素页签、像素按钮、条纹列表、底部操作栏、选择格、步进器、输入框。
   按钮只有三档：.btn（常规）、.btn.sm（工具栏）、.btn.big（页面主操作）。同一组放进 .bar，等宽等高。 */
@import url("../fonts/fusion-pixel/Fusion-Pixel-12px-Proportional-Simplified-Chinese.css");

:root {
  --night: #120e24; --panel: #2a2150; --panel2: #362b66; --hi: #4a3d8a; --lo: #1e1840; --ink: #07050f;
  --well: #0c0919; --strip: #161130; --deep: #120d26; --win: #1b1534;
  --fg: #fff4e2; --mute: #b4a8dc; --dim: #7f74ad; --label: #d9b45a;
  --gold: #ffcc4d; --gold-l: #fff0a8; --gold-d: #c98a1a; --bronze: #8a5e14;
  --red: #ff5d6c; --jade: #6fe3a8; --sky: #6fc8ff;
  --t0: #c9c2e8; --t1: #6fe3a8; --t2: #6fb4ff; --t3: #c38cff; --t4: #ffcc4d; --t5: #7f74ad;
  --row: #1e1840; --row2: #231c4a; --sel: #3d3172;
  --f-px: "Fusion Pixel 12px Proportional Simplified Chinese", "Noto Sans SC", monospace;
  --f-body: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
img { image-rendering: pixelated; image-rendering: crisp-edges; display: block; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.px { font-family: var(--f-px); -webkit-font-smoothing: none; font-weight: 400; }

/* ------------------------------------------------------------ 像素按钮 */
.btn {
  --b: var(--gold); --bl: var(--gold-l); --bd: var(--gold-d); --bt: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px 2px; margin: 3px; border: 0; cursor: pointer; white-space: nowrap;
  font-family: var(--f-px); font-size: 12px; line-height: 12px; -webkit-font-smoothing: none;
  color: var(--bt); background: var(--b);
  box-shadow: 0 -3px 0 var(--ink), 0 3px 0 var(--ink), -3px 0 0 var(--ink), 3px 0 0 var(--ink), inset 0 -5px 0 var(--bd), inset 0 3px 0 var(--bl);
}
.btn:hover { --b: #ffd76b; }
.btn:active { transform: translateY(2px); }
.btn.alt { --b: var(--panel2); --bl: #4e4290; --bd: #241c4a; --bt: var(--fg); }
.btn.alt:hover { --b: #40347a; }
.btn.sm { height: 32px; padding: 0 12px 2px; }
.btn.big { height: 52px; padding: 0 24px 3px; font-size: 24px; line-height: 24px; }
.btn img { width: 16px; height: 16px; flex: none; }
.btn.big img { width: 28px; height: 28px; }
.btn[disabled] { opacity: .4; cursor: not-allowed; transform: none; }
.btn[disabled]:hover { --b: var(--gold); }
.btn.alt[disabled]:hover { --b: var(--panel2); }
.bar { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 10px; }
.bar > .btn { width: calc(100% - 6px); }

/* ------------------------------------------------------------ 窗口 */
.frame {
  position: relative; display: grid; grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  background: var(--win); margin: 8px;
  box-shadow: 0 0 0 4px var(--ink), 0 0 0 8px var(--gold-d), 0 0 0 10px var(--bronze), 0 0 0 14px var(--ink);
}
.frame::before, .frame::after { content: ""; position: absolute; width: 14px; height: 14px; background: var(--gold); box-shadow: 0 0 0 3px var(--ink); top: -14px; z-index: 2; }
.frame::before { left: -14px; } .frame::after { right: -14px; }
.title {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 8px 16px 10px;
  background: linear-gradient(#3a2d12, #2a200c); box-shadow: inset 0 -4px 0 var(--ink), inset 0 3px 0 #5a4518;
}
.title b { font-family: var(--f-px); font-weight: 400; font-size: 24px; line-height: 28px; color: var(--gold); text-shadow: 3px 3px 0 var(--ink); -webkit-font-smoothing: none; white-space: nowrap; }
.title .l, .title .r { font-family: var(--f-px); font-size: 12px; color: #d9b45a; -webkit-font-smoothing: none; }
.title .r { text-align: right; }

/* ------------------------------------------------------------ 页签 */
.tabs { display: flex; gap: 14px; padding: 16px 18px 18px; background: linear-gradient(#120d26, #0c0919); box-shadow: inset 0 -4px 0 var(--ink); overflow-x: auto; }
.tab {
  --b: #2a2150; --bl: #4a3d8a; --bd: #17112f; --tc: var(--mute);
  position: relative; overflow: hidden; flex: 1 1 0; min-width: 0; max-width: 220px; display: flex; align-items: center; justify-content: center; gap: 10px;
  height: 56px; border: 0; cursor: pointer; padding: 0 14px 3px; margin: 4px; background: var(--b); color: var(--tc); white-space: nowrap;
  font-family: var(--f-px); font-size: 24px; line-height: 24px; -webkit-font-smoothing: none; text-shadow: 2px 2px 0 var(--ink);
  box-shadow: 0 -4px 0 var(--ink), 0 4px 0 var(--ink), -4px 0 0 var(--ink), 4px 0 0 var(--ink), inset 0 -6px 0 var(--bd), inset 0 4px 0 var(--bl);
  transition: transform .12s steps(2);
}
.tab img { width: 28px; height: 28px; flex: none; filter: drop-shadow(2px 2px 0 var(--ink)); }
.tab .cnt { font-size: 12px; line-height: 12px; padding: 4px 6px 5px; background: var(--red); color: #fff; text-shadow: none; box-shadow: 0 0 0 2px var(--ink); }
.tab:hover { --b: #3a2e72; --tc: var(--fg); transform: translateY(-3px); }
.tab:active { transform: translateY(2px); }
.tab[aria-selected="true"] { --b: var(--gold); --bl: var(--gold-l); --bd: var(--gold-d); --tc: var(--ink); text-shadow: 2px 2px 0 #ffe38a; animation: tabGlow 1.6s steps(6) infinite; }
.tab[aria-selected="true"]::before { content: ""; position: absolute; top: 0; bottom: 0; width: 34px; left: -60px; background: rgba(255, 255, 255, .55); transform: skewX(-20deg); animation: tabShine 2.4s steps(14) infinite; }
.tab[aria-selected="true"] img { animation: tabHop 1s steps(4) infinite; }
@keyframes tabGlow {
  0%, 100% { box-shadow: 0 -4px 0 var(--ink), 0 4px 0 var(--ink), -4px 0 0 var(--ink), 4px 0 0 var(--ink), inset 0 -6px 0 var(--bd), inset 0 4px 0 var(--bl), 0 0 0 7px rgba(255, 204, 77, .15), 0 0 24px 6px rgba(255, 204, 77, .25); }
  50% { box-shadow: 0 -4px 0 var(--ink), 0 4px 0 var(--ink), -4px 0 0 var(--ink), 4px 0 0 var(--ink), inset 0 -6px 0 var(--bd), inset 0 4px 0 var(--bl), 0 0 0 9px rgba(255, 204, 77, .35), 0 0 36px 12px rgba(255, 204, 77, .45); } }
@keyframes tabShine { 0% { left: -60px; } 55%, 100% { left: 110%; } }
@keyframes tabHop { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

/* ------------------------------------------------------------ 工具栏、主区、操作栏 */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; min-height: 64px; padding: 10px 16px 12px; background: var(--strip); box-shadow: inset 0 -4px 0 var(--ink); }
.toolbar .info { flex: 1 1 260px; font-size: 13px; color: var(--mute); }
.toolbar .info b { color: var(--fg); font-weight: 500; }
.toolbar .acts { display: flex; flex-wrap: wrap; gap: 6px; }
.main { min-height: 360px; display: grid; grid-template-columns: 320px minmax(0, 1fr); }
.main.one { grid-template-columns: minmax(0, 1fr); }
.side { overflow-y: auto; background: var(--strip); box-shadow: inset -4px 0 0 var(--ink); padding: 12px 16px 16px 12px; }
.detail { padding: 18px 22px 20px; overflow-y: auto; display: grid; gap: 18px; align-content: start; }
.actionbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; min-height: 76px; padding: 10px 16px 12px; background: var(--deep); box-shadow: inset 0 4px 0 var(--ink); }
.actionbar .sel { flex: 1 1 240px; }
.actionbar .acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: auto; }

h4.sec { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 0 0 10px; font-family: var(--f-px); font-weight: 400; font-size: 12px; color: var(--label); -webkit-font-smoothing: none; }
h4.sec em { font-style: normal; color: var(--dim); }
.hint { font-size: 13px; color: var(--mute); margin: 0; }
.hint b { color: var(--gold); font-weight: 500; }
.warn { font-size: 13px; color: var(--ink); background: var(--gold); padding: 8px 12px; }

/* ------------------------------------------------------------ 图标框、选中项 */
.ic { flex: none; width: 48px; height: 48px; display: grid; place-items: center; background: var(--well); box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px var(--q, var(--panel)); }
.ic img { width: 100%; height: 100%; }
.ic img.sm { width: 66%; height: 66%; }
.ic.l { width: 72px; height: 72px; box-shadow: 0 0 0 3px var(--ink), 0 0 0 6px var(--q, var(--panel)); }
.ic.s { width: 40px; height: 40px; }
.sel { display: flex; align-items: center; gap: 14px; min-width: 0; }
.sel > div { min-width: 0; }
.sel b { display: block; font-weight: 500; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sel span { font-size: 12px; color: var(--dim); }
.chip { display: inline-block; font-family: var(--f-px); font-size: 12px; line-height: 12px; padding: 4px 6px 5px; color: var(--ink); background: var(--c, var(--t0)); box-shadow: 0 0 0 2px var(--ink); -webkit-font-smoothing: none; vertical-align: middle; }

/* ------------------------------------------------------------ 条纹列表 */
.rows { display: grid; }
.tr {
  display: grid; grid-template-columns: var(--cols, 44px minmax(0, 1fr) auto); gap: 12px; align-items: center;
  min-height: 56px; padding: 6px 12px; border: 0; width: 100%; text-align: left; cursor: pointer;
  background: var(--row); box-shadow: inset 0 -1px 0 var(--deep); font-size: 14px; color: var(--fg);
}
.tr:nth-child(even) { background: var(--row2); }
.tr:hover { background: #2d2560; }
.tr[aria-selected="true"] { background: var(--sel); box-shadow: inset 4px 0 0 var(--gold), inset 0 0 0 1px #6b5aa8; }
.tr .nm { min-width: 0; }
.tr .nm b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr .nm span { display: block; font-size: 12px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr .r { text-align: right; }
.thead { display: grid; grid-template-columns: var(--cols); gap: 12px; padding: 0 12px; background: var(--deep); box-shadow: inset 0 -3px 0 var(--ink); }
.thead span { font-family: var(--f-px); font-size: 12px; color: var(--label); padding: 10px 0 9px; -webkit-font-smoothing: none; white-space: nowrap; }
.thead .r { text-align: right; }
.price b { display: block; font-family: var(--f-px); font-weight: 400; font-size: 12px; color: var(--gold); -webkit-font-smoothing: none; white-space: nowrap; text-align: right; }
.price span { display: block; font-size: 11px; color: var(--dim); text-align: right; }
.dot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; background: var(--dim); box-shadow: 0 0 0 1px var(--ink); vertical-align: 1px; }
.dot.ok { background: var(--jade); } .dot.wait { background: var(--gold); } .dot.bad { background: var(--red); }

/* ------------------------------------------------------------ 选择格（代替下拉框） */
.pick { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 12px; }
.opt {
  position: relative; display: grid; justify-items: center; align-content: center; gap: 6px;
  min-height: 96px; padding: 12px 8px 14px; margin: 3px; border: 0; cursor: pointer; text-align: center;
  background: linear-gradient(#2c2356, #221b46); color: var(--fg);
  box-shadow: 0 0 0 3px var(--ink), inset 0 2px 0 #4a3d8a, inset 0 -4px 0 #150f2e;
  transition: background .15s;
}
.opt img { width: 32px; height: 32px; filter: drop-shadow(2px 2px 0 var(--ink)); }
.opt b { font-family: var(--f-px); font-weight: 400; font-size: 12px; line-height: 14px; color: #e8c46a; -webkit-font-smoothing: none; text-shadow: 2px 2px 0 var(--ink); }
.opt small { font-size: 11px; line-height: 1.3; color: var(--mute); }
.opt .n { position: absolute; top: 6px; right: 8px; font-family: var(--f-px); font-size: 12px; color: var(--fg); text-shadow: 2px 2px 0 var(--ink); -webkit-font-smoothing: none; }
.opt:hover:not([disabled]):not([aria-checked="true"]) { background: linear-gradient(#3a2e72, #2c2358); }
.opt[aria-checked="true"] { background: linear-gradient(var(--gold-l), var(--gold) 45%, var(--gold-d)); box-shadow: 0 0 0 3px var(--ink), 0 0 14px 2px rgba(255, 204, 77, .4); animation: optPick .3s steps(3); }
.opt[aria-checked="true"] b { color: var(--ink); text-shadow: 1px 1px 0 #ffe9a0; }
.opt[aria-checked="true"] small { color: #5a3e08; }
.opt[aria-checked="true"] .n { color: var(--ink); text-shadow: none; }
.opt[disabled] { opacity: .38; cursor: not-allowed; }
@keyframes optPick { 40% { transform: scale(.96); filter: brightness(1.3); } }
.pick.compact .opt { min-height: 76px; padding: 10px 6px 12px; }
.pick.compact .opt img { width: 26px; height: 26px; }

/* 道具格（背包） */
.bag-g { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 10px; }
.bi { aspect-ratio: 1; position: relative; display: grid; place-items: center; border: 0; padding: 0; margin: 3px; cursor: pointer; background: var(--well); box-shadow: 0 0 0 3px var(--ink), 0 0 0 5px var(--q, transparent); }
.bi img { width: 64%; height: 64%; }
.bi img.full { width: 100%; height: 100%; }
.bi .n { position: absolute; right: 4px; bottom: 2px; font-family: var(--f-px); font-size: 12px; text-shadow: 2px 2px 0 var(--ink); -webkit-font-smoothing: none; }
.bi[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--ink), 0 0 0 6px var(--gold); }
.bi.zero { opacity: .35; }

/* ------------------------------------------------------------ 信息块、步进器、输入框 */
.cut { display: grid; gap: 4px; padding: 12px 14px; font-size: 13px; color: var(--mute); background: var(--well); box-shadow: 0 0 0 3px var(--ink); }
.cut div { display: flex; justify-content: space-between; gap: 12px; }
.cut b { font-weight: 500; color: var(--fg); text-align: right; }
.stats { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); gap: 3px; background: var(--ink); box-shadow: 0 0 0 3px var(--ink); }
.stats > div { padding: 10px 12px; background: var(--well); min-width: 0; }
.stats span { display: block; font-size: 11px; color: var(--dim); }
.stats b { display: block; margin-top: 3px; font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ok { color: var(--jade) !important; } .wait { color: var(--gold) !important; } .off { color: var(--dim) !important; } .bad { color: var(--red) !important; }

.qty { display: inline-flex; align-items: center; gap: 6px; }
.qty button { width: 32px; height: 36px; border: 0; background: var(--panel2); box-shadow: 0 0 0 3px var(--ink), inset 0 2px 0 #4e4290, inset 0 -3px 0 #241c4a; cursor: pointer; font-family: var(--f-px); font-size: 12px; -webkit-font-smoothing: none; margin: 3px; }
.qty button:hover:not([disabled]) { background: #40347a; }
.qty button[disabled] { opacity: .4; cursor: not-allowed; }
.qty output { min-width: 56px; height: 36px; display: grid; place-items: center; background: var(--well); box-shadow: 0 0 0 3px var(--ink), inset 2px 2px 0 #000; font-family: var(--f-px); font-size: 12px; color: var(--gold); -webkit-font-smoothing: none; }
.fld { display: grid; gap: 6px; }
.fld label { font-size: 12px; color: var(--mute); }
.fld > .inp-u, .fld > .qty, .fld > .inp { justify-self: start; }
.inp { height: 36px; padding: 0 10px; border: 0; background: var(--well); color: var(--fg); box-shadow: 0 0 0 3px var(--ink), inset 2px 2px 0 #000; margin: 3px; }
.inp-u { display: inline-flex; align-items: center; margin: 3px; box-shadow: 0 0 0 3px var(--ink); }
.inp-u .inp { margin: 0; box-shadow: inset 2px 2px 0 #000; width: 160px; font-family: var(--f-px); -webkit-font-smoothing: none; }
.inp-u span { height: 36px; display: grid; place-items: center; padding: 0 10px; background: var(--panel2); color: var(--mute); font-family: var(--f-px); font-size: 12px; -webkit-font-smoothing: none; }
.inp:focus, .inp-u:focus-within { outline: 3px solid var(--gold); outline-offset: 2px; }
.inp-u .inp:focus { outline: none; }
.total { text-align: right; }
.total span { display: block; font-size: 12px; color: var(--dim); }
.total b { font-family: var(--f-px); font-weight: 400; font-size: 24px; line-height: 28px; color: var(--gold); -webkit-font-smoothing: none; white-space: nowrap; }

/* ------------------------------------------------------------ 空状态、提示、弹窗 */
.empty { display: grid; justify-items: center; align-content: center; gap: 14px; padding: 48px 16px; text-align: center; color: var(--dim); font-size: 14px; }
.empty img { width: 48px; height: 48px; opacity: .85; }
#toasts { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 900; display: grid; gap: 10px; width: min(92vw, 440px); }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: rgba(8, 6, 20, .97); box-shadow: 0 0 0 2px #6b6290, 0 0 0 4px var(--ink); font-size: 14px; }
.toast::before { content: ""; flex: none; width: 10px; height: 10px; background: var(--mute); box-shadow: 0 0 0 2px var(--ink); }
.toast.ok::before { background: var(--jade); } .toast.err::before { background: var(--red); }
.toast.wait::before { background: var(--gold); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .25; } }
.dlg { position: fixed; inset: 0; z-index: 950; display: grid; place-items: center; padding: 16px; background: rgba(5, 3, 12, .72); }
.dlg .win { width: min(440px, 100%); background: var(--win); box-shadow: 0 0 0 4px var(--ink), 0 0 0 8px var(--gold-d), 0 0 0 12px var(--ink); }
.dlg .win.wide { width: min(640px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; }
.dlg .title { grid-template-columns: 1fr auto; }
.prompt { margin: 0; max-height: 240px; overflow-y: auto; white-space: pre-wrap; word-break: break-all; padding: 12px 14px; font: 13px/1.7 var(--f-body); color: var(--fg); background: var(--well); box-shadow: 0 0 0 3px var(--ink), inset 2px 2px 0 #000; }
.dlg .title b { font-size: 12px; line-height: 16px; text-shadow: 2px 2px 0 var(--ink); }
.dlg .x { justify-self: end; border: 0; background: none; color: #d9b45a; cursor: pointer; font-family: var(--f-px); font-size: 24px; line-height: 1; }
.dlg .body { padding: 16px 18px 18px; display: grid; gap: 10px; }
.dlg .list { display: grid; gap: 8px; }
.dlg .list .btn { justify-content: flex-start; width: calc(100% - 6px); height: 48px; }
.dlg .list .btn img { width: 24px; height: 24px; }

@media (prefers-reduced-motion: reduce) { .tab, .tab img, .tab::before, .opt { animation: none !important; transition: none !important; } }
