/* ============================================================================
   extra.css —— 新前端自己补充的样式（原项目里由 uni-app / uv-ui 运行时提供的那部分）
   · 表单元素归一化（原 <input> 由 uni-input 包裹并提供内部样式）
   · toast / loading / 遮罩（原 uni.showToast / uni.showLoading）
   · 滚动容器（原 <scroll-view>）
   · hover-class 效果（原 uni-app hover-class 属性）
   · 少量工具类
   ============================================================================ */

/* ---------- 基础 ---------- */
html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;               /* 页面自身滚动由 .main-scroll 承担（与原 scroll-view 一致） */
  background-color: #050505;
}

#app {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

img {
  display: block;
}

/* ---------- 滚动容器（替代 <scroll-view scroll-y>） ---------- */
.main-scroll {
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}
/* 原 uni-app 由 uni-page-body 承担整页滚动；这里让页面根/滚动容器自己撑满并滚动 */
.page-container > .main-scroll {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  width: 100%;
}
/* 注册页没有 scroll-view（原页面靠页面本身滚动） */
.register-page {
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}
.main-scroll::-webkit-scrollbar,
.uni-scroll-view-scrollbar-hidden::-webkit-scrollbar {
  display: none;
}
.main-scroll {
  scrollbar-width: none;
}

/* ---------- 表单元素归一化 ---------- */
input,
textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: transparent;
  border: 0;
  outline: none;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
  line-height: normal;
}
input::placeholder,
textarea::placeholder {
  color: #a8a08f;                 /* 与原 placeholder-style="color: #a8a08f;" 一致 */
  opacity: 1;
}
input[type='number']::-webkit-outer-spin-button,
input[type='number']::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* ---------- toast（对应 uni.showToast） ---------- */
.app-toast {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  max-width: 70%;
  padding: 0.5rem 0.75rem;
  background: rgba(17, 17, 17, 0.9);
  color: #fff;
  font-size: 0.7rem;
  line-height: 1.35;
  border-radius: 0.3rem;
  text-align: center;
  z-index: 999999;
  word-break: break-all;
  pointer-events: none;
}
.app-toast--success::before {
  content: '✓';
  display: block;
  font-size: 1.1rem;
  margin-bottom: 0.2rem;
  color: #4cd964;
}

/* ---------- loading（对应 uni.showLoading，带 mask） ---------- */
.app-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 999990;
  display: flex;
  align-items: center;
  justify-content: center;
}
.app-loading {
  min-width: 5rem;
  padding: 0.75rem 0.6rem;
  background: rgba(17, 17, 17, 0.88);
  border-radius: 0.35rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.app-loading__text {
  margin-top: 0.35rem;
  color: #fff;
  font-size: 0.65rem;
  line-height: 1.3;
  text-align: center;
  max-width: 8rem;
}
.app-loading__spinner {
  width: 1.4rem;
  height: 1.4rem;
  animation: app-rotate 1s linear infinite;
}
.app-loading__dot {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
@keyframes app-rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ---------- 弹窗（替代 <uv-popup>，对应领取弹窗 ClaimPopup） ---------- */
.uv-popup {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.uv-popup__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
}
.uv-popup__content {
  position: relative;
  z-index: 1;
  max-width: 82%;
  box-sizing: border-box;
}
.uv-popup__content--center {
  margin: 0 auto;
}

/* ---------- hover-class（对应 uni-app 的 hover-class 属性） ---------- */
.app-hover {
  opacity: 0.72;
}

/* ---------- 工具类 ---------- */
.js-hidden { display: none !important; }
.js-nowrap { white-space: nowrap; }
.app-fade-in { animation: app-fade-in 0.25s ease both; }
@keyframes app-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
