/* 媧石皇家 demo 4 — 水晶探索 (crystals.html)
   Demo 2's filter structure (intro · need swipe strip · 水晶標本室 rail/sheet + search + FLIP grid · close),
   restyled Auravell: cream mats, 8px radii, Playfair/serif headings, burgundy accent, dark photo band. */

:root { --x4-edge: max(var(--gutter), calc((100vw - 1440px) / 2 + var(--gutter))); --x4-mat: #F3EBDD; --x4-top: 108px; }

/* ---------- 1. Intro ---------- */
.x4-intro { padding-top: calc(var(--hd-h) + clamp(64px, 8vw, 128px)); padding-bottom: clamp(64px, 8vw, 120px); }
.x4-intro__grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 56px clamp(40px, 6vw, 120px); align-items: center; }
.x4-intro__txt { display: grid; gap: clamp(24px, 2.6vw, 36px); justify-items: start; }
.x4-intro__h { max-width: 9em; font-size: clamp(2.5rem, 5vw, 5.25rem); }
.x4-intro__lead { max-width: 30em; }
.x4-stats { display: flex; gap: 0; margin-top: 8px; border-top: 1px dashed var(--line); width: 100%; max-width: 560px; }
.x4-stats > div { flex: 1 1 0; min-width: 0; padding: 20px 20px 0 0; }
.x4-stats > div + div { padding-left: 20px; border-left: 1px dashed var(--line); }
.x4-stats dt { font-size: var(--fs-label); letter-spacing: .2em; color: var(--muted); }
.x4-stats dd { display: flex; align-items: baseline; gap: 6px; margin-top: 6px; }
.x4-stats .num { font-size: clamp(2.2rem, 3.4vw, 3.2rem); line-height: 1; color: var(--ink); }
.x4-stats small { font-size: var(--fs-small); color: var(--muted); }
.x4-intro__fig { position: relative; display: grid; gap: 14px; padding-bottom: 8px; }
.x4-intro__mat { padding: clamp(16px, 2vw, 28px); background: var(--x4-mat); border-radius: var(--r); }
.x4-intro__media { aspect-ratio: 4 / 5; max-height: min(64vh, 600px); width: 100%; min-height: 0; border-radius: 6px; }
.x4-intro__mini { position: absolute; left: clamp(-56px, -4vw, -24px); bottom: clamp(48px, 6vw, 80px); width: clamp(110px, 11vw, 168px); padding: 10px; background: var(--paper); border-radius: var(--r); box-shadow: 0 18px 40px rgba(23, 24, 26, .1); }
.x4-intro__mini .media { aspect-ratio: 1; min-height: 0; border-radius: 4px; }
.x4-intro__cap { display: flex; align-items: center; gap: 10px; }
.x4-intro__cap::before { content: ""; width: 20px; height: 1px; background: var(--brass); }

/* ---------- 2. Need strip ---------- */
.x4-needs { padding-block: clamp(64px, 7vw, 112px); background: var(--sand); }
.x4-needs__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: clamp(32px, 4vw, 52px); }
.x4-needs__head > div:first-child { display: grid; gap: 18px; }
.x4-strip-nav { display: flex; gap: 10px; }
.x4-arrow { width: 52px; height: 52px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: var(--r); background: var(--paper); transition: background .35s, color .35s, border-color .35s, opacity .3s; }
.x4-arrow svg { width: 20px; height: 20px; }
.x4-arrow:hover:not(:disabled) { background: var(--burgundy); border-color: var(--burgundy); color: #fff; }
.x4-arrow:disabled { opacity: .35; cursor: default; }
.x4-strip { overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scroll-padding-inline: var(--x4-edge); scrollbar-width: none; overscroll-behavior-x: contain; cursor: grab; }
.x4-strip::-webkit-scrollbar { display: none; }
.x4-strip.is-drag { cursor: grabbing; scroll-snap-type: none; }
.x4-strip.is-drag a { pointer-events: none; }
.x4-strip:focus-visible { outline-offset: -2px; }
.x4-strip__track { display: flex; gap: 20px; width: max-content; padding-inline: var(--x4-edge); padding-block: 2px; }
.x4-need { flex: none; width: clamp(260px, 23vw, 330px); scroll-snap-align: start; }
.x4-need__a {
  position: relative; display: grid; grid-template-rows: auto auto auto 1fr auto; gap: 12px; height: 100%; min-height: clamp(340px, 28vw, 400px);
  padding: clamp(22px, 2vw, 30px); border-radius: var(--r); background: var(--paper);
  transition: background-color .55s var(--ease), color .55s var(--ease); user-select: none; -webkit-user-drag: none;
}
.x4-need__top { display: flex; justify-content: space-between; align-items: flex-start; }
.x4-need__no { font-size: var(--fs-label); color: var(--muted); transition: color .55s; }
.x4-need__pic { width: 64px; height: 64px; padding: 5px; border-radius: 6px; background: var(--x4-mat); overflow: hidden; opacity: .0; transform: translateY(8px) scale(.94); transition: opacity .55s var(--ease), transform .55s var(--ease); }
.x4-need__pic img { width: 100%; height: 100%; object-fit: cover; border-radius: 3px; }
.x4-need__seal {
  width: 72px; height: 72px; display: grid; place-items: center; margin-block: 2px 8px; border: 1px solid var(--burgundy); border-radius: var(--r);
  font: 400 2.1rem/1 var(--f-zh-serif); color: var(--burgundy); transition: background-color .55s var(--ease), color .55s var(--ease), border-color .55s;
}
.x4-need__name { font: 400 var(--fs-h3)/1.4 var(--f-zh-serif); letter-spacing: .08em; }
.x4-need__desc { font-size: var(--fs-small); line-height: 1.8; color: var(--muted); transition: color .55s; }
.x4-need__more { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 16px; border-top: 1px dashed var(--line); font-size: var(--fs-label); letter-spacing: .14em; transition: border-color .55s; }
.x4-need__more .num { font-size: 1rem; margin-right: 2px; }
.x4-need__more i { position: relative; width: 28px; height: 1px; background: currentColor; transition: width .45s var(--ease); }
.x4-need__more i::after { content: ""; position: absolute; right: 0; top: -3px; width: 7px; height: 7px; border-top: 1px solid currentColor; border-right: 1px solid currentColor; transform: rotate(45deg); }
.x4-need__a:hover, .x4-need__a:focus-visible { background: var(--burgundy-deep); color: var(--on-dark); }
.x4-need__a:hover .x4-need__seal, .x4-need__a:focus-visible .x4-need__seal { background: var(--on-dark); border-color: var(--on-dark); color: var(--burgundy-deep); }
.x4-need__a:hover .x4-need__desc, .x4-need__a:hover .x4-need__no, .x4-need__a:focus-visible .x4-need__desc { color: var(--on-dark-muted); }
.x4-need__a:hover .x4-need__more { border-color: rgba(244, 237, 227, .24); }
.x4-need__a:hover .x4-need__more i { width: 44px; }
.x4-need__a:hover .x4-need__pic, .x4-need__a:focus-visible .x4-need__pic { opacity: 1; transform: none; }
.x4-strip-progress { position: relative; height: 1px; margin-top: 32px; background: var(--line); overflow: hidden; }
.x4-strip-progress span { position: absolute; inset: 0; background: var(--burgundy); transform-origin: 0 50%; transform: scaleX(.3); transition: transform .25s linear; }

/* ---------- 3. Catalogue ---------- */
.x4-cat { padding-top: clamp(72px, 8vw, 128px); background: var(--paper); }
.x4-cat > .wrap { padding-bottom: clamp(64px, 8vw, 128px); }
.x4-cat__head { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 24em); align-items: baseline; gap: 16px 32px; margin-bottom: clamp(36px, 4vw, 60px); }
.x4-cat__note { justify-self: end; font-size: var(--fs-label); line-height: 1.8; letter-spacing: .06em; color: var(--muted); text-align: right; }
.x4-cat__grid { display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: clamp(32px, 4vw, 72px); align-items: start; }

/* Filter rail (desktop) */
.x4-rail { position: sticky; top: var(--x4-top); display: flex; flex-direction: column; max-height: calc(100vh - var(--x4-top) - 20px); }
.x4-rail__hd { display: flex; align-items: center; justify-content: space-between; padding-bottom: 14px; }
.x4-rail__title { font: 500 var(--fs-label)/1.4 var(--f-sans); letter-spacing: .32em; color: var(--burgundy); }
.x4-rail__close { display: none; }
.x4-rail__body { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line) transparent; padding-right: 6px; margin-right: -6px; }
.x4-rail__ft { display: none; }
.x4-group { padding-block: 20px 24px; border-top: 1px dashed var(--line); }
.x4-group__h { display: flex; align-items: center; justify-content: space-between; min-height: 32px; margin-bottom: 12px; font: 400 1.0625rem/1.4 var(--f-zh-serif); letter-spacing: .14em; }
.x4-group__h small { margin-left: 10px; font: 400 .75rem/1 var(--f-sans); letter-spacing: .08em; color: var(--muted); }
.x4-group__reset { min-height: 32px; padding: 0 2px; font: 400 var(--fs-label)/1 var(--f-sans); letter-spacing: .1em; color: var(--muted); border-bottom: 1px solid currentColor; }
.x4-group__reset[hidden] { display: none; }
.x4-group__reset:hover { color: var(--burgundy); }
.x4-group__opts--chip { display: flex; flex-wrap: wrap; gap: 8px; }
.x4-group__opts--swatch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
.x4-group__opts--row { display: grid; }

.x4-opt { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: var(--fs-small); letter-spacing: .06em; text-align: left; transition: background-color .3s, color .3s, border-color .3s, opacity .3s; }
.x4-opt__n { font-size: .75rem; color: var(--muted); transition: color .3s; }
.x4-opt--chip { padding: 0 14px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; }
.x4-opt--chip:hover { border-color: var(--ink); }
.x4-opt--chip[aria-pressed="true"] { background: var(--burgundy); border-color: var(--burgundy); color: #fff; }
.x4-opt--chip[aria-pressed="true"] .x4-opt__n { color: rgba(255, 255, 255, .75); }
.x4-opt--swatch { width: 100%; padding: 0 8px; border: 1px solid transparent; border-radius: var(--r); }
.x4-opt--swatch .swatch { flex: none; width: 18px; height: 18px; transition: box-shadow .3s; }
.x4-opt--swatch .x4-opt__t { flex: 1; min-width: 0; white-space: nowrap; }
.x4-opt--swatch .x4-opt__n { display: none; }
.x4-opt--swatch:hover { background: var(--sand); }
.x4-opt--swatch[aria-pressed="true"] { border-color: var(--burgundy); background: var(--burgundy-tint); color: var(--burgundy); }
.x4-opt--swatch[aria-pressed="true"] .swatch { box-shadow: 0 0 0 2px var(--paper), 0 0 0 3px var(--burgundy); }
.x4-opt--row { width: 100%; justify-content: space-between; padding: 0 2px; border-bottom: 1px dashed var(--line); }
.x4-opt--row .x4-opt__t { position: relative; padding-left: 18px; transition: padding .35s var(--ease); }
.x4-opt--row .x4-opt__t::before { content: ""; position: absolute; left: 0; top: 50%; width: 8px; height: 8px; margin-top: -4px; border: 1px solid var(--line); border-radius: 50%; transition: background .3s, border-color .3s; }
.x4-opt--row:hover .x4-opt__t { padding-left: 22px; }
.x4-opt--row[aria-pressed="true"] { color: var(--burgundy); }
.x4-opt--row[aria-pressed="true"] .x4-opt__t::before { background: var(--burgundy); border-color: var(--burgundy); }
.x4-opt.is-zero { opacity: .42; }

/* Results bar */
.x4-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; }
.x4-search { position: relative; flex: 1 1 340px; min-width: 0; border-bottom: 1px solid var(--ink); }
.x4-search__ico { position: absolute; left: 0; top: 50%; width: 22px; height: 22px; margin-top: -11px; color: var(--muted); pointer-events: none; }
.x4-search__in {
  width: 100%; min-height: 56px; padding: 10px 48px 10px 36px; border: 0; border-radius: 0; background: transparent; color: var(--ink);
  font: 400 clamp(1.05rem, 1.4vw, 1.3rem)/1.4 var(--f-zh-serif); letter-spacing: .06em; -webkit-appearance: none; appearance: none;
}
.x4-search__in::placeholder { color: #8a8580; opacity: 1; }
.x4-search__in:focus { outline: none; }
.x4-search:focus-within { border-bottom-color: var(--burgundy); box-shadow: 0 1px 0 var(--burgundy); }
.x4-search__in::-webkit-search-cancel-button, .x4-search__in::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
.x4-search__clear[hidden] { display: none; }
.x4-search__clear { position: absolute; right: 0; top: 50%; width: 44px; height: 44px; margin-top: -22px; display: grid; place-items: center; color: var(--muted); }
.x4-search__clear svg { width: 20px; height: 20px; }
.x4-search__clear:hover { color: var(--burgundy); }
.x4-bar__meta { display: flex; align-items: center; gap: 20px; }
.x4-count { font-size: var(--fs-small); letter-spacing: .1em; color: var(--muted); white-space: nowrap; }
.x4-count b { font-weight: 400; font-size: 1.35rem; color: var(--ink); margin-inline: 2px; }
.x4-sort select {
  min-height: 48px; padding: 0 40px 0 18px; border: 1px solid var(--line); border-radius: var(--r); color: var(--ink); cursor: pointer;
  font: 400 var(--fs-small)/1 var(--f-sans); letter-spacing: .06em; -webkit-appearance: none; appearance: none;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%232A2B2F' stroke-width='1.4'/%3E%3C/svg%3E") no-repeat right 14px center / 16px;
}
.x4-sort select:hover { border-color: var(--ink); }

.x4-active { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 20px; }
.x4-active[hidden] { display: none; }
.x4-active__list { display: flex; flex-wrap: wrap; gap: 8px; }
.x4-pill { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px 0 16px; border-radius: var(--r); background: var(--burgundy-tint); color: var(--burgundy); font-size: var(--fs-small); letter-spacing: .06em; transition: background .3s, color .3s; }
.x4-pill svg { width: 16px; height: 16px; }
.x4-pill .swatch { width: 14px; height: 14px; }
.x4-pill:hover { background: var(--burgundy); color: #fff; }
.x4-textbtn { min-height: 44px; padding: 0 2px; font-size: var(--fs-small); letter-spacing: .1em; color: var(--muted); text-decoration: underline; text-underline-offset: 5px; text-decoration-color: var(--line); }
.x4-textbtn:hover { color: var(--burgundy); text-decoration-color: currentColor; }

/* Specimen grid */
.x4-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-flow: row dense; gap: clamp(40px, 3.6vw, 64px) clamp(18px, 2vw, 32px); margin-top: clamp(32px, 3.4vw, 48px); }
.x4-grid[hidden] { display: none; }
.x4-card { min-width: 0; }
.x4-card[hidden] { display: none; }
.x4-card__a { display: flex; flex-direction: column; height: 100%; }
.x4-card__mat { position: relative; flex: none; padding: clamp(12px, 1.4vw, 20px); background: var(--x4-mat); border-radius: var(--r); transition: background-color .5s var(--ease); }
.x4-card__media { aspect-ratio: 1; min-height: 0; border-radius: 4px; }
.x4-card__media img { transition: transform 1.2s var(--ease); }
.x4-card__a:hover .x4-card__mat { background: var(--burgundy-tint); }
.x4-card__a:hover .x4-card__media img { transform: scale(1.05); }
.x4-card__photos { position: absolute; right: calc(clamp(12px, 1.4vw, 20px) + 10px); bottom: calc(clamp(12px, 1.4vw, 20px) + 10px); padding: 4px 10px; border-radius: 6px; background: rgba(254, 249, 239, .92); color: var(--ink); font-size: .75rem; letter-spacing: .06em; }
.x4-card__label { display: grid; gap: 6px; align-content: start; padding-top: 16px; }
.x4-card__top { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px dashed var(--line); font-size: var(--fs-label); letter-spacing: .12em; color: var(--muted); }
.x4-card__top .num { color: var(--burgundy); letter-spacing: .06em; }
.x4-card__name { margin-top: 6px; justify-self: start; font: 400 clamp(1.3rem, 1.7vw, 1.6rem)/1.35 var(--f-zh-serif); letter-spacing: .1em;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .55s var(--ease), color .3s; }
.x4-card__a:hover .x4-card__name { background-size: 100% 1px; color: var(--burgundy); }
.x4-card__lead, .x4-card__more { display: none; }
.x4-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; font-size: var(--fs-label); letter-spacing: .08em; color: var(--muted); }
.x4-card__col { display: inline-flex; align-items: center; gap: 8px; }
.x4-card__needs { color: var(--burgundy); }
.x4-card__needs.is-tags { color: var(--muted); }

/* the wide "feature" specimen that sets the editorial rhythm */
.x4-card.is-wide { grid-column: span 2; }
.x4-card.is-wide-r { grid-column: 2 / span 2; }
.x4-card.is-wide .x4-card__a { flex-direction: row; gap: clamp(20px, 2.4vw, 40px); }
.x4-card.is-wide-r .x4-card__a { flex-direction: row-reverse; }
.x4-card.is-wide .x4-card__mat { flex: 1.25 1 0; display: flex; }
.x4-card.is-wide .x4-card__media { flex: 1; aspect-ratio: 1; }
.x4-card.is-wide .x4-card__label { flex: 1 1 0; min-width: 0; align-content: end; gap: 10px; padding: 0 0 4px; }
.x4-card.is-wide .x4-card__name { font-size: clamp(1.7rem, 2.6vw, 2.5rem); }
.x4-card.is-wide .x4-card__lead { display: block; font: 400 1.05rem/1.9 var(--f-zh-serif); color: var(--ink); max-width: 20em; }
.x4-card.is-wide .x4-card__lead::before { content: "「"; color: var(--burgundy); }
.x4-card.is-wide .x4-card__lead::after { content: "」"; color: var(--burgundy); }
.x4-card.is-wide .x4-card__more { display: flex; align-items: center; gap: 12px; margin-top: 8px; font-size: var(--fs-label); letter-spacing: .14em; color: var(--burgundy); }
.x4-card__more i { width: 28px; height: 1px; background: currentColor; transition: width .45s var(--ease); }
.x4-card__a:hover .x4-card__more i { width: 44px; }

/* Empty state */
.x4-empty { display: grid; justify-items: center; gap: 14px; margin-top: 40px; padding: clamp(48px, 6vw, 88px) 24px; border: 1px dashed var(--line); border-radius: var(--r); text-align: center; }
.x4-empty[hidden] { display: none; }
.x4-empty__seal { width: 72px; height: 72px; display: grid; place-items: center; margin-bottom: 8px; border: 1px solid var(--burgundy); border-radius: var(--r); font: 400 2rem/1 var(--f-zh-serif); color: var(--burgundy); }
.x4-empty .muted { max-width: 26em; font-size: var(--fs-small); }
.x4-empty__act { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 16px 28px; margin-top: 12px; }

/* Mobile filter trigger + sheet */
.x4-fab-wrap { display: none; }
.x4-scrim { position: fixed; inset: 0; z-index: 110; background: rgba(23, 24, 26, .46); animation: x4Fade .4s var(--ease); }
.x4-scrim[hidden] { display: none; }
@keyframes x4Fade { from { opacity: 0; } }
html.x4-lock { overflow: hidden; }

/* ---------- 4. Close (light; the footer that follows is the dark photo band) ---------- */
.x4-close { padding-block: clamp(88px, 10vw, 160px); background: var(--sand); overflow: hidden; }
.x4-close__grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 56px clamp(40px, 6vw, 120px); align-items: center; }
.x4-close__txt { display: grid; gap: 28px; justify-items: start; }
.x4-close__row { display: flex; flex-wrap: wrap; align-items: center; gap: 20px 32px; }
.x4-close__act { display: flex; flex-wrap: wrap; gap: 12px; }
.x4-close__qr { display: flex; align-items: center; gap: 14px; padding: 8px 18px 8px 8px; border: 1px dashed var(--line); border-radius: var(--r); background: var(--paper); font-size: var(--fs-label); line-height: 1.6; letter-spacing: .12em; color: var(--muted); }
.x4-close__qr img { width: 88px; height: 88px; border-radius: 4px; }
.x4-close__stack { position: relative; aspect-ratio: 1 / 1; max-width: 560px; width: 100%; justify-self: end; }
.x4-close__card { position: absolute; padding: 10px; background: var(--paper); border-radius: var(--r); box-shadow: 0 18px 44px rgba(23, 24, 26, .1); }
.x4-close__card .media { aspect-ratio: 1; min-height: 0; border-radius: 4px; }
.x4-close__card--a { left: 0; top: 4%; width: 52%; transform: rotate(-4deg); }
.x4-close__card--b { right: 0; top: 0; width: 46%; transform: rotate(3deg); }
.x4-close__card--c { left: 26%; bottom: 0; width: 50%; transform: rotate(-1deg); }

/* ---------- Responsive ---------- */
@media (max-width: 1199px) and (min-width: 992px) {
  .x4-cat__grid { grid-template-columns: 240px minmax(0, 1fr); }
  .x4-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .x4-card.is-wide-r { grid-column: span 2; }
  .x4-card.is-wide .x4-card__a, .x4-card.is-wide-r .x4-card__a { flex-direction: row; }
}
@media (max-width: 1100px) { .x4-cat__head { grid-template-columns: auto minmax(0, 1fr); } .x4-cat__note { grid-column: 1 / -1; justify-self: start; text-align: left; } }
@media (max-width: 991px) {
  .x4-intro__grid { grid-template-columns: minmax(0, 1fr); }
  .x4-intro__media { aspect-ratio: 4 / 3; max-height: none; }
  .x4-intro__mini { left: auto; right: 16px; bottom: 56px; }
  .x4-cat__grid { grid-template-columns: minmax(0, 1fr); }
  .x4-close__grid { grid-template-columns: minmax(0, 1fr); }
  .x4-close__stack { justify-self: center; max-width: 480px; }

  /* filter rail becomes a bottom sheet */
  .x4-rail {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 120; max-height: min(88vh, 88dvh); height: auto;
    background: var(--paper); border-radius: 18px 18px 0 0; box-shadow: 0 -20px 60px rgba(23, 24, 26, .18);
    transform: translateY(104%); visibility: hidden; transition: transform .55s var(--ease), visibility 0s linear .55s;
  }
  .x4-rail.is-open { transform: none; visibility: visible; transition: transform .55s var(--ease), visibility 0s; }
  .x4-rail::before { content: ""; position: absolute; top: 8px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: var(--line); }
  .x4-rail__hd { padding: 20px var(--gutter) 12px; border-bottom: 1px solid var(--line); }
  .x4-rail__title { font: 400 1.25rem/1.4 var(--f-zh-serif); letter-spacing: .12em; color: var(--ink); }
  .x4-rail__close { display: grid; place-items: center; width: 44px; height: 44px; margin-right: -10px; }
  .x4-rail__close svg { width: 22px; height: 22px; }
  .x4-rail__body { flex: 1 1 auto; min-height: 0; padding: 0 var(--gutter); margin: 0; }
  .x4-group:first-child { border-top: 0; }
  .x4-rail__ft { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--paper); }
  .x4-rail__apply { flex: 1; max-width: 280px; }
  .x4-rail__apply::after { display: none; }

  .x4-fab-wrap { position: sticky; bottom: 18px; z-index: 85; display: flex; justify-content: center; margin-top: -24px; padding-bottom: 18px; pointer-events: none; }
  .x4-fab { pointer-events: auto; display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 24px; border-radius: var(--r); background: var(--ink); color: var(--paper); font-size: var(--fs-small); letter-spacing: .2em; box-shadow: 0 12px 30px rgba(23, 24, 26, .22); transition: transform .4s var(--ease), background .3s; }
  .x4-fab:hover { background: var(--burgundy-deep); }
  .x4-fab svg { width: 20px; height: 20px; }
  .x4-fab__n { display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 6px; background: var(--burgundy); color: #fff; font-size: .75rem; font-weight: 400; letter-spacing: 0; }
  .x4-fab__n[hidden] { display: none; }
}
@media (max-width: 640px) {
  .x4-intro { padding-top: calc(var(--hd-h) + 48px); }
  .x4-intro__media { aspect-ratio: 1; }
  .x4-intro__mini { width: 96px; padding: 6px; bottom: 48px; right: 10px; }
  .x4-stats > div { padding-right: 12px; }
  .x4-stats > div + div { padding-left: 14px; }
  .x4-strip-nav { display: none; }
  .x4-strip-progress { margin-top: 24px; }
  .x4-need { width: 76vw; max-width: 300px; }
  .x4-need__a { min-height: 330px; }
  .x4-need__pic { opacity: 1; transform: none; width: 52px; height: 52px; }
  .x4-cat__head { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .x4-bar { gap: 12px; }
  .x4-search { flex-basis: 100%; }
  .x4-bar__meta { width: 100%; justify-content: space-between; }
  .x4-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px 14px; }
  .x4-card__mat { padding: 8px; }
  .x4-card__photos { right: 14px; bottom: 14px; padding: 2px 7px; }
  .x4-card__label { padding-top: 12px; gap: 4px; }
  .x4-card__top { flex-direction: column; gap: 2px; padding-bottom: 8px; font-size: .75rem; letter-spacing: .08em; }
  .x4-card__name { font-size: 1.15rem; letter-spacing: .06em; }
  .x4-card__meta { font-size: .75rem; gap: 2px 10px; letter-spacing: .04em; }
  .x4-card.is-wide, .x4-card.is-wide-r { grid-column: 1 / -1; }
  .x4-card.is-wide .x4-card__a, .x4-card.is-wide-r .x4-card__a { flex-direction: column; gap: 0; }
  .x4-card.is-wide .x4-card__mat { flex: none; padding: 12px; }
  .x4-card.is-wide .x4-card__media { aspect-ratio: 4 / 3; }
  .x4-card.is-wide .x4-card__label { padding-top: 14px; gap: 6px; }
  .x4-card.is-wide .x4-card__top { flex-direction: row; }
  .x4-card.is-wide .x4-card__name { font-size: 1.6rem; }
  .x4-close__qr img { width: 72px; height: 72px; }
}
