/* 对齐云展 bookConfig: bg=#505050, toolbar=#333333, icon=#EEEEEE */
.flipbook-body {
  margin: 0;
  min-height: 100vh;
  background: #505050;
  color: #eeeeee;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow: hidden;
}

.flipbook-shell {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: #505050;
}

.flipbook-toolbar {
  position: relative;
  z-index: 8;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  background: #333333;
  border-bottom: 1px solid rgba(0, 0, 0, 0.25);
  font-size: 13px;
}

.flipbook-toolbar__title {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 42vw;
  color: #eeeeee;
}

.flipbook-toolbar__right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.flipbook-search {
  position: relative;
  display: block;
  margin: 0;
}

.flipbook-search__icon {
  position: absolute;
  left: 9px;
  top: 50%;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateY(-50%);
  color: rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.flipbook-search__input {
  width: 160px;
  height: 30px;
  padding: 0 10px 0 28px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.95);
  color: #222;
  font-size: 13px;
  outline: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.flipbook-search__input::placeholder {
  color: rgba(0, 0, 0, 0.4);
}

.flipbook-search__input:focus {
  border-color: rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.15);
  background: #fff;
  color: #111;
}

.flipbook-search__input.is-idle,
.flipbook-search__input:read-only {
  background: rgba(180, 180, 180, 0.55);
  border-color: rgba(255, 255, 255, 0.12);
  color: rgba(40, 40, 40, 0.55);
  cursor: pointer;
}

.flipbook-search__input.is-idle::placeholder,
.flipbook-search__input:read-only::placeholder {
  color: rgba(40, 40, 40, 0.4);
}

.flipbook-search:has(.flipbook-search__input.is-idle) .flipbook-search__icon,
.flipbook-search:has(.flipbook-search__input:read-only) .flipbook-search__icon {
  color: rgba(40, 40, 40, 0.4);
}

.flipbook-search-panel {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 12;
  display: flex;
  flex-direction: column;
  width: min(320px, 86vw);
  background: #393939;
  color: #eeeeee;
  box-shadow: 8px 0 24px rgba(0, 0, 0, 0.35);
}

.flipbook-search-panel[hidden] {
  display: none;
}

.flipbook-search-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.flipbook-search-panel__title {
  font-size: 15px;
  font-weight: 600;
}

.flipbook-search-panel__title::before {
  content: "⌕ ";
  font-weight: 400;
  opacity: 0.85;
}

.flipbook-search-panel__close {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.flipbook-search-panel__close:hover {
  background: rgba(255, 255, 255, 0.1);
}

.flipbook-search-panel__form {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 12px 14px 8px;
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
}

.flipbook-search-panel__input {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 12px;
  border: none;
  color: #222;
  font-size: 14px;
  outline: none;
}

.flipbook-search-panel__submit {
  width: 40px;
  height: 36px;
  border: none;
  background: #f3f3f3;
  color: #444;
  font-size: 18px;
  cursor: pointer;
}

.flipbook-search-panel__submit:hover {
  background: #e8e8e8;
}

.flipbook-search-panel__meta {
  padding: 4px 14px 8px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  min-height: 20px;
}

.flipbook-search-panel__results {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0 8px 16px;
}

.flipbook-search-result {
  display: block;
  width: 100%;
  margin: 0 0 8px;
  padding: 10px 10px;
  border: none;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}

.flipbook-search-result:hover {
  background: rgba(255, 255, 255, 0.12);
}

.flipbook-search-result__page {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
}

.flipbook-search-result__snippet {
  display: block;
  font-size: 13px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.9);
  word-break: break-word;
}

.flipbook-search-result__snippet mark {
  background: transparent;
  color: #ffb000;
  font-weight: 700;
  padding: 0;
}

.flipbook-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 0;
  padding: 0;
  background: #505050;
  perspective: 2400px;
}

.flipbook-goto {
  position: relative;
  z-index: 8;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  background: #333333;
  border-top: 1px solid rgba(0, 0, 0, 0.25);
}

.flipbook-goto__arrow {
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.92);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.flipbook-goto__arrow:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.24);
}

.flipbook-goto__arrow:disabled {
  opacity: 0.35;
  cursor: default;
}

.flipbook-goto__input {
  width: 64px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 14px;
  text-align: center;
  outline: none;
  -moz-appearance: textfield;
}

.flipbook-goto__input::-webkit-outer-spin-button,
.flipbook-goto__input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.flipbook-goto__input:focus {
  border-color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.12);
}

.flipbook-goto__total {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  white-space: nowrap;
}

.flipbook-password {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
}

.flipbook-password[hidden] {
  display: none !important;
}

.flipbook-password__panel {
  width: min(100%, 360px);
  padding: 24px 22px 20px;
  border-radius: 12px;
  background: #2a2a2a;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  color: #eee;
}

.flipbook-password__title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 600;
  color: #fff;
}

.flipbook-password__hint {
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.72);
}

.flipbook-password__whatsapp {
  color: #25d366;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.flipbook-password__whatsapp:hover {
  color: #4ae07f;
}

.flipbook-password__form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.flipbook-password__input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 15px;
  outline: none;
  box-sizing: border-box;
}

.flipbook-password__input:focus {
  border-color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.12);
}

.flipbook-password__error {
  margin: 0;
  font-size: 13px;
  color: #ff8f8f;
}

.flipbook-password__error[hidden] {
  display: none !important;
}

.flipbook-password__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.flipbook-password__btn {
  min-width: 76px;
  height: 36px;
  padding: 0 14px;
  border: none;
  border-radius: 8px;
  background: #eee;
  color: #222;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.flipbook-password__btn:hover {
  background: #fff;
}

.flipbook-password__btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.flipbook-password__btn--ghost {
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-weight: 500;
}

.flipbook-password__btn--ghost:hover {
  background: rgba(255, 255, 255, 0.08);
}

.flipbook-book {
  box-shadow: none;
  touch-action: none;
}

.flipbook-book .stf__wrapper {
  margin: 0 auto;
}

.flipbook-book .stf__item,
.flipbook-book .stf__block,
.flipbook-book .stf__item .page {
  background: #fff;
}

.flipbook-book .stf__item img,
.flipbook-book .stf__block img,
.flipbook-book img {
  object-fit: contain;
  object-position: center center;
  width: 100%;
  height: 100%;
  user-select: none;
  -webkit-user-drag: none;
}

.flipbook-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 64px;
  border: none;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.28);
  color: rgba(255, 255, 255, 0.85);
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  z-index: 4;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.flipbook-nav:hover {
  background: rgba(0, 0, 0, 0.45);
}

.flipbook-nav--prev {
  left: 4px;
}

.flipbook-nav--next {
  right: 4px;
}

.flipbook-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at center, rgba(255, 255, 255, 0.05) 0%, transparent 55%),
    #505050;
  z-index: 10;
  transition: opacity 0.35s ease;
}

.flipbook-loading::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.16;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.4) 0.55px, transparent 0.65px);
  background-size: 4px 4px;
}

.flipbook-loading.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.flipbook-loading__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 0 20px;
  max-width: 92vw;
}

.flipbook-loading__scene {
  position: relative;
  width: min(36vw, 120px);
  perspective: 900px;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.4));
}

.flipbook-loading__title {
  margin: 0;
  max-width: 16em;
  color: #eee;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 767px) {
  .flipbook-loading__scene {
    width: min(32vw, 100px);
  }

  .flipbook-loading__title {
    font-size: 13px;
    max-width: 14em;
  }
}

.flipbook-loading__book {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  transform-style: preserve-3d;
}

.flipbook-loading__leaf {
  position: absolute;
  top: 8%;
  bottom: 8%;
  width: 46%;
  border: 2px solid rgba(255, 255, 255, 0.92);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  padding: 0 12%;
}

.flipbook-loading__leaf--left {
  left: 4%;
  border-radius: 14px 2px 2px 14px;
  border-right-color: rgba(255, 255, 255, 0.35);
}

.flipbook-loading__leaf--right {
  right: 4%;
  border-radius: 2px 14px 14px 2px;
  border-left-color: rgba(255, 255, 255, 0.35);
}

.flipbook-loading__leaf span,
.flipbook-loading__turner-face span {
  display: block;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
}

.flipbook-loading__leaf--left span:nth-child(1),
.flipbook-loading__turner-face span:nth-child(1) {
  width: 78%;
}

.flipbook-loading__leaf--left span:nth-child(2),
.flipbook-loading__turner-face span:nth-child(2) {
  width: 62%;
}

.flipbook-loading__leaf--left span:nth-child(3),
.flipbook-loading__turner-face span:nth-child(3) {
  width: 70%;
}

.flipbook-loading__leaf--right span:nth-child(1) {
  width: 70%;
  margin-left: auto;
}

.flipbook-loading__leaf--right span:nth-child(2) {
  width: 58%;
  margin-left: auto;
}

.flipbook-loading__leaf--right span:nth-child(3) {
  width: 74%;
  margin-left: auto;
}

.flipbook-loading__spine {
  position: absolute;
  top: 6%;
  bottom: 6%;
  left: 50%;
  width: 3px;
  margin-left: -1.5px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff 0%, rgba(255, 255, 255, 0.75) 100%);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.35);
  z-index: 3;
}

.flipbook-loading__turner {
  position: absolute;
  top: 8%;
  bottom: 8%;
  left: 50%;
  width: 46%;
  transform-origin: left center;
  transform-style: preserve-3d;
  z-index: 2;
  animation: flipbook-entry-turn 1.4s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
}

.flipbook-loading__turner-face {
  width: 100%;
  height: 100%;
  border: 2px solid rgba(255, 255, 255, 0.95);
  border-radius: 2px 12px 12px 2px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  padding: 0 14%;
  background: rgba(80, 80, 80, 0.15);
  backface-visibility: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

@keyframes flipbook-entry-turn {
  0% {
    transform: rotateY(0deg);
    opacity: 0.2;
  }
  10% {
    opacity: 1;
  }
  48% {
    transform: rotateY(-180deg);
    opacity: 1;
  }
  58%,
  100% {
    transform: rotateY(-180deg);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .flipbook-loading__turner {
    animation: none;
    opacity: 0.45;
    transform: rotateY(-40deg);
  }
}

@media (max-width: 767px) {
  .flipbook-nav {
    opacity: 0;
    pointer-events: none;
  }

  .flipbook-toolbar__title {
    font-size: 12px;
    max-width: 36vw;
  }

  .flipbook-search__input {
    width: 120px;
    height: 28px;
    font-size: 12px;
  }

  .flipbook-goto {
    gap: 6px;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px));
  }

  .flipbook-goto__arrow {
    width: 30px;
    height: 30px;
  }

  .flipbook-goto__input {
    width: 52px;
    height: 30px;
  }
}
