/* =============================================================
   base.css —— 全站基础：单位、配色变量、重置、toast / loading
   尺寸单位说明：原站是 uni-app 的 rpx（750 设计宽），
   这里用 --u = min(100vw, 480px) / 750，写法 calc(96 * var(--u)) 即等于 96rpx。
   ============================================================= */
:root {
  --u: calc(min(100vw, 480px) / 750);

  /* 主题色（管理后台可覆盖，见 theme 配置） */
  --primary: #fce30f;
  --primary-disabled: #fff6a6;
  --text: #111318;
  --muted: #86909c;
  --input-bg: #f4f5f7;
  --tab-inactive-bg: #eceff3;
  --tab-inactive-text: #4e5969;

  --page-bg: #eef0f3;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--page-bg);
}

html {
  scrollbar-width: thin;
  scrollbar-color: #d9dde3 transparent;
}
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: #d9dde3; border-radius: 3px; }
::-webkit-scrollbar-track { background: transparent; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  color: var(--text);
}

/* 手机版：整页一列；桌面：居中白列，两侧灰底 */
.app {
  position: relative;
  width: min(100vw, 480px);
  margin: 0 auto;
  min-height: 100vh;
  background: #fff;
  overflow-x: hidden;
}
@supports (min-height: 100dvh) {
  .app { min-height: 100dvh; }
}

img { border: 0; }
input, button { font-family: inherit; }
input:focus, button:focus { outline: none; }

/* ---------------- toast（对齐 uni.showToast icon:none） ---------------- */
.xh-toast {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate3d(-50%, -50%, 0);
  max-width: 70vw;
  padding: 10px 16px;
  background: rgba(17, 17, 17, 0.78);
  color: #fff;
  font-size: 14px;
  line-height: 1.4;
  border-radius: 8px;
  text-align: center;
  word-break: break-word;
  z-index: 9999;
  animation: xh-fade-in 0.15s ease-out;
  pointer-events: none;
}
@keyframes xh-fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------------- loading ---------------- */
.xh-mask {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.02);
}
.xh-loading-box {
  min-width: 100px;
  padding: 14px 18px;
  background: rgba(17, 17, 17, 0.78);
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.xh-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-top-color: #fff;
  border-radius: 50%;
  animation: xh-spin 0.8s linear infinite;
}
@keyframes xh-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .xh-toast, .xh-spinner { animation: none; }
}

/* 顶部光晕背景（注册页 / 下载页共用）：原站 bg.svg 宽 100% */
.bg-top {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  z-index: 0;
  pointer-events: none;
}
.bg-img { width: 100%; display: block; }

.hidden { display: none !important; }
