/* 绒绒书屋 · 小程序浏览器兼容运行器：视口、页面框架与基础组件的默认样式（对齐微信基础库 style v2 的默认表现）。 */

.mp-window {
  position: relative;
  overflow: hidden;
  width: var(--mp-w, 390px);
  height: var(--mp-h, 844px);
  background: #ffffff;
  color: #000000;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: normal;
  text-align: left;
  transform: translateZ(0);
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  isolation: isolate;
}

.mp-window *,
.mp-window *::before,
.mp-window *::after {
  -webkit-tap-highlight-color: transparent;
}

.mp-window input,
.mp-window textarea,
.mp-window [selectable] {
  -webkit-user-select: text;
  user-select: text;
}

.mp-window [hidden] {
  display: none !important;
}

.mp-pages,
.mp-frame {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
}

/* ---------- 原生导航栏（navigationStyle: default） ---------- */
.mp-navbar {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  z-index: 5;
  box-sizing: border-box;
  color: #000000;
  background: #ffffff;
}

.mp-navbar__bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
}

.mp-navbar__left {
  position: absolute;
  left: 2px;
  top: 0;
  min-width: 44px;
  height: 44px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  color: inherit;
  font: 400 34px/40px -apple-system, "PingFang SC", sans-serif;
  cursor: pointer;
}

.mp-navbar__title {
  max-width: 52%;
  overflow: hidden;
  font-size: 17px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* ---------- 页面主体：fixed 定位相对它（transform 建立包含块），滚动在 .mp-scroller 内 ---------- */
.mp-body {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  overflow: hidden;
  transform: translateZ(0);
}

.mp-scroller {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.mp-scroller::-webkit-scrollbar,
wx-scroll-view::-webkit-scrollbar,
wx-swiper::-webkit-scrollbar {
  display: none;
}

.mp-scroller--locked {
  overflow: hidden;
}

.mp-page {
  display: block;
  min-height: 100%;
}

.mp-refresh {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 0;
  overflow: hidden;
  transition: height 0.2s ease;
}

.mp-refresh.is-on {
  height: 56px;
}

.mp-refresh span {
  width: 6px;
  height: 6px;
  margin: 0 4px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  animation: mp-dot 1s ease-in-out infinite;
}

.mp-refresh--light span {
  background: rgba(255, 255, 255, 0.8);
}

.mp-refresh span:nth-child(2) { animation-delay: 0.15s; }
.mp-refresh span:nth-child(3) { animation-delay: 0.3s; }

@keyframes mp-dot {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 1; }
}

/* ---------- 右上角胶囊（与 wx.getMenuButtonBoundingClientRect 同一位置） ---------- */
.mp-capsule {
  position: absolute;
  z-index: 900;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  border: 0.5px solid rgba(0, 0, 0, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.62);
  color: #000000;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.mp-capsule button {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: 700 15px/1 -apple-system, sans-serif;
  letter-spacing: 1px;
  cursor: pointer;
}

.mp-capsule i {
  width: 0.5px;
  height: 18px;
  background: rgba(0, 0, 0, 0.18);
}

.mp-capsule__close span {
  position: relative;
  width: 15px;
  height: 15px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.mp-capsule__close span::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  transform: translate(-50%, -50%);
}

.mp-capsule--white {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.16);
  color: #ffffff;
}

.mp-capsule--white i {
  background: rgba(255, 255, 255, 0.35);
}

/* ---------- 基础组件 ---------- */
wx-view,
wx-navigator,
wx-picker,
wx-scroll-view,
wx-swiper-item,
wx-cover-view,
wx-form,
wx-label,
wx-match-media,
wx-root-portal {
  display: block;
}

wx-text {
  display: inline;
  white-space: pre-line;
}

wx-text[space="ensp"],
wx-text[space="emsp"],
wx-text[space="nbsp"] {
  white-space: pre-wrap;
}

wx-image {
  position: relative;
  display: inline-block;
  overflow: hidden;
  width: 320px;
  height: 240px;
}

wx-image > img {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
  -webkit-user-drag: none;
}

wx-image[mode="aspectFit"] > img { object-fit: contain; }
wx-image[mode="aspectFill"] > img { object-fit: cover; }
wx-image[mode="center"] > img { object-fit: none; }
wx-image[mode="top"] > img { object-fit: none; object-position: top; }
wx-image[mode="bottom"] > img { object-fit: none; object-position: bottom; }
wx-image[mode="left"] > img { object-fit: none; object-position: left; }
wx-image[mode="right"] > img { object-fit: none; object-position: right; }
wx-image[mode="top left"] > img { object-fit: none; object-position: left top; }
wx-image[mode="top right"] > img { object-fit: none; object-position: right top; }
wx-image[mode="bottom left"] > img { object-fit: none; object-position: left bottom; }
wx-image[mode="bottom right"] > img { object-fit: none; object-position: right bottom; }

wx-image[mode="widthFix"] {
  height: auto;
}

wx-image[mode="widthFix"] > img {
  position: static;
  height: auto;
}

wx-image[mode="heightFix"] {
  width: auto;
}

wx-image[mode="heightFix"] > img {
  position: static;
  width: auto;
}

wx-button {
  position: relative;
  display: block;
  box-sizing: border-box;
  width: 184px;
  margin-left: auto;
  margin-right: auto;
  padding: 8px 24px;
  overflow: hidden;
  border-radius: 4px;
  background-color: #f2f2f2;
  color: #06ae56;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.41176471;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

wx-button::after {
  content: " ";
  position: absolute;
  left: 0;
  top: 0;
  box-sizing: border-box;
  width: 200%;
  height: 200%;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  transform: scale(0.5);
  transform-origin: 0 0;
  pointer-events: none;
}

wx-button[type="primary"] { background-color: #07c160; color: #ffffff; }
wx-button[type="warn"] { background-color: #f2f2f2; color: #fa5151; }
wx-button[size="mini"] { display: inline-block; width: auto; padding: 0 0.75em; font-size: 13px; line-height: 2.3; }
wx-button[disabled] { opacity: 0.6; cursor: not-allowed; }
wx-button[plain] { background-color: transparent; }

.button-hover {
  background-color: #dedede;
}

.navigator-hover {
  background-color: rgba(0, 0, 0, 0.1);
  opacity: 0.7;
}

wx-input,
wx-textarea {
  position: relative;
  display: block;
  cursor: text;
}

wx-input {
  height: 1.4rem;
  min-height: 1.4rem;
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
}

wx-textarea {
  width: 300px;
  height: 150px;
}

wx-input > input,
wx-textarea > textarea {
  position: relative;
  z-index: 1;
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-align: inherit;
  line-height: inherit;
  resize: none;
  -webkit-appearance: none;
  appearance: none;
}

wx-input > input:disabled,
wx-textarea > textarea:disabled {
  -webkit-text-fill-color: currentColor;
  opacity: 0.6;
}

.wx-input-placeholder {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  overflow: hidden;
  color: #808080;
  white-space: nowrap;
  text-overflow: ellipsis;
  pointer-events: none;
}

wx-textarea > .wx-input-placeholder {
  align-items: flex-start;
  white-space: pre-wrap;
}

wx-scroll-view {
  position: relative;
  overflow: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

wx-scroll-view[scroll-y] { overflow-y: auto; }
wx-scroll-view[scroll-x] { overflow-x: auto; white-space: nowrap; }
wx-scroll-view[enable-flex] { display: flex; }

wx-slider {
  display: block;
  margin: 10px 18px;
  padding: 0;
}

.wx-slider-wrapper {
  display: flex;
  align-items: center;
  min-height: 16px;
}

.wx-slider-tap-area {
  flex: 1;
  padding: 8px 0;
  cursor: pointer;
  touch-action: none;
}

.wx-slider-handle-wrapper {
  position: relative;
  height: 2px;
  border-radius: 5px;
  background-color: #e9e9e9;
}

.wx-slider-track {
  height: 100%;
  border-radius: 6px;
  background-color: #1aad19;
}

.wx-slider-handle {
  position: absolute;
  left: 0;
  top: 50%;
  width: 0;
  height: 0;
}

.wx-slider-thumb {
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: #ffffff;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
}

.wx-slider-value {
  width: 3ch;
  margin-left: 1em;
  color: #888888;
  font-size: 14px;
}

wx-slider[disabled] .wx-slider-track { background-color: #cccccc !important; }

wx-switch {
  display: inline-block;
  cursor: pointer;
}

.wx-switch-input {
  position: relative;
  box-sizing: border-box;
  width: 52px;
  height: 32px;
  border: 1px solid #dfdfdf;
  border-radius: 16px;
  background-color: #dfdfdf;
  transition: background-color 0.1s, border 0.1s;
}

.wx-switch-input::before,
.wx-switch-input::after {
  content: " ";
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 15px;
}

.wx-switch-input::before {
  width: 50px;
  height: 30px;
  background-color: #fdfdfd;
  transition: transform 0.3s;
}

.wx-switch-input::after {
  width: 30px;
  height: 30px;
  background-color: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s;
}

.wx-switch-input-checked::before { transform: scale(0); }
.wx-switch-input-checked::after { transform: translateX(20px); }

wx-switch[type="checkbox"] .wx-switch-input {
  width: 22px;
  height: 22px;
  border-radius: 3px;
  background: #ffffff;
}

wx-switch[type="checkbox"] .wx-switch-input::before,
wx-switch[type="checkbox"] .wx-switch-input::after { display: none; }

wx-switch[disabled] { opacity: 0.6; cursor: not-allowed; }

wx-canvas {
  position: relative;
  display: inline-block;
  width: 300px;
  height: 150px;
}

wx-canvas > canvas {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  width: 100%;
  height: 100%;
}

wx-web-view {
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: block;
  background: #ffffff;
}

wx-web-view > iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

wx-page-meta {
  display: none;
}

wx-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #ffffff;
  font-weight: 700;
  line-height: 1;
  vertical-align: middle;
}

wx-progress {
  display: flex;
  align-items: center;
}

.wx-progress-bar {
  flex: 1;
  overflow: hidden;
}

.wx-progress-inner-bar {
  height: 100%;
  transition: width 0.2s;
}

.wx-progress-info {
  margin-left: 15px;
  font-size: 16px;
}

wx-swiper {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

wx-swiper[vertical] {
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
}

wx-swiper-item {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  scroll-snap-align: start;
}

wx-video {
  display: inline-block;
  width: 300px;
  height: 225px;
  background: #000000;
}

wx-video > video {
  width: 100%;
  height: 100%;
}

/* ---------- 系统浮层：toast / modal / actionSheet / picker ---------- */
.mp-ui {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  pointer-events: none;
}

.mp-ui > * {
  pointer-events: auto;
}

.mp-toast {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none !important;
}

.mp-toast--mask {
  pointer-events: auto !important;
}

.mp-toast__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 120px;
  max-width: 70%;
  min-height: 120px;
  padding: 18px 16px;
  border-radius: 12px;
  background: rgba(17, 17, 17, 0.72);
  color: #ffffff;
  text-align: center;
  animation: mp-fade 0.15s ease-out;
}

.mp-toast__card--text {
  min-width: 0;
  min-height: 0;
  padding: 12px 18px;
  border-radius: 10px;
}

.mp-toast__icon {
  margin-bottom: 8px;
  font-size: 40px;
  line-height: 1;
}

.mp-toast__img {
  width: 40px;
  height: 40px;
  margin-bottom: 8px;
}

.mp-toast__spinner {
  width: 36px;
  height: 36px;
  margin-bottom: 12px;
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: mp-spin 0.9s linear infinite;
}

.mp-toast__title {
  font-size: 15px;
  line-height: 1.45;
  word-break: break-word;
}

@keyframes mp-spin { to { transform: rotate(360deg); } }
@keyframes mp-fade { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: none; } }

.mp-modal,
.mp-sheet {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  background: rgba(0, 0, 0, 0.5);
  animation: mp-fade 0.15s ease-out;
}

.mp-modal {
  align-items: center;
  justify-content: center;
}

.mp-modal__card {
  width: 80%;
  max-width: 320px;
  overflow: hidden;
  border-radius: 12px;
  background: #ffffff;
  color: #000000;
  text-align: center;
}

.mp-modal__title {
  padding: 32px 24px 0;
  font-size: 17px;
  font-weight: 700;
}

.mp-modal__content {
  padding: 16px 24px 32px;
  color: rgba(0, 0, 0, 0.6);
  font-size: 15px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.mp-modal__title + .mp-modal__foot {
  margin-top: 24px;
}

.mp-modal__input {
  box-sizing: border-box;
  width: calc(100% - 48px);
  height: 80px;
  margin: 16px 24px 24px;
  padding: 8px;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  font: inherit;
  resize: none;
}

.mp-modal__foot {
  display: flex;
  border-top: 0.5px solid rgba(0, 0, 0, 0.1);
}

.mp-modal__btn {
  flex: 1;
  height: 56px;
  border: 0;
  background: transparent;
  font: 700 17px/56px -apple-system, "PingFang SC", sans-serif;
  cursor: pointer;
}

.mp-modal__btn + .mp-modal__btn {
  border-left: 0.5px solid rgba(0, 0, 0, 0.1);
}

.mp-sheet {
  align-items: flex-end;
}

.mp-sheet__panel {
  width: 100%;
  overflow: hidden;
  border-radius: 12px 12px 0 0;
  background: #f7f7f7;
}

.mp-sheet__alert {
  padding: 16px;
  color: rgba(0, 0, 0, 0.5);
  font-size: 14px;
  text-align: center;
  background: #ffffff;
}

.mp-sheet__item {
  display: block;
  width: 100%;
  height: 56px;
  border: 0;
  border-top: 0.5px solid rgba(0, 0, 0, 0.08);
  background: #ffffff;
  font: 400 17px/56px -apple-system, "PingFang SC", sans-serif;
  cursor: pointer;
}

.mp-sheet__cancel {
  margin-top: 8px;
  border-top: 0;
}

.mp-picker__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  padding: 0 8px;
  background: #ffffff;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.08);
}

.mp-picker__title {
  font-size: 15px;
  color: rgba(0, 0, 0, 0.6);
}

.mp-picker__btn {
  height: 40px;
  padding: 0 14px;
  border: 0;
  background: transparent;
  color: rgba(0, 0, 0, 0.7);
  font-size: 16px;
  cursor: pointer;
}

.mp-picker__btn--ok {
  color: #07c160;
  font-weight: 700;
}

.mp-picker__body {
  display: flex;
  max-height: 260px;
  background: #ffffff;
}

.mp-picker__col {
  flex: 1;
  max-height: 260px;
  overflow-y: auto;
}

.mp-picker__item {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: rgba(0, 0, 0, 0.75);
  font-size: 16px;
  cursor: pointer;
}

.mp-picker__item.is-on {
  color: #000000;
  font-weight: 700;
  background: rgba(7, 193, 96, 0.08);
}

.mp-picker__native {
  margin: 24px auto;
  padding: 8px 12px;
  font-size: 18px;
}
