:root {
  color-scheme: dark;
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  color: #f3f5f7;
  background: #11141a;
  --surface: #1a1e26;
  --raised: #202530;
  --line: #313946;
  --muted: #aab3c1;
  --accent: #a4eee2;
  --ink: #112321;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 280px; }
body:has(dialog[open]) { overflow: hidden; }
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
.shell { width: min(100% - 64px, 1264px); margin-inline: auto; }

.site-header {
  position: sticky;
  z-index: 2;
  top: 0;
  background: #171b22;
  border-bottom: 1px solid var(--line);
}
.header-inner { min-height: 70px; display: flex; align-items: center; gap: 44px; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-size: 18px; font-weight: 750; white-space: nowrap; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--ink);
  font: 800 13px/1 "Segoe UI", sans-serif;
  letter-spacing: .04em;
}
.main-nav { display: flex; align-items: center; gap: 6px; }
.main-nav a { padding: 9px 14px; border-radius: 8px; font-size: 14px; color: var(--muted); white-space: nowrap; }
.main-nav a:hover, .main-nav a[aria-current="page"] { color: #fff; background: #272f39; }
.preview-tag { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }

.layout { display: grid; grid-template-columns: 211px minmax(0, 1fr); gap: 28px; padding-block: 30px 52px; }
.sidebar { position: sticky; top: 100px; align-self: start; padding: 17px 13px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.search-label, .filter-label { display: block; margin: 0 7px 9px; color: var(--muted); font-size: 12px; font-weight: 650; }
.filter-label { margin-top: 23px; }
.search-wrap { position: relative; }
.search-wrap svg { position: absolute; width: 17px; left: 11px; top: 12px; color: var(--muted); pointer-events: none; }
.search-wrap input { width: 100%; padding: 10px 9px 10px 33px; }
input:not([type="radio"], [type="checkbox"]) {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: inherit;
  background: #12161e;
  font-size: 13px;
}
input::placeholder { color: #a0aab8; }
.categories { display: grid; gap: 4px; }
.category-link { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 8px; border: 1px solid transparent; border-radius: 8px; font-size: 13px; color: #c5ccd7; white-space: nowrap; }
.category-link:hover { background: var(--raised); }
.category-link[aria-current="true"] { background: #223530; border-color: #3d625a; color: var(--accent); font-weight: 700; }
.category-icon { display: grid; place-items: center; flex: 0 0 19px; height: 19px; border-radius: 5px; background: #303844; color: #dde4ec; font: 700 11px/1 "Segoe UI", sans-serif; }
.category-count { margin-left: auto; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }

.intro { display: flex; align-items: end; justify-content: space-between; gap: 16px; padding: 8px 0 24px; border-bottom: 1px solid var(--line); }
.eyebrow { color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.intro h1 { margin-top: 6px; font-size: clamp(26px, 3.1vw, 39px); line-height: 1.16; letter-spacing: -.03em; }
#page-intro { margin-top: 9px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.product-count { color: var(--muted); font-size: 12px; white-space: nowrap; }
.product-section { margin-top: 25px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.section-head h2 { display: flex; align-items: center; gap: 9px; font-size: 19px; letter-spacing: -.02em; }
.section-head h2::before { content: ""; width: 3px; height: 17px; border-radius: 2px; background: var(--accent); }
.section-head a { color: var(--muted); font-size: 12px; padding: 6px 0 6px 8px; }
.section-head a:hover { color: var(--accent); }
.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.product-card { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; background: var(--surface); transition: border-color .2s, transform .2s; }
.product-card:hover { transform: translateY(-2px); border-color: #627780; }
.product-art, .mini-art { display: grid; place-items: center; background: radial-gradient(ellipse at 50% 55%, var(--art-light), var(--art-dark) 80%); }
.art-claude { --art-light: #593a34; --art-dark: #2b252a; }
.art-chatgpt { --art-light: #295147; --art-dark: #202e32; }
.art-gemini { --art-light: #3c4667; --art-dark: #252a3c; }
.product-art { position: relative; height: 111px; border-bottom: 1px solid var(--line); }
.product-art img { width: 56px; height: 56px; border-radius: 13px; object-fit: contain; background: #fff; box-shadow: 0 7px 19px #0004; }
.art-tag { position: absolute; top: 11px; left: 11px; padding: 4px 7px; border-radius: 5px; background: #131820d9; color: #e3e9f0; font-size: 10px; }
.card-content { display: flex; flex-direction: column; flex: 1; padding: 14px; }
.card-content h3 { font-size: 16px; line-height: 1.35; }
.card-detail { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.card-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 11px; font-size: 11px; color: #b3c5cf; }
.card-meta span:first-child { color: var(--accent); }
.card-bottom { margin-top: auto; padding-top: 14px; }
.card-sale { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-price { font-size: clamp(17px, 1.8vw, 22px); font-weight: 760; letter-spacing: -.03em; white-space: nowrap; }
.card-price small { color: var(--muted); font-size: 10px; letter-spacing: 0; font-weight: 650; }
.bulk-label { margin-top: 5px; color: var(--muted); font-size: 11px; }

.primary, .secondary, .quick-buy, .icon-button, .stepper button { border-radius: 8px; font-weight: 700; transition: background .2s, color .2s, border-color .2s; }
.primary { padding: 11px 15px; border: 1px solid var(--accent); background: var(--accent); color: var(--ink); }
.primary:hover { background: #c7faf2; }
.secondary, .quick-buy, .icon-button { background: var(--raised); color: #e7ecf1; border: 1px solid var(--line); }
.secondary { padding: 10px 12px; }
.quick-buy { padding: 7px 9px; font-size: 11px; min-height: 34px; white-space: nowrap; }
.secondary:hover, .quick-buy:hover, .icon-button:hover { border-color: #86aca8; color: var(--accent); }
.empty-state { padding: 52px 16px; text-align: center; }
.empty-state h2 { font-size: 19px; }
.empty-state p { color: var(--muted); margin: 9px 0 18px; font-size: 14px; }
.site-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 7px; border-top: 1px solid var(--line); padding-block: 18px 24px; color: var(--muted); font-size: 12px; }

dialog { width: min(100% - 28px, 520px); max-height: calc(100dvh - 28px); overflow: hidden; padding: 0; border: 1px solid #414c5b; border-radius: 17px; background: var(--surface); color: #f3f5f7; box-shadow: 0 22px 80px #0008; }
dialog::backdrop { background: #080b11b8; backdrop-filter: blur(5px); }
.dialog-layout { display: flex; flex-direction: column; max-height: calc(100dvh - 32px); }
.dialog-header, .dialog-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex: none; padding: 13px 20px; }
.dialog-header { border-bottom: 1px solid var(--line); }
.dialog-header h2 { font-size: 16px; }
.icon-button { width: 33px; height: 33px; font-size: 20px; line-height: 1; }
.dialog-body { overflow: auto; padding: 16px 20px; overscroll-behavior: contain; }
.purchase-product { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; gap: 13px; margin-bottom: 14px; }
.mini-art { width: 64px; height: 64px; border: 1px solid var(--line); border-radius: 11px; }
.mini-art img { width: 38px; height: 38px; border-radius: 8px; object-fit: contain; background: white; }
.purchase-product h3 { margin-block: 3px; font-size: 18px; }
.modal-price { font-size: 14px; font-weight: 750; }
.product-description { margin-top: 6px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.options { min-width: 0; margin: 14px 0 0; border: 0; padding: 0; }
.options legend, .purchase-fields label { margin-bottom: 6px; padding: 0; font-weight: 650; font-size: 13px; }
.choice, .invoice-choice { display: inline-flex; align-items: center; gap: 7px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; cursor: pointer; }
.choice, .invoice-choice:has(input:checked) { background: #24352f; border-color: #43685d; }
input[type="radio"], input[type="checkbox"] { accent-color: var(--accent); margin: 0; width: 15px; height: 15px; }
.purchase-fields { display: grid; grid-template-columns: minmax(115px, 1fr) minmax(0, 2fr); gap: 12px; margin-block: 13px; }
.purchase-fields label { display: block; }
.purchase-fields input { width: 100%; height: 36px; padding-inline: 9px; }
.field-hint { margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.stepper { display: grid; grid-template-columns: 29px minmax(0, 1fr) 29px; align-items: center; gap: 3px; }
.stepper input { text-align: center; padding-inline: 1px; appearance: textfield; }
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { appearance: none; margin: 0; }
.stepper button { height: 34px; border: 1px solid var(--line); background: var(--raised); color: #edf5fa; }
.stepper button:hover { border-color: var(--accent); }
.stepper button:disabled, .primary:disabled { opacity: .45; cursor: default; }
.dialog-footer { background: #181c24; border-top: 1px solid var(--line); }
.dialog-footer > div { display: grid; gap: 2px; }
.dialog-footer > div > span { color: var(--muted); font-size: 12px; }
.dialog-footer output { font-size: 18px; font-weight: 800; }
#checkout h3 { font-size: 16px; }
.checkout-rows { display: grid; gap: 8px; margin: 12px 0; font-size: 13px; }
.checkout-rows div { display: flex; justify-content: space-between; gap: 18px; align-items: baseline; }
.checkout-rows dt { color: var(--muted); flex-shrink: 0; }
.checkout-rows dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.checkout-rows .usd-total { color: var(--accent); font-size: 18px; font-weight: 800; }
.preview-note { margin-top: 12px; padding: 9px; border-radius: 7px; background: #282d3a; color: #d2d9e6; font-size: 12px; line-height: 1.5; }

@media (max-width: 930px) {
  .shell { width: calc(100% - 40px); }
  .layout { grid-template-columns: 170px minmax(0, 1fr); gap: 16px; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .shell { width: calc(100% - 28px); }
  .header-inner { gap: 13px; min-height: 58px; }
  .brand { gap: 6px; font-size: 14px; }
  .brand-mark { width: 27px; height: 27px; border-radius: 7px; font-size: 11px; }
  .main-nav { margin-left: auto; gap: 1px; }
  .main-nav a { padding-inline: 8px; font-size: 12px; }
  .preview-tag { display: none; }
  .layout { display: block; padding-block: 13px 34px; }
  .sidebar { position: static; margin-bottom: 17px; padding: 10px; }
  .search-label { margin-left: 0; }
  .filter-label { display: none; }
  .categories { margin-top: 8px; display: flex; flex-wrap: wrap; }
  .category-link { gap: 4px; padding: 5px 7px; min-height: 32px; font-size: 12px; }
  .category-count, .category-icon { display: none; }
  .intro { padding: 2px 0 16px; }
  .product-grid { gap: 8px; }
  .product-art { height: 92px; }
  .product-art img { width: 47px; height: 47px; }
  .art-tag { top: 7px; left: 7px; }
  .card-content { padding: 10px; }
  .card-content h3 { font-size: 14px; }
  .card-sale { flex-wrap: wrap; }
  .quick-buy { min-height: 37px; width: 100%; }
}
@media (max-width: 345px) { .product-grid, .purchase-fields { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
