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

html,body {
  height: 100%;
  font-family: 'PingFang SC','Microsoft YaHei',Arial,sans-serif;
  background: #1F272F;
  overflow: hidden
}

.toggle-btn {
  position: fixed;
  top: 25px;
  right: 20px;
  min-width: 140px;
  height: 50px;
  background: linear-gradient(135deg,#9b59b6 0%,#e74c3c 100%);
  color: white;
  border: none;
  border-radius: 25px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  z-index: 1000;
  box-shadow: 0 6px 20px rgba(155,89,182,.4);
  transition: all .4s cubic-bezier(.175,.885,.32,1.275);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 25px;
  letter-spacing: 1px;
  text-shadow: 0 1px 2px rgba(0,0,0,.3);
  overflow: hidden
}

.toggle-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg,rgba(255,255,255,.1) 0%,rgba(255,255,255,0) 100%);
  border-radius: 25px;
  z-index: 1;
  opacity: .5
}

.toggle-btn:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 10px 30px rgba(155,89,182,.6);
  letter-spacing: 1.2px
}

.toggle-btn:active {
  transform: translateY(-1px) scale(.98);
  box-shadow: 0 4px 15px rgba(155,89,182,.5)
}

.toggle-btn .btn-text {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px
}

.toggle-btn .btn-icon {
  font-size: 18px;
  transition: transform .3s ease;
  animation: iconBounceFast 1.8s ease-in-out infinite
}

.toggle-btn:hover .btn-icon {
  transform: rotate(15deg)
}

.toggle-btn .btn-label {
  position: relative;
  display: inline-block;
  animation: textBounceFast 1.5s ease-in-out infinite
}

.toggle-btn.state-1 {
  background: linear-gradient(135deg,#3498db 0%,#2ecc71 100%);
  box-shadow: 0 6px 20px rgba(52,152,219,.4)
}

.toggle-btn.state-1:hover {
  box-shadow: 0 10px 30px rgba(52,152,219,.6)
}

.toggle-btn.state-1 .btn-label {
  animation: textBounce 2s ease-in-out infinite
}

.toggle-btn.state-1 .btn-icon {
  animation: iconBounce 2.2s ease-in-out infinite
}

@keyframes textBounce {
  0%,100% {
    transform: translateY(0)
  }

  10% {
    transform: translateY(-3px)
  }

  20% {
    transform: translateY(0)
  }

  30% {
    transform: translateY(-2px)
  }

  40% {
    transform: translateY(0)
  }
}

@keyframes textBounceFast {
  0%,100% {
    transform: translateY(0)
  }

  15% {
    transform: translateY(-4px)
  }

  30% {
    transform: translateY(0)
  }

  45% {
    transform: translateY(-3px)
  }

  60% {
    transform: translateY(0)
  }
}

@keyframes iconBounce {
  0%,100% {
    transform: translateY(0) rotate(0)
  }

  25% {
    transform: translateY(-4px) rotate(10deg)
  }

  50% {
    transform: translateY(0) rotate(0)
  }

  75% {
    transform: translateY(-2px) rotate(-5deg)
  }
}

@keyframes iconBounceFast {
  0%,100% {
    transform: translateY(0) scale(1)
  }

  20% {
    transform: translateY(-5px) scale(1.1)
  }

  40% {
    transform: translateY(0) scale(1)
  }

  60% {
    transform: translateY(-3px) scale(1.05)
  }

  80% {
    transform: translateY(0) scale(1)
  }
}

.page-wrapper {
  height: 100vh;
  display: flex;
  flex-direction: column
}

.top-content {
  background: rgba(31,39,47,.95);
  backdrop-filter: blur(10px);
  flex: 0 0 auto;
  transition: all .3s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
  border-bottom: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 5px 15px rgba(0,0,0,.3);
  height: 0;
  opacity: 0;
  transform: translateY(-10px)
}

.top-content.expanded {
  height: auto;
  opacity: 1;
  transform: translateY(0)
}

.top-inner {
  padding: 25px 20px 20px;
  max-width: 1400px;
  margin: 0 auto
}

.game-area {
  flex: 1;
  background: #1F272F;
  min-height: 0;
  position: relative;
  overflow: auto;
  -webkit-overflow-scrolling: touch
}

#gameIframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  background: #1F272F;
  min-height: 100%
}

.game-title {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 25px;
  text-align: center;
  text-shadow: 0 3px 15px rgba(0,0,0,.5);
  letter-spacing: 2px;
  position: relative;
  padding-bottom: 18px;
  background: linear-gradient(90deg,#ff3366,#ff9966,#ffcc33,#2ecc71,#3498db,#9b59b6,#ff3366);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: titleColorChange 6s linear infinite;
  filter: drop-shadow(0 0 10px rgba(255,51,102,.3))
}

@keyframes titleColorChange {
  0% {
    background-position: 0% 50%;
    filter: drop-shadow(0 0 10px rgba(255,51,102,.3))
  }

  25% {
    background-position: 50% 50%;
    filter: drop-shadow(0 0 10px rgba(46,204,113,.3))
  }

  50% {
    background-position: 100% 50%;
    filter: drop-shadow(0 0 10px rgba(52,152,219,.3))
  }

  75% {
    background-position: 50% 50%;
    filter: drop-shadow(0 0 10px rgba(155,89,182,.3))
  }

  100% {
    background-position: 0% 50%;
    filter: drop-shadow(0 0 10px rgba(255,51,102,.3))
  }
}

.game-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 4px;
  background: linear-gradient(90deg,#ff3366,#ff9966,#ffcc33);
  border-radius: 2px;
  animation: underlinePulse 3s ease-in-out infinite
}

@keyframes underlinePulse {
  0%,100% {
    width: 120px;
    opacity: 1
  }

  50% {
    width: 150px;
    opacity: .8
  }
}

.game-title::before {
  content: '✨';
  position: absolute;
  left: -40px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  animation: starTwinkle 2s ease-in-out infinite;
  opacity: .7
}

@keyframes starTwinkle {
  0%,100% {
    opacity: .3;
    transform: translateY(-50%) scale(1)
  }

  50% {
    opacity: 1;
    transform: translateY(-50%) scale(1.2)
  }
}

.games-container {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 15px;
  width: 100%;
  margin: 0 auto
}

.game-box {
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition: transform .3s ease
}

.game-box:hover {
  transform: translateY(-3px)
}

.image-wrapper {
  width: 100%;
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(40,50,60,.15);
  box-shadow: inset 0 0 5px rgba(0,0,0,.05),0 2px 8px rgba(0,0,0,.1);
  transition: all .3s ease;
  border: 1px solid rgba(52,152,219,.05);
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0
}

.image-wrapper::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 8px;
  background: linear-gradient(135deg,rgba(52,152,219,.08),rgba(46,204,113,.08));
  opacity: 0;
  transition: opacity .3s ease;
  pointer-events: none;
  z-index: 1
}

.game-box:hover .image-wrapper {
  box-shadow: inset 0 0 8px rgba(52,152,219,.08),0 4px 12px rgba(52,152,219,.1);
  transform: scale(1.01) translateY(-1px);
  border-color: rgba(52,152,219,.15)
}

.game-box:hover .image-wrapper::before {
  opacity: 1
}

.image-wrapper img {
  object-fit: contain!important;
  object-position: center;
  display: block;
  transition: opacity .4s ease, transform .4s ease;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  border-radius: 6px;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,.1));
  z-index: 0;
  position: relative;
  top: 0;
  transform: translateY(0)
}

.game-box:hover .image-wrapper img {
  transform: scale(1.02);
  filter: drop-shadow(0 2px 6px rgba(52,152,219,.1))
}

.image-wrapper::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg,rgba(255,255,255,.01) 0%,rgba(255,255,255,.002) 50%,rgba(255,255,255,.01) 100%);
  opacity: .1;
  border-radius: 8px;
  pointer-events: none;
  z-index: 0
}

.game-name {
  margin-top: 10px;
  font-size: 16px;
  text-align: center;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 5px;
  font-weight: 600;
  position: relative;
  background: linear-gradient(90deg,#3498db,#2ecc71,#9b59b6,#f39c12,#3498db);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: textColorChange 4s ease-in-out infinite;
  text-shadow: 0 1px 2px rgba(0,0,0,.2)
}

@keyframes textColorChange {
  0% {
    background-position: 0% 50%
  }

  25% {
    background-position: 50% 50%
  }

  50% {
    background-position: 100% 50%
  }

  75% {
    background-position: 50% 50%
  }

  100% {
    background-position: 0% 50%
  }
}

.game-name::before {
  content: '';
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 1px;
  background: linear-gradient(90deg,#3498db,#2ecc71);
  border-radius: .5px;
  transition: width .3s ease
}

.game-box:hover .game-name::before {
  width: 30px
}

.game-name a {
  color: inherit;
  text-decoration: none;
  display: block;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all .3s ease;
  padding: 6px 0;
  background: inherit;
  -webkit-background-clip: inherit;
  background-clip: inherit;
  animation: inherit
}

.game-box:hover .game-name a {
  text-shadow: 0 0 8px rgba(52,152,219,.4);
  transform: translateY(-1px);
  letter-spacing: .5px
}

.empty-state {
  grid-column: 1/-1;
  text-align: center;
  padding: 60px 20px;
  color: #a0aec0;
  background: rgba(255,255,255,.05);
  border-radius: 15px;
  border: 2px dashed rgba(255,255,255,.1);
  backdrop-filter: blur(10px)
}

.empty-state p {
  font-size: 18px;
  margin: 0;
  opacity: .7
}

@media (max-width: 768px) {
  .games-container {
    gap:10px
  }

  .top-inner {
    padding: 30px 15px 15px
  }

  .game-title {
    font-size: 24px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    letter-spacing: 1.5px
  }

  .game-title::before {
    left: -30px;
    font-size: 16px
  }

  .game-title::after {
    width: 80px;
    height: 3px
  }

  .game-name {
    font-size: 14px;
    margin-top: 8px
  }

  .image-wrapper {
    border-radius: 6px
  }

  .image-wrapper img {
    border-radius: 4px
  }

  .toggle-btn {
    min-width: 120px;
    height: 45px;
    font-size: 14px;
    padding: 0 18px;
    top: 20px;
    right: 15px
  }
}

@media (max-width: 600px) {
  .games-container {
    gap:8px
  }

  .top-inner {
    padding: 25px 12px 12px
  }

  .game-title {
    font-size: 22px;
    margin-bottom: 15px;
    padding-bottom: 12px;
    letter-spacing: 1px
  }

  .game-title::before {
    left: -25px;
    font-size: 14px
  }

  .game-name {
    font-size: 13px;
    margin-top: 7px;
    padding: 0 3px
  }

  .image-wrapper {
    border-radius: 5px
  }

  .image-wrapper img {
    border-radius: 3px
  }

  .toggle-btn {
    min-width: 110px;
    height: 42px;
    font-size: 13px;
    padding: 0 15px;
    top: 18px
  }
}

@media (max-width: 480px) {
  .games-container {
    gap:6px
  }

  .top-inner {
    padding: 22px 10px 10px
  }

  .game-title {
    font-size: 20px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    letter-spacing: .8px
  }

  .game-title::after {
    width: 60px;
    height: 2.5px
  }

  .game-title::before {
    display: none
  }

  .game-name {
    font-size: 12px;
    margin-top: 6px;
    padding: 0 2px
  }

  .image-wrapper {
    border-radius: 4px
  }

  .image-wrapper img {
    border-radius: 2px
  }

  .toggle-btn {
    min-width: 100px;
    height: 40px;
    font-size: 12px;
    padding: 0 12px;
    top: 15px;
    right: 12px
  }
}

@media (max-width: 360px) {
  .games-container {
    gap:4px
  }

  .top-inner {
    padding: 20px 8px 8px
  }

  .game-title {
    font-size: 18px;
    margin-bottom: 10px;
    padding-bottom: 8px
  }

  .game-name {
    font-size: 11px;
    margin-top: 5px
  }

  .image-wrapper {
    border-radius: 3px
  }

  .image-wrapper img {
    border-radius: 2px
  }

  .toggle-btn {
    min-width: 90px;
    height: 38px;
    font-size: 11px;
    padding: 0 10px;
    top: 14px
  }
}

@media (min-width: 1024px) {
  .games-container {
    max-width:1200px;
    gap: 20px
  }

  .top-inner {
    padding: 35px 30px 25px
  }

  .game-title {
    font-size: 36px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    letter-spacing: 2.5px
  }

  .game-title::before {
    left: -50px;
    font-size: 24px
  }

  .game-title::after {
    width: 150px;
    height: 5px
  }

  .game-name {
    font-size: 18px;
    margin-top: 15px;
    font-weight: 700
  }

  .image-wrapper {
    border-radius: 10px
  }

  .image-wrapper img {
    border-radius: 8px
  }

  .toggle-btn {
    min-width: 160px;
    height: 55px;
    font-size: 18px;
    border-radius: 27px;
    top: 30px
  }
}

@media (min-width: 1400px) {
  .game-title {
    font-size:40px
  }

  .game-title::before {
    left: -60px
  }
}
/* 可拖动悬浮小圆返回按钮（文字精致版） */
.float-back-btn {
  position: fixed;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #9b59b6 0%, #e74c3c 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  font-family: 'PingFang SC','Microsoft YaHei',Arial,sans-serif;
  letter-spacing: 1px;
  border: none;
  outline: none;
  cursor: move;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(155,89,182,.4);
  transition: all .3s cubic-bezier(.175,.885,.32,1.275);
  user-select: none;
  left: 20px;
  bottom: 100px;
  text-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.float-back-btn:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 10px 30px rgba(155,89,182,.6);
}
.float-back-btn:active {
  transform: scale(.96);
  box-shadow: 0 4px 15px rgba(155,89,182,.5);
}