/* Catalogue site styles (from the approved prototype v43). */

/* Base rules the prototype's host page supplied. Without the [hidden] one, the closed product
   panel, the dimmed backdrop and the inactive view stay on screen and swallow every click. */
[hidden]:not([hidden="until-found" i]) { display: none !important; }
img { max-width: 100%; }
html { box-sizing: border-box; }

/* Fonts served from this site (GFS Didot: headings, Manrope: text), Latin + Greek only. */
/* greek-ext */
@font-face {
  font-family: 'GFS Didot';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/gfsdidot-greek-ext.woff2) format('woff2');
  unicode-range: U+1F00-1FFF;
}
/* greek */
@font-face {
  font-family: 'GFS Didot';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/gfsdidot-greek.woff2) format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
/* latin */
@font-face {
  font-family: 'GFS Didot';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/gfsdidot-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* greek */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(fonts/manrope-greek.woff2) format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
/* latin-ext */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(fonts/manrope-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(fonts/manrope-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Layout: sticky brand bar + category rail; on wide screens a filter column beside a dense
   product grid, on phones the same filters slide up as a sheet. Product photos (beige studio
   shots) carry the colour; the chrome stays in the brand's browns. */
:root {
  --bg: #f7f4f0;
  --surface: #ffffff;
  --sand: #ddd1c1;
  --sand-soft: #ece4d9; --shimmer: rgba(255, 255, 255, .55);
  --ink: #342e29;
  --brown: #493e38;
  --muted: #6a5950;
  --faint: #9a8b80;
  --line: #e3d9cd;
  --price: #493e38;
  --on-brown: #ffffff;
  --shadow: 0 10px 30px rgba(52, 46, 41, .14);
  --scrim: rgba(36, 30, 26, .45);
  --font-display: 'GFS Didot', Georgia, serif;
  --font-body: 'Manrope', 'Helvetica Neue', Arial, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --radius: 4px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1c1916; --surface: #26221e; --sand: #5a4e44; --sand-soft: #322c27; --shimmer: rgba(255, 255, 255, .06); --ink: #f1e9df;
    --brown: #e5d6c3; --muted: #c4b3a3; --faint: #918275; --line: #3c352f; --price: #f1e1cc;
    --on-brown: #1c1916; --shadow: 0 10px 30px rgba(0, 0, 0, .5); --scrim: rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1c1916; --surface: #26221e; --sand: #5a4e44; --sand-soft: #322c27; --shimmer: rgba(255, 255, 255, .06); --ink: #f1e9df;
  --brown: #e5d6c3; --muted: #c4b3a3; --faint: #918275; --line: #3c352f; --price: #f1e1cc;
  --on-brown: #1c1916; --shadow: 0 10px 30px rgba(0, 0, 0, .5); --scrim: rgba(0, 0, 0, .6);
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 15px; line-height: 1.5; margin: 0; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--muted); outline-offset: 2px; }
.wrap { max-width: 1320px; margin: 0 auto; padding-inline: 16px; }

/* ---- header ---- */
.contact { user-select: all; font-variant-numeric: tabular-nums; }
header.site { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); }
/* Viber left · logo centred · search + languages right (the equal side columns keep the logo centred) */
.head-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding-block: 10px; }
.viber { justify-self: start; display: inline-flex; align-items: center; gap: 8px; color: var(--brown); font-weight: 600; font-size: 14px; white-space: nowrap; min-width: 0; }
/* Icon with the word Viber under it, number beside */
.viber-mark { display: inline-flex; flex-direction: column; align-items: center; line-height: 1; }
.viber-mark svg { width: 20px; height: 20px; }
.viber-label { margin-top: 2px; font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.viber .contact { color: var(--ink); }
.logo { justify-self: center; display: block; height: 34px; background: none; border: 0; padding: 0; }
.logo img { height: 34px; width: auto; display: block; }
:root[data-theme="dark"] .logo img { filter: invert(1) hue-rotate(180deg) brightness(1.4); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo img { filter: invert(1) hue-rotate(180deg) brightness(1.4); } }
.head-actions { justify-self: end; display: flex; align-items: center; gap: 10px; }
.search-toggle { width: 36px; height: 36px; border: 0; border-radius: 50%; background: none; color: var(--brown); display: flex; align-items: center; justify-content: center; }
.search-toggle[aria-expanded="true"] { background: var(--brown); color: var(--on-brown); }
.langs { display: flex; border: 1px solid var(--line); border-radius: 21px; overflow: hidden; }
.langs button { border: 0; background: none; padding: 8px 12px; font-size: 13px; font-weight: 600; color: var(--muted); }
.langs button[aria-pressed="true"] { background: var(--brown); color: var(--on-brown); }
/* Desktop: the box slides open to the left of the magnifier. Phones: it drops below the header line. */
.search { position: relative; min-width: 0; margin: 0; width: 0; visibility: hidden; transition: width .25s ease, visibility 0s .25s; }
.head-actions.searching .search { width: 240px; visibility: visible; transition: width .25s ease; }
.search input { width: 100%; height: 38px; padding: 0 38px 0 14px; border: 1px solid var(--line); border-radius: 19px; background: var(--bg); color: var(--ink); }
.search input::placeholder { color: var(--faint); }
.search input::-webkit-search-cancel-button { display: none; }
.search .clear { position: absolute; right: 6px; top: 6px; width: 26px; height: 26px; border: 0; border-radius: 50%; background: var(--sand-soft); color: var(--muted); }
@media (max-width: 640px) {
  /* Phones: number with "[icon] Viber" on one line under it; logo centred in the space between the
     number and the search button (not on the page), so the buttons on the right have room */
  .head-row { grid-template-columns: auto 1fr auto; gap: 8px; }
  .viber { flex-direction: column-reverse; align-items: flex-start; gap: 2px; font-size: 12px; }
  .viber-mark { flex-direction: row; gap: 3px; }
  .viber-mark svg { width: 14px; height: 14px; }
  .viber-label { margin-top: 0; font-size: 10px; }
  .logo { justify-self: center; }
  .logo, .logo img { height: 28px; }
  .head-actions { gap: 4px; }
  .search-toggle { width: 32px; height: 32px; }
  .langs button { padding: 6px 7px; font-size: 11px; }
  .search, .head-actions.searching .search { position: absolute; left: 0; right: 0; top: 100%; width: auto; padding: 8px 16px 12px; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); transition: none; }
  .search { display: none; }
  .head-actions.searching .search { display: block; }
  .search .clear { right: 22px; top: 14px; }
}
.rail { border-top: 1px solid var(--line); }
.rail-row { display: flex; align-items: center; gap: 2px; }
.rail-scroll { flex: 1; min-width: 0; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding-block: 6px; }
.rail-scroll::-webkit-scrollbar { display: none; }
/* ≡ and the panel it opens: phones / tablets only */
.rail-menu { display: none; flex: none; width: 36px; height: 36px; margin-left: -8px; border: 0; border-radius: 50%; background: none; color: var(--ink); align-items: center; justify-content: center; }
.rail-menu[aria-expanded="true"] { background: var(--sand-soft); }
.rail-drop { position: absolute; left: 0; right: 0; top: 100%; z-index: 30; max-height: calc(100vh - 140px); overflow-y: auto;
  padding: 8px 16px 14px; background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 12px; }
.rail-drop[hidden] { display: none; }
.rail-drop button { border: 0; background: none; text-align: left; padding: 11px 8px; border-radius: 6px; font-size: 14px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.rail-drop button[aria-pressed="true"] { color: var(--ink); background: var(--sand-soft); }
@media (max-width: 1023px) { .rail-menu { display: flex; } }
@media (min-width: 1024px) { .rail-drop { display: none !important; } }
/* Same language as the home tabs: selected = brown underline, hover = sand block (mouse devices only) */
.rail-scroll button { position: relative; flex: 0 0 auto; border: 0; background: none; padding: 8px 14px; font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border-radius: 6px 6px 0 0; transition: color .2s ease, background-color .2s ease; }
.rail-scroll button::after { content: ''; position: absolute; left: 14px; right: 14px; bottom: 0; height: 2px; background: var(--brown); transform: scaleX(0); transition: transform .22s ease; }
.rail-scroll button[aria-pressed="true"] { color: var(--ink); }
.rail-scroll button[aria-pressed="true"]::after { transform: scaleX(1); }
@media (hover: hover) and (pointer: fine) {
  .rail-scroll button:hover:not([aria-pressed="true"]), .rail-scroll button.hovered:not([aria-pressed="true"]) { color: var(--ink); background: var(--sand-soft); }
}
.mega { position: absolute; top: 100%; z-index: 30; min-width: 230px; max-width: calc(100vw - 32px); padding: 8px 0; background: var(--surface); border: 1px solid var(--line); border-top: 2px solid var(--brown); box-shadow: var(--shadow); }
.mega button { display: block; width: 100%; border: 0; background: none; text-align: left; padding: 9px 20px; font-size: 14px; color: var(--ink); white-space: nowrap; }
.mega button:hover, .mega button:focus-visible { background: var(--sand-soft); }
/* List on the left, picture on the right: the hovered 二级's newest product (the 一级's newest before any hover) */
.mega-in { display: flex; align-items: flex-start; }
.mega-list { flex: 1 1 auto; min-width: 200px; }
.mega-pic { position: relative; flex: 0 0 200px; width: 200px; height: 200px; margin: 0 8px 0 4px; border-radius: var(--radius); overflow: hidden; background: var(--sand-soft); }
.mega-pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.03); transition: opacity .25s ease, transform .35s ease; }
.mega-pic img.on.is-loaded { opacity: 1; transform: none; }

/* ---- banner ---- */
.banner { margin-top: 16px; position: relative; border-radius: var(--radius); overflow: hidden; background: var(--sand-soft); }
.slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.slides::-webkit-scrollbar { display: none; }
/* the shape of the pictures made for it (2000×787, about 2.54:1), shown whole on a computer — no
   height cap, so a wide screen does not cut their top and bottom; phones keep at least 220px */
.slide { flex: 0 0 100%; scroll-snap-align: start; position: relative; min-height: 220px; aspect-ratio: 2000 / 787; display: flex; align-items: center; max-width: 100%; }
.slide img.bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slide .copy { position: relative; padding: 24px clamp(20px, 5vw, 56px); max-width: 520px; }
.slide.photo .copy { background: linear-gradient(90deg, rgba(247, 244, 240, .92), rgba(247, 244, 240, .55) 70%, transparent); height: 100%; display: flex; flex-direction: column; justify-content: center; color: #342e29; }
.slide.tone { background: var(--brown); color: var(--on-brown); justify-content: space-between; gap: 16px; }
.slide.tone .copy { color: var(--on-brown); }
.slide .eyebrow { font-size: 12px; letter-spacing: .18em; text-transform: uppercase; font-weight: 600; }
.slide h2 { font-family: var(--font-display); font-weight: 400; font-size: clamp(24px, 4.2vw, 40px); line-height: 1.15; margin: 8px 0 14px; text-wrap: balance; }
.slide .cta { align-self: flex-start; border: 0; padding: 12px 22px; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; border-radius: 0; background: #493e38; color: #fff; }
.slide.tone .cta { background: var(--sand); color: #342e29; }
.slide .strip { position: relative; display: flex; gap: 10px; padding-right: clamp(16px, 4vw, 48px); }
.slide .strip img { width: clamp(70px, 13vw, 150px); aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow); }
@media (max-width: 640px) { .slide .strip img:nth-child(n+2) { display: none; } }
/* Banners from the admin: the picture fills the slide; a linked one is clickable as a whole */
.slide.linked { cursor: pointer; }
/* no link: a click opens the picture large */
.slide.viewable { cursor: zoom-in; }
.slide.pic .cta { display: inline-block; }
/* previous / next at the sides, only with two or more banners */
.slide-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .72); color: #342e29; box-shadow: 0 1px 4px rgba(52, 46, 41, .2); display: flex; align-items: center; justify-content: center; cursor: pointer; opacity: .75; transition: opacity .15s, background .15s; }
.slide-nav[hidden] { display: none; }
.slide-nav.prev { left: 12px; }
.slide-nav.next { right: 12px; }
.banner:hover .slide-nav { opacity: 1; }
.slide-nav:hover { background: #fff; }
@media (max-width: 640px) { .slide-nav { width: 32px; height: 32px; } .slide-nav.prev { left: 8px; } .slide-nav.next { right: 8px; } }
.dots { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; }
.dots button { width: 8px; height: 8px; padding: 0; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .6); box-shadow: 0 0 0 1px rgba(52, 46, 41, .25); }
.dots button[aria-current="true"] { background: #493e38; width: 20px; border-radius: 4px; }

/* ---- catalog layout ---- */
.catalog { display: grid; grid-template-columns: 1fr; gap: 24px; padding-block: 20px 48px; }
@media (min-width: 1024px) { .catalog { grid-template-columns: 240px 1fr; } }
.main { min-width: 0; }
.title-row { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.title-row h1 { font-family: var(--font-display); font-weight: 400; font-size: clamp(24px, 3vw, 32px); margin: 0; }
.count { color: var(--faint); font-size: 13px; font-variant-numeric: tabular-nums; }
/* 二级: text tabs (selected = brown underline, hover = sand block). On a mouse device the
   type's picture floats in under the hovered tab. The row wraps so the picture is never clipped. */
.subs { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-top: 16px; border-bottom: 1px solid var(--line); }
.sub-card { position: relative; display: inline-flex; align-items: baseline; gap: 6px; border: 0; background: none; padding: 9px 12px; margin-bottom: -1px; border-radius: 6px 6px 0 0; border-bottom: 2px solid transparent; color: var(--muted); font-size: 13px; font-weight: 600; transition: color .2s ease, background-color .2s ease; }
.sub-name { white-space: nowrap; }
.sub-n { font-size: 12px; font-weight: 500; color: var(--faint); font-variant-numeric: tabular-nums; }
.sub-card[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--brown); }
.sub-card:disabled { opacity: .4; cursor: default; }
.sub-pic { position: absolute; z-index: 15; top: calc(100% + 8px); left: 50%; width: 156px; height: 156px; border-radius: var(--radius); overflow: hidden; background: var(--sand-soft); box-shadow: var(--shadow); border: 1px solid var(--line); opacity: 0; visibility: hidden; transform: translate(-50%, -6px) scale(.96); transition: opacity .18s ease, transform .18s ease, visibility 0s .18s; pointer-events: none; }
.sub-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (hover: hover) and (pointer: fine) {
  .sub-card:not(:disabled):not([aria-pressed="true"]):hover { color: var(--ink); background: var(--sand-soft); }
  .sub-card:not(:disabled):hover .sub-pic { opacity: 1; visibility: visible; transform: translate(-50%, 0) scale(1); transition: opacity .18s ease, transform .18s ease; }
}
@media (hover: none), (pointer: coarse) { .sub-pic { display: none; } }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 18px; padding: 6px 13px; font-size: 13px; color: var(--ink); display: inline-flex; gap: 6px; align-items: center; }
.chip .n { color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.chip[aria-pressed="true"] { background: var(--brown); border-color: var(--brown); color: var(--on-brown); }
.chip[aria-pressed="true"] .n { color: inherit; opacity: .75; }
.chip:disabled { opacity: .4; cursor: default; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.btn-filter { height: 30px; border: 1px solid var(--brown); background: var(--surface); color: var(--brown); padding: 0 12px; border-radius: 15px; font-weight: 600; font-size: 12px; }
@media (min-width: 1024px) { .btn-filter { display: none; } }
.sort { margin-left: auto; height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); font-size: 13px; }
/* Phones/tablets: the sort box matches the slimmer Filters button (after .sort so it wins) */
@media (max-width: 1023px) { .sort { height: 30px; padding: 0 8px; border-radius: 15px; font-size: 12px; } }
.active { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.active .chip { background: var(--sand-soft); border-color: var(--sand-soft); }
.active .x { font-weight: 700; color: var(--muted); }
.link { border: 0; background: none; color: var(--muted); text-decoration: underline; font-size: 13px; padding: 6px 4px; }

/* filters: sidebar on wide screens, bottom sheet on phones */
/* Filter sections: small caps header with its own Clear, hairline between sections */
.f-sec + .f-sec { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 18px; }
.f-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.filters h3 { font-size: 11px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--ink); margin: 0; }
.f-clear { border: 0; background: none; padding: 2px 0; font-size: 12px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
/* Tags: one per line — box, name, count on the right */
.tag-list { display: flex; flex-direction: column; }
.tag-row { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; background: none; padding: 7px 4px; text-align: left; font-size: 14px; color: var(--ink); border-radius: 4px; transition: background-color .15s ease; }
.tag-row .box { flex: 0 0 auto; width: 16px; height: 16px; border: 1.5px solid var(--faint); border-radius: 2px; display: flex; align-items: center; justify-content: center; transition: background-color .15s ease, border-color .15s ease; }
.tag-row .box svg { opacity: 0; }
.tag-row[aria-pressed="true"] .box svg { opacity: 1; }
/* The tick pops in on the row just ticked (the list is redrawn, so a transition wouldn't show) */
.tag-row.pop[aria-pressed="true"] .box svg { animation: tick-pop .22s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes tick-pop { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.tag-row:focus-visible, .f-clear:focus-visible { outline: 2px solid var(--muted); outline-offset: 1px; }
.f-count { color: var(--muted); font-weight: 600; }
.tag-row .label { flex: 1; min-width: 0; }
.tag-row .n { flex: 0 0 auto; font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.tag-row[aria-pressed="true"] .box { background: var(--brown); border-color: var(--brown); }
.tag-row[aria-pressed="true"] .box svg { opacity: 1; }
.tag-row[aria-pressed="true"] .label { font-weight: 600; }
@media (hover: hover) and (pointer: fine) { .tag-row:hover { background: var(--sand-soft); } .tag-row:hover .box { border-color: var(--brown); } }
/* 二级 in the sheet: one at a time, so round radio marks instead of tick boxes */
.tag-row.radio .box { border-radius: 50%; }
.tag-row.radio .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brown); transform: scale(0); transition: transform .15s ease; }
.tag-row.radio[aria-pressed="true"] .box { background: none; border-color: var(--brown); }
.tag-row.radio[aria-pressed="true"] .dot { transform: none; }
.f-sec[hidden] + .f-sec { border-top: 0; margin-top: 0; padding-top: 0; }
.m-only { display: none; }
.sheet-head, .sheet-foot { display: none; }
@media (min-width: 1024px) {
  /* Desktop sidebar: a white panel beside the grid */
  /* Desktop keeps the 二级 tabs above the grid, so the sheet list is not needed */
  .f-types { display: none; }
  .f-types + .f-sec { border-top: 0; margin-top: 0; padding-top: 0; }
  .filters { position: sticky; top: 130px; align-self: start; max-height: calc(100vh - 150px); overflow: auto; padding: 20px 18px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
}
@media (max-width: 1023px) {
  .filters { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--surface); border-radius: 14px 14px 0 0; box-shadow: var(--shadow); max-height: 78vh; display: flex; flex-direction: column; transform: translateY(105%); transition: transform .25s ease; padding-bottom: env(safe-area-inset-bottom, 0px); }
  .filters.open { transform: none; }
  .subs { display: none; }
  .m-only { display: inline-flex; }
  .filters .body { overflow: auto; padding: 4px 16px 16px; }
  .sheet-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px 6px; font-weight: 700; }
  .sheet-foot { display: flex; gap: 10px; padding: 10px 16px; border-top: 1px solid var(--line); }
  /* One line even for 4-digit counts ('Show 1234 products') */
  .sheet-foot button { flex: 1; min-width: 0; height: 38px; padding: 0 8px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-radius: 19px; font-weight: 700; border: 1px solid var(--brown); background: var(--surface); color: var(--brown); }
  .sheet-foot .primary { background: var(--brown); color: var(--on-brown); }
}
/* Price: two thumbs on one track, the chosen span filled */
.range { position: relative; height: 28px; margin: 6px 11px 0; }
.range-track { position: absolute; left: 0; right: 0; top: 11px; height: 6px; border-radius: 3px; background: var(--line); }
.range-fill { position: absolute; top: 0; bottom: 0; border-radius: 3px; background: var(--muted); }
.range input { position: absolute; left: -11px; right: -11px; top: 0; width: calc(100% + 22px); height: 28px; margin: 0; background: none; pointer-events: none; -webkit-appearance: none; appearance: none; }
.range input::-webkit-slider-runnable-track { height: 28px; background: none; }
.range input::-moz-range-track { height: 28px; background: none; }
.range input::-webkit-slider-thumb { -webkit-appearance: none; pointer-events: auto; width: 22px; height: 22px; margin-top: 3px; border-radius: 50%; background: var(--muted); border: 2px solid var(--ink); cursor: grab; }
.range input::-moz-range-thumb { pointer-events: auto; width: 18px; height: 18px; border-radius: 50%; background: var(--muted); border: 2px solid var(--ink); cursor: grab; }
.range input:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--muted); outline-offset: 2px; }
.range-label { margin: 10px 0 0; font-size: 15px; color: var(--ink); }
.range-label b { font-variant-numeric: tabular-nums; }
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 35; }

/* ---- product grid ---- */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 1200px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1500px) { .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.card { border: 0; padding: 0; text-align: left; background: var(--surface); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .2s ease, transform .2s ease; }
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card .ph { aspect-ratio: 1; background: var(--sand-soft); max-width: 100%; }
.card .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .info { padding: 10px 12px 12px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.card .code { font-weight: 600; font-size: 13px; letter-spacing: .02em; min-width: 0; overflow-wrap: anywhere; }
.card .price { font-weight: 700; color: var(--price); font-variant-numeric: tabular-nums; white-space: nowrap; }
.card .cat { padding: 0 12px 12px; margin-top: -6px; font-size: 12px; color: var(--faint); }
.empty { text-align: center; color: var(--muted); padding: 48px 0; }
/* Home showcases (New Arrivals / Classics): title, category tabs, 8 products */
.showcase { margin-top: 40px; }
.show-title { text-align: center; font-family: var(--font-display); font-weight: 400; font-size: clamp(24px, 3.4vw, 34px); margin: 0; color: var(--ink); }
/* 「See all」 under the products, at their bottom-right corner */
.show-foot { display: flex; justify-content: flex-end; margin-top: 14px; }
.see-all { border: 1px solid var(--brown); background: var(--surface); color: var(--brown); padding: 9px 18px; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
.see-all:hover { background: var(--brown); color: var(--on-brown); }
/* Centred; on a narrow phone the tabs wrap onto a second line instead of scrolling. */
.tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 6px; margin-top: 14px; border-bottom: 1px solid var(--line); }
.tabs button { flex: 0 0 auto; border: 0; background: none; padding: 10px 14px; font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); border-bottom: 2px solid transparent; margin-bottom: -1px; }
@media (max-width: 640px) { .tabs button { padding: 8px 10px; font-size: 12px; } }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--brown); }
.tabs button { border-radius: 6px 6px 0 0; transition: color .2s ease, background-color .2s ease; }
/* Hover = sand block, selected = brown underline (same as the category rail), mouse devices only */
@media (hover: hover) and (pointer: fine) {
  .tabs button:hover:not([aria-selected="true"]) { color: var(--ink); background: var(--sand-soft); }
}
.show-grid { margin-top: 16px; }
@media (min-width: 640px) { .grid.show-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* 购买须知 on the home page: the same rows as the current site's accordion */
/* A centred column; the title lines up with the item text (past the +), dividers between items. */
.terms { --terms-indent: 58px; max-width: 960px; margin: 64px auto 56px; }
.terms h2 { font-family: var(--font-body); font-weight: 400; font-size: clamp(28px, 4vw, 44px); color: var(--brown); margin: 0 0 22px; padding-left: var(--terms-indent); }
.terms details { border-top: 1px solid var(--line); }
.terms summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 26px; padding: 22px 16px; font-size: clamp(16px, 2vw, 20px); color: var(--ink); }
.terms summary::-webkit-details-marker { display: none; }
.terms summary::before { content: '+'; width: 16px; text-align: center; font-weight: 700; font-size: 20px; color: var(--ink); }
.terms details[open] summary::before { content: '−'; }
.terms p { margin: 0 0 22px var(--terms-indent); max-width: 65ch; color: var(--muted); }
@media (max-width: 640px) { .terms { --terms-indent: 42px; } .terms summary { gap: 16px; padding-inline: 10px; } }
/* Page numbers under the grid: ‹ 1 … 4 5 6 … 23 ›, current page = brown underline like the tabs */
.pager { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 32px; }
.pager .pages { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.pager button { min-width: 38px; height: 38px; padding: 0 10px; border: 0; background: none; font-size: 14px; font-weight: 600; color: var(--muted); border-radius: 6px 6px 0 0; border-bottom: 2px solid transparent; font-variant-numeric: tabular-nums; transition: color .2s ease, background-color .2s ease; }
.pager button[aria-current="page"] { color: var(--ink); border-bottom-color: var(--brown); }
.pager button:disabled { opacity: .3; cursor: default; }
.pager .gap { min-width: 24px; text-align: center; color: var(--faint); line-height: 38px; }
.pager .range { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
@media (hover: hover) and (pointer: fine) { .pager button:not(:disabled):not([aria-current="page"]):hover { color: var(--ink); background: var(--sand-soft); } }

/* ---- product detail ---- */
.detail { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; }
.detail .panel { position: relative; background: var(--surface); width: min(860px, 100%); max-height: 100%; overflow: auto; overscroll-behavior: contain; border-radius: 8px; box-shadow: var(--shadow); display: grid; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 820px) { .detail .panel { grid-template-columns: minmax(0, 1fr) 280px; } }
@media (max-width: 819px) { .detail { padding: 0; } .detail .panel { border-radius: 0; height: 100%; width: 100%; } }
.detail .big { background: var(--sand-soft); aspect-ratio: 1; max-width: 100%; }
/* Gallery: swipeable strip of photos; thumbs underneath (phone) or down the left (desktop) */
.gallery { min-width: 0; }
.stage { position: relative; }
.slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.slides::-webkit-scrollbar { display: none; }
.slides .big { flex: 0 0 100%; scroll-snap-align: start; }
.zoom { width: 100%; height: 100%; transition: transform .25s ease; }
.g-nav { position: absolute; top: 50%; width: 40px; height: 40px; margin-top: -20px; border: 0; border-radius: 50%; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); font-size: 22px; line-height: 1; opacity: 0; transition: opacity .2s ease; }
.g-nav.prev { left: 12px; } .g-nav.next { right: 12px; }
.g-nav:disabled { visibility: hidden; }
.g-count { position: absolute; left: 12px; bottom: 12px; padding: 3px 9px; border-radius: 12px; background: rgba(28, 25, 22, .55); color: #fff; font-size: 12px; font-variant-numeric: tabular-nums; pointer-events: none; }
.thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 12px 16px 0; scrollbar-width: none; }
.thumbs::-webkit-scrollbar { display: none; }
.thumb { flex: 0 0 56px; width: 56px; height: 56px; padding: 0; border: 0; border-radius: 4px; overflow: hidden; background: var(--sand-soft); opacity: .55; outline: 1.5px solid transparent; outline-offset: 2px; transition: opacity .2s ease, outline-color .2s ease; }
.thumb[aria-current="true"] { opacity: 1; outline-color: var(--brown); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (min-width: 820px) {
  .gallery { padding: 24px 0 24px 24px; }
  .gallery.multi { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; align-items: start; }
  .gallery.multi .stage { grid-column: 2; grid-row: 1; }
  .gallery.multi .thumbs { grid-column: 1; grid-row: 1; flex-direction: column; padding: 2px; overflow: visible; }
  .thumb { flex-basis: 64px; width: 64px; height: 64px; }
  .slides { border-radius: var(--radius); }
  /* Short screens: the photo shrinks so the recommendation rows still peek in below */
  .stage { max-width: max(320px, calc(100vh - 290px)); }
  .g-count { display: none; }
  /* Info stays in view while the photos and rows scroll */
  .detail .panel .txt { position: sticky; top: 0; align-self: start; padding: 44px 24px 24px 20px; }
}
@media (hover: hover) and (pointer: fine) {
  .stage:hover .g-nav { opacity: .92; }
  .detail .big { cursor: zoom-in; }
  .detail .big.zooming .zoom { transform: scale(2); }
}
.detail .big img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Loading: sand block with a light sweep; the picture fades in once it has arrived */
.card .ph, .detail .big { position: relative; overflow: hidden; }
.card .ph::after, .detail .big::after, .sub-pic::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(100deg, transparent 30%, var(--shimmer) 50%, transparent 70%); transform: translateX(-100%); animation: shimmer 1.5s ease-in-out infinite; }
.card .ph.is-loaded::after, .detail .big.is-loaded::after, .sub-pic.is-loaded::after, .card .ph.is-failed::after, .detail .big.is-failed::after, .sub-pic.is-failed::after { display: none; }
.card .ph img, .detail .big img, .sub-pic img, .strip img { opacity: 0; transition: opacity .4s ease; }
.card .ph.is-loaded img, .detail .big.is-loaded img, .sub-pic.is-loaded img, .strip img.is-loaded { opacity: 1; }
@keyframes shimmer { to { transform: translateX(100%); } }
/* Photo missing (deleted, being remade): a quiet picture sign on the sand block, never the broken-image icon */
.card .ph.is-failed::before, .detail .big.is-failed::before, .sub-pic.is-failed::before { content: ""; position: absolute; left: 50%; top: 50%; width: 36px; height: 36px; margin: -18px 0 0 -18px; opacity: .35; background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23432a2a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='16' rx='2'/%3E%3Ccircle cx='9' cy='10' r='2'/%3E%3Cpath d='m21 16-5-5-9 9'/%3E%3C/svg%3E"); }
.detail .txt { padding: 24px clamp(18px, 3vw, 32px) 32px; min-width: 0; }
/* The close button rides along at the top corner while the panel scrolls */
.close-wrap { grid-column: 1 / -1; position: sticky; top: 0; height: 0; z-index: 5; }
.detail .close { position: absolute; top: 10px; right: 10px; z-index: 2; width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); font-size: 20px; line-height: 1; }
.detail h2 { font-family: var(--font-display); font-weight: 400; font-size: 24px; margin: 4px 0 4px; letter-spacing: .02em; overflow-wrap: anywhere; }
.detail .bigprice { font-size: 20px; font-weight: 700; color: var(--price); font-variant-numeric: tabular-nums; }
.detail .loc { margin-top: 4px; font-size: 14px; color: var(--muted); }
.detail .crumbs { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.detail dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; margin: 16px 0 0; font-size: 13px; }
.detail dt { color: var(--muted); }
.detail dd { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
/* 搭配 / 相似: one sideways row each */
.rel { grid-column: 1 / -1; min-width: 0; padding-bottom: 26px; }
.rel:first-of-type { border-top: 1px solid var(--line); }
.rel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 22px clamp(18px, 3vw, 32px) 12px; }
.rel h3 { font-family: var(--font-display); font-weight: 400; font-size: 22px; margin: 0; color: var(--ink); }
.rel-arrows { display: none; gap: 6px; }
.rel-arrows[hidden] { display: none !important; }
.rel-arrows button { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 18px; line-height: 1; }
.rel-arrows button:disabled { opacity: .3; cursor: default; }
@media (hover: hover) and (pointer: fine) { .rel-arrows { display: flex; } .rel-arrows button:not(:disabled):hover { background: var(--sand-soft); } }
.rel-track { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-inline: clamp(18px, 3vw, 32px); padding: 0 clamp(18px, 3vw, 32px) 4px; scrollbar-width: none; }
.rel-track::-webkit-scrollbar { display: none; }
.rel-track .card { flex: 0 0 clamp(128px, 38vw, 168px); scroll-snap-align: start; }
footer.site { border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
footer.site .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-block: 22px 28px; }
footer.site strong { font-family: var(--font-display); font-weight: 400; color: var(--ink); font-size: 16px; }
/* ---- password page ---- */
body.locked > :not(.gate):not(script) { display: none !important; }
.gate { display: none; }
body.locked .gate { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; background: var(--sand-soft); }
/* With a background photo: the photo covers the page under a soft dark veil; the card stays white */
body.locked .gate.has-bg { position: relative; background: #2a2420 var(--gate-bg) center / cover no-repeat; }
.gate.has-bg::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(28, 25, 22, .25), rgba(28, 25, 22, .5)); pointer-events: none; }
.gate.has-bg > * { position: relative; }
.gate.has-bg .langs { background: var(--surface); border-color: transparent; }
.gate-top { display: flex; justify-content: flex-end; padding: 10px 16px; }
.gate-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 8px 16px 24px; }
.gate-card { width: min(400px, 100%); background: var(--surface); border-radius: 8px; box-shadow: var(--shadow); padding: 28px clamp(20px, 6vw, 36px) 22px; text-align: center; }
.gate-card .gate-logo { width: 260px; max-width: 80%; height: auto; display: block; margin: 0 auto 8px; }
.gate-addr { font-size: 12px; letter-spacing: .12em; color: var(--faint); margin-bottom: 6px; }
.gate-card h1 { font-family: var(--font-display); font-weight: 400; font-size: 25px; margin: 0 0 4px; color: var(--ink); }
.gate-card p { margin: 0; color: var(--muted); font-size: 14px; text-wrap: balance; }
.gate-form { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; text-align: left; }
.gate-field { position: relative; }
.gate-field input { width: 100%; box-sizing: border-box; height: 44px; padding: 0 48px 0 16px; border: 1px solid var(--line); border-radius: 22px; background: var(--bg); color: var(--ink); font: inherit; font-size: 16px; letter-spacing: .04em; }
.gate-field input:focus { outline: none; border-color: var(--brown); }
.gate-field input[aria-invalid="true"] { border-color: #b4483c; }
.gate-eye { position: absolute; right: 4px; top: 4px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: none; color: var(--muted); display: flex; align-items: center; justify-content: center; }
.gate-eye:hover { background: var(--sand-soft); color: var(--ink); }
/* 保持登录: unticked = this browser session only */
.gate-remember { display: flex; align-items: center; gap: 8px; margin: 0 0 0 6px; font-size: 14px; color: var(--muted); cursor: pointer; user-select: none; }
.gate-remember input { width: 18px; height: 18px; margin: 0; accent-color: var(--brown); flex: none; }
.gate-err { min-height: 18px; margin: -4px 0 0 16px; font-size: 13px; color: #b4483c; }
.gate-err:empty { display: none; }   /* no room kept until there is an error */
.gate-err a { color: inherit; font-weight: 600; }
#applyHasAcct { margin: 0 0 4px; text-align: center; }
.gate-btn { height: 44px; border: 0; border-radius: 22px; background: var(--brown); color: var(--on-brown); font: inherit; font-size: 15px; font-weight: 700; letter-spacing: .06em; }
.gate-btn:disabled { opacity: .6; }
.gate-help { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.gate-viber { display: block; margin-top: 2px; font-size: 18px; color: var(--brown); font-weight: 700; text-decoration: none; white-space: nowrap; font-variant-numeric: tabular-nums; }
.shake { animation: shake .35s ease; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
/* One view of the login card at a time */
.gv { display: none; }
.gate-card[data-view="login"] .gv-login, .gate-card[data-view="code"] .gv-code, .gate-card[data-view="apply"] .gv-apply,
.gate-card[data-view="done"] .gv-done, .gate-card[data-view="change"] .gv-change, .gate-card[data-view="subs"] .gv-subs,
.gate-card[data-view="forgot"] .gv-forgot, .gate-card[data-view="sent"] .gv-sent, .gate-card[data-view="reset"] .gv-reset,
.gate-card[data-view="resetbad"] .gv-resetbad, .gate-card[data-view="disabled"] .gv-disabled, .gate-card[data-view="reacted"] .gv-reacted,
.gate-card[data-view="privacy"] .gv-privacy { display: flex; }
.gate-card[data-view="privacy"] { width: min(560px, 100%); }
.gate-card[data-view="privacy"] .gate-help { display: none; }
.privacy { text-align: left; font-size: 13.5px; line-height: 1.6; color: var(--ink); }
.privacy h3 { margin: 16px 0 4px; font-size: 14px; color: var(--ink); }
.gate-card .privacy p { margin: 0; font-size: 13.5px; text-wrap: pretty; }
.gate-privacy-link { display: block; margin: 4px auto 0; font-size: 12px; }
.gate-card .g-privacy { margin: 0; font-size: 12px; line-height: 1.5; color: var(--muted); text-align: left; text-wrap: pretty; }   /* left-aligned: fill the line, not balance (.gate-card p) */
.g-privacy .gate-link { padding: 0; font-size: 12px; }
.gate-card[data-view="apply"], .gate-card[data-view="subs"] { width: min(520px, 100%); }
/* 主账号 → 分账号 */
.subs-list { display: flex; flex-direction: column; gap: 10px; }
.sub-row { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.sub-who { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.sub-meta { margin-top: 2px; font-size: 13px; color: var(--muted); }
.sub-meta .off { color: #b4483c; }
.sub-ops { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.sub-ops button { border: 1px solid var(--line); background: var(--surface); color: var(--brown); border-radius: 16px; padding: 5px 12px; font: inherit; font-size: 13px; }
.sub-ops button.danger { color: #b4483c; }
.sub-ops button:disabled { opacity: .5; }
.subs-empty { margin: 0; text-align: center; font-size: 14px; color: var(--faint); }
.subs-made { padding: 12px 14px; border-radius: 12px; background: var(--sand-soft); font-size: 14px; color: var(--ink); }
.subs-made b { display: block; margin: 6px 0; font-size: 22px; letter-spacing: .08em; user-select: all; }
.subs-made .gate-btn { width: 100%; height: 40px; margin-top: 8px; font-size: 14px; }
.subs-form { display: flex; flex-direction: column; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.subs-full { margin: 0; text-align: center; font-size: 13px; color: var(--muted); }
.g-input { width: 100%; box-sizing: border-box; height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: 22px; background: var(--bg); color: var(--ink); font: inherit; font-size: 16px; }
textarea.g-input { height: auto; min-height: 84px; padding: 12px 16px; border-radius: 16px; resize: vertical; }
.g-input:focus { outline: none; border-color: var(--brown); }
.g-input[aria-invalid="true"] { border-color: #b4483c; }
.gate-btn.ghost { background: none; color: var(--brown); border: 1px solid var(--brown); }
/* 访问密码 entry: a soft button with a key, easy to spot under the sign-up one */
.gate-code { align-self: stretch; display: flex; align-items: center; justify-content: center; gap: 8px; height: 40px; border: 1px dashed var(--brown);
  border-radius: 20px; background: var(--sand-soft); color: var(--brown); font: inherit; font-size: 14px; font-weight: 700; letter-spacing: .02em; cursor: pointer; }
.gate-code:hover { background: var(--surface); }
.gate-links { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 8px; }
.gate-links .gate-link { padding: 2px 0; }
.gate-link.strong { color: var(--brown); font-weight: 700; text-decoration: none; }
.gate-link.strong::after { content: " \203A"; }   /* › instead of an underline: bold is enough to see it */
/* 访问密码 view: a note that it lasts one visit, with a sign-up link */
.gate-note { padding: 10px 14px; border-radius: 12px; background: var(--sand-soft); font-size: 13px; line-height: 1.5; color: var(--ink); }
.gate-note .gate-link { padding: 0; font-size: 13px; }
.gate-code svg { flex: none; }
.gate-link { align-self: center; border: 0; background: none; padding: 2px 6px; font: inherit; font-size: 13px; color: var(--muted);
  /* thin, light underline that breaks around g / y / p (phones drew it thick and dark through them) */
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; text-decoration-skip-ink: auto;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); }
.gate-link:hover { text-decoration-color: currentColor; }
.gate-or { display: flex; align-items: center; gap: 10px; margin-top: 2px; font-size: 13px; color: var(--faint); }
.gate-or::before, .gate-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.g-row { display: flex; flex-direction: column; gap: 6px; }
.g-label { padding-left: 16px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.g-hint { padding-left: 16px; font-size: 12px; color: var(--faint); }
.g-company { display: flex; flex-direction: column; gap: 12px; }
.g-company[hidden] { display: none; }
.g-seg { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 24px; overflow: hidden; background: var(--bg); }
.g-seg label { position: relative; }
.g-seg input { position: absolute; opacity: 0; inset: 0; margin: 0; }
.g-seg span { display: flex; align-items: center; justify-content: center; height: 46px; font-size: 14px; font-weight: 600; color: var(--muted); }
.g-seg input:checked + span { background: var(--brown); color: var(--on-brown); }
.g-seg input:focus-visible + span { outline: 2px solid var(--muted); outline-offset: -4px; }
.g-photos { display: flex; flex-wrap: wrap; gap: 8px; }
.g-photo, .g-add { position: relative; width: 84px; height: 84px; border-radius: 8px; overflow: hidden; background: var(--sand-soft); }
.g-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.g-photo button { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border: 0; border-radius: 50%; background: rgba(28, 25, 22, .6); color: #fff; font-size: 15px; line-height: 1; }
.g-add { border: 1px dashed var(--faint); color: var(--muted); font: inherit; font-size: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.g-add b { font-size: 24px; font-weight: 400; line-height: 1; }
.g-trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.g-hidden-user { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
/* Account menu in the header */
.acct { position: relative; }
.acct[hidden] { display: none; }
.acct-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; min-width: 220px; padding: 8px 0; background: var(--surface); border: 1px solid var(--line); border-top: 2px solid var(--brown); box-shadow: var(--shadow); }
.acct-who { padding: 6px 18px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.acct-who strong { display: block; color: var(--ink); font-size: 14px; }
.acct-menu button { display: block; width: 100%; border: 0; background: none; text-align: left; padding: 9px 18px; font: inherit; font-size: 14px; color: var(--ink); }
.acct-menu button:hover, .acct-menu button:focus-visible { background: var(--sand-soft); }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 60; transform: translateX(-50%); padding: 10px 18px; border-radius: 20px; background: var(--brown); color: var(--on-brown); font-size: 14px; box-shadow: var(--shadow); }
/* ---- start-up: spinner while the catalogue loads; a message and retry if it can't ---- */
.boot { display: none; }
body.booting .boot { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; min-height: 60vh; color: var(--muted); text-align: center; }
body.booting #homeView, body.booting #catalogView, body.booting footer.site { display: none !important; }
.spinner { width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--brown); animation: spin .8s linear infinite; }
.boot p, .boot button { display: none; margin: 0; }
body.boot-failed .spinner { display: none; }
body.boot-failed .boot p, body.boot-failed .boot button { display: block; }
.boot button { border: 1px solid var(--brown); background: var(--surface); color: var(--brown); padding: 9px 20px; border-radius: 18px; font-weight: 600; }
@keyframes spin { to { transform: rotate(360deg); } }
/* ---- full-size photo viewer (click a gallery photo) ---- */
.viewer { position: fixed; inset: 0; z-index: 60; background: rgba(20, 17, 15, .95); }
.viewer-track { position: absolute; inset: 0; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior: contain; }
.viewer-track::-webkit-scrollbar { display: none; }
.viewer-slide { flex: 0 0 100%; scroll-snap-align: center; display: flex; align-items: center; justify-content: center; padding: 64px 16px; cursor: zoom-out; }
.viewer-slide img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; display: block; cursor: default; }
.viewer-close { position: absolute; top: calc(12px + env(safe-area-inset-top, 0px)); right: 12px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; font-size: 28px; line-height: 1; }
.viewer-nav { position: absolute; top: 50%; width: 48px; height: 48px; margin-top: -24px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; font-size: 28px; line-height: 1; }
.viewer-nav.prev { left: 16px; } .viewer-nav.next { right: 16px; }
.viewer-nav:disabled { visibility: hidden; }
.viewer-count { position: absolute; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); color: rgba(255, 255, 255, .8); font-size: 13px; font-variant-numeric: tabular-nums; pointer-events: none; }
@media (hover: hover) and (pointer: fine) { .viewer-close:hover, .viewer-nav:not(:disabled):hover { background: rgba(255, 255, 255, .26); } }
@media (hover: none), (pointer: coarse) { .viewer-nav { display: none; } .viewer-slide { padding: 56px 0; } }
/* Newer catalogue arrived after the visitor started browsing */
.update-bar { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 45; display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 32px); padding: 8px 8px 8px 16px; background: var(--brown); color: var(--on-brown); border-radius: 22px; box-shadow: var(--shadow); font-size: 13px; }
.update-bar button { border: 0; border-radius: 16px; padding: 6px 14px; background: var(--on-brown); color: var(--brown); font-weight: 700; font-size: 13px; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* 合拍: one card for several styles in one photo, and the switcher in the detail */
.card .shot-n { position: absolute; right: 8px; bottom: 8px; padding: 2px 9px; border-radius: 999px; background: rgba(28, 25, 22, .72); color: #fff; font-size: 12px; font-weight: 600; z-index: 1; }
.shot-mates { margin: 6px 0 14px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.shot-mates-title { width: 100%; font-size: 12px; color: var(--faint); }
.shot-mate[aria-pressed="true"] { border-color: var(--ink); font-weight: 600; }
