*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  height: var(--app-height, 100dvh);
  min-height: -webkit-fill-available;
  overflow: hidden;
  background: #0a1628;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* 竖屏：地图宽 100%，高等比缩放并垂直居中（细节见下方 #map / #map-frame） */

#viewport {
  width: 100%;
  height: 100%;
  height: var(--app-height, 100dvh);
  position: relative;
  padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0)
    env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
}

#stage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

#map-frame {
  position: relative;
  width: 100%;
  height: 100%;
}

#map-display {
  position: relative;
  display: block;
  width: 100%;
  line-height: 0;
  container-type: inline-size;
  container-name: map;
  --map-btn-font-size: clamp(0.62rem, 2.6cqi, 1rem);
}

#map-display > picture:first-of-type {
  display: block;
  width: 100%;
}

#map-display > picture:first-of-type img#map {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: top;
  user-select: none;
  -webkit-user-drag: none;
}

.ship-layer {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  pointer-events: none;
  will-change: transform;
}

#ship {
  display: block;
  height: auto;
  width: auto;
  transform-origin: center bottom;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
}

.ship-layer--idle #ship {
  animation: ship-idle-sway 3.2s ease-in-out infinite;
}

@keyframes ship-idle-sway {
  0%,
  100% {
    transform: rotate(-2.5deg) translateY(0);
  }
  50% {
    transform: rotate(2.5deg) translateY(-3px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ship-layer--idle #ship {
    animation: none;
  }
}

@media (orientation: portrait), (max-aspect-ratio: 1/1) {
  #stage {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  #map-frame {
    height: auto;
    max-height: 100%;
    flex-shrink: 0;
    width: 100%;
  }

  #map-display {
    display: inline-block;
    width: 100%;
    max-height: 100%;
  }

  #map-display > picture:first-of-type img#map {
    max-height: 100%;
    object-fit: contain;
  }

  #wish-trigger {
    padding: 0.52em 1.25em;
    bottom: 7%;
  }
}

@media (orientation: landscape), (min-aspect-ratio: 1/1) {
  #viewport {
    padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0)
      env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
  }

  #stage {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
  }

  #map-frame {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  #map-display {
    position: relative;
    display: block;
    width: auto;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    aspect-ratio: 1536 / 1024;
    margin-inline: auto;
    --map-btn-font-size: calc(clamp(0.62rem, 2.6cqi, 1rem) * var(--map-ui-scale, 1));
  }

  #map-display > picture:first-of-type {
    display: block;
    width: 100%;
    height: 100%;
  }

  #map-display > picture:first-of-type img#map {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
  }

  #map-display.map-display--stretch-x > picture:first-of-type img#map {
    object-fit: fill;
  }
}

#route-trail {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: visible;
}

#route-trail-path {
  stroke: #d62828;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.route-waypoint {
  fill: #d62828;
  stroke: #ffffff;
  vector-effect: non-scaling-stroke;
}

.city-marker-group {
  --marker-anim-duration: 2.6s;
  --marker-anim-delay: 0s;
}

.city-marker-pulse {
  fill: url(#city-marker-pulse-gradient);
  pointer-events: none;
  transform-box: fill-box;
  transform-origin: center;
}

.city-marker-group--active .city-marker-pulse {
  animation: city-marker-pulse var(--marker-anim-duration) ease-out infinite;
  animation-delay: var(--marker-anim-delay);
}

.city-marker-group--inactive .city-marker-pulse {
  display: none;
}

@keyframes city-marker-pulse {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }
  75%,
  100% {
    transform: scale(5);
    opacity: 0;
  }
}

.city-marker {
  fill: url(#city-marker-gradient);
  stroke: #fff8e7;
  vector-effect: non-scaling-stroke;
  transform-box: fill-box;
  transform-origin: center;
}

.city-marker-group--active .city-marker {
  animation: city-marker-breathe var(--marker-anim-duration) ease-in-out infinite;
  animation-delay: var(--marker-anim-delay);
}

.city-marker-group--inactive .city-marker {
  fill: url(#city-marker-inactive-gradient);
  stroke: #d8dce0;
  transform: scale(1);
}

@keyframes city-marker-breathe {
  0%,
  100% {
    transform: scale(0.92);
  }
  50% {
    transform: scale(1.5);
  }
}

/* —— 许愿助力 —— */
#wish-trigger,
.wish-submit {
  border: none;
  border-radius: 999px;
  background: linear-gradient(90deg, #e8652a 0%, #f5a623 55%, #ffd56a 100%);
  color: #fff;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(232, 101, 42, 0.45);
  transition: transform 0.15s ease, filter 0.15s ease;
}

#wish-trigger {
  position: absolute;
  left: 0;
  right: 0;
  margin-inline: auto;
  width: max-content;
  max-width: calc(100% - 1.5rem);
  bottom: 4%;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  padding: 0.55em 1.35em;
  font-size: var(--map-btn-font-size);
  white-space: nowrap;
  animation: wish-trigger-pulse 2.4s ease-in-out infinite;
  transition: filter 0.15s ease;
}

@keyframes wish-trigger-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
}

#wish-trigger:active {
  animation: none;
  transform: scale(0.96);
  filter: brightness(0.96);
}

.wish-trigger__icon {
  font-size: 1.05em;
  opacity: 0.95;
}

/* —— 右下角导航 —— */
.side-nav {
  position: absolute;
  right: 3%;
  bottom: 2%;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 0.75em;
  align-items: stretch;
  width: max-content;
  max-width: 42%;
  font-size: var(--map-btn-font-size);
}

.side-nav__btn {
  border: none;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  min-height: 2.35em;
  padding: 0.42em 0.65em;
  box-sizing: border-box;
  color: #fff;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: inherit;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.28);
  transition: transform 0.15s ease, filter 0.15s ease;
}

.side-nav__btn:active {
  transform: scale(0.97);
  filter: brightness(0.95);
}

.side-nav__btn--origin {
  background: linear-gradient(135deg, #1e6b8c 0%, #2a8fbf 100%);
}

.side-nav__btn--review {
  background: linear-gradient(135deg, #6d4c8a 0%, #8b6bae 100%);
}

.side-nav__btn--board {
  background: linear-gradient(135deg, #2a7d5f 0%, #3aa87e 100%);
}

.side-nav__btn--donors {
  background: linear-gradient(135deg, #c94c4c 0%, #e07050 100%);
}

@media (orientation: portrait), (max-aspect-ratio: 1/1) {
  #map-display {
    --map-btn-font-size: calc(clamp(1rem, 6cqi, 1.5rem) * var(--map-ui-scale, 1));
  }

  .side-nav {
    gap: 1.05em;
    bottom: 5%;
    right: 2.5%;
  }

  .side-nav__btn {
    min-height: 2.5em;
    padding: 0.45em 0.75em;
  }
}

@media (orientation: landscape), (min-aspect-ratio: 1/1) {
  #wish-trigger {
    bottom: max(4%, calc(env(safe-area-inset-bottom, 0px) + 0.75%));
  }

  .side-nav {
    gap: 1.05em;
    bottom: max(5.5%, calc(env(safe-area-inset-bottom, 0px) + 1.25%));
    right: max(3%, calc(env(safe-area-inset-right, 0px) + 1cqi));
    font-size: calc(var(--map-btn-font-size) * 1.15);
  }

  .side-nav__btn {
    min-height: 2.45em;
    padding: 0.48em 0.85em;
  }
}

@media (prefers-reduced-motion: reduce) {
  #wish-trigger {
    animation: none;
  }
}

.wish-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.wish-modal[hidden] {
  display: none;
}

.wish-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 18, 32, 0.55);
}

.wish-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(92vw, 420px);
  max-height: min(92vh, 640px);
  overflow: hidden;
  border-radius: 14px;
  border: 2px solid #e8c86a;
  background: linear-gradient(180deg, #fffef8 0%, #fff9eb 100%);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  transform-origin: center center;
  will-change: transform, opacity;
}

.wish-modal.is-closing {
  pointer-events: none;
}

.wish-modal.is-closing .wish-modal__backdrop {
  pointer-events: none;
}

.wish-panel__header {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3.1rem;
  padding: 0.75rem 2.75rem;
  border-bottom: 1px solid rgba(232, 200, 106, 0.5);
  background: linear-gradient(180deg, #fffef8 0%, #fff9eb 100%);
  border-radius: 12px 12px 0 0;
}

.wish-panel__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem 1.25rem 1.5rem;
  -webkit-overflow-scrolling: touch;
}

.wish-panel__close {
  position: absolute;
  top: 50%;
  right: 0.6rem;
  z-index: 3;
  width: 2rem;
  height: 2rem;
  margin: 0;
  border: none;
  background: transparent;
  color: #9a9a9a;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
}

.wish-panel__title {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  color: #c44a28;
  font-size: 1.15rem;
  font-weight: 700;
  text-align: center;
}

.wish-panel__title-icon {
  font-size: 1.2rem;
  color: #ffb347;
  text-shadow: 0 1px 0 #e88a20;
}

.wish-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.wish-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.wish-field__label {
  color: #8b4518;
  font-size: 0.9rem;
  font-weight: 600;
}

.wish-field__input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1.5px solid #e8c86a;
  border-radius: 8px;
  background: #fff9e6;
  color: #3d2a14;
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.wish-field__input::placeholder {
  color: #b8a888;
}

.wish-field__input:focus {
  border-color: #d4a843;
  box-shadow: 0 0 0 3px rgba(232, 200, 106, 0.35);
}

.wish-field__textarea {
  min-height: 4.5rem;
  resize: vertical;
}

.wish-field__select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%238b4518' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

.wish-photo {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.wish-photo__frame {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 240px);
  aspect-ratio: 1 / 1;
  margin-inline: auto;
  border: 1.5px dashed #e8c86a;
  border-radius: 10px;
  background: #fff9e6;
  overflow: hidden;
  cursor: pointer;
}

.wish-photo__frame:focus-visible {
  outline: none;
  border-color: #d4a843;
  box-shadow: 0 0 0 3px rgba(232, 200, 106, 0.35);
}

.wish-photo__preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wish-photo__preview:not([hidden]) + .wish-photo__placeholder {
  display: none;
}

.wish-photo__placeholder {
  color: #b8a888;
  font-size: 0.88rem;
  text-align: center;
  padding: 0 1rem;
}

.wish-photo__actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.wish-photo__btn {
  flex: 1;
  min-width: 5rem;
  padding: 0.45rem 0.75rem;
  border: 1.5px solid #e8c86a;
  border-radius: 999px;
  background: #fff9e6;
  color: #8b4518;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.wish-photo__btn--ghost {
  flex: 0 0 auto;
  border-color: #d4a843;
  color: #a83820;
}

.wish-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 0.35rem;
  padding: 0.7rem 1rem;
  font-size: 1rem;
  letter-spacing: 0.08em;
}

.wish-submit:active:not(:disabled) {
  transform: scale(0.98);
  filter: brightness(0.96);
}

.wish-submit:disabled {
  opacity: 0.62;
  cursor: not-allowed;
  filter: grayscale(0.08);
}

.wish-submit__icon {
  font-size: 0.95rem;
  opacity: 0.95;
}

.wish-tip {
  z-index: 410;
}

.wish-tip.is-error {
  color: #a83820;
}

/* —— 留言板页面 —— */
.board-layout-wrap {
  height: 100%;
  height: var(--app-height, 100dvh);
  overflow: hidden;
}

.board-page {
  height: 100%;
  height: var(--app-height, 100dvh);
  overflow: hidden;
  background: linear-gradient(180deg, #0a1628 0%, #132a45 100%);
}

.board-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(390px, 51vw) minmax(0, 1fr);
  gap: 0.65rem;
  min-height: 0;
  height: 100%;
  height: var(--app-height, 100dvh);
  padding: max(10px, env(safe-area-inset-top, 10px))
    max(10px, env(safe-area-inset-right, 10px))
    max(10px, env(safe-area-inset-bottom, 10px))
    max(10px, env(safe-area-inset-left, 10px));
}

.photo-wall {
  --photo-rows: 3;
  --photo-columns: 4;
  --photo-grid-line: rgba(255, 255, 255, 0.28);
  display: grid;
  grid-template-columns: repeat(var(--photo-columns), minmax(0, 1fr));
  grid-template-rows: repeat(var(--photo-rows), minmax(0, 1fr));
  gap: 2px;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  padding: 2px;
  border-radius: 8px;
  border: 1px solid var(--photo-grid-line);
  background: var(--photo-grid-line);
}

.photo-wall__cell {
  position: relative;
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(10, 22, 40, 0.35);
}

.photo-wall__cell--empty {
  background: rgba(255, 255, 255, 0.05);
}

.photo-wall__btn {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  overflow: hidden;
  border-radius: 3px;
}

.photo-wall__btn:focus-visible {
  outline: 2px solid #e8c86a;
  outline-offset: 1px;
}

.photo-wall__btn--source {
  z-index: 1;
}

.photo-wall__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.board-center {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
  border-radius: 14px;
  border: 2px solid #e8c86a;
  background: linear-gradient(180deg, #fffef8 0%, #fff9eb 100%);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.board-center__header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(232, 200, 106, 0.45);
  background: linear-gradient(180deg, #fffef8 0%, #fff9eb 100%);
}

.board-page__viewport {
  width: 100%;
  min-height: 100%;
  padding: max(16px, env(safe-area-inset-top, 16px))
    max(20px, env(safe-area-inset-right, 20px))
    max(16px, env(safe-area-inset-bottom, 16px))
    max(20px, env(safe-area-inset-left, 20px));
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
}

.board-page__header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.board-page__back {
  flex-shrink: 0;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  background: rgba(139, 69, 24, 0.1);
  color: #8b4518;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease;
}

.board-page__back:active {
  background: rgba(139, 69, 24, 0.18);
}

.board-page__title {
  margin: 0;
  color: #c44a28;
  font-size: clamp(1rem, 2.4vw, 1.25rem);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.board-messages {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0.75rem 1rem 1rem;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.board-message {
  flex-shrink: 0;
  padding: 0.72rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(232, 200, 106, 0.5);
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 1px 4px rgba(139, 69, 24, 0.06);
}

.board-message__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.28rem;
}

.board-message__name {
  color: #8b4518;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.35;
}

.board-message__meta {
  margin: 0 0 0.42rem;
  color: #a83820;
  font-size: 0.76rem;
  line-height: 1.4;
}

.board-message__time {
  flex-shrink: 0;
  color: #b8a888;
  font-size: 0.7rem;
  line-height: 1.35;
  white-space: nowrap;
}

.board-message__wish {
  margin: 0;
  padding-top: 0.42rem;
  border-top: 1px dashed rgba(232, 200, 106, 0.45);
  color: #3d2a14;
  font-size: 0.86rem;
  line-height: 1.5;
  word-break: break-word;
}

.board-pagination {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.55rem 0.75rem;
  padding: 0.55rem 1rem 0.75rem;
  border-top: 1px solid rgba(232, 200, 106, 0.45);
}

.board-pagination__page {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.board-pagination__input {
  box-sizing: border-box;
  width: 3rem;
  padding: 0.32rem 0.25rem;
  border: 1.5px solid #e8c86a;
  border-radius: 8px;
  background: #fff9e6;
  color: #8b4518;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  appearance: textfield;
  -moz-appearance: textfield;
}

.board-pagination__input::-webkit-outer-spin-button,
.board-pagination__input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.board-pagination__input:focus-visible {
  outline: 2px solid #e8c86a;
  outline-offset: 2px;
}

.board-pagination__total {
  color: #8b4518;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

.board-pagination__btn {
  padding: 0.35rem 0.85rem;
  border: 1.5px solid #e8c86a;
  border-radius: 999px;
  background: #fff9e6;
  color: #8b4518;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.board-pagination__btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.board-pagination__info {
  color: #8b4518;
  font-size: 0.8rem;
  font-weight: 600;
}

.board-page__intro {
  margin-bottom: 1rem;
  color: rgba(245, 230, 200, 0.85);
  font-size: 0.92rem;
  line-height: 1.6;
}

.board-page__list {
  padding: 1.25rem;
  border-radius: 14px;
  border: 2px solid #e8c86a;
  background: linear-gradient(180deg, #fffef8 0%, #fff9eb 100%);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
  min-height: 12rem;
}

.board-page__empty {
  margin: 0;
  padding: 1.5rem 0;
  color: #b8a888;
  font-size: 0.88rem;
  text-align: center;
}

.page-tip {
  position: fixed;
  top: max(8px, env(safe-area-inset-top, 8px));
  left: 50%;
  z-index: 310;
  box-sizing: border-box;
  width: max-content;
  max-width: calc(100vw - max(24px, env(safe-area-inset-left, 0px) + env(safe-area-inset-right, 0px) + 16px));
  margin: 0;
  padding: 0.42rem 1rem;
  border-radius: 999px;
  background: rgba(255, 248, 220, 0.94);
  color: #1a1a1a;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(0.85rem, 3.4vw, 1.05rem);
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: 0.02em;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.48s ease;
  pointer-events: none;
}

.page-tip.is-visible {
  opacity: 1;
}

.page-tip[hidden] {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .page-tip {
    transition: none;
  }
}

.board-photo-modal {
  position: fixed;
  inset: 0;
  z-index: 320;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(12px, env(safe-area-inset-top, 12px))
    max(12px, env(safe-area-inset-right, 12px))
    max(12px, env(safe-area-inset-bottom, 12px))
    max(12px, env(safe-area-inset-left, 12px));
}

.board-photo-modal[hidden] {
  display: none;
}

.board-photo-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 18, 32, 0.62);
}

.board-photo-modal__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(92vw, 440px);
  max-height: min(92vh, 760px);
  overflow: hidden;
  border-radius: 14px;
  border: 2px solid #e8c86a;
  background: linear-gradient(180deg, #fffef8 0%, #fff9eb 100%);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  transform-origin: center center;
  will-change: transform, opacity;
}

.board-photo-modal.is-closing {
  pointer-events: none;
}

.board-photo-modal.is-closing .board-photo-modal__backdrop {
  pointer-events: none;
}

.board-photo-modal__close {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  z-index: 3;
  width: 2rem;
  height: 2rem;
  margin: 0;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: #8b4518;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.board-photo-modal__media {
  flex-shrink: 0;
  width: 50%;
  margin: 0.65rem auto 0;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  overflow: hidden;
  background: #0a1628;
}

.board-photo-modal__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.board-photo-modal__body {
  flex: 1 1 auto;
  min-height: min(46vh, 360px);
  overflow-y: auto;
  padding: 1rem 1.15rem 1.3rem;
  -webkit-overflow-scrolling: touch;
}

.board-photo-modal__header {
  margin-bottom: 0.65rem;
  text-align: center;
}

.board-photo-modal__name {
  margin: 0 0 0.3rem;
  color: #8b4518;
  font-size: 1.05rem;
  font-weight: 700;
}

.board-photo-modal__meta {
  margin: 0 0 0.25rem;
  color: #a83820;
  font-size: 0.82rem;
  line-height: 1.45;
}

.board-photo-modal__time {
  display: block;
  color: #b8a888;
  font-size: 0.75rem;
}

.board-photo-modal__wish {
  margin: 0;
  padding-top: 0.7rem;
  border-top: 1px dashed rgba(232, 200, 106, 0.45);
  color: #3d2a14;
  font-size: 0.96rem;
  line-height: 1.65;
  word-break: break-word;
}

@media (orientation: portrait), (max-aspect-ratio: 1/1) {
  .board-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 15fr 70fr 15fr;
    grid-template-areas:
      "wall-top"
      "center"
      "wall-bottom";
    gap: 0.25rem;
    min-height: 0;
    padding: max(0px, env(safe-area-inset-top, 0))
      max(0px, env(safe-area-inset-right, 0))
      max(0px, env(safe-area-inset-bottom, 0))
      max(0px, env(safe-area-inset-left, 0));
  }

  #photo-wall-left {
    grid-area: wall-top;
    min-height: 0;
    overflow: hidden;
  }

  #photo-wall-right {
    grid-area: wall-bottom;
    min-height: 0;
    overflow: hidden;
  }

  .board-center {
    grid-area: center;
    height: 100%;
    min-height: 0;
    margin-left: max(6px, env(safe-area-inset-left, 0));
    margin-right: max(6px, env(safe-area-inset-right, 0));
  }

  .photo-wall {
    width: 100%;
    height: 100%;
  }
}

@media (max-width: 900px) and (orientation: landscape),
  (max-width: 900px) and (min-aspect-ratio: 1/1) {
  .board-layout {
    grid-template-columns: minmax(0, 0.85fr) minmax(330px, 63vw) minmax(0, 0.85fr);
    gap: 0.45rem;
  }

  .photo-wall {
    gap: 2px;
    padding: 2px;
  }
}

/* —— 捐助芳名榜弹窗 —— */
.donate-modal {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(12px, env(safe-area-inset-top, 12px))
    max(12px, env(safe-area-inset-right, 12px))
    max(12px, env(safe-area-inset-bottom, 12px))
    max(12px, env(safe-area-inset-left, 12px));
}

.donate-modal.is-closing {
  pointer-events: none;
}

.donate-modal[hidden] {
  display: none;
}

.donate-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 18, 32, 0.62);
  backdrop-filter: blur(2px);
  opacity: 1;
  transition: opacity 0.55s ease;
}

.donate-modal.is-closing .donate-modal__backdrop {
  opacity: 0;
}

.donate-panel {
  --scroll-wrap-width: min(88vw, 520px);
  --scroll-rod-width: 1.15rem;
  --scroll-rod-height: 2.65rem;
  --scroll-paper-max-width: min(72vw, 420px);
  --scroll-title-font-size: clamp(1.05rem, 3.8vw, 1.45rem);
  --scroll-title-padding: 0.55rem 1.5rem;
  --scroll-wrap-margin-bottom: -1.35rem;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(94vw, 920px);
  height: calc(var(--app-height, 100dvh) * 0.8);
  max-height: calc(var(--app-height, 100dvh) * 0.8);
}

.donate-panel__close {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  z-index: 5;
  width: 1.45rem;
  height: 1.45rem;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #6b4423;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
}

.donate-scroll {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--scroll-wrap-width);
  margin-bottom: var(--scroll-wrap-margin-bottom);
  pointer-events: none;
}

.donate-scroll__rod {
  flex-shrink: 0;
  width: var(--scroll-rod-width);
  height: var(--scroll-rod-height);
  border-radius: 45%;
  background:
    linear-gradient(180deg, #c9a066 0%, #8b5a2b 35%, #6b4423 70%, #4a2f18 100%);
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.35),
    inset 0 -2px 4px rgba(0, 0, 0, 0.25),
    0 3px 8px rgba(0, 0, 0, 0.28);
  transition: transform 0.85s cubic-bezier(0.33, 1, 0.68, 1);
}

.donate-scroll__rod--left {
  transform: translateX(42%);
}

.donate-scroll__rod--right {
  transform: translateX(-42%);
}

.donate-scroll__paper {
  flex: 1;
  min-width: 0;
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  text-align: center;
  background:
    linear-gradient(180deg, #faf0d8 0%, #f3e2bc 48%, #e8d3a8 100%);
  border: 2px solid #c9a066;
  border-radius: 4px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    0 4px 14px rgba(0, 0, 0, 0.18);
  transition:
    max-width 0.85s cubic-bezier(0.33, 1, 0.68, 1),
    opacity 0.55s ease;
}

.donate-scroll__title {
  margin: 0;
  padding: var(--scroll-title-padding);
  color: #5c3317;
  font-family: "STKaiti", "KaiTi", "PingFang SC", "Microsoft YaHei", serif;
  font-size: var(--scroll-title-font-size);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-align: center;
  white-space: nowrap;
  opacity: 0;
  transform: scale(0.88);
  transition:
    opacity 0.45s ease,
    transform 0.55s cubic-bezier(0.33, 1, 0.68, 1);
}

.donate-panel.is-open .donate-scroll__rod--left {
  transform: translateX(0);
}

.donate-panel.is-open .donate-scroll__rod--right {
  transform: translateX(0);
}

.donate-panel.is-open .donate-scroll__paper {
  max-width: var(--scroll-paper-max-width);
  opacity: 1;
  transition-delay: 0s;
}

.donate-panel.is-open .donate-scroll__title {
  opacity: 1;
  transform: scale(1);
  transition-delay: 0.25s;
}

.donate-panel.is-closing .donate-scroll__title {
  opacity: 0;
  transform: scale(0.88);
  transition-delay: 0.08s;
}

.donate-panel.is-closing .donate-scroll__paper {
  max-width: 0;
  opacity: 0;
  transition-delay: 0.35s;
}

.donate-panel.is-closing .donate-scroll__rod--left {
  transform: translateX(42%);
  transition-delay: 0.42s;
}

.donate-panel.is-closing .donate-scroll__rod--right {
  transform: translateX(-42%);
  transition-delay: 0.42s;
}

.donate-panel__sheet {
  width: 100%;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 1.85rem 1.1rem 1.1rem;
  border-radius: 18px;
  border: 2px solid rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.22);
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  transition:
    opacity 0.45s ease,
    transform 0.55s cubic-bezier(0.33, 1, 0.68, 1);
}

.donate-panel.is-open .donate-panel__sheet {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition-delay: 0.35s;
}

.donate-panel.is-closing .donate-panel__sheet {
  opacity: 0;
  transform: translateY(14px) scale(0.98);
  transition-delay: 0s;
}

.donate-list-viewport {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  scrollbar-width: thin;
  scrollbar-color: rgba(139, 69, 24, 0.35) transparent;
}

.donate-list-viewport::-webkit-scrollbar {
  width: 6px;
}

.donate-list-viewport::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(139, 69, 24, 0.35);
}

.donate-panel__notice {
  margin: 0 0 0.65rem;
  padding: 0.35rem 0.5rem;
  color: #8b7355;
  font-size: clamp(0.72rem, 1.9vw, 0.84rem);
  font-weight: 600;
  line-height: 1.45;
  text-align: center;
}

.donate-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.65rem 0.85rem;
  padding: 0.15rem 0.25rem 0.5rem;
}

.donate-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  min-width: 0;
  padding: 0.45rem 0.35rem;
  border-radius: 10px;
  background: rgba(255, 249, 235, 0.85);
  border: 1px solid rgba(201, 160, 102, 0.35);
}

.donate-item__name {
  color: #4a2f18;
  font-size: clamp(0.78rem, 2.2vw, 0.92rem);
  font-weight: 700;
  text-align: center;
  word-break: break-all;
}

.donate-item__meta {
  color: #7a5a32;
  font-size: clamp(0.66rem, 1.8vw, 0.78rem);
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  word-break: break-all;
}

.donate-item__amount {
  color: #8b4518;
  font-size: clamp(0.72rem, 1.9vw, 0.84rem);
  font-weight: 600;
}

.donate-panel__empty {
  margin: 0;
  padding: 2rem 0;
  color: #8b7355;
  font-size: 0.92rem;
  text-align: center;
}

@media (orientation: portrait), (max-aspect-ratio: 1/1) {
  .donate-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem 0.65rem;
  }

  .donate-panel__sheet {
    padding: 1.65rem 0.75rem 0.85rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .donate-scroll__rod,
  .donate-scroll__paper,
  .donate-scroll__title,
  .donate-panel__sheet {
    transition: none;
  }

  .donate-panel.is-open .donate-scroll__rod--left,
  .donate-panel.is-open .donate-scroll__rod--right {
    transform: none;
  }

  .donate-panel.is-open .donate-scroll__paper {
    max-width: var(--scroll-paper-max-width);
    opacity: 1;
  }

  .donate-panel.is-open .donate-scroll__title,
  .donate-panel.is-open .donate-panel__sheet {
    opacity: 1;
    transform: none;
  }
}

/* —— 创作回顾弹窗 —— */
.review-modal {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(12px, env(safe-area-inset-top, 12px))
    max(12px, env(safe-area-inset-right, 12px))
    max(12px, env(safe-area-inset-bottom, 12px))
    max(12px, env(safe-area-inset-left, 12px));
}

.review-modal.is-closing {
  pointer-events: none;
}

.review-modal[hidden] {
  display: none;
}

.review-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 18, 32, 0.62);
  backdrop-filter: blur(2px);
  opacity: 1;
  transition: opacity 0.55s ease;
}

.review-modal.is-closing .review-modal__backdrop {
  opacity: 0;
}

.review-panel {
  --scroll-wrap-width: min(88vw, 520px);
  --scroll-rod-width: 1.15rem;
  --scroll-rod-height: 2.65rem;
  --scroll-paper-max-width: min(72vw, 420px);
  --scroll-title-font-size: clamp(1.05rem, 3.8vw, 1.45rem);
  --scroll-title-padding: 0.55rem 1.5rem;
  --scroll-wrap-margin-bottom: -1.35rem;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(94vw, 920px);
  height: calc(var(--app-height, 100dvh) * 0.8);
  max-height: calc(var(--app-height, 100dvh) * 0.8);
}

.review-panel__close {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  z-index: 5;
  width: 1.45rem;
  height: 1.45rem;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #5c3d6e;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
}

.review-scroll {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--scroll-wrap-width);
  margin-bottom: var(--scroll-wrap-margin-bottom);
  pointer-events: none;
}

.review-scroll__rod {
  flex-shrink: 0;
  width: var(--scroll-rod-width);
  height: var(--scroll-rod-height);
  border-radius: 45%;
  background:
    linear-gradient(180deg, #b89fd4 0%, #8b6bae 35%, #6d4c8a 70%, #4a335f 100%);
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.35),
    inset 0 -2px 4px rgba(0, 0, 0, 0.25),
    0 3px 8px rgba(0, 0, 0, 0.28);
  transition: transform 0.85s cubic-bezier(0.33, 1, 0.68, 1);
}

.review-scroll__rod--left {
  transform: translateX(42%);
}

.review-scroll__rod--right {
  transform: translateX(-42%);
}

.review-scroll__paper {
  flex: 1;
  min-width: 0;
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  text-align: center;
  background:
    linear-gradient(180deg, #f5eefb 0%, #e8dcf5 48%, #ddd0ee 100%);
  border: 2px solid #b89fd4;
  border-radius: 4px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    0 4px 14px rgba(0, 0, 0, 0.18);
  transition:
    max-width 0.85s cubic-bezier(0.33, 1, 0.68, 1),
    opacity 0.55s ease;
}

.review-scroll__title {
  margin: 0;
  padding: var(--scroll-title-padding);
  color: #4a335f;
  font-family: "STKaiti", "KaiTi", "PingFang SC", "Microsoft YaHei", serif;
  font-size: var(--scroll-title-font-size);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-align: center;
  white-space: nowrap;
  opacity: 0;
  transform: scale(0.88);
  transition:
    opacity 0.45s ease,
    transform 0.55s cubic-bezier(0.33, 1, 0.68, 1);
}

.review-panel.is-open .review-scroll__rod--left {
  transform: translateX(0);
}

.review-panel.is-open .review-scroll__rod--right {
  transform: translateX(0);
}

.review-panel.is-open .review-scroll__paper {
  max-width: var(--scroll-paper-max-width);
  opacity: 1;
  transition-delay: 0s;
}

.review-panel.is-open .review-scroll__title {
  opacity: 1;
  transform: scale(1);
  transition-delay: 0.25s;
}

.review-panel.is-closing .review-scroll__title {
  opacity: 0;
  transform: scale(0.88);
  transition-delay: 0.08s;
}

.review-panel.is-closing .review-scroll__paper {
  max-width: 0;
  opacity: 0;
  transition-delay: 0.35s;
}

.review-panel.is-closing .review-scroll__rod--left {
  transform: translateX(42%);
  transition-delay: 0.42s;
}

.review-panel.is-closing .review-scroll__rod--right {
  transform: translateX(-42%);
  transition-delay: 0.42s;
}

.review-panel__sheet {
  width: 100%;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 1.85rem 1.1rem 1.1rem;
  border-radius: 18px;
  border: 2px solid rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.22);
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  transition:
    opacity 0.45s ease,
    transform 0.55s cubic-bezier(0.33, 1, 0.68, 1);
}

.review-panel.is-open .review-panel__sheet {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition-delay: 0.35s;
}

.review-panel.is-closing .review-panel__sheet {
  opacity: 0;
  transform: translateY(14px) scale(0.98);
  transition-delay: 0s;
}

.review-content-viewport {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  scrollbar-width: thin;
  scrollbar-color: rgba(109, 76, 138, 0.35) transparent;
}

.review-content-viewport::-webkit-scrollbar {
  width: 6px;
}

.review-content-viewport::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(109, 76, 138, 0.35);
}

.review-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 0.15rem 0.25rem 0.5rem;
}

.review-block {
  margin: 0;
}

.review-block--text {
  color: #4a335f;
  font-size: clamp(0.82rem, 2.2vw, 0.95rem);
  line-height: 1.75;
  text-align: justify;
  white-space: pre-wrap;
}

.review-block--image,
.review-block--gallery {
  width: 100%;
}

.review-image-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(245, 238, 251, 0.85);
  cursor: zoom-in;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.review-image-btn img {
  display: block;
  width: 100%;
  height: auto;
}

.review-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.review-block__caption {
  margin-top: 0.45rem;
  color: #6d4c8a;
  font-size: clamp(0.72rem, 1.9vw, 0.84rem);
  line-height: 1.5;
  text-align: center;
}

.review-panel__empty {
  margin: 0;
  padding: 2rem 0;
  color: #8b7355;
  font-size: 0.92rem;
  text-align: center;
}

.review-lightbox {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(12px, env(safe-area-inset-top, 12px))
    max(12px, env(safe-area-inset-right, 12px))
    max(12px, env(safe-area-inset-bottom, 12px))
    max(12px, env(safe-area-inset-left, 12px));
}

.review-lightbox[hidden] {
  display: none;
}

.review-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
}

.review-lightbox__close {
  position: absolute;
  top: max(12px, env(safe-area-inset-top, 12px));
  right: max(12px, env(safe-area-inset-right, 12px));
  z-index: 2;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.review-lightbox__img {
  position: relative;
  z-index: 1;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

@media (orientation: portrait), (max-aspect-ratio: 1/1) {
  .review-panel__sheet {
    padding: 1.65rem 0.75rem 0.85rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .review-scroll__rod,
  .review-scroll__paper,
  .review-scroll__title,
  .review-panel__sheet {
    transition: none;
  }

  .review-panel.is-open .review-scroll__rod--left,
  .review-panel.is-open .review-scroll__rod--right {
    transform: none;
  }

  .review-panel.is-open .review-scroll__paper {
    max-width: var(--scroll-paper-max-width);
    opacity: 1;
  }

  .review-panel.is-open .review-scroll__title,
  .review-panel.is-open .review-panel__sheet {
    opacity: 1;
    transform: none;
  }
}

/* —— 缘起弹窗 —— */
.origin-modal {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(12px, env(safe-area-inset-top, 12px))
    max(12px, env(safe-area-inset-right, 12px))
    max(12px, env(safe-area-inset-bottom, 12px))
    max(12px, env(safe-area-inset-left, 12px));
}

.origin-modal.is-closing {
  pointer-events: none;
}

.origin-modal[hidden] {
  display: none;
}

.origin-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 18, 32, 0.62);
  backdrop-filter: blur(2px);
  opacity: 1;
  transition: opacity 0.55s ease;
}

.origin-modal.is-closing .origin-modal__backdrop {
  opacity: 0;
}

.origin-panel {
  --origin-font-scale: 1.7;
  --scroll-wrap-width: min(88vw, 520px);
  --scroll-rod-width: 1.15rem;
  --scroll-rod-height: 2.65rem;
  --scroll-paper-max-width: min(72vw, 420px);
  --scroll-title-font-size: clamp(1.05rem, 3.8vw, 1.45rem);
  --scroll-title-padding: 0.55rem 1.5rem;
  --scroll-wrap-margin-bottom: -1.35rem;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(94vw, 920px);
  height: calc(var(--app-height, 100dvh) * 0.8);
  max-height: calc(var(--app-height, 100dvh) * 0.8);
}

.origin-panel__close {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  z-index: 5;
  width: 1.45rem;
  height: 1.45rem;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #1e6b8c;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
}

.origin-scroll {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--scroll-wrap-width);
  margin-bottom: var(--scroll-wrap-margin-bottom);
  pointer-events: none;
}

.origin-scroll__rod {
  flex-shrink: 0;
  width: var(--scroll-rod-width);
  height: var(--scroll-rod-height);
  border-radius: 45%;
  background:
    linear-gradient(180deg, #6ec4e8 0%, #2a8fbf 35%, #1e6b8c 70%, #12465f 100%);
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.35),
    inset 0 -2px 4px rgba(0, 0, 0, 0.25),
    0 3px 8px rgba(0, 0, 0, 0.28);
  transition: transform 0.85s cubic-bezier(0.33, 1, 0.68, 1);
}

.origin-scroll__rod--left {
  transform: translateX(42%);
}

.origin-scroll__rod--right {
  transform: translateX(-42%);
}

.origin-scroll__paper {
  flex: 1;
  min-width: 0;
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  text-align: center;
  background:
    linear-gradient(180deg, #e8f6fc 0%, #d4edf8 48%, #c0e2f2 100%);
  border: 2px solid #6ec4e8;
  border-radius: 4px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    0 4px 14px rgba(0, 0, 0, 0.18);
  transition:
    max-width 0.85s cubic-bezier(0.33, 1, 0.68, 1),
    opacity 0.55s ease;
}

.origin-scroll__title {
  margin: 0;
  padding: var(--scroll-title-padding);
  color: #12465f;
  font-family: "STKaiti", "KaiTi", "PingFang SC", "Microsoft YaHei", serif;
  font-size: var(--scroll-title-font-size);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-align: center;
  white-space: nowrap;
  opacity: 0;
  transform: scale(0.88);
  transition:
    opacity 0.45s ease,
    transform 0.55s cubic-bezier(0.33, 1, 0.68, 1);
}

.origin-panel.is-open .origin-scroll__rod--left {
  transform: translateX(0);
}

.origin-panel.is-open .origin-scroll__rod--right {
  transform: translateX(0);
}

.origin-panel.is-open .origin-scroll__paper {
  max-width: var(--scroll-paper-max-width);
  opacity: 1;
  transition-delay: 0s;
}

.origin-panel.is-open .origin-scroll__title {
  opacity: 1;
  transform: scale(1);
  transition-delay: 0.25s;
}

.origin-panel.is-closing .origin-scroll__title {
  opacity: 0;
  transform: scale(0.88);
  transition-delay: 0.08s;
}

.origin-panel.is-closing .origin-scroll__paper {
  max-width: 0;
  opacity: 0;
  transition-delay: 0.35s;
}

.origin-panel.is-closing .origin-scroll__rod--left {
  transform: translateX(42%);
  transition-delay: 0.42s;
}

.origin-panel.is-closing .origin-scroll__rod--right {
  transform: translateX(-42%);
  transition-delay: 0.42s;
}

.origin-panel__sheet {
  width: 100%;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 1.85rem 1.1rem 1.1rem;
  border-radius: 18px;
  border: 2px solid rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.22);
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  transition:
    opacity 0.45s ease,
    transform 0.55s cubic-bezier(0.33, 1, 0.68, 1);
}

.origin-panel.is-open .origin-panel__sheet {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition-delay: 0.35s;
}

.origin-panel.is-closing .origin-panel__sheet {
  opacity: 0;
  transform: translateY(14px) scale(0.98);
  transition-delay: 0s;
}

.origin-content-viewport {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  scrollbar-width: thin;
  scrollbar-color: rgba(30, 107, 140, 0.35) transparent;
  container-type: inline-size;
  container-name: origin;
}

.origin-panel--image-only .origin-content-viewport {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  overflow-x: hidden;
  overflow-y: auto;
}

.origin-content-viewport::-webkit-scrollbar {
  width: 6px;
}

.origin-content-viewport::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(30, 107, 140, 0.35);
}

.origin-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 0.15rem 0.25rem 0.5rem;
}

.origin-panel--image-only .origin-panel__sheet {
  padding: 2.15rem 0.5rem 0.5rem;
}

.origin-panel--image-only .origin-content {
  flex: 0 0 auto;
  width: 100%;
  height: auto;
  gap: 0;
  padding: 0.12rem 0 0;
}

.origin-block {
  margin: 0;
}

.origin-block--text {
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  color: #123547;
  font-size: clamp(calc(0.82rem * var(--origin-font-scale)), calc(2.2vw * var(--origin-font-scale)), calc(0.95rem * var(--origin-font-scale)));
  line-height: 1.85;
  text-align: justify;
  text-indent: 2em;
  white-space: pre-wrap;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.origin-block--figure {
  width: 100%;
}

.origin-panel--image-only .origin-block--figure {
  width: 100%;
  flex: 0 0 auto;
  display: block;
}

.origin-figure-btn {
  display: block;
  width: 100%;
  max-width: 100%;
  padding: 0;
  border: none;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(232, 246, 252, 0.85);
  cursor: zoom-in;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.origin-panel--image-only .origin-figure-btn {
  width: 100%;
  max-width: 100%;
  display: block;
  overflow: hidden;
  background: transparent;
  box-shadow: none;
  border-radius: 8px;
}

.origin-figure__img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  object-position: center;
}

.origin-panel--image-only .origin-figure__img {
  width: 100%;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  object-position: center;
}

.origin-block--image,
.origin-block--gallery {
  width: 100%;
}

.origin-image-btn {
  display: block;
  width: 100%;
  max-width: 100%;
  padding: 0;
  border: none;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(232, 246, 252, 0.85);
  cursor: zoom-in;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.origin-image-btn img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  object-position: center;
}

.origin-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.origin-block__caption {
  margin-top: 0.45rem;
  color: #1e6b8c;
  font-size: clamp(calc(0.72rem * var(--origin-font-scale)), calc(1.9vw * var(--origin-font-scale)), calc(0.84rem * var(--origin-font-scale)));
  line-height: 1.5;
  text-align: center;
}

.origin-panel__empty {
  margin: 0;
  padding: 2rem 0;
  color: #5a7a88;
  font-size: calc(0.92rem * var(--origin-font-scale));
  text-align: center;
}

.origin-lightbox {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(12px, env(safe-area-inset-top, 12px))
    max(12px, env(safe-area-inset-right, 12px))
    max(12px, env(safe-area-inset-bottom, 12px))
    max(12px, env(safe-area-inset-left, 12px));
}

.origin-lightbox[hidden] {
  display: none;
}

.origin-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
}

.origin-lightbox__close {
  position: absolute;
  top: max(12px, env(safe-area-inset-top, 12px));
  right: max(12px, env(safe-area-inset-right, 12px));
  z-index: 2;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.origin-lightbox__img {
  position: relative;
  z-index: 1;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

@media (orientation: portrait), (max-aspect-ratio: 1/1) {
  .origin-panel {
    --origin-font-scale: 1.3;
  }

  .origin-panel--image-only .origin-panel__sheet {
    padding: 2rem 0.35rem 0.35rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .origin-scroll__rod,
  .origin-scroll__paper,
  .origin-scroll__title,
  .origin-panel__sheet {
    transition: none;
  }

  .origin-panel.is-open .origin-scroll__rod--left,
  .origin-panel.is-open .origin-scroll__rod--right {
    transform: none;
  }

  .origin-panel.is-open .origin-scroll__paper {
    max-width: var(--scroll-paper-max-width);
    opacity: 1;
  }

  .origin-panel.is-open .origin-scroll__title,
  .origin-panel.is-open .origin-panel__sheet {
    opacity: 1;
    transform: none;
  }
}
