* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #101318;
  color: #fff;
}

body {
  position: relative;
}

button,
input,
textarea {
  font: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.hidden-element {
  display: none !important;
}

.app-root {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  background: #0f1116;
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
  overflow: hidden;
}

.screen-active {
  display: block;
}

.screen-scroll-content {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  padding: 72px 16px 100px;
}

.bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #111;
  z-index: 0;
}

.screen-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.soft-overlay {
  background: linear-gradient(to bottom, rgba(8, 9, 14, 0.35), rgba(8, 9, 14, 0.6));
}

.album-overlay {
  background: linear-gradient(to bottom, rgba(7, 9, 16, 0.45), rgba(12, 15, 22, 0.72));
}

.tree-hole-overlay {
  background: linear-gradient(to bottom, rgba(8, 11, 17, 0.48), rgba(8, 10, 16, 0.74));
}

.top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: none;
  justify-content: flex-end;
  align-items: center;
  padding: 12px 14px;
  pointer-events: none;
}

.current-account-badge {
  opacity: 0;
  visibility: hidden;
  width: 0;
  height: 0;
  overflow: hidden;
}

.top-bar-actions {
  display: flex;
  gap: 10px;
  margin-left: auto;
  pointer-events: auto;
}

.icon-button,
.text-button,
.primary-button,
.secondary-button,
.bottom-nav-button,
.draw-button {
  border: none;
  outline: none;
  cursor: pointer;
}

.icon-button,
.text-button {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  backdrop-filter: blur(10px);
}

.icon-button {
  width: 40px;
  height: 40px;
  font-size: 18px;
}

.text-button {
  padding: 0 14px;
  height: 40px;
  font-size: 14px;
}

.panel-card {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(16px);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
}

.primary-button {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, #f48fb1, #b39ddb);
}

.secondary-button {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 14px;
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
}

.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at top, rgba(255, 170, 194, 0.18), transparent 34%),
    linear-gradient(180deg, #10131c, #171c29);
  padding: 20px;
}

.login-card {
  width: min(92vw, 420px);
  padding: 28px 22px;
}

.login-title {
  margin: 0;
  text-align: center;
  font-size: 30px;
  font-weight: 700;
}

.login-subtitle {
  margin: 10px 0 24px;
  text-align: center;
  color: rgba(255, 255, 255, 0.76);
  font-size: 14px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.input-label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
}

.input-label input {
  width: 100%;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 0 14px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.login-submit {
  margin-top: 8px;
}

.home-screen {
  overflow: hidden;
}

.home-content {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  padding: 72px 16px 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.home-banner-wrap {
  width: min(92vw, 760px);
  height: 180px;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.3);
}

.home-banner-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #111;
}

.home-lux-panel {
  width: min(92vw, 760px);
  margin-top: 16px;
  padding: 18px 16px 20px;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.stat-box {
  padding: 14px 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  text-align: center;
}

.stat-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
}

.stat-value {
  margin-top: 8px;
  font-size: 24px;
  font-weight: 700;
}

.home-copy {
  margin-top: 16px;
  text-align: center;
}

.home-copy h2 {
  margin: 0;
  font-size: 24px;
}

.home-copy p {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.7;
  font-size: 14px;
}

/* 修复抽卡按钮居中 */
.draw-panel {
  margin-top: 22px;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.draw-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-width: 180px;
  min-height: 52px;
  margin: 0 auto;
  border-radius: 999px;
  color: #fff;
  font-size: 17px;
  background: linear-gradient(135deg, #f8a5c2, #778beb);
  box-shadow: 0 10px 24px rgba(120, 120, 255, 0.22);
}

.tree-caption {
  margin-top: 18px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  text-align: center;
}

/* 猫咪送花 */
.cat-paw-floating {
  position: absolute;
  left: 50%;
  top: 52%;
  z-index: 8;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.55);
  transition: opacity 0.35s ease;
  background: transparent !important;
}

.cat-paw-floating.visible {
  opacity: 1;
}

.cat-paw-floating.arriving {
  animation: catGiftArrive 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.cat-paw-floating.leaving {
  animation: catGiftLeave 0.45s ease forwards;
}

@keyframes catGiftArrive {
  0% {
    opacity: 0;
    transform: translate(42vw, 34vh) scale(0.35) rotate(-8deg);
  }
  50% {
    opacity: 1;
    transform: translate(8vw, 6vh) scale(0.85) rotate(4deg);
  }
  72% {
    opacity: 1;
    transform: translate(-4vw, -3vh) scale(1.02) rotate(-2deg);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }
}

@keyframes catGiftLeave {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.7);
  }
}

.cat-paw-button {
  pointer-events: auto;
  position: relative;
  width: 156px;
  height: 156px;
  border: none;
  background: transparent !important;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
  outline: none;
}

.cat-paw-button.integrated {
  display: block;
}

.cat-paw-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: transparent !important;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.25));
  user-select: none;
  pointer-events: none;
}

.rose-image {
  position: absolute;
  width: 58px;
  height: 58px;
  object-fit: contain;
  background: transparent !important;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.18));
  user-select: none;
  pointer-events: none;
}

.integrated-rose {
  right: 8px;
  top: 10px;
  transform: rotate(12deg);
}

.ending-home-stage {
  margin-top: 32px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ending-center-card-wrap {
  width: 240px;
  height: 340px;
  perspective: 1600px;
  cursor: pointer;
}

.ending-entry-button {
  margin-top: 24px;
  width: 126px;
  height: 126px;
  padding: 0;
  border: none;
  background: transparent;
}

.ending-entry-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.album-top-panel {
  padding: 18px;
}

.album-progress-title {
  color: rgba(255, 255, 255, 0.76);
  font-size: 14px;
  text-align: center;
}

.album-progress-text {
  margin-top: 8px;
  font-size: 28px;
  font-weight: 700;
  text-align: center;
}

.album-category-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
}

.category-section,
.easter-egg-section,
.sealed-black-pack-section,
.tree-hole-panel,
.tree-hole-history-panel {
  padding: 16px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  text-align: center;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
}

.section-subtitle {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.72);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.album-card-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.album-card-button {
  width: 100%;
  aspect-ratio: 0.72;
  border: none;
  padding: 0;
  background: transparent;
  border-radius: 14px;
  overflow: hidden;
}

.album-card-button:disabled {
  cursor: default;
}

.album-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
}

.album-card-date {
  font-size: 11px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.82);
  text-align: center;
}

.album-card-date.unowned {
  color: rgba(255, 255, 255, 0.45);
}

.sealed-pack-wrap {
  margin-top: 14px;
  display: flex;
  justify-content: center;
}

.sealed-pack-image {
  width: 150px;
  height: 210px;
  object-fit: contain;
  filter: drop-shadow(0 10px 28px rgba(0, 0, 0, 0.28));
}

.easter-egg-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.easter-egg-item {
  min-height: 86px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  padding: 12px;
  text-align: center;
}

.easter-egg-item.locked {
  opacity: 0.48;
}

.easter-egg-item-label {
  font-size: 16px;
  font-weight: 700;
}

.easter-egg-item-threshold {
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
}

.tree-hole-layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tree-hole-tip-text {
  font-size: 16px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.88);
  text-align: center;
}

.tree-hole-textarea {
  width: 100%;
  min-height: 180px;
  margin-top: 14px;
  padding: 14px;
  resize: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.tree-hole-history-list {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tree-hole-history-item {
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
}

.tree-hole-history-time {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.54);
}

.tree-hole-history-text {
  margin-top: 8px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-all;
}

.empty-tip {
  color: rgba(255, 255, 255, 0.58);
  text-align: center;
  padding: 18px 0;
}

/* 修复底部导航不居中 */
.bottom-nav {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: min(92vw, 520px);
  bottom: 12px;
  z-index: 30;
  display: none;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
  justify-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 18px;
  background: rgba(14, 18, 24, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
}

.bottom-nav-button {
  width: 100%;
  min-height: 46px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 14px;
  color: rgba(255, 255, 255, 0.76);
  background: transparent;
  font-size: 15px;
  text-align: center;
}

.bottom-nav-button-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}

.mask-layer,
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
}

.mask-layer.visible,
.modal-mask.visible {
  display: flex;
  align-items: center;
  justify-content: center;
}

.mask-layer {
  background: rgba(4, 7, 15, 0.72);
}

.dark-mask {
  background: rgba(0, 0, 0, 0.88);
}

.card-viewer-box {
  position: relative;
  z-index: 3;
  width: min(82vw, 320px);
  aspect-ratio: 0.72;
  perspective: 1800px;
}

.black-card-box {
  width: min(84vw, 340px);
}

.card-rotate-shell {
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.08s linear;
}

.card-flip-shell {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.68s ease;
}

.card-flip-shell.is-flipped {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  overflow: hidden;
  backface-visibility: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.card-face-back {
  transform: rotateY(0deg);
}

.card-face-front {
  transform: rotateY(180deg);
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #1a1f2a;
}

.particle-layer,
.flash-layer,
.draw-center-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.particle-layer {
  z-index: 1;
  overflow: hidden;
}

.particle-item {
  position: absolute;
  border-radius: 999px;
  opacity: 0;
  animation-name: particle-burst;
  animation-timing-function: ease-out;
  animation-fill-mode: forwards;
}

.particle-item.rarity-nr {
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.7);
}

.particle-item.rarity-sr {
  background: rgba(255, 168, 212, 0.95);
  box-shadow: 0 0 14px rgba(255, 168, 212, 0.78);
}

.particle-item.rarity-ssr {
  background: rgba(255, 221, 106, 0.96);
  box-shadow: 0 0 18px rgba(255, 221, 106, 0.88);
}

.particle-item.rarity-black {
  background: rgba(138, 115, 255, 0.96);
  box-shadow: 0 0 18px rgba(138, 115, 255, 0.88);
}

@keyframes particle-burst {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(0.4);
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(var(--move-x), var(--move-y)) scale(1.15);
  }
}

.flash-layer {
  z-index: 2;
  opacity: 0;
}

.flash-layer.nr-flash {
  animation: full-flash 0.5s ease;
  background: radial-gradient(circle, rgba(255,255,255,0.24), transparent 50%);
}

.flash-layer.sr-flash {
  animation: full-flash 0.65s ease;
  background: radial-gradient(circle, rgba(255,164,198,0.32), transparent 52%);
}

.flash-layer.ssr-flash {
  animation: full-flash 0.78s ease;
  background: radial-gradient(circle, rgba(255,220,108,0.38), transparent 54%);
}

@keyframes full-flash {
  0% { opacity: 0; }
  20% { opacity: 1; }
  100% { opacity: 0; }
}

.draw-center-glow {
  z-index: 2;
  opacity: 0;
}

.draw-center-glow.active-nr {
  opacity: 1;
  background: radial-gradient(circle at center, rgba(255,255,255,0.18), transparent 34%);
}

.draw-center-glow.active-sr {
  opacity: 1;
  background: radial-gradient(circle at center, rgba(255,170,210,0.26), transparent 38%);
}

.draw-center-glow.active-ssr {
  opacity: 1;
  background: radial-gradient(circle at center, rgba(255,222,120,0.3), transparent 42%);
}

.easter-ball-button {
  width: 180px;
  height: 180px;
  padding: 0;
  border: none;
  background: transparent;
}

.easter-ball-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.note-viewer-box {
  width: min(88vw, 520px);
  max-height: 84vh;
  overflow: auto;
}

.note-viewer-image {
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 16px;
}

.modal-mask {
  z-index: 100;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.48);
}

.modal-box {
  width: min(88vw, 420px);
  padding: 20px;
  border-radius: 20px;
  background: rgba(22, 25, 36, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
}

.modal-title {
  font-size: 20px;
  font-weight: 700;
}

.modal-text {
  margin-top: 12px;
  white-space: pre-wrap;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.86);
}

.modal-actions {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.toast-layer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 96px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}

.toast-message {
  padding: 10px 14px;
  max-width: 78vw;
  border-radius: 999px;
  background: rgba(12, 14, 22, 0.82);
  color: #fff;
  font-size: 13px;
  animation: toast-fade 2.3s ease forwards;
}

@keyframes toast-fade {
  0% { opacity: 0; transform: translateY(8px); }
  10% { opacity: 1; transform: translateY(0); }
  85% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-6px); }
}

.barrage-layer {
  position: fixed;
  inset: 0;
  z-index: 25;
  pointer-events: none;
}

body.dark-theme {
  background: #05070d;
}

body.ending-theme .home-screen .soft-overlay {
  background: linear-gradient(to bottom, rgba(0,0,0,0.44), rgba(0,0,0,0.7));
}

@media (min-width: 768px) {
  .card-grid {
    grid-template-columns: repeat(5, 1fr);
  }

  .screen-scroll-content {
    padding-left: 24px;
    padding-right: 24px;
  }

  .home-banner-wrap,
  .home-lux-panel {
    width: min(86vw, 860px);
  }

  .home-banner-wrap {
    height: 230px;
  }

  .bottom-nav {
    width: min(78vw, 560px);
  }
}
