/* =============================================
   infFITS — Pinterest-style layout
   主色 #1e1e19，輔以白、灰
   ============================================= */

:root {
  --color-bg:            #ffffff;
  --color-bg-subtle:     #f4f4f5;
  --color-surface:       #ffffff;
  --color-border:        #e4e4e7;
  --color-border-strong: #d4d4d8;
  --color-text:          #1e1e19;
  --color-text-muted:    #52525b;
  --color-text-subtle:   #71717a;
  --color-overlay:       rgba(0, 0, 0, 0.42);
  --color-primary:       #1e1e19;
  --color-primary-text:  #fafafa;
  --color-disabled-bg:   #e4e4e7;
  --color-disabled-text: #71717a;
  --color-error-border:  #a1a1aa;
  --color-field-error:   #1e1e19;
  --color-accent:        #e8673c;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

*, *::before, *::after { box-sizing: border-box; }

/* 全域關閉瀏覽器預設 focus 外框（連結／按鈕點擊或 Tab 時常見的藍色矩形） */
:focus {
  outline: none;
}

:focus-visible {
  outline: none;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans TC', sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  overflow-x: hidden;
  letter-spacing: 0.05em;
}

/* ── App root ──────────────────────────────── */
.app-root {
  min-height: 100vh;
  min-height: 100dvh;
}

/* ── Navbar ────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 200;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 20px;
  background: #fff;
  border-bottom: 1px solid var(--color-border);
}

.navbar__brand {
  font-size: 1.35rem;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.05em;
  color: var(--color-text);
  text-decoration: none;
  flex-shrink: 0;
}

.navbar__nav {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

@media (max-width: 600px) { .navbar__nav { display: none; } }

.navbar__nav-btn {
  padding: 6px 14px;
  border: none;
  background: none;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: 8px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.navbar__nav-btn:hover { background: var(--color-bg-subtle); color: var(--color-text); }

.navbar__auth {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-left: auto;
}

.navbar__login-btn {
  padding: 6px 16px;
  border: none;
  background: none;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--color-text);
  cursor: pointer;
  border-radius: 8px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}

.navbar__login-btn:hover { background: var(--color-bg-subtle); }

.navbar__register-btn {
  padding: 8px 18px;
  border: none;
  border-radius: 999px;
  background: #d8ff94;
  color: #1e1e19;
  font-size: 0.88rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
  transition: opacity .15s;
}

.navbar__register-btn:active { opacity: .8; }

/* ── Landing Hero（Persona Mosaic） ───────── */
.landing-hero {
  position: relative;
  width: 100%;
  min-height: clamp(440px, 78vh, 720px);
  margin: 0;
  overflow: hidden;
  background: #0f0f0f;
}

.landing-hero__mosaic {
  position: absolute;
  inset: 0;
}

.landing-hero__tiles {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 3px;
}

.landing-hero__tile {
  position: relative;
  overflow: hidden;
  background: #1a1a1a;
}

.landing-hero__tile-inner {
  position: absolute;
  inset: -6%;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: 1;
  transform: scale(1.02);
  transition: opacity 2.6s cubic-bezier(0.4, 0, 0.2, 1);
  animation: landing-hero-tile-drift 18s ease-in-out infinite alternate;
  animation-delay: calc(var(--tile-i, 0) * 1.4s);
  will-change: transform, opacity;
}

.landing-hero__tile-inner--out {
  opacity: 0.15;
}

@keyframes landing-hero-tile-drift {
  from { transform: scale(1.02) translate3d(0, 0, 0); }
  to   { transform: scale(1.14) translate3d(-1.5%, -1%, 0); }
}

.landing-hero__grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.14;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
}

.landing-hero__veil {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(105deg, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0.28) 42%, rgba(0, 0, 0, 0.55) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.08) 38%, rgba(0, 0, 0, 0.62) 100%);
}

.landing-hero__content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: clamp(440px, 78vh, 720px);
  max-width: 1280px;
  margin: 0 auto;
  padding:
    max(88px, calc(56px + env(safe-area-inset-top, 0px) + 28px))
    24px
    40px;
  color: #fff;
  pointer-events: none;
}

.landing-hero__content-inner {
  max-width: 640px;
  pointer-events: auto;
}

.landing-hero__title {
  margin: 0 0 14px;
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    'SF Pro Display',
    'Noto Sans TC',
    system-ui,
    sans-serif;
  font-size: clamp(1.85rem, 4.8vw, 3.15rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.14;
  text-wrap: balance;
  text-shadow: 0 2px 28px rgba(0, 0, 0, 0.35);
}

.landing-hero__subtitle {
  margin: 0 0 18px;
  font-size: clamp(0.95rem, 2vw, 1.12rem);
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.88);
  letter-spacing: 0.02em;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.3);
}

.landing-hero__quiz-cta {
  display: inline-block;
  margin: 0 0 22px;
  padding: 12px 22px;
  border: 0;
  border-radius: 999px;
  background: #d8ff94;
  color: #1e1e19;
  font-size: 0.88rem;
  font-weight: 800;
  font-family: inherit;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.landing-hero__quiz-cta:hover {
  transform: translateY(-1px);
}

.landing-hero__quiz-cta:active {
  opacity: 0.88;
}

.landing-hero__persona {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}

.landing-hero__persona-kicker {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.landing-hero__persona-label {
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 1.1s cubic-bezier(0.2, 0, 0, 1),
    transform 1.1s cubic-bezier(0.2, 0, 0, 1);
}

.landing-hero__persona-label--visible {
  opacity: 1;
  transform: translateY(0);
}

.landing-hero__progress {
  display: flex;
  gap: 8px;
  margin-top: 22px;
  pointer-events: none;
}

.landing-hero__dot {
  width: 28px;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  transition: background 1.2s ease, width 1.2s ease;
}

.landing-hero__dot--active {
  width: 44px;
  background: rgba(255, 255, 255, 0.92);
}

.app-root:has(.landing-hero) .navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 300;
}

.app-root:has(.landing-hero) .navbar:not(.navbar--solid) {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.52) 0%, rgba(0, 0, 0, 0) 92%);
  border-bottom-color: transparent;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.app-root:has(.landing-hero) .navbar.navbar--solid {
  background: #fff;
  border-bottom-color: var(--color-border);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.app-root:has(.landing-hero) .navbar:not(.navbar--solid) .navbar__brand,
.app-root:has(.landing-hero) .navbar:not(.navbar--solid) .navbar__login-btn {
  color: #fff;
}

.app-root:has(.landing-hero) .app-main {
  position: relative;
  z-index: 1;
}

@media (prefers-reduced-motion: reduce) {
  .landing-hero__tile-inner {
    animation: none;
    transition: none;
  }

  .landing-hero__persona-label {
    transition: none;
  }
}

/* ── Generated Look — Hero Reveal（電影海報揭曉） ─ */
.look-reveal {
  position: relative;
  padding: 48px 20px 56px;
  background: linear-gradient(180deg, #0c0c0c 0%, #1a1a18 42%, #f4f4f5 100%);
  overflow: hidden;
}

.look-reveal__head {
  max-width: 1280px;
  margin: 0 auto 28px;
  text-align: center;
  color: #fff;
}

.look-reveal__kicker {
  margin: 0 0 8px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

.look-reveal__section-title {
  margin: 0 0 8px;
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.look-reveal__section-sub {
  margin: 0;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.55;
}

.look-reveal__stage {
  position: relative;
  max-width: 520px;
  margin: 0 auto;
  min-height: clamp(480px, 72vw, 640px);
  perspective: 1200px;
}

.look-reveal__curtain {
  position: absolute;
  top: -4%;
  bottom: -4%;
  width: 52%;
  z-index: 4;
  background: linear-gradient(90deg, #050505, #121210);
  box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.65);
  transition: transform 1.45s cubic-bezier(0.65, 0, 0.15, 1);
  pointer-events: none;
}

.look-reveal__curtain--left {
  left: 0;
  transform-origin: left center;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.look-reveal__curtain--right {
  right: 0;
  transform-origin: right center;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
}

.look-reveal--inview .look-reveal__curtain--left {
  transform: translateX(-102%) rotateY(-8deg);
}

.look-reveal--inview .look-reveal__curtain--right {
  transform: translateX(102%) rotateY(8deg);
}

.look-reveal__poster {
  position: relative;
  z-index: 2;
  margin: 0 auto;
  width: min(100%, 400px);
  aspect-ratio: 2 / 3;
  border-radius: 6px;
  overflow: visible;
  opacity: 0;
  transform: scale(0.88) translateY(24px);
  transition:
    opacity 1.1s cubic-bezier(0.2, 0, 0, 1) 0.35s,
    transform 1.25s cubic-bezier(0.2, 0, 0, 1) 0.35s;
  box-shadow:
    0 40px 100px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.08);
}

.look-reveal--inview .look-reveal__poster {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.look-reveal__poster--swap {
  opacity: 0.55;
  transform: scale(0.96);
  transition-duration: 0.28s;
}

.look-reveal__badge {
  position: absolute;
  top: 14px;
  left: 50%;
  z-index: 5;
  transform: translateX(-50%);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #1e1e19;
  background: rgba(255, 255, 255, 0.94);
  white-space: nowrap;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.look-reveal__persona {
  position: absolute;
  bottom: 16px;
  left: 0;
  right: 0;
  z-index: 5;
  margin: 0;
  text-align: center;
  font-size: clamp(1.1rem, 3vw, 1.35rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #fff;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.65);
}

.look-reveal__hero {
  position: absolute;
  inset: 0;
  border-radius: 6px;
  overflow: hidden;
  background: #1a1a1a;
}

.look-reveal__hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.08) 0%,
    rgba(0, 0, 0, 0) 35%,
    rgba(0, 0, 0, 0.55) 100%
  );
  pointer-events: none;
}

.look-reveal__hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
  display: block;
  transform: scale(1.02);
  transition: transform 1.8s ease;
}

.look-reveal--inview .look-reveal__hero-img {
  transform: scale(1.06);
}

.look-reveal__pieces {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
}

.look-piece {
  position: absolute;
  width: clamp(72px, 22vw, 108px);
  pointer-events: auto;
  opacity: 0;
  transform: translateY(16px) scale(0.9);
  transition:
    opacity 0.7s cubic-bezier(0.2, 0, 0, 1),
    transform 0.7s cubic-bezier(0.2, 0, 0, 1);
}

.look-reveal--inview .look-piece {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.look-reveal--inview .look-piece--top        { transition-delay: 0.55s; }
.look-reveal--inview .look-piece--bottom     { transition-delay: 0.68s; }
.look-reveal--inview .look-piece--shoes      { transition-delay: 0.8s; }
.look-reveal--inview .look-piece--accessory  { transition-delay: 0.92s; }
.look-reveal--inview .look-piece--bag        { transition-delay: 1.04s; }

.look-piece--top {
  top: 6%;
  right: -14%;
}

.look-piece--bottom {
  bottom: 22%;
  left: -12%;
}

.look-piece--shoes {
  bottom: 6%;
  right: -6%;
}

.look-piece--accessory {
  top: 38%;
  left: -14%;
}

.look-piece--bag {
  top: 14%;
  left: -8%;
}

.look-piece__label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.88);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}

.look-piece__frame {
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.2);
}

.look-piece--linked {
  cursor: pointer;
}

.look-piece--linked:hover .look-piece__frame {
  transform: scale(1.04);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.42);
}

.look-piece__frame {
  transition: transform 0.35s cubic-bezier(0.2, 0, 0, 1);
}

.look-piece__img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: #f4f4f5;
}

.look-piece__name {
  margin: 5px 0 0;
  font-size: 0.58rem;
  font-weight: 600;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.9);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
}

@media (max-width: 480px) {
  .look-piece--top       { right: -4%; top: 4%; }
  .look-piece--bottom    { left: -4%; }
  .look-piece--shoes     { right: 0; }
  .look-piece--accessory { left: -4%; }
  .look-piece--bag       { left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .look-reveal__curtain,
  .look-reveal__poster,
  .look-piece,
  .look-reveal__hero-img {
    transition: none;
  }

  .look-reveal--inview .look-reveal__curtain--left,
  .look-reveal--inview .look-reveal__curtain--right {
    transform: translateX(-102%);
  }

  .look-reveal--inview .look-reveal__curtain--right {
    transform: translateX(102%);
  }
}

/* ── Main wrapper（寬螢幕放寬，利於多欄瀑布流欄寬） ─ */
.app-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px 48px;
  overflow-x: hidden;
}

@media (min-width: 1320px) {
  .app-main {
    max-width: min(1480px, calc(100% - 40px));
  }
}

@media (min-width: 1560px) {
  .app-main {
    max-width: min(1640px, calc(100% - 48px));
  }
}

@media (min-width: 1800px) {
  .app-main {
    max-width: min(1760px, calc(100% - 64px));
  }
}

/* ── Recently viewed ───────────────────────── */
.recently-viewed {
  padding: 22px 0 18px;
  scroll-margin-top: 72px;
}

/* TOP 10：偏 iOS / SF 標題層級（小一號、semibold），避免巨型 display 字級 */
.recently-viewed__title {
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    'SF Pro Text',
    'SF Pro Display',
    system-ui,
    sans-serif;
  font-size: clamp(1.0625rem, 0.55vw + 0.98rem, 1.25rem);
  font-weight: 600;
  letter-spacing: 0.05em;
  line-height: 1.28;
  margin: 0 0 14px;
  color: var(--color-text);
}

.recently-viewed__scroll {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 4px;
  align-items: stretch;
}

.recently-viewed__scroll::-webkit-scrollbar { display: none; }

.recently-viewed__scroll .masonry-card {
  flex: 0 0 min(240px, 65vw);
  width: min(240px, 65vw);
}

.recently-viewed__scroll .top-pick-card {
  flex: 0 0 min(268px, 72vw);
  width: min(268px, 72vw);
}

/* ── TOP 10 商品卡（大圖 + hover 推薦理由）── */
.top-pick-card {
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  cursor: pointer;
}

.top-pick-card__figure {
  position: relative;
  aspect-ratio: 3 / 4;
  background: linear-gradient(160deg, #e4e4e7, #d4d4d8);
  overflow: hidden;
}

.top-pick-card__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 420ms cubic-bezier(0.2, 0, 0, 1);
}

.top-pick-card__disc {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #fff;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.top-pick-card__fav {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  line-height: 0;
  color: var(--color-text);
}

.top-pick-card__fav--active {
  color: var(--color-accent);
}

.top-pick-card__ai-dock {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 2;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: calc(100% - 20px);
}

.top-pick-card__ai-strip {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  box-sizing: border-box;
}

.top-pick-card__ai-strip--compact {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  white-space: nowrap;
  transition:
    opacity 220ms ease,
    transform 220ms ease,
    visibility 220ms ease;
}

.top-pick-card__ai-strip--detail {
  position: absolute;
  left: 0;
  bottom: 0;
  width: max-content;
  max-width: min(200px, 100%);
  padding: 8px 10px 10px;
  border-radius: 14px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition:
    opacity 260ms cubic-bezier(0.2, 0, 0, 1),
    transform 260ms cubic-bezier(0.2, 0, 0, 1),
    visibility 260ms cubic-bezier(0.2, 0, 0, 1);
}

.top-pick-card__ai-head {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  font-size: 0.66rem;
  font-weight: 600;
}

.top-pick-card__ai-fit {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.top-pick-card__ai-fit strong {
  font-weight: 900;
}

.top-pick-card__spark {
  font-size: 0.78rem;
  line-height: 1;
}

.top-pick-card__ai-divider {
  width: 1px;
  height: 14px;
  background: rgba(255, 255, 255, 0.45);
  flex-shrink: 0;
}

.top-pick-card__ai-size {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.top-pick-card__ai-size strong {
  font-weight: 800;
}

.top-pick-card__size-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  color: var(--color-text);
  font-size: 0.65rem;
  font-weight: 900;
  flex-shrink: 0;
}

.top-pick-card__ai-rule {
  border: 0;
  height: 1px;
  margin: 6px 0;
  background: rgba(255, 255, 255, 0.28);
}

.top-pick-card__ai-reason-title {
  margin: 0 0 5px;
  font-size: 0.66rem;
  font-weight: 800;
}

.top-pick-card__ai-reasons {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.top-pick-card__ai-reasons li {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  font-size: 0.6rem;
  font-weight: 500;
  line-height: 1.32;
  color: rgba(255, 255, 255, 0.95);
}

.top-pick-card__check {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.55rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.top-pick-card__body {
  padding: 12px 12px 14px;
}

.top-pick-card__title {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.35;
  color: var(--color-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.top-pick-card__tags {
  margin: 0 0 8px;
  min-height: 1.2em;
  line-height: 1.2;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--color-text-muted);
}

.top-pick-card__tags:empty::before {
  content: '\00a0';
  visibility: hidden;
}

.top-pick-card__price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.top-pick-card__price {
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--color-text);
}

.top-pick-card__price-orig {
  font-size: 0.8rem;
  color: var(--color-text-subtle);
  text-decoration: line-through;
}

@media (hover: hover) and (pointer: fine) {
  .top-pick-card__figure:hover .top-pick-card__img {
    transform: scale(1.03);
  }

  .top-pick-card__figure:hover .top-pick-card__ai-strip--compact {
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
  }

  .top-pick-card__figure:hover .top-pick-card__ai-strip--detail {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
}

/* 觸控：點圖區聚焦時同樣展開推薦理由 */
.top-pick-card__figure:focus-within .top-pick-card__ai-strip--compact {
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
}

.top-pick-card__figure:focus-within .top-pick-card__ai-strip--detail {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.recently-viewed__card {
  flex-shrink: 0;
  width: 148px;
  cursor: pointer;
}

.recently-viewed__figure {
  width: 148px;
  height: 148px;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #e4e4e7, #d4d4d8);
}

.recently-viewed__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1);
  transition: transform 420ms cubic-bezier(0.2, 0, 0, 1);
}

.recently-viewed__name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 5px;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recently-viewed__price-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ── 情境穿搭指南 ──────────────────────────── */
.scenario-guide {
  padding: 8px 0 22px;
  scroll-margin-top: 72px;
}

.scenario-guide__head {
  margin-bottom: 14px;
}

.scenario-guide__head--secondary {
  margin-top: 14px;
}

.scenario-guide__title {
  margin: 0 0 4px;
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

.scenario-guide__subtitle {
  margin: 0;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  line-height: 1.45;
}

.scenario-guide__carousel {
  position: relative;
}

.scenario-guide__scroll {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 4px 2px 8px;
}

.scenario-guide__scroll::-webkit-scrollbar {
  display: none;
}

.scenario-guide__nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.96);
  color: var(--color-text);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scenario-guide__nav--prev { left: -6px; }
.scenario-guide__nav--next { right: -6px; }

.scenario-guide__nav:hover {
  background: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
}

.scenario-card {
  flex: 0 0 min(280px, 78vw);
  width: min(280px, 78vw);
  scroll-snap-align: start;
  position: relative;
  padding: 0;
  border: 0;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  background: #1a1a1a;
  aspect-ratio: 3 / 4;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.scenario-card__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 480ms cubic-bezier(0.2, 0, 0, 1);
}

.scenario-card__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 16px 14px 14px;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0) 35%,
    rgba(0, 0, 0, 0.45) 68%,
    rgba(0, 0, 0, 0.72) 100%
  );
  color: #fff;
  pointer-events: none;
}

.scenario-card__title {
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.scenario-card__desc {
  margin: 0 0 12px;
  font-size: 0.78rem;
  line-height: 1.45;
  opacity: 0.92;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.scenario-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 600;
}

.scenario-card__cta {
  opacity: 0.95;
}

@media (hover: hover) {
  .scenario-card:hover .scenario-card__img {
    transform: scale(1.04);
  }
}

@media (max-width: 640px) {
  .scenario-guide__nav--prev { left: 0; }
  .scenario-guide__nav--next { right: 0; }
}

/* ── 情境推薦結果彈窗 ──────────────────────── */
.scenario-results-modal-open {
  overflow: hidden;
}

.scenario-results-modal__backdrop {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: max(12px, env(safe-area-inset-top))
           max(12px, env(safe-area-inset-right))
           max(12px, env(safe-area-inset-bottom))
           max(12px, env(safe-area-inset-left));
  background: var(--color-overlay);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

@media (min-width: 720px) {
  .scenario-results-modal__backdrop {
    align-items: center;
  }
}

.scenario-results-modal {
  position: relative;
  width: min(100%, 1120px);
  max-height: min(92vh, 92dvh, 820px);
  display: flex;
  flex-direction: column;
  padding: 20px 18px 18px;
  border-radius: 20px 20px 0 0;
  background: #fff;
  border: 1px solid var(--color-border);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
}

@media (min-width: 720px) {
  .scenario-results-modal {
    border-radius: 20px;
    padding: 22px 22px 20px;
  }
}

.scenario-results-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: var(--color-bg-subtle);
  font-size: 1.5rem;
  line-height: 1;
  color: var(--color-text);
  cursor: pointer;
}

.scenario-results-modal__title {
  margin: 0 36px 6px 0;
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  font-weight: 800;
  color: var(--color-text);
  padding-right: 8px;
}

.scenario-results-modal__subtitle {
  margin: 0 0 14px;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--color-text-muted);
}

.scenario-results-modal__scroll {
  flex: 1;
  min-height: 0;
  display: flex;
  gap: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 6px;
  align-items: stretch;
}

.scenario-results-modal__scroll::-webkit-scrollbar {
  display: none;
}

.scenario-results-modal__scroll .masonry-card {
  flex: 0 0 min(240px, 72vw);
  width: min(240px, 72vw);
}

/* ── Badge + Price shared ──────────────────── */
.discount-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  color: #fff;
  background: var(--color-accent);
  padding: 1px 5px;
  border-radius: 4px;
  white-space: nowrap;
}

.price-main {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-text);
}

.price-orig {
  font-size: 0.72rem;
  color: var(--color-text-subtle);
  text-decoration: line-through;
}

.masonry-card__cta-btn {
  width: 100%;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  background: #111;
  color: #fff;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.masonry-card__cta-btn:hover {
  background: #000;
}

.masonry-card__cta-btn:active {
  transform: translateY(1px);
}

.masonry-card__cta-btn:disabled,
.masonry-card__cta-btn[aria-disabled='true'] {
  background: var(--color-bg-subtle);
  color: var(--color-text-muted);
  cursor: not-allowed;
  transform: none;
}

.size-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--color-text);
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  padding: 1px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

/* ── Feed section ──────────────────────────── */
.feed-section {
  padding-top: 4px;
  scroll-margin-top: 72px;
}

.feed-section__title {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 800;
  margin: 0 0 6px;
  letter-spacing: 0.05em;
  color: var(--color-text);
}

.feed-section__subtitle {
  font-size: 0.88rem;
  color: var(--color-text-muted);
  margin: 0 0 16px;
  line-height: 1.5;
}

/* ── Filter tabs ───────────────────────────── */
.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.filter-tab {
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--color-border-strong);
  background: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--color-text);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
  transition:
    background-color 0.22s cubic-bezier(0.2, 0, 0, 1),
    color 0.22s cubic-bezier(0.2, 0, 0, 1),
    border-color 0.22s cubic-bezier(0.2, 0, 0, 1),
    transform 0.22s cubic-bezier(0.2, 0, 0, 1);
}

.filter-tab:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.12);
}

.filter-tab:active {
  transform: scale(0.97);
}

@media (prefers-reduced-motion: reduce) {
  .filter-tab {
    transition-duration: 0.01ms;
  }

  .filter-tab:active {
    transform: none;
  }
}

.filter-tab--active {
  background: var(--color-text);
  color: #fff;
  border-color: var(--color-text);
}

/* ── 無限瀑布流容器（觀察用 sentinel 置於欄位下方） ─ */
.masonry-feed {
  overflow-x: hidden;
}

.masonry-feed__sentinel {
  min-height: 1px;
  width: 100%;
  margin-top: 8px;
  pointer-events: none;
  text-align: center;
  font-size: 0.75rem;
  color: var(--color-text-subtle);
  line-height: 1.4;
}

.masonry-feed__end {
  width: fit-content;
  max-width: calc(100% - 32px);
  margin: 22px auto 6px;
  padding: 10px 16px;
  border: 1px solid rgba(212, 212, 216, 0.72);
  border-radius: 999px;
  color: rgba(30, 30, 25, 0.72);
  background: rgba(255, 255, 255, 0.78);
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  font-size: 0.82rem;
  line-height: 1.45;
  text-align: center;
  opacity: 0;
  transform: translate3d(0, 8px, 0) scale(0.985);
}

.masonry-feed__end[hidden] {
  display: none !important;
}

.masonry-feed__end--visible {
  animation: feed-end-apple-in 460ms cubic-bezier(0.2, 0, 0, 1) both;
}

@keyframes feed-end-apple-in {
  from {
    opacity: 0;
    transform: translate3d(0, 8px, 0) scale(0.985);
  }
  70% {
    opacity: 1;
    transform: translate3d(0, -1px, 0) scale(1.001);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

/* ── Masonry grid（最多 6 欄，依視寬遞增） ─ */
.masonry-grid {
  column-count: 2;
  column-gap: 12px;
}

@media (min-width: 560px) { .masonry-grid { column-count: 3; } }
@media (min-width: 720px) { .masonry-grid { column-count: 4; } }
@media (min-width: 900px) { .masonry-grid { column-count: 5; } }
@media (min-width: 1080px) { .masonry-grid { column-count: 6; } }

/* 身形儲存後重繪瀑布流：Apple 風格柔和 crossfade */
.masonry-grid.masonry-grid--updating {
  opacity: 0.78;
  transform: scale(0.999);
}

.masonry-grid.masonry-grid--refresh .masonry-card {
  animation: masonry-card-apple-in 620ms cubic-bezier(0.2, 0, 0, 1) both;
}

.masonry-grid.masonry-grid--refresh .masonry-card:nth-child(2n)  { animation-delay: 24ms; }
.masonry-grid.masonry-grid--refresh .masonry-card:nth-child(3n)  { animation-delay: 48ms; }
.masonry-grid.masonry-grid--refresh .masonry-card:nth-child(4n)  { animation-delay: 72ms; }
.masonry-grid.masonry-grid--refresh .masonry-card:nth-child(5n)  { animation-delay: 96ms; }

@keyframes masonry-card-apple-in {
  from {
    opacity: 0;
    transform: translate3d(0, 6px, 0) scale(0.996);
  }
  70% {
    opacity: 1;
    transform: translate3d(0, -0.5px, 0) scale(1);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .masonry-grid.masonry-grid--updating {
    opacity: 1;
    transform: none;
  }
  .masonry-grid.masonry-grid--refresh {
    animation: none;
  }
  .masonry-grid.masonry-grid--refresh .masonry-card {
    animation: none;
  }
  .masonry-feed__end--visible {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* ── Masonry card ──────────────────────────── */
.masonry-card {
  display: inline-block;
  width: 100%;
  break-inside: avoid;
  break-inside: avoid-column;
  -webkit-column-break-inside: avoid;
  page-break-inside: avoid;
  margin-bottom: 14px;
  cursor: pointer;
  border-radius: 16px;
  overflow: hidden;
  background: transparent;
}

/* 圖片區：由 JS 設定 aspect-ratio（直向或正方形，高≥寬），img 使用 srcset */
.masonry-card__figure {
  position: relative;
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(160deg, #e4e4e7, #d4d4d8);
}

.masonry-card__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: relative;
  z-index: 0;
  transform: scale(1);
  transition: transform 420ms cubic-bezier(0.2, 0, 0, 1);
}

/* 圖上 hover：半透明遮罩 + 儲存／尺／分享／更多（僅精確 hover 裝置預設顯示動效） */
.masonry-card__hover {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  padding: 10px 10px 12px;
  border-radius: inherit;
  background: rgba(0, 0, 0, 0.42);
  opacity: 0;
  visibility: hidden;
  transition: opacity 260ms cubic-bezier(0.2, 0, 0, 1), visibility 260ms cubic-bezier(0.2, 0, 0, 1);
  pointer-events: none;
}

.masonry-card__hover-save {
  align-self: flex-end;
  margin-bottom: auto;
  padding: 7px 16px;
  border: none;
  border-radius: 999px;
  background: var(--color-accent);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transform: translate3d(0, -8px, 0) scale(0.98);
  opacity: 0;
  transition:
    transform 340ms cubic-bezier(0.2, 0, 0, 1),
    opacity 260ms cubic-bezier(0.2, 0, 0, 1),
    background 180ms cubic-bezier(0.2, 0, 0, 1),
    box-shadow 200ms cubic-bezier(0.2, 0, 0, 1);
}

.masonry-card__hover-save:active { opacity: 0.92; }

.masonry-card__hover-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  gap: 10px;
  transform: translate3d(0, 10px, 0);
  transition: transform 360ms cubic-bezier(0.2, 0, 0, 1) 60ms;
}

.masonry-card__hover-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.masonry-card__hover-fab {
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #fff;
  color: var(--color-text);
  font-size: 0.85rem;
  font-weight: 700;
  font-family: inherit;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
  transform: translate3d(0, 8px, 0) scale(0.96);
  opacity: 0;
  transition:
    transform 340ms cubic-bezier(0.2, 0, 0, 1),
    opacity 260ms cubic-bezier(0.2, 0, 0, 1),
    box-shadow 200ms cubic-bezier(0.2, 0, 0, 1);
}

.masonry-card__hover-left .masonry-card__hover-fab:nth-child(1) { transition-delay: 0.08s; }

.masonry-card__hover-left .masonry-card__hover-fab:nth-child(2) { transition-delay: 0.13s; }

.masonry-card__hover-bar > .masonry-card__hover-fab:last-child { transition-delay: 0.18s; }

.masonry-card__hover-fab--icon { color: var(--color-text); }

.masonry-card__hover-fab svg { display: block; }

.masonry-card__hover-save:focus-visible,
.masonry-card__hover-fab:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

@media (hover: hover) {
  .recently-viewed__card:hover .recently-viewed__img {
    transform: scale(1.035);
  }

  .masonry-card:hover .masonry-card__img {
    transform: scale(1.035);
  }

  .masonry-card:hover .masonry-card__hover {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .masonry-card:hover .masonry-card__hover-save {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 1;
  }

  .masonry-card:hover .masonry-card__hover-bar {
    transform: translate3d(0, 0, 0);
  }

  .masonry-card:hover .masonry-card__hover-fab {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .recently-viewed__img {
    transition: none;
  }

  .masonry-card__img {
    transition: none;
  }

  .masonry-card__hover {
    transition: opacity 0.12s ease, visibility 0.12s ease;
  }

  .masonry-card__hover-save,
  .masonry-card__hover-bar,
  .masonry-card__hover-fab {
    transition: none;
    transform: none;
    opacity: 1;
  }

  @media (hover: hover) {
    .recently-viewed__card:hover .recently-viewed__img {
      transform: none;
    }

    .masonry-card:hover .masonry-card__img {
      transform: none;
    }
  }
}

.masonry-card__body { padding: 8px 2px 0; }

.masonry-card__title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
}

.masonry-card__title {
  flex: 1;
  min-width: 0;
  font-size: 0.82rem;
  font-weight: 700;
  margin: 0;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.masonry-card__fav-btn {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--color-text-subtle);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  box-shadow: none;
}

/* 與全域一致：收藏鈕不要任何 focus ring（先前 :focus-visible 規則會蓋過全域） */
.masonry-card__fav-btn:focus,
.masonry-card__fav-btn:focus-visible,
.masonry-card__fav-btn:active {
  outline: none;
  box-shadow: none;
}

.masonry-card__fav-btn:hover {
  color: var(--color-text);
}

.masonry-card__fav-btn--active {
  color: var(--color-accent);
}

.masonry-card__fav-btn--active:hover {
  color: var(--color-accent);
  opacity: 0.92;
}

.masonry-card__fav-icon {
  display: block;
  pointer-events: none;
}

.masonry-card__desc {
  font-size: 0.73rem;
  color: var(--color-text-subtle);
  margin: 0 0 5px;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.45;
}

.masonry-card__desc.masonry-card__desc--ai-one-line {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.masonry-card__size-fit {
  margin: 8px 0 9px;
  padding: 8px;
  border: 1px solid rgba(212, 212, 216, 0.72);
  border-radius: 12px;
  background: rgba(250, 250, 250, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.masonry-card__size-fit--panel {
  padding: 10px 10px 9px;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.94) 0%, rgba(250, 250, 250, 0.88) 100%);
  border-color: rgba(228, 228, 231, 0.95);
}

.masonry-card__size-fit-ai-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.masonry-card__size-fit-ai-pill {
  flex-shrink: 0;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  background: rgba(244, 244, 245, 0.95);
  border: 1px solid rgba(228, 228, 231, 0.9);
}

.masonry-card__size-fit-ai-match {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  text-align: right;
}

.masonry-card__size-fit-ai-match-label {
  font-size: 0.62rem;
  font-weight: 650;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  text-transform: uppercase;
}

.masonry-card__size-fit-ai-match-value {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  font-variant-numeric: tabular-nums;
  color: var(--color-text);
  line-height: 1;
}

.masonry-card__size-fit-ai-meter {
  height: 5px;
  border-radius: 999px;
  background: #e4e4e7;
  overflow: hidden;
  margin-bottom: 10px;
}

.masonry-card__size-fit-ai-meter-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3f3f46 0%, var(--color-text) 55%, #52525b 100%);
  min-width: 4px;
  transition: width 0.35s cubic-bezier(0.2, 0, 0, 1);
}

.masonry-card__size-fit-ai-rec {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.masonry-card__size-fit-ai-rec-label {
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
}

.masonry-card__size-fit-ai-rec-size {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #fff;
  background: var(--color-text);
}

.masonry-card__size-fit-ai-stock {
  margin: 0;
  font-size: 0.65rem;
  font-weight: 650;
  letter-spacing: 0.05em;
  line-height: 1.4;
  color: var(--color-text-muted);
}

.masonry-card__size-fit-ai-stock--low {
  color: #9a3412;
  font-weight: 700;
}

.masonry-card__size-fit-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}

.masonry-card__size-fit-title {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: 0.05em;
}

.masonry-card__size-fit-best {
  flex-shrink: 0;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--color-text);
  color: #fff;
  font-size: 0.64rem;
  font-weight: 700;
  line-height: 1;
}

/* 第三欄固定寬度，避免右側文案長短不一時擠壓中欄，造成每列軌道總長不同 */
.masonry-card__size-row {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) 4.5rem;
  align-items: center;
  gap: 6px;
}

.masonry-card__size-row + .masonry-card__size-row {
  margin-top: 5px;
}

.masonry-card__size-label {
  color: var(--color-text-subtle);
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1;
  text-align: center;
}

.masonry-card__size-track {
  display: block;
  width: 100%;
  min-width: 0;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e4e4e7;
}

.masonry-card__size-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #a1a1aa;
}

.masonry-card__size-meta {
  min-width: 0;
  width: 100%;
  color: var(--color-text-subtle);
  font-size: 0.64rem;
  font-weight: 650;
  line-height: 1;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.masonry-card__size-row--best .masonry-card__size-label,
.masonry-card__size-row--best .masonry-card__size-meta {
  color: var(--color-text);
}

.masonry-card__size-row--best .masonry-card__size-fill {
  background: var(--color-text);
}

.masonry-card__price-row {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

/* Skeleton loading state */
.skeleton-line {
  height: 10px;
  border-radius: 6px;
  background: linear-gradient(90deg, #e4e4e7 25%, #d4d4d8 50%, #e4e4e7 75%);
  background-size: 200% 100%;
  margin-bottom: 6px;
}

.skeleton-line--title { width: 68%; }
.skeleton-line--desc  { width: 46%; }

/* ── Body-metrics modal ────────────────────── */
.body-metrics-modal__backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(12px, env(safe-area-inset-top))
           max(12px, env(safe-area-inset-right))
           max(12px, env(safe-area-inset-bottom))
           max(12px, env(safe-area-inset-left));
  background: var(--color-overlay);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.body-metrics-modal__backdrop[hidden] { display: none !important; }

.body-metrics-modal {
  width: min(100%, 460px);
  max-height: min(90vh, 90dvh, 640px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  margin: auto;
  padding: 30px 28px 30px;
  border-radius: 22px;
  background: #fff;
  border: 1px solid var(--color-border);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, .14),
    inset 0 1px 0 rgba(255, 255, 255, .86);
  text-align: center;
}

.body-metrics-modal__logo {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
  color: var(--color-text);
}

.body-metrics-modal__title {
  margin: 0 0 10px;
  font-size: clamp(1.05rem, 3vw, 1.2rem);
  font-weight: 700;
  line-height: 1.35;
  color: var(--color-text);
}

.body-metrics-modal__desc {
  max-width: 332px;
  margin: 0 auto 28px;
  font-size: 0.85rem;
  line-height: 1.52;
  color: var(--color-text-muted);
}

.body-metrics-modal__error-banner {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.85rem;
  color: var(--color-text);
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-error-border);
}

.body-metrics-modal__error-banner[hidden] { display: none !important; }

.body-metrics-modal__form {
  max-width: 356px;
  margin: 0 auto;
}

.body-metrics-modal__field {
  text-align: left;
  margin-bottom: 20px;
}

.body-metrics-modal__label {
  display: block;
  margin-bottom: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-text);
}

.body-metrics-modal__input-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  align-items: center;
  gap: 10px;
}

.body-metrics-modal__select {
  width: 100%;
  min-width: 0;
  min-height: 54px;
  padding: 12px 44px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  font-size: 20px;
  font-family: inherit;
  line-height: 1.25;
  color: var(--color-text);
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2352525b' d='M1 1.5L6 6.5 11 1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 14px 10px;
  text-align: center;
  text-align-last: center;
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color .15s, box-shadow .15s;
}

.body-metrics-modal__select:focus {
  border-color: rgba(30, 30, 25, 0.55);
  box-shadow: 0 0 0 1.5px rgba(30, 30, 25, .12);
}

.body-metrics-modal__select--placeholder {
  font-size: 16px;
  font-weight: 650;
  color: var(--color-text-muted);
}

.body-metrics-modal__select option {
  font-size: 28px;
  line-height: 1.75;
  padding: 6px 0;
}

.body-metrics-modal__select--error {
  border-color: var(--color-field-error);
  box-shadow: 0 0 0 2px rgba(30, 30, 25, .14);
}

.body-metrics-modal__unit {
  flex-shrink: 0;
  font-size: 0.96rem;
  color: var(--color-text-subtle);
  min-width: 0;
}

.body-metrics-modal__hint {
  margin: 6px 0 0;
  font-size: 0.75rem;
  color: var(--color-text);
  min-height: 1.1em;
}

.body-metrics-modal__submit {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  width: 100%;
  min-height: 54px;
  margin-top: 6px;
  padding: 13px 18px;
  border: none;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  line-height: 1.35;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition:
    transform 220ms cubic-bezier(0.2, 0, 0, 1),
    box-shadow 220ms cubic-bezier(0.2, 0, 0, 1),
    filter 220ms cubic-bezier(0.2, 0, 0, 1),
    opacity .15s;
  background: var(--color-primary);
  color: var(--color-primary-text);
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.body-metrics-modal__submit::before {
  content: '';
  position: absolute;
  inset: 1px;
  z-index: -1;
  border-radius: inherit;
  background:
    linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, 0.20) 38%, transparent 56%),
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.18), transparent 42%);
  opacity: 0.9;
  transform: translateX(-42%);
  transition: transform 520ms cubic-bezier(0.2, 0, 0, 1), opacity 220ms cubic-bezier(0.2, 0, 0, 1);
}

.body-metrics-modal__submit:disabled {
  cursor: not-allowed;
  background: var(--color-disabled-bg);
  color: var(--color-disabled-text);
  box-shadow: none;
}

.body-metrics-modal__submit:disabled::before {
  opacity: 0;
}

.body-metrics-modal__submit:not(:disabled):hover {
  transform: translate3d(0, -1px, 0);
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.20),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  filter: saturate(1.04);
}

.body-metrics-modal__submit:not(:disabled):hover::before {
  transform: translateX(38%);
}

.body-metrics-modal__submit:not(:disabled):active {
  opacity: .92;
  transform: translate3d(0, 0, 0) scale(0.985);
}

@media (prefers-reduced-motion: reduce) {
  .body-metrics-modal__submit,
  .body-metrics-modal__submit::before {
    transition: none;
  }

  .body-metrics-modal__submit:not(:disabled):hover,
  .body-metrics-modal__submit:not(:disabled):active {
    transform: none;
  }

  .body-metrics-modal__submit:not(:disabled):hover::before {
    transform: translateX(-42%);
  }
}

/* ── AI 浮動按鈕 + iframe 彈窗（高於 .body-metrics-modal__backdrop 1000） ── */
.ai-fab {
  position: fixed;
  right: max(16px, env(safe-area-inset-right, 0px));
  bottom: max(16px, env(safe-area-inset-bottom, 0px));
  z-index: 1050;
  width: 56px;
  height: 56px;
  padding: 0;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1e1e19;
  background: #d8ff94;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.14), 0 2px 6px rgba(0, 0, 0, 0.08);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  isolation: isolate;
  outline: none;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.ai-fab::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transform: scale(0.86);
  border: none;
  box-shadow: 0 0 0 2px rgba(216, 255, 148, 0.55);
}

.ai-fab:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16), 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ai-fab:focus,
.ai-fab:focus-visible {
  outline: none;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.14), 0 2px 6px rgba(0, 0, 0, 0.08);
}

.ai-fab:active {
  transform: scale(0.97);
}

.ai-fab.ai-fab--pulse::after {
  animation: ai-fab-pulse 520ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes ai-fab-pulse {
  0% {
    opacity: 0.55;
    transform: scale(0.86);
    box-shadow: 0 0 0 2px rgba(216, 255, 148, 0.45);
  }
  100% {
    opacity: 0;
    transform: scale(1.34);
    box-shadow: 0 0 0 14px rgba(216, 255, 148, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ai-fab:hover,
  .ai-fab:active {
    transform: none;
  }
}

.ai-iframe-shell {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px))
    max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  box-sizing: border-box;
  pointer-events: none;
}

.ai-iframe-shell[hidden] {
  display: none !important;
}

.ai-iframe-shell__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  opacity: 0;
}

.ai-iframe-shell__panel {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  max-height: min(96vh, 960px);
  max-height: min(96svh, 960px);
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 22px;
  overflow: hidden;
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.18),
    0 8px 24px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
  opacity: 0;
  transform: translate3d(0, 10px, 0) scale(0.992);
  will-change: transform, opacity;
  backface-visibility: hidden;
}

.ai-iframe-shell.is-open,
.ai-iframe-shell.is-closing {
  pointer-events: auto;
}

/* 強制模式：背景不可點擊關閉、遮罩更深 */
.ai-iframe-shell--forced .ai-iframe-shell__backdrop {
  cursor: default;
  background: rgba(0, 0, 0, 0.34);
}

.ai-iframe-shell.is-open .ai-iframe-shell__backdrop {
  animation: ai-backdrop-in 360ms cubic-bezier(0.2, 0, 0, 1) both;
}

.ai-iframe-shell.is-open .ai-iframe-shell__panel {
  animation: ai-panel-in 520ms cubic-bezier(0.16, 1, 0.3, 1) 45ms both;
}

.ai-iframe-shell.is-closing .ai-iframe-shell__backdrop {
  animation: ai-backdrop-out 220ms cubic-bezier(0.32, 0, 0.67, 0) both;
}

.ai-iframe-shell.is-closing .ai-iframe-shell__panel {
  animation: ai-panel-out 220ms cubic-bezier(0.32, 0, 0.67, 0) both;
}

.ai-iframe-shell__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(228, 228, 231, 0.88);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(29, 29, 31, 0.82);
  background: rgba(245, 245, 247, 0.82);
  backdrop-filter: saturate(160%) blur(8px);
  -webkit-backdrop-filter: saturate(160%) blur(8px);
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  opacity: 0;
  transform: translateY(-8px) scale(0.92);
  transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 180ms cubic-bezier(0.22, 1, 0.36, 1),
    background-color 160ms ease,
    box-shadow 200ms ease,
    color 160ms ease;
}

/* display:flex 會蓋掉 HTML hidden，強制模式務必真正隱藏關閉鈕 */
.ai-iframe-shell__close[hidden],
.ai-iframe-shell.is-open .ai-iframe-shell__close[hidden] {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  opacity: 0 !important;
  transform: none !important;
}

.ai-iframe-shell__close:hover {
  color: #111;
  background: rgba(255, 255, 255, 0.95);
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  transform: translateY(0) scale(1.03);
}

.ai-iframe-shell__close:active {
  transform: translateY(0) scale(0.95);
}

.ai-iframe-shell__close:focus,
.ai-iframe-shell__close:focus-visible {
  outline: none;
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.ai-iframe-shell__close:hover:focus,
.ai-iframe-shell__close:hover:focus-visible {
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.ai-iframe-shell__close svg {
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.ai-iframe-shell__close:hover svg {
  transform: rotate(90deg);
}

.ai-iframe-shell.is-open .ai-iframe-shell__close {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition-delay: 80ms;
}

.ai-iframe-shell.is-closing .ai-iframe-shell__close {
  opacity: 0;
  transform: translateY(-6px) scale(0.9);
  transition-delay: 0ms;
}

.ai-iframe-shell__frame {
  width: 100%;
  /* 載入前占位；實際高度由 JS 依 .ai-frame 內容寫入 */
  height: 260px;
  max-height: calc(100vh - 56px);
  max-height: calc(100svh - 56px);
  border: none;
  display: block;
  flex-shrink: 0;
  overflow: auto;
  opacity: 0;
  transform: translate3d(0, 3px, 0);
  will-change: transform, opacity;
}

.ai-iframe-shell.is-open .ai-iframe-shell__frame {
  animation: ai-frame-in 360ms cubic-bezier(0.2, 0, 0, 1) 150ms both;
}

.ai-iframe-shell.is-closing .ai-iframe-shell__frame {
  animation: ai-frame-out 160ms cubic-bezier(0.4, 0, 1, 1) both;
}

@keyframes ai-backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes ai-backdrop-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes ai-panel-in {
  from {
    opacity: 0;
    transform: translate3d(0, 10px, 0) scale(0.992);
  }
  62% {
    opacity: 1;
    transform: translate3d(0, -1px, 0) scale(1.001);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes ai-panel-out {
  from {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    opacity: 0;
    transform: translate3d(0, 8px, 0) scale(0.992);
  }
}

@keyframes ai-frame-in {
  from {
    opacity: 0;
    transform: translate3d(0, 3px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes ai-frame-out {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translate3d(0, 4px, 0);
  }
}

html.ai-iframe-shell--open,
html.ai-iframe-shell--open body {
  overflow: hidden;
}

/* ── AI 全域 loading ───────────────────────── */
.ai-global-loading {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(246, 246, 247, 0.62);
  backdrop-filter: saturate(135%) blur(18px);
  -webkit-backdrop-filter: saturate(135%) blur(18px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms cubic-bezier(0.2, 0, 0, 1);
}

.ai-global-loading::before,
.ai-global-loading::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(36px);
  opacity: 0.52;
}

.ai-global-loading::before {
  width: min(54vw, 520px);
  height: min(54vw, 520px);
  background: radial-gradient(circle at center, rgba(214, 220, 230, 0.34), rgba(214, 220, 230, 0));
  transform: translate(-22vw, -18vh);
  animation: ai-glow-drift-a 6.8s ease-in-out infinite alternate;
}

.ai-global-loading::after {
  width: min(48vw, 460px);
  height: min(48vw, 460px);
  background: radial-gradient(circle at center, rgba(245, 235, 210, 0.34), rgba(245, 235, 210, 0));
  transform: translate(24vw, 20vh);
  animation: ai-glow-drift-b 7.6s ease-in-out infinite alternate;
}

.ai-global-loading.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.ai-global-loading__wrap {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  animation: ai-loading-enter 420ms cubic-bezier(0.2, 0, 0, 1);
}

.ai-global-loading__text {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 670;
  letter-spacing: 0.05em;
  color: rgba(28, 28, 30, 0.84);
  text-align: center;
  max-width: min(320px, calc(100vw - 48px));
  line-height: 1.42;
  animation: ai-loading-text-breathe 1.6s ease-in-out infinite;
}

.ai-global-loading__text::after {
  content: '';
  animation: ai-loading-dots 1.25s steps(4, end) infinite;
}

.ai-global-loading__inner {
  position: relative;
  width: 74px;
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 24px;
  background:
    linear-gradient(168deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.66));
  border: 1px solid rgba(255, 255, 255, 0.88);
  box-shadow:
    0 22px 52px rgba(0, 0, 0, 0.12),
    0 6px 18px rgba(0, 0, 0, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  animation: ai-loading-card-float 2.4s ease-in-out infinite;
}

.ai-global-loading__ring {
  position: absolute;
  inset: 15px;
  border-radius: 50%;
  border: 2px solid rgba(28, 28, 30, 0.1);
  border-top-color: rgba(28, 28, 30, 0.78);
  animation: ai-ring-spin 820ms linear infinite;
}

.ai-global-loading__ring--2 {
  inset: 22px;
  border-width: 1.5px;
  border-color: rgba(28, 28, 30, 0.06);
  border-top-color: rgba(28, 28, 30, 0.26);
  border-right-color: transparent;
  border-bottom-color: rgba(28, 28, 30, 0.26);
  animation-duration: 1320ms;
  animation-direction: reverse;
}

.ai-global-loading__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(28, 28, 30, 0.78);
  animation: ai-dot-pulse 920ms ease-in-out infinite;
}

@keyframes ai-loading-enter {
  from {
    opacity: 0;
    transform: translate3d(0, 8px, 0) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes ai-loading-card-float {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, -4px, 0); }
}

@keyframes ai-loading-text-breathe {
  0%, 100% { opacity: 0.78; }
  50% { opacity: 1; }
}

@keyframes ai-loading-dots {
  0%   { content: ''; }
  25%  { content: '.'; }
  50%  { content: '..'; }
  75%, 100% { content: '...'; }
}

@keyframes ai-glow-drift-a {
  from { transform: translate(-22vw, -18vh) scale(1); }
  to { transform: translate(-18vw, -14vh) scale(1.08); }
}

@keyframes ai-glow-drift-b {
  from { transform: translate(24vw, 20vh) scale(1); }
  to { transform: translate(20vw, 16vh) scale(1.07); }
}

@keyframes ai-ring-spin {
  to { transform: rotate(360deg); }
}

@keyframes ai-dot-pulse {
  0%, 100% { opacity: 0.35; transform: scale(0.82); }
  50%       { opacity: 1;    transform: scale(1.12); }
}

@media (prefers-reduced-motion: reduce) {
  .ai-global-loading {
    transition: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .ai-global-loading::before,
  .ai-global-loading::after {
    animation: none;
  }
  .ai-global-loading__wrap,
  .ai-global-loading__inner,
  .ai-global-loading__text {
    animation: none;
  }
  .ai-global-loading__ring,
  .ai-global-loading__dot {
    animation: none;
  }
  .ai-global-loading__text::after {
    animation: none;
    content: '...';
  }
  .ai-global-loading__dot {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ai-fab::after {
    animation: none !important;
    transition: none !important;
    opacity: 0 !important;
  }
  .ai-iframe-shell__backdrop,
  .ai-iframe-shell__panel,
  .ai-iframe-shell__frame {
    transition: none;
    animation: none !important;
  }
  .ai-iframe-shell__panel {
    transform: none;
    filter: none;
    opacity: 1;
  }
  .ai-iframe-shell__close {
    opacity: 1;
    transform: none;
  }
  .ai-iframe-shell__close svg {
    transform: none !important;
  }
  .ai-iframe-shell__backdrop,
  .ai-iframe-shell__frame {
    opacity: 1;
    transform: none;
  }
}

/* ── 商品詳情（點擊「尺」） ─────────────────── */
.pdp-open {
  overflow: hidden;
}

.pdp-modal__backdrop {
  position: fixed;
  inset: 0;
  z-index: 1150;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: max(12px, env(safe-area-inset-top))
           max(12px, env(safe-area-inset-right))
           max(12px, env(safe-area-inset-bottom))
           max(12px, env(safe-area-inset-left));
  background: var(--color-overlay);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

@media (min-width: 720px) {
  .pdp-modal__backdrop {
    align-items: center;
  }
}

.pdp-modal {
  position: relative;
  width: min(100%, 920px);
  max-height: min(92vh, 92dvh);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 20px;
  background: #fff;
  border: 1px solid var(--color-border);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.2);
}

.pdp-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--color-text);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.pdp-modal__layout {
  display: grid;
  grid-template-columns: 1fr;
}

@media (min-width: 720px) {
  .pdp-modal__layout {
    grid-template-columns: minmax(280px, 1fr) minmax(300px, 1.05fr);
  }
}

.pdp-modal__gallery {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 16px 16px 0;
  background: var(--color-bg-subtle);
}

.pdp-modal__hero {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #e4e4e7;
  min-height: 280px;
}

.pdp-modal__hero-img {
  width: 100%;
  height: 100%;
  min-height: 280px;
  object-fit: cover;
  object-position: 50% 15%;
  display: block;
}

.pdp-modal__badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #fff;
  background: var(--color-accent);
}

.pdp-modal__side {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 72px;
}

.pdp-modal__thumbs {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pdp-modal__thumb {
  padding: 0;
  border: 2px solid transparent;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  background: #fff;
}

.pdp-modal__thumb--active {
  border-color: var(--color-text);
}

.pdp-modal__thumb img {
  display: block;
  width: 64px;
  height: 64px;
  object-fit: cover;
}

.pdp-modal__swatches {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.pdp-modal__swatch {
  width: 28px;
  height: 28px;
  border: 2px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.pdp-modal__swatch--active {
  border-color: var(--color-text);
}

.pdp-modal__info {
  padding: 18px 20px 22px;
}

.pdp-modal__title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.pdp-modal__title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.35;
}

.pdp-modal__fav {
  flex-shrink: 0;
  padding: 4px;
  border: 0;
  background: none;
  cursor: pointer;
  color: var(--color-text);
}

.pdp-modal__tags {
  margin: 0 0 10px;
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

.pdp-modal__price-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.pdp-modal__match {
  margin-bottom: 14px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--color-border);
  background: #fff;
}

.pdp-modal__match-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.pdp-modal__match-label {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
}

.pdp-modal__match-pct {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 900;
  line-height: 1.1;
}

.pdp-modal__match-caption {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-text);
}

.pdp-modal__match-meter {
  height: 6px;
  border-radius: 999px;
  background: var(--color-bg-subtle);
  overflow: hidden;
  margin-bottom: 12px;
}

.pdp-modal__match-meter > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--color-text);
}

.pdp-modal__metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
}

.pdp-modal__metric-label {
  display: block;
  font-size: 0.72rem;
  color: var(--color-text-muted);
}

.pdp-modal__metric-val {
  font-size: 0.82rem;
  font-weight: 800;
}

.pdp-modal__row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-bottom: 10px;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: #fff;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.pdp-modal__row:hover {
  border-color: var(--color-border-strong);
  background: var(--color-bg-subtle);
}

.pdp-modal--focus-size .pdp-modal__row--size {
  border-color: var(--color-text);
  box-shadow: 0 0 0 2px rgba(30, 30, 25, 0.08);
}

.pdp-modal__row-icon {
  display: flex;
  color: var(--color-text-muted);
}

.pdp-modal__row-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.pdp-modal__row-text strong {
  font-size: 0.88rem;
  font-weight: 800;
}

.pdp-modal__row-text small {
  font-size: 0.72rem;
  color: var(--color-text-muted);
}

.pdp-modal__row--why {
  grid-template-columns: 1fr auto;
}

.pdp-modal__row-text--wide {
  width: 100%;
}

.pdp-modal__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.pdp-modal__chip {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--color-text);
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
}

.pdp-modal__size-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 6px 10px;
  border-radius: 10px;
  background: var(--color-text);
  color: #fff;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.1;
}

.pdp-modal__size-pill em {
  font-size: 0.62rem;
  font-style: normal;
  font-weight: 600;
  opacity: 0.85;
}

.pdp-modal__chev {
  font-size: 1.2rem;
  color: var(--color-text-subtle);
}

.pdp-modal__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.pdp-modal__btn {
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid var(--color-border);
}

.pdp-modal__btn--ghost {
  background: #fff;
  color: var(--color-text);
}

.pdp-modal__btn--primary {
  border-color: var(--color-text);
  background: var(--color-text);
  color: #fff;
}
