:root {
  --navy-950: #050d18;
  --navy-900: #071426;
  --navy-800: #0d223d;
  --navy-700: #143458;
  --blue: #2589d8;
  --cyan: #4cc9f0;
  --green: #29c488;
  --ink: #edf7ff;
  --muted: #91a9bf;
  --line: rgba(139, 196, 235, .16);
  --panel: rgba(10, 27, 48, .94);
  --shadow: 0 18px 48px rgba(0, 8, 22, .38);
  --radius: 8px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
html { min-width: 320px; }
body { margin: 0; min-height: 100vh; background: #050d18; color: var(--ink); }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; background: linear-gradient(145deg, #071426 0%, #0a1c32 48%, #07111f 100%); }
button, input, select { font: inherit; }
button { letter-spacing: 0; }
[hidden] { display: none !important; }
.notice { padding: 8px 16px; border-bottom: 1px solid rgba(76, 201, 240, .22); background: #091c32; color: #b8d9ee; text-align: center; font-size: 13px; font-weight: 650; }
.notice span { color: var(--cyan); }
.header { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; padding: 14px 4vw; border-bottom: 1px solid var(--line); background: rgba(7, 20, 38, .88); }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand img { width: 52px; height: 52px; border: 2px solid #32658f; border-radius: 50%; box-shadow: 0 7px 20px rgba(0, 0, 0, .3); }
.brand span { display: flex; flex-direction: column; }
.brand strong { color: #e8f7ff; font-size: 21px; }
.brand small { color: #7fa0ba; font-size: 11px; }
.header nav, .section-tabs, .categories { display: flex; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: rgba(13, 34, 61, .9); }
.header nav button, .section-tabs button, .categories button { border: 0; border-radius: 999px; background: transparent; color: #91a9bf; cursor: pointer; }
.header nav button { padding: 10px 32px; }
.header nav button.active, .section-tabs button.active, .categories button.active { background: #1769aa; color: #fff; box-shadow: 0 6px 18px rgba(24, 111, 177, .3); font-weight: 750; }
.account { justify-self: end; display: flex; align-items: center; gap: 9px; }
.status, .balance { display: flex; align-items: center; gap: 7px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: rgba(13, 34, 61, .9); color: #91a9bf; font-size: 12px; }
.status b, .balance b { color: #eaf7ff; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }
.balance { color: #62d5f6; }
.user-button { min-height: 34px; padding: 6px 13px; border: 1px solid #318bc9; border-radius: 999px; background: #0c2947; color: #8adcf5; font-weight: 750; cursor: pointer; }
.section-tabs { width: max-content; max-width: calc(100% - 24px); margin: 18px auto 16px; }
.section-tabs button { padding: 8px 19px; }
main { width: min(1180px, calc(100% - 32px)); margin: 0 auto 60px; }
.page { display: none; }
.page.active { display: block; animation: rise .22s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(7px); } }
.market-heading { display: flex; align-items: end; justify-content: space-between; margin: 8px 0 14px; }
.market-heading p { margin: 0 0 3px; color: var(--cyan); font-size: 10px; font-weight: 900; }
.market-heading h1 { margin: 0; font-size: 27px; }
.market-heading > span { padding: 6px 11px; border: 1px solid var(--line); border-radius: 999px; background: rgba(13, 34, 61, .8); color: #91a9bf; font-size: 11px; }
.identity-badges { display: flex; align-items: center; gap: 8px; }
.identity-badges > span { padding: 6px 11px; border: 1px solid var(--line); border-radius: 999px; background: rgba(13, 34, 61, .8); color: #91a9bf; font-size: 11px; }
.identity-badges #tradePermission.allowed { border-color: rgba(41, 196, 136, .36); color: #67d6ad; }
.categories { width: max-content; max-width: 100%; margin: 0 auto 16px; overflow: auto; }
.categories button { padding: 8px 21px; white-space: nowrap; }
.toolbar { display: flex; align-items: end; gap: 10px; margin-bottom: 14px; }
.toolbar label:not(.search) { display: flex; flex-direction: column; gap: 4px; }
.toolbar label > span { padding-left: 3px; color: #7e99b1; font-size: 10px; }
.toolbar select, .search input, .buy-controls input, .login-panel input { border: 1px solid var(--line); border-radius: 6px; background: #0c213b; color: #eaf7ff; outline: none; }
.toolbar select, .search input { height: 42px; }
.toolbar select { padding: 0 36px 0 12px; }
.toolbar select:focus, .search input:focus, .buy-controls input:focus, .login-panel input:focus { border-color: #3caee6; box-shadow: 0 0 0 3px rgba(60, 174, 230, .14); }
.refresh { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: var(--radius); background: #0c2947; color: var(--cyan); font-size: 21px; cursor: pointer; }
.search { position: relative; display: flex; width: min(300px, 40%); margin-left: auto; }
.search input { width: 100%; padding: 0 40px 0 14px; }
.search b { position: absolute; top: 10px; right: 13px; color: #7190aa; font-size: 21px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
.result-meta { display: flex; justify-content: space-between; margin: 0 2px 10px; color: #7f99af; font-size: 11px; }
.grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 13px; }
.card { position: relative; display: flex; min-width: 0; flex-direction: column; align-items: center; padding: 13px 11px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: 0 8px 24px rgba(0, 7, 18, .25); color: var(--ink); cursor: pointer; transition: transform .18s, border-color .18s, box-shadow .18s; }
.card:hover { transform: translateY(-3px); border-color: rgba(76, 201, 240, .38); box-shadow: var(--shadow); }
.card > .grade { position: absolute; top: 9px; left: 9px; z-index: 1; padding: 2px 7px; border-radius: 4px; background: #48647d; color: #fff; font-size: 9px; font-weight: 900; }
.card.g-S > .grade, .card.g-T1 > .grade { background: #1688bc; }
.card.g-A > .grade { background: #396ec1; }
.card.g-B > .grade { background: #287b98; }
.card img.item { width: 100%; aspect-ratio: 1.15; margin-bottom: 7px; object-fit: contain; }
.card h2 { max-width: 100%; margin: 0; overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.card .offers { margin: 4px 0 10px; color: #7f99af; font-size: 10px; }
.card .label { color: #607e98; font-size: 9px; }
.price { display: flex; max-width: 100%; align-items: center; justify-content: center; gap: 5px; margin-top: 3px; color: #66d5f4; font-size: 11px; font-weight: 850; text-align: center; line-height: 1.25; }
.price img { width: 17px; height: 17px; }
.card .cta { margin-top: 9px; color: #56bde8; font-size: 10px; font-weight: 700; }
.empty { display: flex; min-height: 330px; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 1px dashed var(--line); border-radius: var(--radius); background: rgba(9, 26, 46, .68); color: #7f99af; }
.empty b { color: #eaf7ff; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 22px; }
.pager button { padding: 8px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: #0d2947; color: #b8d9ee; cursor: pointer; }
.pager button:disabled { opacity: .4; }
.pager span { min-width: 190px; color: #89a3ba; text-align: center; font-size: 12px; }
.safety { position: fixed; right: 18px; bottom: 80px; display: flex; flex-direction: column; padding: 13px 16px; border: 1px solid #245e82; border-radius: var(--radius); background: #0b2945; box-shadow: var(--shadow); color: #86d8f2; }
.safety b { font-size: 13px; }
.safety span { color: #91a9bf; font-size: 9px; }
footer { padding: 24px; color: #708ba2; text-align: center; font-size: 11px; }
.modal-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(1, 8, 18, .76); backdrop-filter: blur(5px); }
.modal-backdrop.open { display: grid; }
.modal { position: relative; display: grid; grid-template-columns: 34% 66%; width: min(880px, 100%); max-height: 88vh; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #091a2f; box-shadow: 0 30px 90px rgba(0, 0, 0, .55); }
.close { position: absolute; top: 14px; right: 14px; z-index: 2; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; background: #102a47; color: #9bb5ca; font-size: 24px; cursor: pointer; }
.product { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 35px 20px; background: #0b223c; text-align: center; }
.product img { width: 190px; height: 190px; object-fit: contain; }
.product > span { padding: 2px 9px; border-radius: 999px; background: #1769aa; color: #fff; font-size: 11px; font-weight: 800; }
.product h2 { margin: 10px 0 4px; font-size: 21px; }
.product p { margin: 0; color: #819bb2; font-size: 11px; }
.quotes { padding: 54px 24px 24px; overflow: auto; }
.quotes > header { display: flex; align-items: end; justify-content: space-between; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.quotes header small, .login-panel > small { color: var(--cyan); font-weight: 800; }
.quotes h3 { margin: 2px 0 0; font-size: 19px; }
.quotes header > span { color: #758fa6; font-size: 10px; }
.offer-row { display: grid; grid-template-columns: 28px 1fr auto 120px auto; align-items: center; gap: 12px; padding: 13px 4px; border-bottom: 1px solid var(--line); }
.offer-row > i { color: #728ca3; font-style: normal; }
.offer-row div { display: flex; flex-direction: column; }
.offer-row small { color: #819bb2; }
.offer-row strong, .buy-controls small b { color: #67d8f4; }
.offer-row button, .list-item { border: 0; border-radius: 6px; background: #16845f; color: #fff; font-weight: 750; cursor: pointer; }
.offer-row button { padding: 7px 13px; }
.offer-row button:disabled { background: #25394c; color: #8298aa; cursor: not-allowed; }
.buy-controls { gap: 3px; }
.buy-controls input { width: 100%; height: 34px; padding: 0 8px; }
.loading { padding: 70px 10px; color: #819bb2; text-align: center; }
.toast { position: fixed; z-index: 80; bottom: 24px; left: 50%; transform: translateX(-50%); padding: 11px 18px; border: 1px solid var(--line); border-radius: 999px; background: #102a47; color: #fff; box-shadow: var(--shadow); font-size: 12px; }
.login-panel { position: relative; width: min(420px, 100%); padding: 30px; border: 1px solid var(--line); border-radius: var(--radius); background: #091a2f; box-shadow: 0 30px 90px rgba(0, 0, 0, .55); text-align: left; }
.login-panel > small { letter-spacing: 2px; }
.login-panel h2 { margin: 5px 0; }
.login-panel > p { margin: 0 0 20px; color: #819bb2; font-size: 12px; }
.login-panel label { display: flex; flex-direction: column; gap: 5px; margin: 12px 0; color: #91a9bf; font-size: 12px; }
.login-panel input { height: 44px; padding: 0 12px; }
.login-submit { width: 100%; height: 44px; margin-top: 8px; border: 0; border-radius: 6px; background: #1769aa; color: #fff; font-weight: 800; cursor: pointer; }
.login-panel #loginMessage, .login-panel #listingMessage { min-height: 20px; margin-top: 8px; color: #f08b8b; text-align: center; font-size: 12px; }
.bag-card .meta { display: grid; grid-template-columns: 1fr 1fr; width: 100%; margin-top: 7px; padding-top: 7px; border-top: 1px solid var(--line); color: #7f99af; font-size: 9px; }
.bag-card .meta b { color: #dceefa; font-size: 12px; }
.bag-card .meta b.permanent { color: #67d6ad; }
.bag-card .meta b.limited { color: #f0c66c; }
.bag-grid .card { cursor: default; }
.list-item { width: 100%; height: 32px; margin-top: 10px; }
.list-item:disabled { background: #25394c; color: #6f879b; cursor: not-allowed; }
.list-item.restricted { background: #25394c; color: #9db0c1; }
.listing-panel .listing-total { margin: 14px 0; padding: 12px; border-radius: 6px; background: #0c213b; color: #91a9bf; text-align: center; }
.listing-panel .listing-total b { color: #67d8f4; font-size: 18px; }
.listing-table { display: flex; flex-direction: column; gap: 8px; }
.listing-row { display: grid; grid-template-columns: 58px minmax(180px, 1fr) 110px 130px 78px 100px; align-items: center; gap: 14px; padding: 11px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.listing-row > img { width: 54px; height: 54px; object-fit: contain; }
.listing-row > div, .listing-row > span { display: flex; min-width: 0; flex-direction: column; }
.listing-row small { color: #7f99af; font-size: 10px; }
.listing-row > div b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.listing-row > span b { color: #dceefa; }
.listing-row > button { padding: 8px 10px; border: 1px solid #2d769e; border-radius: 6px; background: #0c2947; color: #7dd6f1; cursor: pointer; }
.listing-status { width: max-content; padding: 4px 8px; border-radius: 999px; background: #24394e; color: #9ab1c4; font-size: 11px; }
.listing-status.listed { background: #123f38; color: #67d6ad; }
.listing-status.sold { background: #173e5b; color: #7dd6f1; }
@media (max-width: 1050px) {
  .grid { grid-template-columns: repeat(4, 1fr); }
  .header { grid-template-columns: 1fr auto; }
  .header nav { grid-row: 2; grid-column: 1 / -1; justify-self: center; }
  .account { grid-column: 2; }
}
@media (max-width: 850px) {
  .offer-row { grid-template-columns: 24px 1fr auto; }
  .buy-controls { grid-column: 2 / 3; }
  .offer-row > button { grid-column: 3; }
  .listing-row { grid-template-columns: 50px 1fr auto; }
  .listing-row > span, .listing-row > .listing-status { grid-column: 2; }
  .listing-row > button { grid-row: 1 / 4; grid-column: 3; }
}
@media (max-width: 720px) {
  .notice { font-size: 11px; }
  .header { padding: 12px 16px; }
  .brand strong { font-size: 16px; }
  .brand small { display: none; }
  .brand img { width: 43px; height: 43px; }
  .header nav button { padding: 9px 22px; }
  .section-tabs { display: flex; width: 100%; }
  .section-tabs button { flex: 1; }
  main { width: calc(100% - 20px); }
  .market-heading { align-items: flex-start; flex-direction: column; gap: 7px; }
  .identity-badges { flex-wrap: wrap; }
  .categories { width: 100%; }
  .toolbar { align-items: stretch; flex-wrap: wrap; }
  .toolbar label:not(.search) { flex: 1; }
  .toolbar select { width: 100%; }
  .refresh { margin-top: 14px; }
  .search { width: 100%; margin: 0; }
  .grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .result-meta span:last-child { display: none; }
  .card { padding: 8px; }
  .card h2 { font-size: 12px; }
  .modal { grid-template-columns: 1fr; overflow: auto; }
  .product { padding: 25px 15px; }
  .product img { width: 140px; height: 140px; }
  .quotes { padding: 20px; }
  .safety { display: none; }
}
@media (max-width: 460px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .account .balance { padding: 6px 9px; }
  .market-heading h1 { font-size: 23px; }
  .categories button { padding: 8px 16px; }
  .offer-row { grid-template-columns: 22px 1fr auto; }
  .offer-row button { grid-column: 2 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
