:root {
  --paper: #F3EBDD;
  --ink: #28251F;
  --cinnabar: #9C3527;
  --gold: #7E5D28;
  --bar-height: 48px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-size: min(2.666667vw, 12.8px);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(704px 525px at 12% -8%, rgba(255, 250, 237, 0.92), rgba(255, 250, 237, 0) 58%),
    radial-gradient(486px 397px at 104% 8%, rgba(156, 53, 39, 0.055), rgba(156, 53, 39, 0) 62%),
    var(--paper);
  color: var(--ink);
  overscroll-behavior-y: contain;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: rgba(93, 72, 43, 0.025);
}

#pwa-shell {
  width: min(100%, 480px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--paper);
  box-shadow: 0 0 48px rgba(68, 51, 31, 0.12);
}

.pwa-bar {
  position: fixed;
  z-index: 100;
  top: 0;
  left: 50%;
  display: flex;
  align-items: center;
  width: min(100%, 480px);
  height: calc(var(--bar-height) + var(--safe-top));
  padding: var(--safe-top) 10px 0;
  transform: translateX(-50%);
  border-bottom: 1px solid rgba(126, 93, 40, 0.12);
  background: rgba(243, 235, 221, 0.94);
  box-shadow: 0 6px 20px rgba(77, 59, 35, 0.04);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.pwa-bar__button {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  height: 36px;
  min-width: 36px;
  padding: 0 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.pwa-bar__button[hidden] {
  display: none;
}

.pwa-bar__button:active {
  background: rgba(126, 93, 40, 0.1);
}

.pwa-bar__home {
  margin-left: 2px;
  border: 1px solid rgba(156, 53, 39, 0.28);
  color: var(--cinnabar);
  font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", serif;
  font-size: 18px;
}

.pwa-bar__title {
  flex: 1;
  overflow: hidden;
  padding: 0 8px;
  font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", serif;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 2px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pwa-bar__install {
  min-width: 48px;
  color: var(--gold);
  font-size: 13px;
  letter-spacing: 1px;
}

#pwa-view {
  min-height: 100vh;
  padding-top: calc(var(--bar-height) + var(--safe-top));
}

#pwa-view .page {
  min-height: calc(100vh - var(--bar-height) - var(--safe-top));
}



#pwa-view button,
#pwa-view input,
#pwa-view textarea,
#pwa-view select {
  font: inherit;
}

#pwa-view input,
#pwa-view textarea {
  appearance: none;
  -webkit-appearance: none;
}

#pwa-view button {
  cursor: pointer;
  touch-action: manipulation;
}

#pwa-view button:active {
  opacity: 0.84;
}

.wx-picker {
  position: relative;
}

.wx-picker__native {
  position: absolute;
  z-index: 4;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0;
  cursor: pointer;
}

.wx-switch {
  position: relative;
  display: inline-flex;
  width: 46px;
  height: 28px;
  vertical-align: middle;
  cursor: pointer;
}

.wx-switch__input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.wx-switch__track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #CEC4B4;
  transition: background 160ms ease;
}

.wx-switch__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #FFF9EE;
  box-shadow: 0 2px 5px rgba(77, 59, 35, 0.18);
  transition: transform 160ms ease;
}

.wx-switch__input:checked + .wx-switch__track {
  background: var(--gold);
}

.wx-switch__input:checked + .wx-switch__track::after {
  transform: translateX(18px);
}

.wx-slider {
  width: 100%;
}

.wx-slider__input {
  width: 100%;
  accent-color: var(--gold);
}

#pwa-loading {
  position: fixed;
  z-index: 500;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--paper);
  transition: opacity 220ms ease, visibility 220ms ease;
}

body.pwa-ready #pwa-loading,
#pwa-loading[hidden] {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.pwa-loading__mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 62px;
  height: 62px;
  border: 1px solid #7D2A20;
  border-radius: 9px;
  background: linear-gradient(145deg, #A63B2C, #8E2D21);
  color: #FFF8E9;
  font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", serif;
  font-size: 38px;
  transform: rotate(-2deg);
  animation: seal-breathe 1.4s ease-in-out infinite;
}

.pwa-loading__text {
  margin-top: 16px;
  color: var(--gold);
  font-size: 13px;
  letter-spacing: 5px;
}

@keyframes seal-breathe {
  0%, 100% { transform: rotate(-2deg) scale(1); }
  50% { transform: rotate(-2deg) scale(1.045); }
}

#pwa-toast {
  position: fixed;
  z-index: 600;
  bottom: calc(30px + var(--safe-bottom));
  left: 50%;
  max-width: min(82vw, 360px);
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(40, 37, 31, 0.9);
  color: #FFF9EE;
  font-size: 13px;
  line-height: 1.45;
  opacity: 0;
  transform: translate(-50%, 10px);
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
}

#pwa-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.pwa-modal-backdrop {
  position: fixed;
  z-index: 700;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(40, 37, 31, 0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.pwa-modal {
  width: min(100%, 340px);
  padding: 22px;
  border: 1px solid #D6C6AE;
  border-radius: 18px;
  background: #FFF9EE;
  box-shadow: 0 20px 60px rgba(40, 37, 31, 0.18);
}

.pwa-modal h2 {
  margin: 0 0 10px;
  font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", serif;
  font-size: 19px;
}

.pwa-modal p {
  margin: 0;
  color: #5F5A50;
  font-size: 14px;
  line-height: 1.7;
}

.pwa-modal textarea {
  width: 100%;
  min-height: 100px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #D6C6AE;
  border-radius: 10px;
  background: #FFFDF8;
  color: var(--ink);
  resize: vertical;
}

.pwa-modal__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

.pwa-modal__actions button {
  min-width: 74px;
  padding: 9px 14px;
  border: 0;
  border-radius: 9px;
  background: #EDE2D0;
  color: #4E4A42;
  font-size: 14px;
}

.pwa-modal__actions .is-primary {
  margin-left: 8px;
  background: #37332A;
  color: #FFF8E9;
}

.pwa-fatal {
  margin: 30px 20px;
  padding: 24px;
  border: 1px solid #D6C6AE;
  border-radius: 14px;
  background: #FFF9EE;
}

.pwa-fatal h2 {
  margin-top: 0;
}

.pwa-fatal p {
  color: #68635A;
  word-break: break-word;
}



@supports (padding: max(0px)) {
  .page {
    padding-bottom: max(2.8rem, var(--safe-bottom)) !important;
  }
}