/* 毛绒午后 · 加载画面 */
#loading {
  --tl-ink: #4b5842;
  --tl-ink-soft: #606d53;
  --tl-apricot: #b25e30;
  --tl-track: #e6dfca;
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  user-select: none;
  background: linear-gradient(#cfe5ef, #e6f0ec 34%, #f8f1e1 66%, #f5e7cd);
  font-family:
    "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif;
  color: var(--tl-ink);
  transition:
    opacity 0.28s ease,
    visibility 0.28s ease;
}
#loading.is-done {
  opacity: 0;
  visibility: hidden;
}
#loading.is-done .tl-stage-wrap {
  transform: scale(1.06);
}
#loading.is-ready {
  cursor: pointer;
}
.tl-glow {
  position: absolute;
  left: 53%;
  top: 38%;
  width: min(740px, 145vw);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, #ffe2a6b3, #ffe2a640 38%, #ffe2a600 69%);
  animation: tl-glow 7s ease-in-out infinite;
  pointer-events: none;
}

/* 远山草坡 */
.tl-hills {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 30vh;
  min-height: 160px;
}
.tl-cloud {
  position: absolute;
  width: 120px;
  height: 34px;
  border-radius: 40px;
  background: #fff;
  opacity: 0.55;
  filter: blur(0.3px);
}
.tl-cloud::before,
.tl-cloud::after {
  content: "";
  position: absolute;
  background: inherit;
  border-radius: 50%;
}
.tl-cloud::before {
  width: 50px;
  height: 50px;
  left: 20px;
  top: -24px;
}
.tl-cloud::after {
  width: 38px;
  height: 38px;
  left: 60px;
  top: -16px;
}
.tl-cloud.c1 {
  top: 12%;
  left: -140px;
  animation: tl-drift 70s linear infinite -13s;
}
.tl-cloud.c2 {
  top: 18%;
  left: -140px;
  animation: tl-drift 90s linear infinite -49s;
}

.tl-stage-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.7s ease;
  margin-top: -8vh;
}

/* 主标志 */
.tl-mark-box {
  position: relative;
  --tl-mark-size: clamp(126px, 18vh, 156px);
  width: var(--tl-mark-size);
  height: calc(var(--tl-mark-size) + 5px);
}
.tl-mark {
  display: block;
  width: 100%;
  height: auto;
  animation: tl-nap 4.2s ease-in-out infinite;
  transform-origin: 50% 90%;
}
.tl-shadow {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 84px;
  height: 10px;
  margin-left: -42px;
  border-radius: 50%;
  background: #4b5842;
  opacity: 0.11;
  animation: tl-shadow 4.2s ease-in-out infinite;
}
.tl-sleep {
  position: absolute;
  top: -14px;
  left: -19px;
  width: 42px;
  height: 48px;
  overflow: visible;
  fill: none;
  stroke: #707f60;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}
.tl-z {
  opacity: 0;
  animation: tl-sleep 4.2s ease-out infinite;
}
.tl-z-small {
  animation-delay: 1.35s;
}

/* 字标 */
.tl-title {
  margin: 14px 0 0;
  font-size: clamp(36px, 10vw, 54px);
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1.1;
  font-family:
    "ZCOOL QingKe HuangYou", "站酷庆科黄油体", "Alimama FangYuanTi VF",
    "阿里妈妈方圆体", "PingFang SC", "Microsoft YaHei", sans-serif;
  text-indent: 0.14em;
}
.tl-title .noon {
  color: var(--tl-apricot);
}
.tl-en {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.46em;
  text-indent: 0.46em;
  color: var(--tl-ink-soft);
  font-family: "Fredoka", "Nunito", "Trebuchet MS", "Segoe UI", sans-serif;
}

/* 爪印进度 */
.tl-progress {
  margin-top: 32px;
  width: min(340px, 80vw);
}
#loading.is-ready .tl-progress {
  visibility: hidden;
}
#loadEntry {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: min(340px, 88vw);
  transform: translateX(-50%);
  text-align: center;
  animation: tl-entry 0.5s ease both;
}
#loadEntry[hidden] {
  display: none;
}
#loadEntry button {
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid #b25e304b;
  border-radius: 99px;
  background: #fff9e9b3;
  color: var(--tl-ink);
  box-shadow: none;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
#loadEntry button:hover {
  background: #fff9e9;
}
#loadEntry button:focus-visible {
  outline: 2px solid var(--tl-ink);
  outline-offset: 3px;
}
#loadAudioHint {
  display: block;
  margin-top: 9px;
  color: var(--tl-ink-soft);
  font-size: 13px;
}
@keyframes tl-entry {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.tl-paws {
  position: relative;
  height: 26px;
  display: flex;
  justify-content: space-between;
  padding: 0 4px;
}
.tl-paw {
  width: 16px;
  height: 16px;
  opacity: 0.14;
  transform: scale(0.7);
  transition:
    opacity 0.35s ease,
    transform 0.35s cubic-bezier(0.3, 1.6, 0.5, 1);
  fill: var(--tl-ink);
}
.tl-paw:nth-child(odd) {
  margin-top: 9px;
}
.tl-paw:nth-child(odd) svg {
  transform: rotate(-12deg);
}
.tl-paw:nth-child(even) svg {
  transform: rotate(12deg);
}
.tl-paw.on {
  opacity: 0.85;
  transform: scale(1);
  fill: #b76c3a;
}
.tl-track {
  margin-top: 8px;
  height: 10px;
  border-radius: 99px;
  background: var(--tl-track);
  box-shadow: inset 0 1px 2px rgba(75, 88, 66, 0.18);
  overflow: hidden;
}
.tl-fill {
  height: 100%;
  width: 100%;
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 0.28s ease;
  border-radius: 99px;
  background: linear-gradient(90deg, #f6cf8a, #d9844a);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.08);
}
.tl-meta {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 14px;
  color: var(--tl-ink-soft);
}
.tl-pct {
  font-family: "Fredoka", "Nunito", "Segoe UI", sans-serif;
  font-weight: 700;
  color: var(--tl-ink);
  font-variant-numeric: tabular-nums;
}

/* 园长小贴士 */
.tl-tip {
  position: absolute;
  left: 50%;
  bottom: max(28px, calc(env(safe-area-inset-bottom) + 12px));
  transform: translateX(-50%);
  width: min(460px, 88vw);
  box-sizing: border-box;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  border-radius: 18px;
  background: rgba(255, 252, 243, 0.78);
  box-shadow: 0 6px 20px rgba(75, 88, 66, 0.1);
  backdrop-filter: blur(6px);
  font-size: 14px;
  line-height: 1.55;
}
.tl-tip-icon {
  flex: 0 0 40px;
  height: 40px;
}
.tl-tip-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #935727;
  letter-spacing: 0.08em;
}
.tl-tip-text {
  transition: opacity 0.4s ease;
  color: var(--tl-ink);
}
.tl-tip-text.fade {
  opacity: 0;
}

@keyframes tl-glow {
  0%,
  100% {
    opacity: 0.82;
  }
  50% {
    opacity: 1;
  }
}
@keyframes tl-nap {
  0%,
  100% {
    transform: translateY(0) scale(1, 1);
  }
  50% {
    transform: translateY(-4px) scale(1.015, 1.025);
  }
}
@keyframes tl-shadow {
  0%,
  100% {
    transform: scaleX(1);
    opacity: 0.11;
  }
  50% {
    transform: scaleX(0.92);
    opacity: 0.08;
  }
}
@keyframes tl-sleep {
  0% {
    opacity: 0;
    transform: translate(0, 0);
  }
  22% {
    opacity: 0.8;
  }
  84%,
  100% {
    opacity: 0;
    transform: translate(-8px, -20px);
  }
}
@keyframes tl-drift {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(calc(100vw + 300px));
  }
}

@media (max-height: 560px) {
  .tl-tip {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  #loading *,
  #loading *::before,
  #loading *::after {
    animation: none !important;
  }
}

/* Keep the entry controls within the viewport in landscape and on small phones. */
#loading .tl-meta {
  gap: 12px;
}
#loading .tl-pct {
  flex-shrink: 0;
}
#loadRecovery {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}
#loadRecovery[hidden] {
  display: none;
}
#loadRecovery button {
  min-height: 44px;
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 14px;
  background: #e9ead7;
  color: #4b5842;
}
#loadRecovery .primary {
  background: #526b47;
  color: #fff9ed;
}
#loading.is-failed .tl-track,
#loading.is-failed .tl-paws {
  visibility: hidden;
}
#loading.is-failed .tl-pct,
#loading.is-failed .tl-tip {
  display: none;
}
@media (max-height: 430px) {
  #loading .tl-mark-box {
    --tl-mark-size: 92px;
  }
  #loading .tl-title {
    font-size: 30px;
  }
  #loading .tl-progress {
    margin-top: 20px;
  }
}
@media (prefers-reduced-motion: reduce) {
  #loading,
  #loading * {
    transition: none !important;
  }
}

header .brand {
  padding: 3px 12px 3px 5px;
  border: 1px solid #fff9;
  border-radius: 17px;
  background: #fbf8eee8;
  box-shadow: 0 3px 12px #4b58421a;
  color: #4b5842;
}
.brand h1 {
  letter-spacing: 0.1em;
  font-weight: 760;
}
.brand small {
  color: #4b5842;
  text-transform: uppercase;
}
.brand .park-brand-mark {
  width: 52px;
  height: 52px;
  display: block;
  flex-shrink: 0;
}
.brand .brand-accent {
  color: #8e5229;
}
@media (max-width: 700px) {
  .brand .park-brand-mark {
    width: 39px;
    height: 39px;
  }
  .brand {
    gap: 6px;
  }
  .brand h1 {
    white-space: nowrap;
  }
}

@media (max-width: 360px) {
  header .brand {
    padding-right: 8px;
    gap: 4px;
  }
  .brand .park-brand-mark {
    width: 32px;
    height: 32px;
  }
  .brand h1 {
    font-size: 16px;
    letter-spacing: 0.04em;
  }
  .brand small {
    letter-spacing: 0.12em;
  }
  .header-right {
    gap: 4px;
  }
  #connection {
    padding-inline: 7px;
    white-space: nowrap;
  }
}
