/* mp.css — H5 运行时基础样式（重置 + 系统弹窗/提示） */
html, body {
  margin: 0;
  padding: 0;
  background: #e9ebf2;
  -webkit-tap-highlight-color: transparent;
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', 'Microsoft YaHei', sans-serif;
}

body {
  overscroll-behavior: none;
}

#mp-app {
  min-height: 100vh;
  box-sizing: border-box;
}

/* 微信原生控件观感重置 */
button {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  background: transparent;
  margin: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  line-height: inherit;
  text-align: center;
  border-radius: 0;
}
button::after {
  border: none;
}
input, textarea {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  outline: none;
  background: transparent;
  font: inherit;
  color: inherit;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
img {
  border: none;
  vertical-align: middle;
}
a {
  text-decoration: none;
  color: inherit;
}

/* scroll-view 容器 */
[data-mp-scroll] {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* button.loading 中的小转圈 */
.mp-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
}
.mp-loading::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0.8em;
  height: 0.8em;
  margin: -0.4em 0 0 -1.4em;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: mp-spin 0.8s linear infinite;
}
@keyframes mp-spin {
  to { transform: rotate(360deg); }
}

/* Toast */
.mp-toast {
  position: fixed;
  left: 50%;
  top: 45%;
  transform: translate(-50%, -50%);
  background: rgba(17, 17, 17, 0.82);
  color: #fff;
  border-radius: 12px;
  padding: 20px 26px;
  max-width: 70vw;
  z-index: 9999;
  text-align: center;
  font-size: 15px;
  line-height: 1.5;
  animation: mp-fade-in 0.2s ease-out;
  transition: opacity 0.3s ease;
}
.mp-toast-hide { opacity: 0; }
.mp-toast-icon {
  width: 38px;
  height: 38px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: #07c160;
  color: #fff;
  font-size: 24px;
  line-height: 38px;
  text-align: center;
  font-weight: bold;
}
.mp-toast-text { white-space: pre-wrap; word-break: break-all; }
@keyframes mp-fade-in {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.92); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* Modal */
.mp-modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: mp-mask-in 0.2s ease-out;
}
@keyframes mp-mask-in { from { opacity: 0; } to { opacity: 1; } }
.mp-modal {
  width: 78vw;
  max-width: 320px;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  text-align: center;
  animation: mp-modal-in 0.2s ease-out;
}
@keyframes mp-modal-in {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}
.mp-modal-title {
  font-size: 17px;
  font-weight: 600;
  color: #111;
  padding: 22px 20px 8px;
}
.mp-modal-content {
  font-size: 14px;
  color: #666;
  padding: 10px 22px 22px;
  line-height: 1.6;
  white-space: pre-wrap;
  text-align: left;
  word-break: break-word;
}
.mp-modal-btns {
  display: flex;
  border-top: 0.5px solid #e5e5e5;
}
.mp-modal-btn {
  flex: 1;
  height: 48px;
  line-height: 48px;
  font-size: 16px;
  color: #576b95;
  background: #fff;
}
.mp-modal-btn + .mp-modal-btn {
  border-left: 0.5px solid #e5e5e5;
}
.mp-modal-cancel { color: #666; }

/* ActionSheet */
.mp-sheet-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9000;
  display: flex;
  align-items: flex-end;
  animation: mp-mask-in 0.2s ease-out;
}
.mp-sheet {
  width: 100%;
  background: #f7f7f7;
  border-radius: 14px 14px 0 0;
  padding: 8px 0 calc(12px + env(safe-area-inset-bottom));
  animation: mp-sheet-in 0.2s ease-out;
}
@keyframes mp-sheet-in {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.mp-sheet-items {
  background: #fff;
  border-radius: 14px;
  margin: 0 8px;
  overflow: hidden;
}
.mp-sheet-item {
  display: block;
  width: 100%;
  height: 52px;
  line-height: 52px;
  font-size: 16px;
  color: #111;
  background: #fff;
  border-bottom: 0.5px solid #e5e5e5;
}
.mp-sheet-item:last-child { border-bottom: none; }
.mp-sheet-cancel {
  display: block;
  width: calc(100% - 16px);
  height: 50px;
  line-height: 50px;
  font-size: 16px;
  color: #576b95;
  background: #fff;
  border-radius: 14px;
  margin: 8px 8px 0;
}
