/* ==========================================================================
   珍视福 · 一屏商城（mini）
   首页 / 分类 / 我的 —— 每页 100dvh，不许滚动
   沿用 tokens.css 的纸·墨·海蓝·玉·金
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img { display: block; }

body.mini {
  margin: 0;
  height: 100dvh;
  overflow: hidden;                 /* 一屏到底，不出现滚动条 */
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

.shell {
  height: 100dvh;
  max-width: 480px;
  margin-inline: auto;
  padding: max(14px, env(safe-area-inset-top)) 18px 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* 分类 / 我的：信息区吃掉剩余高度，tabbar 才贴得住底 */
body[data-page="cat"] .mmain,
body[data-page="me"] .mmain { flex: 1 1 auto; min-height: 0; }

/* ---------------- 顶栏 ---------------- */
.mhead {
  flex: none;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 6px 0 10px;
}
.mhead__brand { display: flex; align-items: center; gap: 9px; }
.mhead__brand img { height: 30px; width: auto; }
.mhead__brand span {
  font-size: 10px; letter-spacing: .18em; color: var(--ink-4);
  border-left: 1px solid var(--line); padding-left: 9px;
}
.mhead__act {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; letter-spacing: .08em; color: var(--ink-3);
  border-bottom: 1px solid transparent; padding-bottom: 2px;
}
.mhead__act:hover { color: var(--ink); border-color: var(--gold-2); }
.mhead__act svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.5; }

/* ---------------- 主区（吃掉剩余高度） ---------------- */
.mmain {
  flex: 0 0 auto;              /* 信息区按内容高，剩余高度全给产品图 */
  display: flex; flex-direction: column;
}

/* ---------------- 产品舞台 ---------------- */
.pstage {
  flex: 1 1 auto; min-height: 0;
  position: relative;
  display: grid; place-items: center;
  padding: 4px 0 2px;
  margin-inline: -18px;          /* 出血到屏幕边，产品可以更大 */
}
.pstage__ring {
  position: absolute; left: 50%; top: 50%;
  width: 92%; height: auto;
  transform: translate(-50%, -50%);
  color: var(--blue-300); opacity: .85; pointer-events: none;
}
.pstage__glow {
  position: absolute; left: 50%; top: 52%;
  width: 74%; aspect-ratio: 1; transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(127,182,210,.30), rgba(127,182,210,0) 64%);
  pointer-events: none;
}
.pstage img {
  position: relative;
  max-width: 100%; max-height: 100%;
  width: auto; height: auto;
  object-fit: contain;
  filter: drop-shadow(0 14px 22px rgba(8,40,60,.16));
}

/* ---------------- 产品信息 ---------------- */
.pinfo { flex: none; padding-top: 4px; }
.pinfo__name {
  margin: 0;
  font-family: var(--font-serif); font-size: 21px; font-weight: 700;
  letter-spacing: .03em; line-height: 1.3;
}
.pinfo__spec {
  margin: 5px 0 0;
  font-size: 12px; letter-spacing: .1em; color: var(--ink-4);
}
.pinfo__hook {
  margin: 8px 0 0;
  font-size: 13px; line-height: 1.6; color: var(--ink-2);
}
.pinfo__hook b { color: var(--jade); font-weight: 600; }

/* 价格行 */
.prow {
  flex: none;
  display: flex; align-items: baseline; gap: 8px;
  margin-top: 12px;
}
.prow i { font-style: normal; font-family: var(--font-latin); font-size: 14px; color: var(--ink-3); }
.prow b {
  font-family: var(--font-latin); font-size: 38px; font-weight: 400;
  line-height: 1; color: var(--blue-800); letter-spacing: -.01em;
}
.prow em {
  font-style: normal; font-size: 12px; color: var(--ink-4); letter-spacing: .04em;
}
.prow .prow__free {
  margin-left: auto; font-size: 11px; letter-spacing: .1em;
  color: var(--gold); border: 1px solid rgba(201,174,124,.5);
  padding: 3px 8px; border-radius: 2px;
}

/* 规格切换 */
.psku {
  flex: none;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin-top: 12px;
}
.psku button {
  padding: 9px 4px;
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 2px;
  color: var(--ink-3);
  font-size: 12px; letter-spacing: .04em;
  line-height: 1.35;
  transition: border-color .2s, background .2s, color .2s;
}
.psku button b {
  display: block; font-family: var(--font-latin);
  font-size: 15px; font-weight: 400; color: var(--ink); letter-spacing: 0;
}
.psku button.on {
  border-color: var(--blue-800);
  background: var(--blue-900);
  color: #CFDDE4;
}
.psku button.on b { color: #F2EDE2; }

/* ---------------- 按钮基类 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 18px;
  border: 1px solid transparent; border-radius: 2px;
  font-family: inherit; font-size: 14px; font-weight: 400;
  letter-spacing: .04em; line-height: 1.3;
  text-align: center; white-space: nowrap; cursor: pointer;
  transition: background .2s, border-color .2s, color .2s, box-shadow .2s;
}
.btn:disabled { opacity: .55; cursor: default; }
.btn:focus-visible { outline: 2px solid var(--blue-500); outline-offset: 2px; }
.btn--solid { background: var(--blue-900); border-color: var(--blue-900); color: #F2EDE2; }
.btn--solid:hover { background: var(--blue-800); }
.btn--ghost-dark { background: transparent; border-color: var(--line); color: var(--ink-2); }
.btn--ghost-dark:hover { border-color: var(--ink-3); color: var(--ink); }

/* 主按钮 */
.pbuy {
  flex: none;
  margin-top: 14px;
}
.pbuy .btn { width: 100%; justify-content: center; min-height: 54px; font-size: 16px; letter-spacing: .04em; }
.pbuy .btn--solid { background: var(--blue-900); border-color: var(--blue-900); color: #F2EDE2; }
.pbuy .btn--solid:hover { background: var(--blue-800); }
.pbuy__note {
  display: block; margin-top: 7px;
  font-size: 10.5px; line-height: 1.5; color: var(--ink-4);
  text-align: center; letter-spacing: .04em;
}

/* ---------------- 底部服务保障条（分类 / 我的 收尾） ---------------- */
.mfoot {
  flex: none;
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 12px; padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  font-size: 10.5px; letter-spacing: .14em; color: var(--ink-4);
}
.mfoot span { display: inline-flex; align-items: center; gap: 5px; }
.mfoot svg { width: 13px; height: 13px; stroke: var(--gold); fill: none; stroke-width: 1.5; }
.mfoot--wide { display: none; }   /* 只在桌面版放进右栏底部 */

/* ---------------- 底部 tabbar ---------------- */
.tabbar {
  flex: none;
  display: grid; grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  margin-top: 10px;
  padding-bottom: max(6px, env(safe-area-inset-bottom));
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 0 4px;
  font-size: 10.5px; letter-spacing: .1em; color: var(--ink-4);
}
.tabbar svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.4; }
.tabbar a.on { color: var(--blue-800); }
.tabbar a.on svg { stroke-width: 1.9; }

/* ---------------- 分类页 ---------------- */
.cats {
  flex: none;
  display: flex; gap: 8px; overflow-x: auto;
  padding: 2px 0 12px;
  scrollbar-width: none;
}
.cats::-webkit-scrollbar { display: none; }
.cats button {
  flex: none; padding: 7px 15px;
  border: 1px solid var(--line); border-radius: 999px;
  font-size: 12.5px; letter-spacing: .06em; color: var(--ink-3);
  background: transparent; transition: all .2s;
}
.cats button.on { background: var(--blue-900); border-color: var(--blue-900); color: #F2EDE2; }

.glist {
  flex: 1 1 auto; min-height: 0;
  overflow: hidden;
  display: flex; flex-direction: column; gap: 10px;
}
.gcard {
  display: grid; grid-template-columns: 96px 1fr;
  gap: 14px; align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--paper-2);
}
.gcard__ph {
  position: relative;
  width: 96px; height: 96px; border-radius: 2px; overflow: hidden;
  background: var(--blue-900);
  display: grid; place-items: center;
  padding: 5px;
}
.gcard__tag {
  position: absolute; left: 3px; bottom: 3px;
  font-style: normal; font-size: 9.5px; letter-spacing: .06em; line-height: 1;
  color: #F2EDE2; background: rgba(8,40,60,.78);
  padding: 3px 5px; border-radius: 2px;
}
.gcard__ph img { width: 100%; height: 100%; object-fit: contain; }
.gcard__nm {
  margin: 0; font-family: var(--font-serif); font-size: 15px;
  font-weight: 700; line-height: 1.4; letter-spacing: .02em;
}
.gcard__sp { margin: 4px 0 0; font-size: 11px; color: var(--ink-4); }
.gcard__row { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.gcard__pr { font-family: var(--font-latin); font-size: 20px; color: var(--blue-800); }
.gcard__pr i { font-style: normal; font-size: 11px; color: var(--ink-3); margin-right: 2px; }
.gcard__go {
  margin-left: auto; padding: 7px 16px;
  background: var(--blue-900); color: #F2EDE2;
  font-size: 12.5px; letter-spacing: .06em; border-radius: 2px;
}
.gempty {
  flex: 1 1 auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; text-align: center; padding-bottom: 12px;
}
.gempty b { font-family: var(--font-serif); font-size: 16px; font-weight: 700; color: var(--ink-2); }
.gempty span { font-size: 12px; line-height: 1.7; color: var(--ink-4); max-width: 260px; }
.gempty a {
  margin-top: 4px; padding-bottom: 2px;
  font-size: 12.5px; letter-spacing: .06em; color: var(--blue-700);
  border-bottom: 1px solid rgba(18,79,112,.35);
}

/* ---------------- 我的 ---------------- */
.mecard {
  flex: none;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--paper-2);
  padding: 16px;
}
.mecard__top { display: flex; align-items: baseline; gap: 10px; }
.mecard__phone {
  font-family: var(--font-latin); font-size: 22px; color: var(--ink);
  letter-spacing: .02em;
}
.mecard__tier {
  font-size: 11px; letter-spacing: .12em; color: var(--gold);
  border: 1px solid rgba(201,174,124,.5); padding: 2px 7px; border-radius: 2px;
}
.mecard__id { margin: 8px 0 0; font-size: 11px; letter-spacing: .1em; color: var(--ink-4); }

/* 未登录态：卡片竖向居中，别顶在上半截 */
#meBox.is-guest { justify-content: center; }
.mecard__hello {
  margin: 0 0 6px; font-family: var(--font-serif);
  font-size: 19px; font-weight: 700; letter-spacing: .02em; color: var(--ink);
}
.mecard__hint { margin: 0 0 16px; font-size: 12.5px; line-height: 1.7; color: var(--ink-4); }
.mecard__login { width: 100%; min-height: 50px; font-size: 15px; margin-bottom: 4px; }
.mecard__stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  margin-top: 14px; padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}
.mecard__stats div { text-align: center; border-right: 1px solid var(--line-soft); }
.mecard__stats div:last-child { border-right: 0; }
.mecard__stats b {
  display: block; font-family: var(--font-latin);
  font-size: 19px; font-weight: 400; color: var(--blue-800);
}
.mecard__stats span { font-size: 10.5px; letter-spacing: .1em; color: var(--ink-4); }

.melist {
  flex: 1 1 auto; min-height: 0;
  overflow: hidden;
  display: flex; flex-direction: column;
  margin-top: 12px;
  border-top: 1px solid var(--line-soft);
}
#meOut { margin-top: auto; color: var(--ink-3); }

/* #meBox 是 mmain 与卡片/列表之间的隔层，必须也参与 flex，否则 melist 长不高 */
body[data-page="me"] #meBox {
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column;
}
.melist a, .melist button {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 14px 2px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 14px; letter-spacing: .04em; color: var(--ink-2);
  text-align: left;
}
.melist a:active, .melist button:active { background: var(--paper-2); }
.melist i {
  font-style: normal; margin-left: auto;
  font-size: 11.5px; color: var(--ink-4); letter-spacing: .04em;
}
.melist .arw { width: 14px; height: 14px; stroke: var(--ink-4); fill: none; stroke-width: 1.6; }

/* 最近订单 */
.morder {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 2px; border-bottom: 1px solid var(--line-soft);
  font-size: 12.5px; color: var(--ink-2);
}
.morder b { font-family: var(--font-latin); font-size: 14px; color: var(--ink); }
.morder .st {
  margin-left: auto; font-size: 11px; letter-spacing: .06em;
  padding: 2px 7px; border-radius: 2px;
  border: 1px solid var(--line); color: var(--ink-3);
}
.morder .st.is-ok { color: var(--jade); border-color: rgba(90,148,64,.45); }

/* ---------------- 弹层（地址 / 确认 / 结果） ---------------- */
.msheet { position: fixed; inset: 0; z-index: 120; }
.msheet[hidden] { display: none; }
.msheet__mask {
  position: absolute; inset: 0; background: rgba(8,40,60,.42);
  backdrop-filter: blur(3px);
}
.msheet__box {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-width: 480px; margin-inline: auto;
  background: var(--paper);
  border-top: 1px solid var(--line);
  border-radius: 10px 10px 0 0;
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
  max-height: 86dvh; overflow: auto;
  animation: mUp .28s var(--ease) both;
}
@keyframes mUp { from { transform: translateY(24px); opacity: 0 } to { transform: none; opacity: 1 } }
.msheet__kick {
  margin: 0 0 6px; font-size: 10.5px; letter-spacing: .26em;
  color: var(--gold); text-transform: uppercase;
}
.msheet__t {
  margin: 0 0 14px; font-family: var(--font-serif);
  font-size: 19px; font-weight: 700; letter-spacing: .02em;
}
.msheet__note {
  margin: 12px 0 0; font-size: 11px; line-height: 1.7; color: var(--ink-4);
}

.msum { border-top: 1px solid var(--line); }
.msum > div {
  display: flex; align-items: baseline; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
}
.msum dt { flex: none; width: 52px; margin: 0; font-size: 11px; letter-spacing: .16em; color: var(--ink-4); }
.msum dd { margin: 0; color: var(--ink-2); line-height: 1.6; }
.msum dd b { font-family: var(--font-latin); font-size: 18px; color: var(--ink); }

.mfield { margin-bottom: 10px; }
.mfield label { display: block; font-size: 11px; letter-spacing: .14em; color: var(--ink-4); margin-bottom: 5px; }
.mfield input, .mfield textarea {
  width: 100%; padding: 11px 12px;
  border: 1px solid var(--line); border-radius: 2px;
  background: #fff; color: var(--ink);
  font-family: inherit; font-size: 14px;
}
.mfield textarea { resize: none; height: 68px; }
.mfield input:focus, .mfield textarea:focus {
  outline: none; border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(29,111,156,.1);
}

.msheet__act { display: flex; gap: 10px; margin-top: 16px; }
.msheet__act .btn { flex: 1; justify-content: center; min-height: 48px; }
.msheet__act .btn--solid { background: var(--blue-900); border-color: var(--blue-900); color: #F2EDE2; }

/* ---------------- 轻提示 ---------------- */
.mtoast {
  position: fixed; left: 50%; top: max(16px, env(safe-area-inset-top)); z-index: 130;
  transform: translate(-50%, -8px);
  max-width: 80vw; padding: 10px 18px;
  background: var(--blue-900); color: #F2EDE2;
  font-size: 12.5px; letter-spacing: .04em;
  border-radius: 2px; opacity: 0; pointer-events: none;
  transition: opacity .26s var(--ease), transform .26s var(--ease);
}
.mtoast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------------- 桌面：两栏，仍然一屏 ---------------- */
@media (min-width: 900px) {
  .shell {
    max-width: 1060px;
    padding: 26px 32px 24px;
    display: grid;
    grid-template-columns: 1.02fr .98fr;
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas: "head head" "stage info";
    column-gap: clamp(28px, 4vw, 64px);
    height: 100dvh;
  }
  .mhead { grid-area: head; padding-bottom: 18px; border-bottom: 1px solid var(--line-soft); }
  .pstage { grid-area: stage; margin-inline: 0; }
  .mmain { grid-area: info; align-self: center; padding-top: 0; }
  .pinfo__name { font-size: 27px; }
  .pinfo__spec { font-size: 13px; }
  .pinfo__hook { font-size: 14px; }
  .prow b { font-size: 46px; }
  .psku button { padding: 11px 6px; font-size: 13px; }
  .psku button b { font-size: 17px; }
  .pbuy { margin-top: 18px; }
  .pbuy .btn { min-height: 56px; }
  .mfoot--wide { display: flex; margin-top: 26px; }
  .mmain > .pinfo,
  .mmain > .prow,
  .mmain > .psku,
  .mmain > .pbuy { }
  .tabbar { display: none; }
  .mhead__nav { display: flex; gap: 26px; margin-left: auto; margin-right: 18px; }
  .mhead__nav a { font-size: 13px; letter-spacing: .06em; color: var(--ink-3); }
  .mhead__nav a.on { color: var(--ink); border-bottom: 1px solid var(--gold-2); padding-bottom: 2px; }

  /* 分类 / 我的：中间一栏，仍然不滚动 */
  .shell--mid {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas: "head" "main";
    max-width: 720px;
  }
  /* 关键：.mmain 不能再居中，否则整块沉到屏幕中间、上下都空 */
  .shell--mid .mmain { grid-area: main; padding-top: 26px; align-self: stretch; }
  .gcard { padding: 16px; grid-template-columns: 116px 1fr; gap: 18px; }
  .gcard__ph { width: 116px; height: 116px; }
  .gcard__nm { font-size: 17px; }
  .gcard__pr { font-size: 24px; }
  .mecard { padding: 22px; }
  .mecard__phone { font-size: 25px; }
  .mecard__stats b { font-size: 22px; }
  .melist a, .melist button { padding: 17px 2px; font-size: 15px; }
  .morder { padding: 14px 2px; }
}
.mhead__nav { display: none; }

/* 极矮屏（如横屏 / SE）时再压一档 */
@media (max-height: 700px) and (max-width: 899px) {
  .pinfo__name { font-size: 19px; }
  .prow b { font-size: 32px; }
  .psku button { padding: 7px 4px; }
  .pbuy .btn { min-height: 46px; }
  .tabbar a { padding: 6px 0 2px; }
  .pinfo__hook { margin-top: 6px; }
  .prow { margin-top: 9px; }
  .psku { margin-top: 9px; }
  .pbuy { margin-top: 10px; }
  .tabbar { margin-top: 8px; }
}

@media (max-height: 640px) and (max-width: 899px) {
  .mecard { padding: 13px; }
  .mecard__phone { font-size: 19px; }
  .mecard__stats { margin-top: 11px; padding-top: 11px; }
  .mecard__stats b { font-size: 17px; }
  .melist { margin-top: 8px; }
  .melist a, .melist button { padding: 10px 2px; font-size: 13px; }
  .morder { padding: 9px 2px; }
  .cats { padding-bottom: 9px; }
  .gcard { padding: 9px; }
  .gcard__ph { width: 78px; height: 78px; }
}

/* ---------------- 付款方式（2026-10-26 全线上支付） ---------------- */
.mpay { margin: 14px 0 2px; }
.mpay__t {
  font-size: 11px; letter-spacing: .16em; color: var(--ink-4);
  margin-bottom: 8px;
}
.mpay__o {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px; margin-bottom: 8px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 2px;
  background: var(--paper);
  transition: border-color var(--t-fast, 150ms) ease, background var(--t-fast, 150ms) ease;
}
.mpay__o.on { border-color: var(--blue-500); background: var(--paper-2); }
.mpay__o.is-off { opacity: .45; cursor: not-allowed; }
.mpay__o input {
  appearance: none; -webkit-appearance: none;
  width: 15px; height: 15px; flex: none; margin: 0;
  border: 1px solid var(--ink-4); border-radius: 50%;
  position: relative;
}
.mpay__o input:checked { border-color: var(--blue-500); border-width: 4px; }
.mpay__n {
  display: block; font-size: 14px; color: var(--ink); font-weight: 600;
  line-height: 1.35;
}
.mpay__n small {
  display: block; font-size: 11.5px; font-weight: 400; color: var(--ink-4);
  margin-top: 2px; letter-spacing: 0;
}
@media (max-height: 700px) {
  .mpay__o { padding: 9px 11px; margin-bottom: 6px; }
  .mpay { margin-top: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .msheet__box { animation: none; }
  .mtoast { transition: none; }
}
