/**
 * 16 型人格测试 · 网页版外壳样式
 *
 * 只负责「小程序外壳」和基础标签的默认样式：
 *   手机宽度的页面容器、导航栏、底部标签栏、Toast / Loading / Modal 浮层，
 *   以及 view / text / image / button / canvas 的默认表现。
 * 页面本身的样式来自小程序 WXSS（构建时转换后写进 app.css）。
 */

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  background: #d9dcec;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  overflow: hidden;
  color: #3a3a55;
}

* {
  -webkit-tap-highlight-color: transparent;
}

/* ---------------- 手机大小的外壳 ---------------- */

.mp-shell {
  --shell-w: min(100vw, 480px);
  --rpx: calc(var(--shell-w) / 750);
  --nav-h: calc(88 * var(--rpx));
  --tabbar-h: 0px;
  --shell-h: 100vh;
  --shell-h: 100dvh;
  --page-vh: calc(var(--shell-h) - var(--nav-h) - var(--tabbar-h));

  position: relative;
  display: flex;
  flex-direction: column;
  width: var(--shell-w);
  height: var(--shell-h);
  margin: 0 auto;
  overflow: hidden;
  background: #eef0fb;
  box-shadow: 0 0 60px rgba(40, 44, 80, 0.18);
  /* 让页面里 position:fixed 的悬浮按钮相对这个外壳定位，而不是整块屏幕 */
  transform: translateZ(0);
}

.mp-shell.mp-tabbar-on {
  --tabbar-h: calc(112 * var(--rpx));
}

/* ---------------- 导航栏 ---------------- */

.mp-nav {
  position: relative;
  z-index: 30;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  height: var(--nav-h);
  padding: 0 calc(12 * var(--rpx));
  background: #eef0fb;
  color: #111;
}

.mp-nav-light {
  color: #fff;
}

.mp-nav-back {
  width: calc(56 * var(--rpx));
  height: calc(56 * var(--rpx));
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.04);
  color: inherit;
  font-size: calc(40 * var(--rpx));
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.mp-nav-back[hidden] {
  display: none;
}

.mp-nav-title {
  position: absolute;
  left: 50%;
  top: 0;
  max-width: 62%;
  height: var(--nav-h);
  transform: translateX(-50%);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: calc(34 * var(--rpx));
  font-weight: 600;
  line-height: var(--nav-h);
  text-align: center;
}

/* ---------------- 页面滚动区 ---------------- */

.mp-page-root {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  background: #eef0fb;
}

.mp-page-root::-webkit-scrollbar {
  width: 5px;
}

.mp-page-root::-webkit-scrollbar-thumb {
  background: rgba(120, 120, 160, 0.25);
  border-radius: 3px;
}

#app-page {
  min-height: 100%;
}

/* ---------------- 底部标签栏 ---------------- */

.mp-tabbar {
  position: relative;
  z-index: 30;
  flex: 0 0 auto;
  display: none;
  height: var(--tabbar-h);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  background: #fff;
}

.mp-shell.mp-tabbar-on .mp-tabbar {
  display: flex;
}

.mp-tabbar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(4 * var(--rpx));
  color: #9a9ab8;
  cursor: pointer;
  user-select: none;
}

.mp-tabbar-icon {
  width: calc(48 * var(--rpx));
  height: calc(48 * var(--rpx));
  object-fit: contain;
}

.mp-tabbar-text {
  font-size: calc(20 * var(--rpx));
  line-height: 1.2;
}

/* ---------------- 小程序基础标签的默认样式 ---------------- */

view {
  display: block;
}

text {
  display: inline;
}

.mp-image {
  display: inline-block;
  vertical-align: top;
}

.mp-image[data-mode="aspectFill"] {
  object-fit: cover;
}

.mp-image[data-mode="aspectFit"] {
  object-fit: contain;
}

.mp-image[data-mode="scaleToFill"] {
  object-fit: fill;
}

.mp-image[data-mode="widthFix"] {
  width: 100%;
  height: auto;
}

canvas {
  display: block;
}

/* 微信 button 的默认样式，页面自己的 .btn 类会覆盖它 */
button {
  position: relative;
  display: block;
  margin: 0 auto;
  padding: 0 14px;
  box-sizing: border-box;
  border: none;
  border-radius: 5px;
  background: #f8f8f8;
  color: #000;
  font-family: inherit;
  font-size: 18px;
  line-height: 2.55;
  text-align: center;
  text-decoration: none;
  overflow: hidden;
  cursor: pointer;
}

button[disabled] {
  color: rgba(0, 0, 0, 0.3);
  background: rgba(0, 0, 0, 0.05);
  cursor: default;
}

.mp-btn-loading {
  opacity: 0.9;
}

.mp-btn-spinner {
  display: inline-block;
  width: 0.9em;
  height: 0.9em;
  margin-right: 0.35em;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  vertical-align: -0.1em;
  animation: mp-spin 0.8s linear infinite;
}

/* ---------------- 浮层：Toast / Loading / Modal ---------------- */

#app-overlays {
  position: absolute;
  inset: 0;
  z-index: 900;
  overflow: hidden;
  pointer-events: none;
}

.mp-toast {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  min-width: calc(180 * var(--rpx));
  max-width: 72%;
  padding: calc(24 * var(--rpx)) calc(32 * var(--rpx));
  border-radius: calc(16 * var(--rpx));
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: calc(28 * var(--rpx));
  line-height: 1.5;
  text-align: center;
}

.mp-toast-icon {
  font-size: calc(56 * var(--rpx));
  line-height: 1.2;
}

.mp-loading-mask {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.12);
  pointer-events: auto;
}

.mp-loading-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(18 * var(--rpx));
  min-width: calc(180 * var(--rpx));
  padding: calc(36 * var(--rpx)) calc(32 * var(--rpx));
  border-radius: calc(16 * var(--rpx));
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: calc(28 * var(--rpx));
}

.mp-spinner {
  width: calc(48 * var(--rpx));
  height: calc(48 * var(--rpx));
  border: calc(4 * var(--rpx)) solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: mp-spin 0.8s linear infinite;
}

@keyframes mp-spin {
  to {
    transform: rotate(360deg);
  }
}

.mp-modal-mask {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  pointer-events: auto;
}

.mp-modal {
  width: calc(560 * var(--rpx));
  max-width: 84%;
  overflow: hidden;
  border-radius: calc(16 * var(--rpx));
  background: #fff;
}

.mp-modal-title {
  padding: calc(44 * var(--rpx)) calc(40 * var(--rpx)) 0;
  color: #000;
  font-size: calc(34 * var(--rpx));
  font-weight: 600;
  text-align: center;
}

.mp-modal-content {
  padding: calc(24 * var(--rpx)) calc(40 * var(--rpx)) calc(44 * var(--rpx));
  color: #353535;
  font-size: calc(30 * var(--rpx));
  line-height: 1.6;
  text-align: center;
  white-space: pre-wrap;
  word-break: break-all;
}

.mp-modal-actions {
  display: flex;
  border-top: 1px solid #ededed;
}

.mp-modal-btn {
  flex: 1;
  height: calc(96 * var(--rpx));
  border: none;
  border-radius: 0;
  background: #fff;
  font-size: calc(32 * var(--rpx));
  line-height: 1;
  cursor: pointer;
}

.mp-modal-btn + .mp-modal-btn {
  border-left: 1px solid #ededed;
}

.mp-modal-cancel {
  color: #000;
}

.mp-modal-confirm {
  color: #576b95;
  font-weight: 600;
}

.mp-copy-input {
  position: absolute;
  left: -9999px;
  top: 0;
}

/* ---------------- 导航栏右侧：验证码剩余时间 ---------------- */

.mp-nav-status {
  position: relative;
  z-index: 1;
  margin-left: auto;
  margin-right: calc(8 * var(--rpx));
  padding: calc(4 * var(--rpx)) calc(16 * var(--rpx));
  border-radius: 999px;
  background: rgba(108, 92, 232, 0.12);
  color: #6c5ce8;
  font-size: calc(20 * var(--rpx));
  line-height: 1.7;
  white-space: nowrap;
  cursor: pointer;
}

.mp-nav-status[hidden] {
  display: none;
}

.mp-nav-status-ask {
  background: rgba(248, 93, 138, 0.14);
  color: #d4547e;
}

/* ---------------- 验证码验证页 ---------------- */

.mp-gate {
  position: absolute;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(48 * var(--rpx)) calc(40 * var(--rpx));
  overflow-y: auto;
  background: linear-gradient(160deg, #f4f0ff 0%, #fdeff6 55%, #eef0fb 100%);
}

.mp-gate[hidden] {
  display: none;
}

.mp-gate-card {
  position: relative;
  width: 100%;
  max-width: calc(620 * var(--rpx));
  padding: calc(56 * var(--rpx)) calc(44 * var(--rpx)) calc(48 * var(--rpx));
  border-radius: calc(36 * var(--rpx));
  background: #fff;
  box-shadow: 0 calc(20 * var(--rpx)) calc(60 * var(--rpx)) rgba(108, 92, 232, 0.16);
  text-align: center;
}

.mp-gate-back {
  position: absolute;
  top: calc(20 * var(--rpx));
  left: calc(20 * var(--rpx));
  height: calc(56 * var(--rpx));
  padding: 0 calc(18 * var(--rpx));
  border: none;
  border-radius: 999px;
  background: rgba(108, 92, 232, 0.08);
  color: #6c5ce8;
  font-family: inherit;
  font-size: calc(24 * var(--rpx));
  line-height: 1;
  cursor: pointer;
}

.mp-gate-back[hidden] {
  display: none;
}

.mp-gate-badge {
  width: calc(110 * var(--rpx));
  height: calc(110 * var(--rpx));
  margin: 0 auto calc(24 * var(--rpx));
  border-radius: 50%;
  background: linear-gradient(135deg, #9d7bf3 0%, #e86aa6 100%);
  color: #fff;
  font-size: calc(52 * var(--rpx));
  line-height: calc(110 * var(--rpx));
  box-shadow: 0 calc(10 * var(--rpx)) calc(26 * var(--rpx)) rgba(157, 123, 243, 0.35);
}

.mp-gate-app {
  color: #6c5ce8;
  font-size: calc(24 * var(--rpx));
  letter-spacing: calc(2 * var(--rpx));
}

.mp-gate-title {
  margin-top: calc(10 * var(--rpx));
  color: #3a3a55;
  font-size: calc(42 * var(--rpx));
  font-weight: 700;
  line-height: 1.35;
}

.mp-gate-desc {
  margin-top: calc(16 * var(--rpx));
  color: #6b6b85;
  font-size: calc(26 * var(--rpx));
  line-height: 1.7;
}

.mp-gate-field {
  margin-top: calc(36 * var(--rpx));
  padding: calc(6 * var(--rpx)) calc(20 * var(--rpx));
  border: calc(3 * var(--rpx)) solid rgba(108, 92, 232, 0.35);
  border-radius: calc(24 * var(--rpx));
  background: #fafaff;
}

.mp-gate-input {
  width: 100%;
  height: calc(88 * var(--rpx));
  border: none;
  outline: none;
  background: transparent;
  color: #3a3a55;
  font-family: inherit;
  font-size: calc(40 * var(--rpx));
  font-weight: 600;
  letter-spacing: calc(6 * var(--rpx));
  text-align: center;
  text-transform: uppercase;
}

.mp-gate-input::placeholder {
  color: #c3c4d8;
  font-size: calc(28 * var(--rpx));
  font-weight: 400;
  letter-spacing: calc(1 * var(--rpx));
}

.mp-gate-msg {
  min-height: calc(40 * var(--rpx));
  margin-top: calc(16 * var(--rpx));
  color: #6c5ce8;
  font-size: calc(24 * var(--rpx));
  line-height: 1.6;
}

.mp-gate-error {
  color: #e2555d;
}

.mp-gate-btn {
  width: 100%;
  height: calc(96 * var(--rpx));
  margin-top: calc(8 * var(--rpx));
  padding: 0;
  border: none;
  border-radius: calc(48 * var(--rpx));
  background: linear-gradient(135deg, #9d7bf3 0%, #e86aa6 100%);
  color: #fff;
  font-family: inherit;
  font-size: calc(32 * var(--rpx));
  font-weight: 600;
  letter-spacing: calc(1 * var(--rpx));
  line-height: 1;
  box-shadow: 0 calc(8 * var(--rpx)) calc(24 * var(--rpx)) rgba(157, 123, 243, 0.35);
  cursor: pointer;
}

.mp-gate-tip {
  margin-top: calc(28 * var(--rpx));
  color: #9a9ab8;
  font-size: calc(22 * var(--rpx));
  line-height: 1.8;
  white-space: pre-line;
}

/* 版本号：卖家确认页面是不是最新的一版 */
.mp-gate-version {
  margin-top: calc(14 * var(--rpx));
  color: #c3c4d8;
  font-size: calc(18 * var(--rpx));
  letter-spacing: calc(1 * var(--rpx));
}
