/* ========== 网页外壳 ==========
   base.css / pages.css 由小程序样式转换而来（100rpx = 1rem），这里放网页专用的部分和覆盖。
   手机上铺满屏幕；桌面上居中成一个 480px 宽的手机竖屏。 */
html {
  font-size: calc(min(100vw, 480px) / 7.5);
  -webkit-text-size-adjust: 100%;
}
:root { --side: max(0px, calc((100vw - 480px) / 2)); }
body { margin: 0; min-height: 100vh; }
#app { position: relative; max-width: 480px; min-height: 100vh; margin: 0 auto; background: #ffffff; }
@media (min-width: 520px) {
  body { background: #ebebeb; }
  #app { box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04), 0 24px 80px rgba(0, 0, 0, 0.08); }
}

* { -webkit-tap-highlight-color: transparent; }
img { display: block; max-width: 100%; }
input, textarea, button { font: inherit; color: inherit; background: none; border: 0; outline: 0; margin: 0; padding: 0; -webkit-appearance: none; appearance: none; }
textarea { resize: none; }
.circle-btn img { width: 0.48rem; height: 0.48rem; } /* 小程序里是 .circle-btn image */
.fit-cover { object-fit: cover; }
.fit-contain { object-fit: contain; }
[data-tap] { cursor: pointer; user-select: none; -webkit-user-select: none; }
[data-tap]:not(.mask):not(.no-press):active { opacity: 0.72; }
body.lock { overflow: hidden; }
.hidden { display: none !important; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  height: 0.88rem;
  padding-top: env(safe-area-inset-top);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
}
.topbar-title { font-size: 0.32rem; font-weight: 700; }
.topbar-back {
  position: absolute;
  left: 0.12rem;
  bottom: 0;
  width: 0.88rem;
  height: 0.88rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 300;
  line-height: 1;
}
.topbar-brand {
  position: absolute;
  left: 0.56rem;
  bottom: 0.22rem;
  font-size: 0.3rem;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.02rem;
}

/* ---------- 固定在底部的东西，桌面上要跟着中间那一栏 ---------- */
.tabbar, .sheet, .p-today .actions, .p-log .foot, .p-onboarding .ob-foot { left: var(--side) !important; right: var(--side) !important; }

/* 小程序里的横向 scroll-view */
.p-today .strip, .p-progress .drops { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.p-today .strip::-webkit-scrollbar, .p-progress .drops::-webkit-scrollbar { display: none; }
.p-today .strip { position: relative; }

/* 输入框字号不小于 16px，避免 iOS 聚焦时自动放大 */
.p-log .search-input, .p-log .say-input { font-size: max(16px, 0.3rem); }
.p-log .say-input { display: block; width: 100%; min-height: 1.4rem; }
.p-log .search-input { height: 0.92rem; }
.p-log .photo-pick { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--grey); font-size: 0.26rem; }

/* ---------- 滚轮选择器（替代小程序的 picker-view） ---------- */
.wheels { position: relative; display: flex; height: 4rem; margin-top: 0.16rem; }
.wheels::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 1.56rem;
  height: 0.88rem;
  border-top: 2px solid #ececec;
  border-bottom: 2px solid #ececec;
  pointer-events: none;
}
.wheel {
  flex: 1;
  height: 4rem;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  overscroll-behavior: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  -webkit-mask-image: linear-gradient(transparent, #000 32%, #000 68%, transparent);
  mask-image: linear-gradient(transparent, #000 32%, #000 68%, transparent);
}
.wheel::-webkit-scrollbar { display: none; }
.wheel-pad { height: 1.56rem; }
.wheel-item {
  height: 0.88rem;
  line-height: 0.88rem;
  text-align: center;
  font-size: 0.44rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  scroll-snap-align: center;
  color: #c4c4c4;
  cursor: pointer;
}
.wheel-item.on { color: #111111; }

/* ---------- 提示、对话框、操作菜单 ---------- */
.ui-toast {
  position: fixed;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  max-width: 72vw;
  padding: 12px 18px;
  border-radius: 14px;
  background: rgba(17, 17, 17, 0.92);
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
  z-index: 300;
  pointer-events: none;
  animation: ui-pop 0.18s ease-out;
}
.ui-mask { position: fixed; left: 0; right: 0; top: 0; bottom: 0; background: rgba(17, 17, 17, 0.45); z-index: 200; animation: ui-fade 0.15s ease-out; }
.ui-modal {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(84vw, 360px);
  box-sizing: border-box;
  padding: 24px 22px 18px;
  border-radius: 24px;
  background: #ffffff;
  z-index: 201;
  animation: ui-pop 0.18s ease-out;
}
.ui-modal-title { font-size: 18px; font-weight: 800; text-align: center; line-height: 1.4; }
.ui-modal-content { margin-top: 10px; font-size: 14px; line-height: 1.6; color: #3a3a3a; text-align: center; white-space: pre-wrap; word-break: break-all; }
.ui-modal-input { display: block; width: 100%; box-sizing: border-box; height: 46px; margin-top: 14px; padding: 0 14px; border-radius: 12px; background: #f2f2f2; font-size: 16px; }
.ui-modal-actions { display: flex; margin-top: 18px; }
.ui-btn { flex: 1; height: 46px; border-radius: 999px; font-size: 15px; font-weight: 800; cursor: pointer; }
.ui-btn-cancel { background: #f2f2f2; color: #111111; }
.ui-btn-ok { background: #111111; color: #ffffff; }
.ui-btn-cancel + .ui-btn-ok { margin-left: 10px; }
.ui-sheet {
  position: fixed;
  left: var(--side);
  right: var(--side);
  bottom: 0;
  padding: 10px 16px calc(16px + env(safe-area-inset-bottom));
  border-radius: 24px 24px 0 0;
  background: #ffffff;
  z-index: 201;
  animation: sheet-up 0.22s ease-out;
}
.ui-sheet-item { height: 54px; line-height: 54px; text-align: center; font-size: 16px; font-weight: 700; border-bottom: 1px solid #f0f0f0; cursor: pointer; }
.ui-sheet-cancel { margin-top: 10px; height: 50px; line-height: 50px; text-align: center; font-size: 15px; color: #9a9a9a; background: #f2f2f2; border-radius: 999px; cursor: pointer; }
@keyframes ui-pop {
  from { opacity: 0; transform: translate(-50%, -46%); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}
@keyframes ui-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---------- 运动 ---------- */
.p-today .ex-card.is-empty .meal-icon { opacity: 0.55; }
.p-today .ex-head { display: flex; align-items: center; }
.p-today .ex-head-img { width: 1.3rem; height: 1.9rem; margin-right: 0.24rem; flex-shrink: 0; }
.p-today .ex-kinds { display: flex; flex-wrap: wrap; margin-top: 0.28rem; }
.p-today .ex-chip { background: var(--card); }
.p-today .ex-chip.on { background: #111111; color: #ffffff; }
.p-today .ex-mins { font-size: 0.8rem; line-height: 1.1; margin-top: 0.08rem; text-align: center; }
.p-today .ex-steps {
  display: block;
  width: 100%;
  box-sizing: border-box;
  height: 1.1rem;
  margin-top: 0.24rem;
  padding: 0 0.3rem;
  border-radius: 0.28rem;
  background: var(--card);
  font-size: max(16px, 0.44rem);
  font-weight: 800;
  text-align: center;
}
.p-today .ex-empty { display: flex; align-items: center; margin-top: 0.16rem; }
.p-today .ex-empty-img { width: 1.1rem; height: 1.6rem; margin-right: 0.2rem; }
.p-progress .week-ex { margin-top: 0.12rem; }

/* ---------- 网页独有：微信内打开提示、恢复码 ---------- */
.web-banner {
  margin: 0.2rem 0.56rem 0;
  padding: 0.18rem 0.24rem;
  border-radius: 0.24rem;
  background: #111111;
  color: #ffffff;
  font-size: 0.24rem;
  line-height: 1.5;
  display: flex;
  align-items: center;
}
.web-banner-text { flex: 1; }
.web-banner-close { margin-left: 0.2rem; color: #d6ff3c; font-weight: 800; }
.code-box {
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  background: #111111;
  color: #d6ff3c;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 1px;
  word-break: break-all;
  text-align: center;
}
