*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #f7f7f7;
  color: #222222;
  font-family: "PingFang SC", "Songti SC", "STSong", "Noto Serif SC", serif;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  user-select: none;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
    env(safe-area-inset-bottom) env(safe-area-inset-left);
}

#game {
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 0;
}

#game canvas {
  display: block;
  margin: 0 auto;
  touch-action: none;
  image-rendering: auto;
}

#boot-mask {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: #ffffff;
  transition: opacity 0.35s ease;
}

.boot-yi-wrap {
  position: relative;
  width: calc(100vw * 280 / 750 * 1.45);
  height: calc(100vw * 280 / 750 * 1.45);
  display: grid;
  place-items: center;
}

.boot-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid rgba(166, 124, 0, 0.55);
  box-sizing: border-box;
}

.boot-ring-outer {
  inset: 0;
  animation: boot-spin-cw 5s linear infinite;
  border-color: rgba(166, 124, 0, 0.65);
  box-shadow: 0 0 0 1px rgba(166, 124, 0, 0.08);
}

.boot-ring-inner {
  inset: 14%;
  animation: boot-spin-ccw 3.2s linear infinite;
  border-color: rgba(166, 124, 0, 0.38);
}

.boot-yi {
  position: relative;
  z-index: 1;
  margin: 0;
  letter-spacing: 0;
  font-size: calc(100vw * 280 / 750 * 1.06);
  color: #a67c00;
  font-family: "Songti SC", "STSong", "PingFang SC", serif;
  animation: boot-yi-breathe 1.8s ease-in-out infinite;
  will-change: transform, opacity;
}

@keyframes boot-spin-cw {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes boot-spin-ccw {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(-360deg);
  }
}

@keyframes boot-yi-breathe {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.78;
    transform: scale(0.97);
  }
}

@media (prefers-reduced-motion: reduce) {
  .boot-ring-outer,
  .boot-ring-inner,
  .boot-yi {
    animation: none;
  }
}

#boot-mask.is-hide {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

#boot-mask.is-gone {
  display: none !important;
}

#wx-tip {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 40;
  padding: 16px 18px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid #e0e0e0;
  color: #222222;
  font-family: "PingFang SC", "Songti SC", sans-serif;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
}

#wx-tip[hidden] {
  display: none !important;
}

.wx-tip-title {
  font-size: 18px;
  color: #222222;
  margin-bottom: 8px;
  font-weight: 600;
}

.wx-tip-body {
  font-size: 16px;
  line-height: 1.55;
  color: #666666;
  margin-bottom: 12px;
}

.wx-tip-body b {
  color: #222222;
  font-weight: 600;
}

#wx-tip-ok {
  display: block;
  width: 100%;
  padding: 12px 12px;
  border: none;
  border-radius: 8px;
  background: #c9a227;
  color: #ffffff;
  font-size: 17px;
  font-family: inherit;
}

/* 账号登录浮层 */
#liuyao-login {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: block;
  padding: 0;
  pointer-events: auto;
  touch-action: none;
}

#liuyao-login .liuyao-login-backdrop {
  opacity: 0;
  transition: opacity 180ms ease-out;
}

#liuyao-login .liuyao-login-page {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 180ms ease-out,
    transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

#liuyao-login.is-open .liuyao-login-backdrop {
  opacity: 1;
}

#liuyao-login.is-open .liuyao-login-page {
  opacity: 1;
  transform: translateY(0);
}

#liuyao-login[hidden] {
  display: none !important;
}

.liuyao-login-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 10, 6, 0.78);
}

.liuyao-login-page {
  position: relative;
  box-sizing: border-box;
  min-height: 100%;
  padding: max(24px, env(safe-area-inset-top)) 20px max(32px, env(safe-area-inset-bottom));
  overflow-y: auto;
  background: #f7f7f7;
  font-family: "PingFang SC", "Songti SC", sans-serif;
}

.liuyao-login-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 420px;
  margin: 0 auto 48px;
  color: #9a7b2e;
  font-size: 15px;
  letter-spacing: 0.18em;
}

.liuyao-login-back {
  border: 0;
  background: transparent;
  color: #555;
  font: inherit;
  letter-spacing: 0;
  cursor: pointer;
}

.liuyao-login-back::before {
  content: "‹";
  margin-right: 4px;
  font-size: 22px;
  vertical-align: -1px;
}

.liuyao-login-card {
  position: relative;
  box-sizing: border-box;
  width: min(420px, 100%);
  margin: 0 auto;
  padding: 34px 26px 26px;
  border-radius: 20px;
  background: #ffffff;
  border: 1px solid #ece5d5;
  box-shadow: 0 18px 44px rgba(48, 34, 12, 0.12);
}

.liuyao-login-mark {
  width: 54px;
  height: 54px;
  margin: 0 auto 18px;
  border: 1px solid #a67c00;
  border-radius: 50%;
  color: #a67c00;
  display: grid;
  place-items: center;
  font-family: "Songti SC", serif;
  font-size: 30px;
}

.liuyao-login-card h2 {
  text-align: center;
  font-size: 22px;
  color: #222;
  margin-bottom: 6px;
  font-weight: 600;
}

.liuyao-login-sub {
  text-align: center;
  font-size: 14px;
  color: #666;
  margin-bottom: 16px;
  line-height: 1.5;
}

.liuyao-login-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 24px 0 20px;
  padding: 4px;
  border-radius: 12px;
  background: #f5f2ea;
}

.liuyao-login-tabs button {
  border: 0;
  padding: 10px;
  border-radius: 8px;
  background: transparent;
  color: #777;
  font: inherit;
  cursor: pointer;
}

.liuyao-login-tabs button.is-active {
  background: #fff;
  color: #8b6914;
  box-shadow: 0 2px 8px rgba(86, 64, 17, 0.12);
}

.liuyao-login-card label {
  display: block;
  font-size: 14px;
  color: #555;
  margin-bottom: 12px;
}

.liuyao-login-card input {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 11px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
  color: #222;
  background: #fafafa;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.liuyao-login-card input:focus {
  outline: none;
  border-color: #a67c00;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(166, 124, 0, 0.12);
}

.liuyao-login-user {
  font-size: 18px;
  color: #222;
  margin-bottom: 14px;
  font-weight: 600;
}

.liuyao-login-err {
  font-size: 14px;
  color: #c62828;
  margin: 8px 0 4px;
}

.liuyao-login-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.liuyao-login-actions button {
  flex: 1 1 auto;
  min-width: 88px;
  padding: 11px 14px;
  border-radius: 8px;
  border: 1px solid #d8d8d8;
  background: #fff;
  color: #333;
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}

.liuyao-login-actions button:hover {
  border-color: #a67c00;
}

.liuyao-login-actions button:active {
  transform: scale(0.97);
}

.liuyao-login-actions button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.liuyao-login-actions button.primary {
  background: #a67c00;
  border-color: #a67c00;
  color: #fff;
}

.liuyao-login-hint {
  margin-top: 12px;
  font-size: 12px;
  color: #999;
  text-align: center;
}
