/* ==========================================================================
   若水文化 WAKAMIZU BUNKA — 手机菜单 B「色卡式」
   css/wk-menu-b-20261024.css
   --------------------------------------------------------------------------
   作用域：.wkm（#zh-menu / #ja-menu）。取代旧的 .menu / .menu__* 规则。
   只用站内已有 token（--wk-*、--pin-*、--fs-*、--header-h …），括号里是兜底值。

   布局（菜单在 ≥1024px 不出现，桌面用顶部导航）：
     · 手机竖屏            全屏；高度跟随可视区，长屏拉伸、短屏压缩
     · 手机横屏 / 矮屏     全屏；左门店、右六宫格两栏
     · 平板 600–1023px     右侧浮动面板 + 半透明遮罩
   动画：JS 在容器上切 data-state="opening → open → closing"。
   ========================================================================== */

/* ---------- 容器 ---------- */
.wkm {
  --wkm-x: max(var(--gutter, 20px), env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
  --wkm-gap: clamp(10px, 2.1dvh, 22px);
  --wkm-tile-gap: clamp(8px, 1.25dvh, 12px);
  --wkm-nail-ry: clamp(30px, 9.5vw, 46px);         /* 门店照片「甲形拱顶」的纵向半径 */
  --wkm-ease: var(--wk-fx-ease, cubic-bezier(.22, .61, .36, 1));
  --wkm-io: var(--wk-fx-io, cubic-bezier(.65, 0, .35, 1));
  --wkm-tape: var(--wk-fx-tape, rgba(242, 232, 142, .88));
  --wkm-bg:
    radial-gradient(70% 34% at 100% 0%, rgba(249, 206, 220, .5), rgba(249, 206, 220, 0) 70%),
    radial-gradient(70% 30% at 0% 100%, rgba(195, 234, 228, .55), rgba(195, 234, 228, 0) 70%),
    var(--wk-mist, #f5fbfa);

  position: fixed;
  inset: 0;
  z-index: var(--z-menu, 90);
  height: 100vh;
  height: 100dvh;
  box-sizing: border-box;
  padding-top: var(--header-h, 64px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--wkm-bg);
  color: var(--wk-ink, #22303a);
  font-family: var(--wk-font-body);
  opacity: 0;
  transition: opacity .28s var(--wkm-ease);
  -webkit-tap-highlight-color: transparent;
;--wk-emphasis-weight:var(--wk-body-strong-weight);--wk-medium-weight:var(--wk-body-medium-weight);--wk-semibold-weight:var(--wk-body-strong-weight);--wk-heavy-weight:var(--wk-body-strong-weight);}
.wkm[hidden] { display: none; }                      /* display:flex 会盖过 UA 的 [hidden]，必须写 */
.wkm[data-state="open"] { opacity: 1; }
.wkm[data-state="closing"] { opacity: 0; transition-duration: .2s; }

:where(.wkm) a { color: inherit; text-decoration: none; }   /* :where = 0 优先级，不压过色卡自己的颜色 */
.wkm :focus-visible {
  outline: 2px solid var(--wk-focus, #236864);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- 面板 / 滚动区（极端矮屏和放大文字时可滚动） ---------- */
.wkm__panel {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  padding: clamp(2px, .9dvh, 10px) var(--wkm-x) 0;
}
.wkm__body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: var(--wkm-gap);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  /* 负边距 + 内边距：给焦点框留位置，不被 overflow 裁掉 */
  margin: 0 calc(var(--wkm-x) * -1);
  padding: 4px var(--wkm-x) 2px;
}

/* ---------- 眉标 ---------- */
.wkm__eyebrow {
  flex: 0 0 auto;
  margin: 0;
  min-height: 22px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.wkm__dots { display: inline-flex; gap: 6px; }
.wkm__dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--wk-aqua-300, #a6dcd4); }
.wkm__dots i:nth-child(2) { background: var(--wk-petal-300, #f3b3c8); }
.wkm__dots i:nth-child(3) { background: var(--wk-lilac-300, #cabdf0); }
.wkm__eyebrow-en {
  margin-left: 6px;
  font-family: var(--wk-font-latin);
  font-style: italic;
  font-size: 1rem;
  letter-spacing: .02em;
  color: var(--wk-ink-3, #66727c);
;--wk-emphasis-weight:700;--wk-medium-weight:500;--wk-semibold-weight:600;--wk-heavy-weight:800;}

/* ---------- 旗下品牌 ---------- */
.wkm__salons {
  flex: 1.4 1 0;
  min-height: min-content;
  max-height: 384px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.wkm__salons-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
}
.wkm__salons-title {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--wk-font-display);
  font-weight:var(--wk-emphasis-weight);
  font-size: calc(clamp(1.0625rem, .95rem + .6vw, 1.25rem) * var(--title-up, 1.15));
  letter-spacing: var(--ls-head, .06em);
  line-height: 1.3;
;--wk-emphasis-weight:700;--wk-medium-weight:400;--wk-semibold-weight:700;--wk-heavy-weight:700;}
.wkm__more {
  flex: 0 1 auto;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-xs, .75rem);
  font-weight:var(--wk-emphasis-weight);
  letter-spacing: .04em;
  color: var(--wk-aqua-700, #236864);
}
.wkm__more svg { width: 14px; height: 14px; transition: transform .25s var(--wkm-ease); }

.wkm__stores {
  flex: 1 1 auto;
  min-height: min-content;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(8px, 2.6vw, 14px);
}
.wkm__stores > li { min-width: 0; min-height: 0; display: flex; }

.wkm-store {
  --pin: var(--wk-gold, #a07a50);
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(min-content, 1fr) auto auto;
  border-radius: 6px;
}
.wkm-store--emily { --pin: var(--pin-emily, #157c4f); }
.wkm-store--anna { --pin: var(--pin-anna, #3568b2); }
.wkm-store--cherry { --pin: var(--pin-cherry, #b63042); }

/* 甲形：上方椭圆拱顶（不是正圆），下方直角 */
.wkm-store__nail {
  position: relative;
  min-height: 78px;
  margin-bottom: 7px;
  overflow: hidden;
  isolation: isolate;
  border-radius: 50% 50% 0 0 / var(--wkm-nail-ry) var(--wkm-nail-ry) 0 0;
  background: var(--wk-petal-50, #fff3f6);
  transform: translateZ(0);
  transition: transform .2s var(--wkm-ease);
}
.wkm-store__nail img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  transition: transform .7s var(--wkm-ease);
}
.wkm-store--emily img { object-position: 30% 50%; }   /* 色板墙 */
.wkm-store--anna img { object-position: 38% 50%; }    /* 台灯与深蓝椅 */
.wkm-store--cherry img { object-position: 50% 58%; }  /* 作品：清透粉 */
.wkm-store__nail::after {                            /* 甲油胶的高光边 */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .5),
    inset 0 14px 18px -14px rgba(255, 255, 255, .95);
}
.wkm-store__name {
  min-width: 0;
  font-family: var(--wk-font-latin);
  font-size: clamp(.8125rem, .74rem + .35vw, .9375rem);
  line-height: 1.2;
  letter-spacing: .01em;
  text-wrap: balance;
  overflow-wrap: anywhere;
;--wk-emphasis-weight:700;--wk-medium-weight:500;--wk-semibold-weight:600;--wk-heavy-weight:800;}
.wkm-store__area {
  min-width: 0;
  margin-top: 2px;
  display: block;
  font-size: var(--fs-2xs, .6875rem);
  line-height: 1.4;
  letter-spacing: .02em;
  color: var(--wk-ink-2, #45535d);
  overflow-wrap: anywhere;
}
.wkm-store__area i { display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: var(--pin); vertical-align: .08em; }
.wkm-store[aria-current="page"] .wkm-store__nail {
  outline: 1.5px solid var(--wk-gold, #a07a50);
  outline-offset: 3px;
}

/* ---------- 六宫格色卡 ---------- */
.wkm__tiles {
  flex: 1.3 1 0;
  min-height: calc(3 * 64px + 2 * var(--wkm-tile-gap));
  max-height: calc(3 * 100px + 2 * var(--wkm-tile-gap));
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: var(--wkm-tile-gap);
}
.wkm__tiles > li { min-width: 0; min-height: 0; display: flex; }
.wkm__stores > li:nth-child(1), .wkm__tiles > li:nth-child(1) { --i: 0; }
.wkm__stores > li:nth-child(2), .wkm__tiles > li:nth-child(2) { --i: 1; }
.wkm__stores > li:nth-child(3), .wkm__tiles > li:nth-child(3) { --i: 2; }
.wkm__tiles > li:nth-child(4) { --i: 3; }
.wkm__tiles > li:nth-child(5) { --i: 4; }
.wkm__tiles > li:nth-child(6) { --i: 5; }

.wkm-tile {
  --tile: var(--wk-petal-100, #fde0ea);
  --tile-deep: var(--wk-petal-300, #f3b3c8);
  flex: 1 1 auto;
  min-width: 0;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  container-type: size;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 4px;
  box-sizing: border-box;
  padding: clamp(7px, 1dvh, 10px) 12px;
  border-radius: var(--r-md, 14px);
  background: linear-gradient(160deg, color-mix(in srgb, var(--tile) 55%, #fff) 0%, var(--tile) 72%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .8),
    inset 0 0 0 1px color-mix(in srgb, var(--tile-deep) 28%, transparent);
  color: var(--wk-ink, #22303a);
  transition: transform .2s var(--wkm-ease), box-shadow .25s var(--wkm-ease);
}
.wkm-tile--petal { --tile: var(--wk-petal-100, #fde0ea); --tile-deep: var(--wk-petal-300, #f3b3c8); }
.wkm-tile--lilac { --tile: var(--wk-lilac-100, #e8e1fa); --tile-deep: var(--wk-lilac-300, #cabdf0); }
.wkm-tile--aqua { --tile: var(--wk-aqua-100, #d5f1ec); --tile-deep: var(--wk-aqua-300, #a6dcd4); }
.wkm-tile--lemon { --tile: var(--wk-lemon-100, #fbf6d0); --tile-deep: var(--wk-lemon-300, #f2e88e); }
.wkm-tile--paper { --tile: var(--wk-paper, #fffdf8); --tile-deep: var(--wk-ink, #22303a); }
.wkm-tile--contact {
  background: linear-gradient(160deg, #2c7d77 0%, var(--wk-aqua-700, #236864) 70%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22);
  color: #fff;
}

/* 顶油光泽：面板打开时从左到右扫过一次 */
.wkm-tile::after {
  content: "";
  position: absolute;
  inset: -20% -60%;
  z-index: -1;
  background: linear-gradient(105deg, rgba(255, 255, 255, 0) 42%, rgba(255, 255, 255, .62) 50%, rgba(255, 255, 255, 0) 58%);
  opacity: 0;
  pointer-events: none;
}
.wkm-tile--contact::after { background: linear-gradient(105deg, rgba(255, 255, 255, 0) 42%, rgba(255, 255, 255, .22) 50%, rgba(255, 255, 255, 0) 58%); }

.wkm-tile__top { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; }
.wkm-tile__no {
  font-family: var(--wk-font-latin);
  font-style: italic;
  font-size: .75rem;
  color: var(--wk-gold-deep, #84623d);
;--wk-emphasis-weight:700;--wk-medium-weight:500;--wk-semibold-weight:600;--wk-heavy-weight:800;}
.wkm-tile__en {
  font-family: var(--wk-font-latin);
  font-size: .625rem;
  letter-spacing: var(--ls-label, .18em);
  text-transform: uppercase;
  color: var(--wk-ink-2, #45535d);
  overflow-wrap: anywhere;
;--wk-emphasis-weight:700;--wk-medium-weight:500;--wk-semibold-weight:600;--wk-heavy-weight:800;}
.wkm-tile__main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.wkm-tile__desc {
  display: none;
  font-size: var(--fs-2xs, .6875rem);
  line-height: 1.45;
  letter-spacing: .02em;
  color: var(--wk-ink-2, #45535d);
}
.wkm-tile__bottom { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.wkm-tile__zh {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--wk-font-display);
  font-weight:var(--wk-emphasis-weight);
  font-size: calc(clamp(1rem, .9rem + .7vw, 1.1875rem) * var(--title-up, 1.15));
  line-height: 1.3;
  letter-spacing: var(--ls-head, .06em);
;--wk-emphasis-weight:700;--wk-medium-weight:400;--wk-semibold-weight:700;--wk-heavy-weight:700;}
.wkm-tile__arrow { flex: 0 0 auto; width: 16px; height: 16px; transition: transform .25s var(--wkm-ease); }
.wkm-tile--contact :is(.wkm-tile__no, .wkm-tile__en, .wkm-tile__desc) { color: rgba(255, 255, 255, .86); }

/* 按 ZIP 原尺寸：内容区够高时显示说明，矮卡自动隐藏。 */
@container (min-height: 68px) {
  .wkm-tile__desc { display: block; }
}

/* 标题沿用站内横压比例，展开排版宽度后再缩放，保留可见文字的实际宽度。 */
.wkm__salons-title > .wkm__label,
.wkm-tile__zh > .wkm__label {
  display: block;
  width: calc(100% / var(--title-x, .85));
  transform: scaleX(var(--title-x, .85));
  transform-origin: left center;
}

/* ---------- 当前页：荧光笔 ---------- */
.wkm__label { position: relative; isolation: isolate; }
.wkm [aria-current="page"] .wkm__label::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: -.15em;
  right: -.15em;
  top: 52%;
  height: 46%;
  background: var(--wkm-tape);
  rotate: -1.2deg;
  transform-origin: 0 50%;
}

/* ---------- 底部 ---------- */
.wkm__foot {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  column-gap: 12px;
  padding: 2px 0 calc(4px + env(safe-area-inset-bottom, 0px));
  font-size: var(--fs-xs, .75rem);
  letter-spacing: .02em;
  color: var(--wk-ink-2, #45535d);
}
.wkm__foot a { display: inline-flex; align-items: center; min-height: 44px; max-width: 100%; overflow-wrap: anywhere; }
.wkm__foot [aria-hidden="true"] { opacity: .55; }

/* ---------- 交互 ---------- */
@media (hover: hover) and (pointer: fine) {
  .wkm-tile:hover {
    transform: translateY(-2px);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, .8),
      inset 0 0 0 1px color-mix(in srgb, var(--tile-deep) 40%, transparent),
      var(--wk-shadow-soft, 0 10px 30px -14px rgba(42, 70, 92, .28));
  }
  .wkm-tile:hover .wkm-tile__arrow,
  .wkm__salons-head:hover .wkm__more svg { transform: translateX(3px); }
  .wkm-store:hover .wkm-store__nail img { transform: scale(1.05); }
}
.wkm-tile:active { transform: scale(.975); transition-duration: .08s; }
.wkm-store:active .wkm-store__nail { transform: scale(.97); transition-duration: .08s; }

/* ---------- 打开动画（一次编排好的序列） ----------
   0.00s 底色淡入 → 0.06s 三色圆点弹出 → 0.14s 门店照片像刷甲油一样从下往上显现
   → 0.26s 色卡依次浮起 → 0.62s 顶油光泽扫过 → 0.70s 当前页荧光笔划出 */
.wkm[data-state="open"] .wkm__dots i { animation: wkm-pop .5s cubic-bezier(.34, 1.56, .64, 1) backwards; }
.wkm[data-state="open"] .wkm__dots i:nth-child(1) { animation-delay: .06s; }
.wkm[data-state="open"] .wkm__dots i:nth-child(2) { animation-delay: .12s; }
.wkm[data-state="open"] .wkm__dots i:nth-child(3) { animation-delay: .18s; }
.wkm[data-state="open"] .wkm__eyebrow-en,
.wkm[data-state="open"] .wkm__salons-head { animation: wkm-rise .45s var(--wkm-ease) .1s backwards; }
.wkm[data-state="open"] .wkm-store__nail { animation: wkm-polish .62s var(--wkm-io) calc(.14s + var(--i, 0) * .08s) backwards; }
.wkm[data-state="open"] .wkm-store__nail img { animation: wkm-settle 1.1s var(--wkm-ease) calc(.14s + var(--i, 0) * .08s) backwards; }
.wkm[data-state="open"] :is(.wkm-store__name, .wkm-store__area) { animation: wkm-rise .4s var(--wkm-ease) calc(.34s + var(--i, 0) * .08s) backwards; }
.wkm[data-state="open"] .wkm-tile { animation: wkm-rise .5s var(--wkm-ease) calc(.26s + var(--i, 0) * .045s) backwards; }
.wkm[data-state="open"] .wkm-tile::after { animation: wkm-gloss 1.15s var(--wkm-io) calc(.62s + var(--i, 0) * .07s) backwards; }
.wkm[data-state="open"] [aria-current="page"] .wkm__label::before { animation: wkm-tape .55s var(--wkm-ease) .7s backwards; }
.wkm[data-state="open"] .wkm__foot { animation: wkm-fade .5s ease .5s backwards; }

@keyframes wkm-fade { from { opacity: 0; } }
@keyframes wkm-rise { from { opacity: 0; transform: translate3d(0, 14px, 0) scale(.985); } }
@keyframes wkm-pop { 0% { opacity: 0; transform: scale(.2); } 70% { opacity: 1; transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes wkm-polish { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes wkm-settle { from { transform: scale(1.12); } }
@keyframes wkm-gloss { 0% { opacity: 0; transform: translateX(-70%); } 15%, 80% { opacity: 1; } 100% { opacity: 0; transform: translateX(70%); } }
@keyframes wkm-tape { from { transform: scaleX(0); } }
@keyframes wkm-slide { from { opacity: 0; transform: translate3d(24px, 0, 0); } }

/* ---------- 手机：头部透明，让菜单底色一直铺到状态栏 ---------- */
@media (max-width: 599px), (max-width: 1023px) and (max-height: 559px) {
  .site-header.menu-open {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

/* ---------- 窄屏（≤359px，如 iPhone SE 1 代） ---------- */
@media (max-width: 359px) {
  .wkm-tile { padding-inline: 10px; }
  .wkm-tile__zh { font-size: calc(.9375rem * var(--title-up, 1.15)); letter-spacing: .02em; }
  .wkm-tile__arrow { display: none; }
}

/* ---------- 竖屏但特别矮：按 ZIP 原尺寸再压一档 ---------- */
@media (max-height: 519px) and (orientation: portrait) {
  .wkm { --wkm-gap: 8px; --wkm-tile-gap: 7px; }
  .wkm__eyebrow { display: none; }
  .wkm-store__nail { min-height: 58px; margin-bottom: 4px; }
  .wkm__tiles { min-height: calc(3 * 54px + 2 * var(--wkm-tile-gap)); }
  .wkm-tile__top { display: none; }
}

/* ---------- 手机横屏 / 矮屏：两栏 ---------- */
@media (max-height: 559px) and (orientation: landscape) and (max-width: 1023px) {
  .wkm { --wkm-gap: 8px; --wkm-tile-gap: 8px; }
  .wkm__body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
    grid-template-rows: auto minmax(0, 1fr);
    column-gap: 18px;
    row-gap: 6px;
  }
  .wkm__eyebrow { grid-column: 1; grid-row: 1; }
  .wkm__salons { grid-column: 1; grid-row: 2; min-height: 150px; max-height: none; }
  .wkm__tiles {
    grid-column: 2;
    grid-row: 1 / 3;
    min-height: calc(3 * 50px + 2 * var(--wkm-tile-gap));
    max-height: none;
  }
  .wkm-store__nail { min-height: 56px; }
  .wkm__foot { padding-bottom: calc(2px + env(safe-area-inset-bottom, 0px)); }
  @media (max-width: 700px) {
    .wkm-tile__arrow { display: none; }
  }
}

/* ---------- 平板 600–1023px：右侧浮动面板 ---------- */
@media (min-width: 600px) and (max-width: 1023px) and (min-height: 560px) {
  .wkm {
    align-items: flex-end;
    padding:
      calc(var(--header-h, 64px) + 10px)
      max(14px, env(safe-area-inset-right, 0px))
      max(14px, env(safe-area-inset-bottom, 0px))
      max(14px, env(safe-area-inset-left, 0px));
    background: rgba(34, 48, 58, .28);
    -webkit-backdrop-filter: blur(6px) saturate(1.05);
    backdrop-filter: blur(6px) saturate(1.05);
  }
  .wkm__panel {
    --wkm-x: 22px;
    --wkm-nail-ry: 44px;
    width: min(440px, 100%);
    max-height: 880px;
    padding-top: 18px;
    border-radius: 26px;
    background: var(--wkm-bg);
    box-shadow: var(--wk-shadow-lift, 0 22px 48px -20px rgba(42, 70, 92, .38)), inset 0 0 0 1px rgba(255, 255, 255, .7);
  }
  .wkm[data-state="open"] .wkm__panel { animation: wkm-slide .45s var(--wkm-ease) backwards; }
  .wkm[data-state="closing"] .wkm__panel { transform: translate3d(14px, 0, 0); transition: transform .2s ease; }
  .wkm__foot { padding-bottom: 6px; }
}

@media (min-width: 1024px) {
  .wkm { display: none; }
}

/* ---------- 减少动态效果 ---------- */
@media (prefers-reduced-motion: reduce) {
  .wkm, .wkm *, .wkm *::before, .wkm *::after { animation: none !important; }
  .wkm { transition-duration: .12s; }
  .wkm-tile, .wkm-store__nail, .wkm-store__nail img, .wkm__panel { transition: none !important; }
}
