/* H5 基础样式：由小程序 app.wxss 换算而来（750rpx = 屏幕宽，1rpx = 0.1rem）
 * html font-size = min(视口宽,480px)/75 → 375px 宽时 1rem=5px，32rpx=3.2rem=16px */
html {
  font-size: calc(min(100vw, 480px) / 75);
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* 移动端隐藏滚动条（内容仍可滚动），保持原生 App 观感 */
*::-webkit-scrollbar { width: 0; height: 0; display: none; }
body {
  margin: 0;
  background: #E9EBEF;
  color: #1D2129;
  font-size: 2.8rem;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  overflow-x: hidden;
}
button, input { font-family: inherit; }
a { color: inherit; }
#app-shell {
  position: relative;
  width: min(100vw, 480px);
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background: #F5F6F8;
}
#page-root { height: 100%; }
.page {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #F5F6F8;
  animation: page-in .22s ease-out;
}
@keyframes page-in { from { opacity: 0; transform: translateY(1.6rem); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .page { animation: none; } }

/* ---- 三主题（与小程序 config/style.js + app.wxss 一致） ---- */
.theme-arco {
  --theme: #3E7BFA;
  --bg-grad: #F4F6FA;
  --mine-head: #FFFFFF;
  --brand-grad: linear-gradient(135deg, #6E9BFF, #2F6BFF);
  --brand-soft: #EDF2FF;
  --btn-shadow: 0 1.2rem 3.2rem rgba(62, 123, 250, .32);
  --card-radius: 3.2rem;
}
.theme-nebula {
  --theme: #E60012;
  --bg-grad: #E60012;
  --mine-head: linear-gradient(180deg, #E8383C 0%, #D40010 58%, #B0000E 100%);
  --brand-grad: radial-gradient(260% 360% at 16% -20%, rgba(255,255,255,.24) 0%, rgba(255,255,255,0) 55%),
                linear-gradient(160deg, #E8383C 0%, #D40010 58%, #B0000E 100%);
  --brand-soft: rgba(230, 0, 18, .07);
  --btn-shadow: 0 1.2rem 3.2rem rgba(230, 0, 18, .28);
  --card-radius: 3.2rem;
}
.theme-orange {
  --theme: #FF7D00;
  --bg-grad: #F5F6F8;
  --mine-head: linear-gradient(180deg, #FF9A2E 0%, #FF7D00 58%, #D96400 100%);
  --brand-grad: radial-gradient(260% 360% at 16% -20%, rgba(255,255,255,.24) 0%, rgba(255,255,255,0) 55%),
                linear-gradient(160deg, #FF9A2E 0%, #FF7D00 58%, #D96400 100%);
  --brand-soft: rgba(255, 125, 0, .07);
  --btn-shadow: 0 1.2rem 3.2rem rgba(255, 125, 0, .28);
  --card-radius: 3.2rem;
}

/* ---- 通用 ---- */
.mp-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 9.2rem;
  border-radius: 4.6rem;
  font-size: 2.9rem;
  font-weight: 600;
  letter-spacing: .04em;
  color: #fff;
  background: var(--brand-grad, var(--theme, #FF7D00));
  box-shadow: var(--btn-shadow, none);
  border: 0;
  cursor: pointer;
}
.mp-btn:active { opacity: .88; }
.mp-btn.ghost-dark { background: #F2F3F5; color: #4E5969; }
.hidden { display: none !important; }
.empty {
  padding: 8rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.6rem;
}
.empty .e-t { font-size: 2.6rem; font-weight: 600; color: #86909C; }
.empty .e-s { font-size: 2.3rem; color: #C9CDD4; }

/* H5 补充：原生导航被移除后的自绘顶栏（首页/我的为品牌栏，详情页为白底返回栏） */
.topnav {
  flex-shrink: 0;
  min-height: 8.8rem;
  padding: env(safe-area-inset-top) 2.8rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 1.6rem;
  background: var(--mine-head, var(--theme, #FF7D00));
  color: #fff;
}
.topnav.white { background: #fff; color: #1D2129; border-bottom: .2rem solid #F2F3F5; }
.topnav .nav-logo { width: 5.2rem; height: 5.2rem; border-radius: 1rem; object-fit: cover; background: #fff; }
.topnav .nav-title { font-size: 3.2rem; font-weight: 700; }
.topnav .nav-spacer { flex: 1; }
.topnav .nav-back {
  width: 5.2rem; height: 5.2rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.06); font-size: 3.8rem; line-height: 1; cursor: pointer;
}
.topnav.white .nav-back { background: #F2F3F5; }
.topnav .nav-back:active { opacity: .8; }
.topnav .nav-page-title { font-size: 3.1rem; font-weight: 600; }

/* ---- 轻提示（arco 风格，替代 wx.showToast） ---- */
.toast {
  position: absolute;
  left: 50%;
  top: 40%;
  transform: translate(-50%, -50%) scale(.94);
  max-width: 70%;
  padding: 1.6rem 2.4rem;
  border-radius: 1.2rem;
  background: rgba(29, 33, 41, .88);
  color: #fff;
  font-size: 2.6rem;
  line-height: 1.5;
  text-align: center;
  z-index: 400;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .18s, transform .18s;
}
.toast.show { opacity: 1; visibility: visible; transform: translate(-50%, -50%) scale(1); }

/* ---- 图片预览 ---- */
.lightbox {
  position: absolute;
  inset: 0;
  z-index: 380;
  background: rgba(0,0,0,.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  cursor: zoom-out;
}
.lightbox.show { opacity: 1; visibility: visible; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox .lb-close {
  position: absolute; top: 2rem; right: 2rem;
  color: #fff; font-size: 4rem; line-height: 1; cursor: pointer;
}
