/* ===== CSS VARIABLES ===== */
:root {
  --bg: #ffffff;
  --text: #000000;
  --yellow: #ffd100;
  --pink: #ff98ad;
  --green: #78e0cb;
  --slot-size: clamp(120px, 28vw, 220px);
}

/* ===== FONT FACE ===== */
@font-face {
  font-family: 'wiseshot';
  src: url('../font/wiseshot.woff2') format('woff2'),
       url('../font/wiseshot.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ===== RESET ===== */
* {
  margin: 0;
  box-sizing: border-box;
}

/* ===== BASE STYLES ===== */
html,
body {
  width: 100%;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  /* 优先使用wiseshot字体，后备为Baloo 2和系统字体，保证兼容性 */
  font-family: 'wiseshot', 'Baloo 2', system-ui, -apple-system, 'Segoe UI', sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* ===== LAYOUT ===== */
.wrapper {
  width: min(100%, 860px);
  text-align: center;
  padding: 1rem;
}

/* ===== SLOTS CONTAINER ===== */
#slots {
  display: flex;
  justify-content: center;
  gap: clamp(16px, 4vw, 32px);
  margin-bottom: clamp(32px, 8vw, 56px);
  margin-top: 6rem;
}

.slot {
  width: var(--slot-size);
  height: var(--slot-size);
  border-radius: 22%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #f5f5f5;
}

.slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
}

/* ===== REFRESH BUTTON ===== */
#refreshBtn {
  width: 68px;
  height: 68px;
  border: none;
  background: #f5f5f5;
  border-radius: 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s ease;
}

#refreshBtn img {
  width: 40px;
  height: 40px;
  transition: transform 0.4s ease;
}

#refreshBtn:hover {
  transform: scale(1.1);
}

#refreshBtn.spin img {
  animation: rotate 0.8s linear infinite;
}

@keyframes rotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* ===== LINKS ===== */
.links {
  display: flex;
  justify-content: center;
  gap: 20px;
}

.links a {
  display: inline-flex;
  width: 60px;
  height: 60px;
  transition: transform 0.1s ease;
}

.links img {
  width: 100%;
  height: 100%;
}

.links a:hover {
  transform: scale(1.1);
}

/* ===== TYPOGRAPHY ===== */
h1 {
  font-size: clamp(2.4rem, 7vw, 3.4rem);
  margin-bottom: 1.4rem;
  font-weight: normal;
}

p.meta {
  max-width: 500px;
  margin: 1.8rem auto;
  line-height: 1.6;
  font-size: 1rem;
}

p.meta a {
  color: #000000;
  text-decoration: underline;
}

p.meta a:hover {
  color: #3A84F7;
}

/* ===== LOADING ANIMATION ===== */
#loading {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
#loading .wave {
  display: inline-block;
  font-family: 'wiseshot', 'Baloo 2', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 2.2rem;
  color: var(--text);
  animation: wave 1.2s infinite;
  animation-timing-function: ease-in-out;
}
#loading .wave:nth-child(1) { animation-delay: 0s; }
#loading .wave:nth-child(2) { animation-delay: 0.1s; }
#loading .wave:nth-child(3) { animation-delay: 0.2s; }
#loading .wave:nth-child(4) { animation-delay: 0.3s; }
#loading .wave:nth-child(5) { animation-delay: 0.4s; }
#loading .wave:nth-child(6) { animation-delay: 0.5s; }
#loading .wave:nth-child(7) { animation-delay: 0.6s; }
#loading .wave:nth-child(8) { animation-delay: 0.7s; }
#loading .wave:nth-child(9) { animation-delay: 0.8s; }
#loading .wave:nth-child(10) { animation-delay: 0.9s; }

@keyframes wave {
  0%, 100% { transform: translateY(0); }
  20% { transform: translateY(-0.5em); }
  40% { transform: translateY(0.2em); }
  60% { transform: translateY(-0.3em); }
  80% { transform: translateY(0.1em); }
}

/* ===== RESPONSIVE DESIGN ===== */

/* 手机设备 (540px 及以下) */
@media (max-width: 540px) {
  html,
  body {
    overflow: hidden;
  }

  .wrapper {
    padding: 1rem;
  }
  
  #slots {
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 3rem;
    margin-bottom: 2rem;
  }
  
  .slot {
    width: clamp(100px, 60vw, 160px);
    height: clamp(100px, 60vw, 160px);
    border-radius: 24px;
  }

  .slot:nth-child(2) {
    width: clamp(180px, 60vw, 160px);
    height: clamp(180px, 60vw, 160px);
  }
  
  h1 {
    margin-bottom: 1rem;
  }
  
  #refreshBtn {
    width: 56px;
    height: 56px;
    border-radius: 16px;
  }
  
  #refreshBtn img {
    width: 32px;
    height: 32px;
  }
    
  .links {
    gap: 16px;
  }
  
  .links img {
    width: 44px;
    height: 44px;
  }
  
  p.meta {
    font-size: 0.9rem;
    margin: 1.5rem auto;
    padding: 0 1rem;
  }
}

/* 小屏手机 (375px 及以下) */
@media (max-width: 375px) {
  .wrapper {
    padding: 0.75rem;
  }
  
  #slots {
    margin-top: 2rem;
    gap: 12px;
  }
  
  .slot {
    width: clamp(80px, 50vw, 120px);
    height: clamp(80px, 50vw, 120px);
  }
  
  #refreshBtn {
    width: 48px;
    height: 48px;
  }
  
  #refreshBtn img {
    width: 28px;
    height: 28px;
  }
  
  .links a {
    width: 40px;
    height: 40px;
  }
  
  p.meta {
    font-size: 0.85rem;
    line-height: 1.5;
  }
}

/* 横屏手机优化 */
@media (max-height: 500px) and (orientation: landscape) {
  .wrapper {
    padding: 0.5rem;
  }
  
  #slots {
    margin-top: 1rem;
    margin-bottom: 1rem;
  }
  
  h1 {
    margin-bottom: 0.5rem;
  }
  
  p.meta {
    margin: 1rem auto;
  }
} 