/* H5 移动端微调样式 */

/* 隐藏滚动条 (横滑分类栏用) */
.scrollbar-hide::-webkit-scrollbar { display: none; }
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }

/* iOS 安全区适配 */
body { padding-bottom: env(safe-area-inset-bottom); }

/* 行数截断 */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 点击高亮去除 */
* { -webkit-tap-highlight-color: transparent; }

/* 按钮点击反馈 */
button:active:not(:disabled), a:active { opacity: 0.7; }

/* input 去除 iOS 默认样式 */
input, textarea, select { -webkit-appearance: none; appearance: none; }

/* 图片轮播 snap 容器 */
.snap-x { scroll-snap-type: x mandatory; }
.snap-center { scroll-snap-align: center; }
.snap-x > img { scroll-snap-stop: always; }

/* 数字字体 */
.font-mono { font-family: 'SF Mono', Menlo, Consolas, monospace; }

/* 加载中骨架 */
@keyframes shimmer {
  0% { background-position: -200px 0; }
  100% { background-position: 200px 0; }
}
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 400px 100%;
  animation: shimmer 1.4s infinite;
}

/* 安全区按钮 */
@supports (padding: max(0px)) {
  .safe-bottom { padding-bottom: max(0.75rem, env(safe-area-inset-bottom)); }
}

/* safe-area 工具类 (替代内联 style) */
.safe-pt { padding-top: env(safe-area-inset-top); }
.safe-pt-sm { padding-top: calc(env(safe-area-inset-top) + 0.5rem); }
.safe-pb { padding-bottom: env(safe-area-inset-bottom); }
.safe-pb-sm { padding-bottom: calc(env(safe-area-inset-bottom) + 0.5rem); }
.safe-pb-md { padding-bottom: calc(env(safe-area-inset-bottom) + 1rem); }
.safe-pb-lg { padding-bottom: calc(env(safe-area-inset-bottom) + 1.5rem); }
.safe-pb-xl { padding-bottom: calc(env(safe-area-inset-bottom) + 2rem); }
.safe-pb-5rem { padding-bottom: calc(env(safe-area-inset-bottom) + 5rem); }
.safe-bottom-bar { padding-bottom: calc(env(safe-area-inset-bottom) + 4rem); }
.safe-bottom-float { bottom: calc(env(safe-area-inset-bottom) + 5rem); }
