@font-face {
  font-family: "Instrument Serif";
  src: url("instrument-serif.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Union Han";
  src: url("union-han.woff2") format("woff2");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("bricolage.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
}
:root {
  color-scheme: light;
  --paper: #fcfbf8;
  --surface: #ffffff;
  --ink: #2d231d;
  --muted: #6b594c;
  --line: #e3d9cd;
  --soft: #f3eee6;
  --action: #704637;
  --dark: #30231c;
  --error: #932c26;
  font-family: "Bricolage Grotesque", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; font-size: 15px; line-height: 1.5; }
body.customer { min-height: 100svh; }
.customer main { padding-bottom: 36px; }
main { flex: 1; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button, summary { cursor: pointer; }
button:disabled { opacity: .55; cursor: default; }
:focus-visible { outline: 3px solid #745d43; outline-offset: 3px; }
::selection { background: #d9c9b2; color: var(--ink); }
img { display: block; width: 100%; }
h1, h2, h3, p, dl, dd { margin: 0; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.025em; }
.frame { width: min(1160px, calc(100% - 64px)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.topbar { background: var(--paper); color: var(--ink); border-bottom: 1px solid var(--line); }
.bar-inner { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.wordmark { display: inline-flex; align-items: center; gap: 13px; white-space: nowrap; }
.wordmark img { width: 32px; height: 32px; }
.brand-type { display: flex; flex-direction: column; gap: 3px; }
.brand-chinese { font-family: "Union Han", "Songti SC", STSong, serif; font-size: 21px; font-weight: 600; letter-spacing: .045em; line-height: 1.16; }
.brand-english { font-family: "Instrument Serif", Georgia, serif; font-size: 15px; letter-spacing: .09em; line-height: 1; }
.bar-link { display: inline-flex; align-items: center; gap: 9px; border: 0; min-height: 44px; padding: 0; background: transparent; color: var(--ink); white-space: nowrap; font-size: 14px; text-underline-offset: 4px; }
.bar-link:hover, .back-link:hover { text-decoration: underline; }
.bar-actions { display: flex; gap: 18px; align-items: center; }
.arrow-right { position: relative; display: inline-block; flex: none; width: 15px; height: 15px; }
.arrow-right::before { position: absolute; top: 7px; left: 1px; content: ""; width: 12px; height: 1px; background: currentColor; }
.arrow-right::after { position: absolute; top: 4px; left: 7px; content: ""; width: 6px; height: 6px; border: solid currentColor; border-width: 1px 1px 0 0; transform: rotate(45deg); }
.showroom { margin-top: 22px; }
.shop-photo { display: block; height: clamp(195px, 25vw, 288px); overflow: hidden; border-radius: 2px; background: #b2a38f; }
.shop-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; filter: sepia(.28) saturate(.73) brightness(1.04); }
.browse { margin-top: 27px; }
.browse-controls { display: flex; gap: 23px; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.categories { display: flex; gap: clamp(12px, 1.5vw, 24px); min-width: 0; align-items: center; overflow-x: auto; scrollbar-width: none; }
.categories .filter { flex: none; text-align: left; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; font-size: 14px; color: var(--muted); min-height: 50px; padding: 6px 0; }
.categories .filter:hover { color: var(--ink); }
.categories .filter:focus-visible { outline-offset: -2px; }
.categories .filter[aria-pressed="true"] { color: var(--action); border-bottom-color: var(--action); background: transparent; font-weight: 700; }
.search { display: flex; align-items: center; gap: 11px; flex: 0 0 clamp(228px, 25%, 290px); min-height: 42px; margin-block: 3px 7px; background: var(--soft); border: 1px solid transparent; border-radius: 5px; padding-inline: 13px 9px; }
.search:focus-within { border-color: var(--action); }
.search-icon { display: block; position: relative; width: 14px; height: 14px; flex: 0 0 14px; border: 1.5px solid currentColor; border-radius: 50%; margin-right: 2px; }
.search-icon::after { content: ""; position: absolute; top: 10px; left: 10px; width: 5px; height: 1.5px; background: currentColor; transform: rotate(45deg); transform-origin: left; }
.search input { min-width: 0; width: 100%; border: 0; background: none; outline: 0; min-height: 40px; padding: 0; font-size: 16px; }
::placeholder { color: #706256; opacity: 1; }
.filter { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 5px; padding: 8px 15px; min-height: 42px; white-space: nowrap; }
.filter:hover { border-color: var(--action); background: var(--soft); }
.filter[aria-pressed="true"] { color: #fff; border-color: var(--action); background: var(--action); }
.list-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-block: 20px 13px; scroll-margin-top: 12px; }
.list-heading h1 { font-size: 24px; font-weight: 680; }
.list-meta { display: flex; gap: 12px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.shoe-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.shoe-card { display: block; min-width: 0; border-radius: 3px; }
.shoe-card:hover .shoe-copy h3 { color: var(--action); }
.shoe-media { position: relative; background: var(--soft); border-radius: 3px; overflow: hidden; }
.shoe-media img { display: block; width: 100%; height: auto; aspect-ratio: auto 4 / 3; }
.shoe-copy { padding: 9px 2px 12px; overflow-wrap: anywhere; }
.shoe-copy h3 { font-size: 20px; font-variant-numeric: tabular-nums; }
.shoe-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 9px; margin-top: 4px; font-size: 13px; color: var(--muted); }
.shoe-colors { color: var(--muted); font-size: 13px; margin-top: 4px; }
.sold-badge, .sold-label { background: #f0d9c6; color: #633c23; }
.sold-badge { position: absolute; top: 9px; left: 9px; border-radius: 4px; padding: 3px 8px; font-size: 12px; }
.empty-state { grid-column: 1 / -1; min-height: 148px; display: grid; justify-items: center; align-content: center; gap: 12px; background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 22px 16px; text-align: center; }
.empty-state h3, .empty-state h2 { font-size: 18px; }
.empty-state p { color: var(--muted); font-size: 14px; margin-top: 7px; }
.floating { position: fixed; inset: auto 0 max(14px, env(safe-area-inset-bottom)) 0; pointer-events: none; display: flex; justify-content: center; }
.floating .button { pointer-events: auto; box-shadow: 0 6px 19px #2f21152d; }
.button { min-height: 43px; display: inline-flex; justify-content: center; align-items: center; gap: 7px; border: 1px solid transparent; padding: 8px 15px; border-radius: 6px; white-space: nowrap; text-align: center; font-weight: 650; }
.button.primary { color: #fff; background: var(--action); border-color: var(--action); }
.button.primary:hover:not(:disabled) { background: #573326; }
.button.outline { background: var(--surface); border-color: #d8d0c4; }
.button.outline:hover:not(:disabled) { background: #f2eee7; border-color: var(--action); }
.button.danger { color: var(--error); }
.detail-view { padding-top: 20px; }
.back-link { display: inline-flex; align-items: center; min-height: 42px; color: var(--action); font-weight: 650; }
.back-link::before { content: ""; display: inline-block; width: 7px; height: 7px; border: solid currentColor; border-width: 0 0 2px 2px; transform: rotate(45deg); margin-right: 8px; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(22px, 6vw, 80px); margin-top: 10px; }
.gallery { min-width: 0; }
.gallery-track { display: flex; aspect-ratio: 4 / 3; max-height: 590px; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; border-radius: 4px; background: var(--soft); }
.gallery-track::-webkit-scrollbar { display: none; }
.detail-photo { display: block; flex: 0 0 100%; min-width: 0; padding: 0; background: transparent; border: 0; cursor: zoom-in; scroll-snap-align: start; }
.detail-photo img { width: 100%; height: 100%; object-fit: contain; }
.thumbs { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.thumb { width: 62px; height: 62px; background: #fff; padding: 2px; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.thumb img { height: 100%; object-fit: contain; }
.thumb[aria-pressed="true"] { border: 2px solid var(--action); }
.detail-info h1 { font-size: clamp(32px, 5vw, 56px); overflow-wrap: anywhere; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 9px; }
.detail-tags span { padding: 4px 9px; border-radius: 4px; font-size: 13px; }
.detail-tags span:first-child { background: var(--soft); }
.detail-group { margin-top: 22px; }
.detail-group h2 { font-size: 16px; margin-bottom: 8px; }
.choices { display: flex; flex-wrap: wrap; gap: 7px; }
.choices .filter { white-space: normal; overflow-wrap: anywhere; }
.size-text { color: var(--muted); margin-bottom: 8px; }
.specs { border-top: 1px solid var(--line); margin-top: 22px; }
.specs > div { display: grid; grid-template-columns: 84px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.specs dt { color: var(--muted); }
.specs dd { overflow-wrap: anywhere; }
.inquiry { width: 100%; margin-top: 23px; }
.copy-fallback { display: block; width: 100%; min-height: 115px; resize: vertical; }
#lightbox { padding: 0; background: var(--dark); color: #fff; border: 0; border-radius: 8px; width: min(900px, calc(100% - 22px)); max-height: 92vh; max-height: 92svh; overflow: hidden; }
#lightbox::backdrop { background: #211d19e5; }
.zoom-toolbar { display: flex; align-items: center; gap: 3px; padding: 3px 6px; }
.zoom-toolbar .button { min-height: 44px; padding-inline: 10px; color: #fff; border: 0; background: transparent; }
.zoom-toolbar output { min-width: 44px; text-align: center; font-variant-numeric: tabular-nums; }
#close-lightbox { margin-left: auto; }
#zoom-stage { width: 100%; height: min(72vh, 660px); height: min(72svh, 660px); overflow: auto; touch-action: pan-x pan-y; overscroll-behavior: contain; }
.zoom-surface { display: grid; place-items: center; width: max-content; min-width: 100%; min-height: 100%; }
#large-image { display: block; width: 100%; max-width: none; height: auto; object-fit: contain; }
.admin-main { padding-block: 20px 44px; max-width: 940px; }
.admin-tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); }
.admin-tabs button { color: var(--muted); font-weight: 640; background: none; border: 0; border-bottom: 3px solid transparent; min-height: 47px; padding: 5px 0 8px; }
.admin-tabs button[aria-pressed="true"] { color: var(--action); border-bottom-color: var(--action); }
.editor-title { margin-block: 22px 15px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.editor-title h1, .login-view h1 { font-size: clamp(27px, 4.4vw, 40px); }
.editor-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 0; align-items: start; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.editor-block { padding: 20px; min-width: 0; }
.photos-block { border-right: 1px solid var(--line); }
.editor-block h2 { font-size: 19px; }
.block-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.block-heading span { color: var(--muted); font-size: 13px; white-space: nowrap; }
.variant { margin-top: 12px; }
.variant + .variant { margin-top: 17px; padding-top: 16px; border-top: 1px solid var(--line); }
.variant-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.variant-head h3 { font-size: 15px; }
.text-action { border: 0; background: none; padding: 5px 0; color: var(--error); min-height: 36px; }
.upload-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-bottom: 12px; }
.upload-grid:has(.uploader:only-child) { grid-template-columns: 1fr; }
.upload-grid:has(.uploader:only-child) .uploader { aspect-ratio: auto; min-height: 105px; }
.upload-tile { position: relative; min-width: 0; aspect-ratio: 1 / 1; border-radius: 8px; overflow: hidden; }
.upload-tile img { height: 100%; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: inherit; }
.uploader { display: grid; justify-items: center; align-content: center; gap: 2px; background: #f5eee3; border: 1px dashed #ad9580; color: var(--action); font-weight: 670; font-size: 14px; text-align: center; cursor: pointer; }
.uploader:focus-within { outline: 3px solid #745d43; outline-offset: 2px; }
.uploader:has(input:disabled) { opacity: .55; }
.uploader small { font-size: 12px; font-weight: 500; }
.upload-plus { display: block; position: relative; width: 24px; height: 24px; }
.upload-plus::before, .upload-plus::after, .photo-remove::before, .photo-remove::after { content: ""; position: absolute; width: 14px; height: 1.5px; background: currentColor; top: calc(50% - .75px); left: calc(50% - 7px); }
.upload-plus::after { transform: rotate(90deg); }
.photo-remove::before { transform: rotate(45deg); }
.photo-remove::after { transform: rotate(-45deg); }
.photo-remove, .cover-label, .set-cover { position: absolute; border: 0; border-radius: 4px; }
.photo-remove { top: 3px; right: 3px; width: 31px; height: 31px; padding: 0; background: var(--dark); color: #fff; font-size: 21px; line-height: 1; }
.cover-label, .set-cover { bottom: 4px; left: 4px; padding: 3px 5px; font-size: 12px; }
.cover-label { background: var(--action); color: #fff; }
.set-cover { background: var(--surface); border: 1px solid var(--line); }
.variant-advanced, #materials { margin-top: 13px; }
summary { color: var(--action); min-height: 36px; padding-block: 6px; }
#materials summary span { margin-left: 9px; color: var(--muted); font-size: 13px; }
.variant-add { min-height: 38px; margin-top: 7px; border: 0; background: transparent; padding: 4px 0; color: var(--action); font-weight: 650; }
.variant-add:hover { text-decoration: underline; text-underline-offset: 3px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 12px; margin-top: 11px; }
.field-grid .full { grid-column: 1 / -1; }
.field-grid label, .variant-field, #login-form label { display: block; font-size: 14px; font-weight: 620; min-width: 0; }
.required { color: var(--error); }
.admin input:not([type="file"]), .admin select { display: block; min-width: 0; min-height: 45px; width: 100%; background: var(--surface); border: 1px solid #d8d1c7; border-radius: 4px; padding: 8px 10px; font-size: 16px; font-weight: 450; }
.admin label input:not([type="file"]), .admin label select { margin-top: 4px; }
.editor-actions { position: sticky; bottom: 0; z-index: 1; margin-top: 12px; padding-block: 10px max(12px, env(safe-area-inset-bottom)); background: var(--paper); }
.action-buttons { display: flex; justify-content: flex-end; gap: 8px; }
.action-buttons .button { min-width: 121px; }
.message { overflow-wrap: anywhere; color: var(--muted); margin-block: 8px; }
.message[data-kind="error"] { color: var(--error); }
.message[data-kind="success"] { color: var(--action); }
#notice { background: var(--soft); padding: 9px 12px; border-radius: 7px; }
.login-view { max-width: 405px; margin: min(10vh, 75px) auto 0; background: var(--surface); border: 1px solid var(--line); border-radius: 5px; padding: clamp(21px, 5vw, 32px); }
.login-description { color: var(--muted); margin-top: 7px; }
#login-form { margin-block: 16px 8px; }
#login-form .button { width: 100%; margin-top: 12px; }
.management-controls { display: grid; grid-template-columns: minmax(0, 1fr) 140px; gap: 9px; }
.management-list { margin-top: 12px; display: grid; gap: 8px; }
.manage-empty { min-height: 160px; }
.product-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; }
.row-info, .row-head, .row-controls { display: flex; gap: 7px; align-items: center; min-width: 0; }
.row-controls, .row-head { flex-wrap: wrap; }
.row-thumb { flex: 0 0 59px; width: 59px; height: 59px; background: var(--soft); border-radius: 6px; overflow: hidden; }
.row-thumb img { height: 100%; object-fit: contain; background: #fff; }
.row-head h2 { font-size: 17px; overflow-wrap: anywhere; }
.row-copy { min-width: 0; }
.row-copy p { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.status-label { white-space: nowrap; font-size: 12px; background: var(--soft); border-radius: 4px; padding: 2px 5px; }
.status-label[data-status="sold"] { background: #f0d9c6; color: #633c23; }
.status-label[data-status="published"] { background: #eee5d8; color: var(--action); }
.row-controls .button { padding: 5px 9px; font-size: 13px; }
@media (max-width: 920px) {
  .shoe-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
  .frame { width: calc(100% - 30px); }
  .bar-inner { min-height: 62px; }
  .wordmark { gap: 8px; }
  .wordmark img { width: 27px; height: 27px; }
  .brand-chinese { font-size: 18px; }
  .brand-english { font-size: 13px; }
  .bar-link { font-size: 13px; gap: 5px; }
  .showroom { margin-top: 12px; }
  .shop-photo { height: clamp(158px, 50vw, 220px); }
  .shop-photo img { object-position: 50% 31%; }
  .browse { margin-top: 12px; }
  .browse-controls { display: flex; flex-direction: column; align-items: stretch; gap: 3px; }
  .categories { order: 1; margin-inline: -15px; padding-inline: 15px; gap: 16px; }
  .categories .filter { min-height: 43px; }
  .search { flex: 0 0 auto; margin: 0; }
  .list-heading { padding-block: 14px 10px; }
  .list-heading h1 { font-size: 21px; }
  .shoe-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .shoe-copy { padding: 8px 2px 11px; }
  .shoe-copy h3 { font-size: 17px; }
  .empty-state { min-height: 120px; }
  .detail-view { padding-top: 7px; }
  .detail-layout { grid-template-columns: 1fr; gap: 17px; margin-top: 3px; }
  .detail-group { margin-top: 17px; }
  .admin-main { padding-block: 9px 10px; }
  .editor-title { margin-block: 17px 12px; }
  .editor-grid { grid-template-columns: 1fr; }
  .editor-block { padding: 15px; }
  .photos-block { border-right: 0; border-bottom: 1px solid var(--line); }
  .editor-actions { margin-inline: -15px; padding-inline: 15px; border-top: 1px solid var(--line); }
  .action-buttons .button { flex: 1; min-width: 0; }
  .product-row { flex-direction: column; align-items: stretch; gap: 7px; }
  .row-controls { justify-content: flex-start; }
}
@media (prefers-reduced-motion: no-preference) {
  .button, .filter, .shoe-copy h3 { transition: color .16s ease, background-color .16s ease, border-color .16s ease; }
}

.category-form { display: flex; align-items: center; gap: 8px; }
.category-form input, .category-form select { flex: 1 1 auto; }
.category-row { display: grid; gap: 10px; }
.category-row .row-info { justify-content: space-between; flex-wrap: wrap; }
.category-row h2 { font-size: 17px; overflow-wrap: anywhere; }
.category-row .message { margin: 0; font-size: 14px; }
#local-draft-status { font-size: 13px; }


.category-field-header { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.category-field select { margin-top: 4px; }
.category-manage-link { padding: 0; border: 0; background: none; color: var(--action); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.category-sort-help { margin-bottom: 10px; color: var(--muted); font-size: 13px; }
.category-row-label { display: flex; align-items: center; gap: 8px; min-width: 0; }
.category-grip { position: relative; display: grid; place-items: center; width: 38px; height: 44px; flex: 0 0 38px; border: 0; border-radius: 4px; background: transparent; color: var(--action); cursor: grab; touch-action: none; }
.category-grip::before { content: ""; width: 13px; height: 2px; background: currentColor; box-shadow: 0 -5px currentColor, 0 5px currentColor; border-radius: 1px; }
.category-grip:disabled { cursor: default; opacity: .35; }
.category-dragging { border-color: var(--action); background: var(--soft); }
#category-dialog { width: min(560px, calc(100% - 22px)); max-height: 84vh; max-height: 84dvh; padding: 0 14px 14px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 9px; overscroll-behavior: contain; }
#category-dialog::backdrop { background: #221c17a8; }
#category-dialog .editor-title { position: sticky; z-index: 2; top: 0; padding: 12px 0; margin: 0 0 5px; background: var(--paper); }
#category-dialog .editor-title h1 { font-size: 24px; }


.category-reordering .category-row { position: relative; transition: transform 150ms ease; }
.category-reordering .category-dragging { z-index: 1; transition: none; will-change: transform; cursor: grabbing; }
@media (prefers-reduced-motion: reduce) {
  .category-reordering .category-row { transition: none; }
}


.sku-readout { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.sku-readout > span { font-size: 14px; font-weight: 650; }
.sku-readout output { display: flex; align-items: center; min-height: 43px; padding: 6px 9px; width: 100%; border-radius: 4px; background: var(--soft); color: var(--muted); overflow-wrap: anywhere; }


#delete-product-dialog { width: min(410px, calc(100% - 32px)); padding: 22px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
#delete-product-dialog::backdrop { background: #211d1980; }
#delete-product-dialog h2 { margin-bottom: 8px; font-size: 21px; }
#delete-product-description { color: var(--muted); line-height: 1.55; overflow-wrap: anywhere; }
.delete-dialog-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
#confirm-product-delete { background: var(--error); border-color: var(--error); color: #fff; }
.delete-dialog-fallback { position: fixed; inset: 0; z-index: 20; box-shadow: 0 0 0 100vmax #211d1980; }
@media (max-width: 650px) {
  #delete-product-dialog { width: min(100%, 480px); max-width: none; margin: auto auto 0; padding: 19px 16px calc(14px + env(safe-area-inset-bottom)); border-radius: 14px 14px 0 0; }
  .delete-dialog-actions > button { flex: 1; }
}
