.app-view-layer[hidden] {
  display: none;
}

.app-view-panel__header[hidden] {
  display: none !important;
}

.app-view-layer {
  position: absolute;
  inset: 0;
  z-index: var(--z-modal);
  border-radius: 0;
  overflow: hidden;
}

.app-view-layer__backdrop {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.82) 0%,
    rgba(245, 247, 255, 0.95) 100%
  );
  backdrop-filter: blur(24px) saturate(1.2);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  animation: backdropFadeIn var(--transition-smooth) ease forwards;
}

@keyframes backdropFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.app-view-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  border: none;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
}

.app-view-panel__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px 12px;
  background: rgba(255, 255, 255, 0.82);
  border-bottom: 1px solid rgba(17, 17, 17, 0.06);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.app-view-panel__back-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(17, 17, 17, 0.06);
  border-radius: 14px;
  background: rgba(247, 247, 248, 0.96);
  color: #111111;
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 4px 12px rgba(15, 23, 42, 0.04);
  transition:
    background var(--transition-fast),
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    border-color var(--transition-fast);
}

.app-view-panel__back-button:hover {
  background: rgba(255, 255, 255, 1);
  border-color: rgba(17, 17, 17, 0.08);
  transform: translateY(-1px);
  box-shadow:
    0 2px 4px rgba(15, 23, 42, 0.05),
    0 8px 18px rgba(15, 23, 42, 0.05);
}

.app-view-panel__back-button:active {
  transform: scale(0.96);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.app-view-panel__title-group {
  min-width: 0;
  flex: 1;
}

.app-view-panel__eyebrow {
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  color: rgba(17, 17, 17, 0.5);
}

.app-view-panel__title {
  margin-top: 1px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  color: #111111;
}

.app-view-panel__header-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.app-view-panel__header--tongxunwang {
  gap: 10px;
  padding-top: 12px;
  padding-bottom: 10px;
  background: rgba(255, 255, 255, 0.9);
  border-bottom-color: rgba(17, 17, 17, 0.05);
}

.app-view-panel__header--tongxunwang .app-view-panel__title-group {
  display: flex;
  align-items: center;
  min-height: 34px;
}

.app-view-panel__header--tongxunwang .app-view-panel__title {
  margin-top: 0;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.app-view-panel__header--chenyuance {
  animation: none;
}

.app-view-panel__header-action--chenyuance {
  margin-left: auto;
}

.app-view-panel__header--zhimeng {
  position: relative;
  justify-content: center;
}

.app-view-panel__header--zhimeng .app-view-panel__back-button {
  position: absolute;
  left: 18px;
  top: 50%;
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.05);
  box-shadow: none;
}

.app-view-panel__header--zhimeng .app-view-panel__back-button:hover {
  background: rgba(17, 17, 17, 0.1);
  transform: translateY(-50%);
}

.app-view-panel__header--zhimeng .app-view-panel__back-button:active {
  transform: translateY(-50%) scale(0.96);
}

.app-view-panel__header--zhimeng .app-view-panel__back-button {
  transform: translateY(-50%);
}

.app-view-panel__header--zhimeng .app-view-panel__title-group {
  flex: 0 1 auto;
  width: 100%;
  text-align: center;
  padding: 0 72px;
}

.app-view-panel__header--zhimeng .app-view-panel__title {
  margin-top: 0;
}

.app-view-panel__header--zhimeng .app-view-panel__header-action--zhimeng {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  min-height: 34px;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12px;
}

.app-view-panel__header--zhimeng .app-view-panel__header-action--zhimeng:hover {
  transform: translateY(-50%);
}

.app-view-panel__header--zhimeng .app-view-panel__header-action--zhimeng:active {
  transform: translateY(-50%) scale(0.97);
}

.app-view-panel__body {
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding: 0;
  scroll-behavior: smooth;
}

.app-view-panel__body--dressup-station {
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(240, 244, 248, 0.98));
}

.app-view-panel__body--gongshangyuan {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding: 0;
  background: #f4f6f8;
}

.app-view-panel__body::-webkit-scrollbar {
  width: 5px;
}

.app-view-panel__body::-webkit-scrollbar-track {
  background: transparent;
}

.app-view-panel__body::-webkit-scrollbar-thumb {
  background: rgba(17, 17, 17, 0.12);
  border-radius: 3px;
}

.app-view-panel__body::-webkit-scrollbar-thumb:hover {
  background: rgba(17, 17, 17, 0.2);
}

.app-view-panel__body {
  scrollbar-width: thin;
  scrollbar-color: rgba(17, 17, 17, 0.12) transparent;
}

.app-placeholder {
  display: grid;
  gap: 12px;
  place-items: center;
  min-height: 100%;
  padding: 48px 24px;
  text-align: center;
}

.app-placeholder__title {
  font-size: 20px;
  font-weight: 700;
  color: #111111;
}

.app-placeholder__text {
  max-width: 280px;
  font-size: 13px;
  line-height: 1.75;
  color: rgba(17, 17, 17, 0.6);
}

.app-view-panel {
  animation: none;
}

@keyframes panelSlideIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.app-view-panel__header {
  animation: headerFadeIn var(--transition-base) ease forwards;
}

@keyframes headerFadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.app-view-content {
  padding: 16px 18px;
}

@media (max-width: 420px) {
  .app-view-layer {
    inset: 0;
  }

  .app-view-panel__body--gongshangyuan {
    background: #f4f6f8;
  }

  .app-view-panel__header {
    padding: 13px 16px 11px;
  }

  .app-view-panel__back-button {
    width: 32px;
    min-width: 32px;
    height: 32px;
    border-radius: 13px;
    font-size: 17px;
  }

  .app-view-panel__title {
    font-size: 20px;
  }

  .app-view-panel__header--zhimeng .app-view-panel__back-button {
    left: 16px;
    width: 32px;
    min-width: 32px;
    height: 32px;
  }

  .app-view-panel__header--zhimeng .app-view-panel__title-group {
    padding: 0 60px;
  }

  .app-view-panel__header--zhimeng .app-view-panel__header-action--zhimeng {
    right: 16px;
    min-height: 32px;
    padding: 6px 12px;
  }

  .app-view-content {
    padding: 14px 16px;
  }

  .app-placeholder {
    padding: 40px 20px;
  }

  .app-placeholder__title {
    font-size: 18px;
  }
}

@supports (padding: env(safe-area-inset-bottom)) {
  .app-view-panel__header {
    padding-top: calc(14px + env(safe-area-inset-top));
    padding-left: calc(18px + env(safe-area-inset-left));
    padding-right: calc(18px + env(safe-area-inset-right));
  }

  .app-view-content {
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }
}

@media (prefers-contrast: high) {
  .app-view-layer__backdrop {
    background: rgba(255, 255, 255, 0.95);
  }

  .app-view-panel__header {
    border-bottom-color: rgba(17, 17, 17, 0.2);
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-view-panel,
  .app-view-layer__backdrop,
  .app-view-panel__header {
    animation: none;
  }

  .app-view-panel {
    opacity: 1;
    transform: none;
  }
}

.dark-mode .app-view-layer__backdrop {
  background:
    radial-gradient(circle at 78% 8%, rgba(204, 223, 255, 0.18), transparent 30%),
    linear-gradient(180deg, rgba(8, 15, 33, 0.18), rgba(19, 13, 42, 0.22)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.74) 0%, rgba(245, 247, 255, 0.88) 100%);
  backdrop-filter: blur(24px) saturate(0.96) brightness(0.94);
  -webkit-backdrop-filter: blur(24px) saturate(0.96) brightness(0.94);
}

.dark-mode .app-view-layer::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(circle at 82% 4%, rgba(204, 223, 255, 0.20), transparent 26%),
    linear-gradient(180deg, rgba(8, 15, 33, 0.08), rgba(22, 16, 38, 0.10));
  mix-blend-mode: multiply;
  opacity: 0.72;
}

.dark-mode .app-view-layer:has(.settings-page)::after {
  display: none;
}

.dark-mode .settings-page {
  position: relative;
  z-index: 3;
}

.dark-mode .app-view-panel {
  background: transparent;
}

@media (hover: none), (pointer: coarse) {
  .llx-entry,
  .cyc-dream-item,
  .gsy-map__house,
  .gsy-map__zone-label {
    transition: none !important;
    animation: none !important;
  }

  .llx-entry:hover,
  .llx-entry:active {
    transform: none !important;
    background: #fbfcfe !important;
    border-color: #c8d3e3 !important;
    box-shadow: none !important;
  }

  .cyc-dream-item:hover,
  .cyc-dream-item:active {
    transform: none !important;
    background: #fff7ee !important;
    border-color: #6d462c !important;
    box-shadow: 0 10px 24px rgba(109, 70, 44, 0.12) !important;
  }

  .gsy-map__zone-button:hover .gsy-map__house,
  .gsy-map__zone-button:focus-visible .gsy-map__house,
  .gsy-map__zone-button:active .gsy-map__house {
    transform: none !important;
    box-shadow:
      0 12px 22px rgba(109, 85, 55, 0.08),
      inset 0 1px 0 rgba(255, 255, 255, 0.96) !important;
  }

  .gsy-map__zone-button:hover .gsy-map__zone-label,
  .gsy-map__zone-button:focus-visible .gsy-map__zone-label,
  .gsy-map__zone-button:active .gsy-map__zone-label {
    transform: none !important;
    box-shadow:
      0 12px 22px rgba(104, 80, 50, 0.08),
      inset 0 1px 0 rgba(255, 255, 255, 0.95) !important;
  }

  .llx-entry,
  .cyc-dream-item,
  .gsy-map__zone-button,
  .gsy-map__house,
  .gsy-map__zone-label {
    -webkit-tap-highlight-color: transparent;
  }
}
