/* 小程序网页运行层的基础样式：外框（导航栏、底部标签）、原生组件的默认样子、弹窗 */
:root { --rpx: calc(min(100vw, 480px) / 750); color-scheme: light; }
* { -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: #e9ecf1; height: 100%; }
body { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif; color: #1f1f1f; }
#mp-frame { position: relative; max-width: 480px; height: 100vh; height: 100dvh; margin: 0 auto; background: #f5f5f5; overflow: hidden; transform: translateZ(0); }
.mp-boot { padding: 120px 0; text-align: center; color: #8c8c8c; }

#mp-nav { position: absolute; left: 0; right: 0; top: 0; height: 44px; display: flex; align-items: center; background: #fff; border-bottom: 1px solid #ececec; z-index: 50; }
#mp-nav a { width: 48px; height: 44px; display: flex; align-items: center; justify-content: center; font-size: 28px; color: #1f1f1f; cursor: pointer; user-select: none; }
#mp-nav .mp-nav-refresh { font-size: 20px; color: #8c8c8c; }
.mp-nav-title { flex: 1; text-align: center; font-size: 17px; font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#mp-root { position: absolute; left: 0; right: 0; top: 45px; bottom: 0; }
#mp-frame.has-tab #mp-root { bottom: calc(52px + env(safe-area-inset-bottom)); }
#mp-stack, .mp-page-wrap { position: absolute; inset: 0; }
.mp-page-wrap { overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
.mp-page { min-height: 100%; font-size: 16px; line-height: 1.4; box-sizing: border-box; }
#mp-tabbar { position: absolute; left: 0; right: 0; bottom: 0; height: 52px; padding-bottom: env(safe-area-inset-bottom); display: flex; background: #fff; border-top: 1px solid #ececec; z-index: 50; }
#mp-tabbar a { flex: 1; display: flex; align-items: center; justify-content: center; font-size: 15px; color: #8c8c8c; cursor: pointer; user-select: none; }
#mp-tabbar a.on { color: #1677ff; font-weight: 600; }

/* 原生组件 */
mp-view, mp-host, mp-picker, mp-label, mp-switch, mp-loading { display: block; }
mp-host.mp-virtual { display: contents; }
mp-text { display: inline; white-space: pre-line; }
mp-scroll-view { display: block; -webkit-overflow-scrolling: touch; }
mp-scroll-view::-webkit-scrollbar { display: none; }
mp-picker { cursor: pointer; }
img { max-width: 100%; }
img[data-mode="aspectFit"] { object-fit: contain; }
img[data-mode="aspectFill"] { object-fit: cover; }
img[data-mode="widthFix"] { height: auto; }
:where(.mp-page) input, :where(.mp-page) textarea { font: inherit; color: inherit; border: 0; outline: 0; background: transparent; padding: 0; margin: 0; width: 100%; box-sizing: border-box; min-height: 1.4em; }
:where(.mp-page) textarea { resize: none; display: block; }
:where(.mp-page) button { position: relative; display: block; margin: 0 auto; padding: 0 14px; box-sizing: border-box; font: inherit; font-size: 18px; text-align: center; line-height: 2.55555556; border-radius: 5px; color: #000; background: #f8f8f8; border: 1px solid rgba(0, 0, 0, .2); cursor: pointer; }
:where(.mp-page) button[data-type="primary"] { color: #fff; background: #07c160; border-color: #07c160; }
:where(.mp-page) button[data-size="mini"] { display: inline-block; font-size: 13px; line-height: 2.3; padding: 0 1.34em; }
:where(.mp-page) button:disabled { opacity: .6; }

/* toast / loading */
.mp-toast { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 300; pointer-events: none; }
.mp-toast.mask { pointer-events: auto; }
.mp-toast-box { max-width: 70%; padding: 10px 16px; border-radius: 8px; background: rgba(17, 17, 17, .78); color: #fff; font-size: 15px; line-height: 1.5; text-align: center; }
.mp-toast.with-icon .mp-toast-box { min-width: 110px; padding: 18px 16px 14px; }
.mp-toast-icon { font-size: 34px; line-height: 1; margin-bottom: 8px; }
.mp-spin { width: 30px; height: 30px; margin: 0 auto 10px; border: 3px solid rgba(255, 255, 255, .3); border-top-color: #fff; border-radius: 50%; animation: mp-spin .8s linear infinite; }
@keyframes mp-spin { to { transform: rotate(360deg); } }

/* modal / action sheet */
.mp-mask { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); z-index: 200; display: flex; }
.mp-modal-wrap { align-items: center; justify-content: center; }
.mp-modal { width: 82%; max-width: 340px; background: #fff; border-radius: 12px; overflow: hidden; text-align: center; }
.mp-modal-title { padding: 24px 20px 4px; font-size: 17px; font-weight: 600; }
.mp-modal-content { padding: 10px 22px 22px; font-size: 15px; color: #595959; line-height: 1.6; white-space: pre-line; max-height: 50vh; overflow: auto; }
.mp-modal-input { display: block; width: calc(100% - 40px); margin: 14px 20px 22px; padding: 10px 12px; box-sizing: border-box; font: inherit; font-size: 15px; border: 1px solid #d9d9d9; border-radius: 8px; outline: none; }
.mp-modal-btns { display: flex; border-top: 1px solid #eee; }
.mp-modal-btns button { flex: 1; height: 52px; font: inherit; font-size: 17px; font-weight: 600; background: #fff; border: 0; cursor: pointer; }
.mp-modal-btns button + button { border-left: 1px solid #eee; }
.mp-sheet-wrap { align-items: flex-end; }
.mp-sheet { width: 100%; background: #f5f5f5; border-radius: 12px 12px 0 0; overflow: hidden; padding-bottom: env(safe-area-inset-bottom); }
.mp-sheet-title { padding: 14px 16px; text-align: center; font-size: 13px; color: #8c8c8c; background: #fff; border-bottom: 1px solid #eee; }
.mp-sheet-list { max-height: 60vh; overflow-y: auto; background: #fff; }
.mp-sheet-item { padding: 15px 16px; text-align: center; font-size: 17px; border-bottom: 1px solid #f0f0f0; cursor: pointer; }
.mp-sheet-item.on { color: #1677ff; font-weight: 600; }
.mp-sheet-cancel { margin-top: 8px; padding: 15px 16px; text-align: center; font-size: 17px; background: #fff; cursor: pointer; }

/* 登录 */
.mp-login { padding: 72px 32px 0; text-align: center; }
.mp-login-icon { width: 84px; height: 84px; border-radius: 20px; box-shadow: 0 6px 20px rgba(22, 119, 255, .18); }
.mp-login-title { margin-top: 18px; font-size: 24px; font-weight: 700; }
.mp-login-sub { margin-top: 6px; font-size: 14px; color: #8c8c8c; }
.mp-login-input { display: block; width: 100%; margin-top: 40px; padding: 14px 16px; box-sizing: border-box; font-size: 18px; text-align: center; letter-spacing: 4px; border: 1px solid #d9d9d9; border-radius: 12px; outline: none; background: #fff; }
.mp-login-input:focus { border-color: #1677ff; }
.mp-login-input::placeholder { letter-spacing: 0; color: #bfbfbf; }
.mp-login-btn { display: block; width: 100%; margin-top: 16px; padding: 14px; font-size: 17px; font-weight: 600; color: #fff; background: #1677ff; border: 0; border-radius: 12px; cursor: pointer; }
.mp-login-btn:disabled { opacity: .6; }
.mp-login-msg { margin-top: 16px; font-size: 14px; color: #8c8c8c; min-height: 20px; }
