/* 盖章收藏册 */

/* 统计页问号按钮：扩大触控区域 */
.stat-info-btn {
  width: 36px !important;
  height: 36px !important;
  padding: 10px !important;
  box-sizing: border-box !important;
  right: -28px !important;
}

/* 邮戳覆盖：淡印章装饰 */
.postmark {
  margin-top: 20px !important;
  margin-bottom: 20px !important;
}

.postmark-img {
  transform: rotate(-8deg) !important;
  opacity: 0.3 !important;
  width: 88px !important;
  height: 88px !important;
  filter: none !important;
  box-shadow: none !important;
  background: transparent !important;
}

.stamps-book {
  padding: 16px 16px 0;
  height: 100%;
  overflow: hidden;
  background: #f8f3eb;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.stamps-header {
  text-align: center;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.stamps-title {
  font-size: 24px;
  font-weight: 700;
  color: #894f3a;
  margin: 0 0 6px;
}

.stamps-subtitle {
  font-size: 14px;
  color: #a89888;
  margin: 0;
}

.stamps-progress-bar {
  width: 100%;
  max-width: 240px;
  height: 6px;
  background: #e8ddd3;
  border-radius: 3px;
  margin: 12px auto 0;
  overflow: hidden;
}

.stamps-progress-fill {
  height: 100%;
  background: #894f3a;
  border-radius: 3px;
  transition: width 0.4s ease;
}

.stamps-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  flex: 1;
  min-height: 0;
}

.stamp-card {
  background: transparent;
  border-radius: 16px;
  padding: 14px 12px 12px;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.stamp-card.unlocked {
}

.stamp-card.locked {
}

.stamp-card.locked .stamp-img {
  filter: grayscale(1);
  opacity: 0.35;
}

.stamp-card.locked .stamp-name {
  color: #a89888;
}

.stamp-card.locked .stamp-desc {
  color: #b8a898;
}

.stamp-img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  margin: 0 auto 8px;
  display: block;
  transition: filter 0.3s ease;
}

.stamp-name {
  font-size: 14px;
  font-weight: 600;
  color: #894f3a;
  margin-bottom: 4px;
}

.stamp-desc {
  font-size: 12px;
  color: #a89888;
  margin-bottom: 8px;
  line-height: 1.4;
}

.stamp-card-progress {
  width: 100%;
  height: 4px;
  background: #E6D8CF;
  border-radius: 999px;
  overflow: hidden;
}

.stamp-card-progress-fill {
  height: 100%;
  background: #C9A88C;
  border-radius: 999px;
  transition: width 0.4s ease;
}

.stamp-card.unlocked .stamp-card-progress-fill {
  background: #894f3a;
}

.stamp-progress-text {
  font-size: 13px;
  color: #7A5C50;
  margin-top: 6px;
  font-weight: 600;
}

.stamp-card.unlocked .stamp-progress-text {
  color: #894f3a;
  font-weight: 700;
}

/* 占位符：预留盖章位 */
.stamp-placeholder {
  opacity: 0.5;
}

.stamp-placeholder-circle {
  width: 64px;
  height: 64px;
  border: 2px dashed rgba(137, 79, 58, 0.2);
  border-radius: 50%;
  margin: 0 auto 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stamp-placeholder-circle::after {
  content: '?';
  font-size: 24px;
  color: rgba(137, 79, 58, 0.2);
  font-weight: 300;
}

.stamp-placeholder .stamp-name {
  color: #c0b0a0;
  font-size: 12px;
}

.stamp-placeholder .stamp-desc {
  color: #d0c0b0;
}

/* 分页指示器 */
.stamps-page-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 0 20px;
  flex-shrink: 0;
}

.stamp-page-nav {
  font-size: 12px;
  color: #a89888;
  margin-left: 4px;
}

.stamp-page-arrow {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: #e8ddd3;
  color: #894f3a;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.2s, background 0.2s;
  padding: 0;
  line-height: 1;
}

.stamp-page-arrow:active {
  background: #ddd0c4;
}

.stamp-page-arrow.disabled {
  opacity: 0.25;
  pointer-events: none;
}

/* 解锁弹窗 */
.stamp-unlock-overlay {
  position: fixed;
  inset: 0;
  z-index: 8000;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.3s ease;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.stamp-unlock-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.stamp-unlock-modal {
  background: #f8f3eb;
  border-radius: 24px;
  padding: 36px 28px 28px;
  text-align: center;
  max-width: 300px;
  width: 100%;
  position: relative;
  overflow: hidden;
}

.stamp-unlock-glow {
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(137, 79, 58, 0.12) 0%, transparent 70%);
  border-radius: 50%;
  animation: glowPulse 3s ease-in-out infinite;
  pointer-events: none;
}

.stamp-unlock-img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  margin: 0 auto;
  display: block;
  animation: stampDrop 1.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
  position: relative;
  z-index: 1;
}

.stamp-unlock-title {
  font-size: 20px;
  font-weight: 700;
  color: #894f3a;
  margin: 16px 0 6px;
}

.stamp-unlock-desc {
  font-size: 14px;
  color: #85736e;
  margin-bottom: 24px;
  line-height: 1.5;
}

.stamp-unlock-btn {
  display: block;
  width: 100%;
  height: 44px;
  border: none;
  border-radius: 22px;
  background: #894f3a;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  box-shadow: 0 4px 12px rgba(137, 79, 58, 0.25);
  cursor: pointer;
  transition: transform 0.1s;
}

.stamp-unlock-btn:active {
  animation: buttonPress 0.15s ease;
}

/* 粒子容器 */
.stamp-particles {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  z-index: 0;
  pointer-events: none;
}

.stamp-particle {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  animation: particleBurst 3s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

/* Keyframes */
@keyframes stampDrop {
  0% {
    opacity: 0;
    transform: scale(2.5) translateY(-60px) rotate(-15deg);
  }
  40% {
    opacity: 1;
    transform: scale(0.85) translateY(6px) rotate(3deg);
  }
  65% {
    transform: scale(1.08) translateY(-4px) rotate(-2deg);
  }
  80% {
    transform: scale(0.97) translateY(2px) rotate(1deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0) rotate(0deg);
  }
}

@keyframes particleBurst {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(var(--px), var(--py)) scale(0);
    opacity: 0;
  }
}

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

@keyframes glowPulse {
  0%, 100% { opacity: 0.6; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.1); }
}

@keyframes buttonPress {
  0% { transform: scale(1); }
  50% { transform: scale(0.95); }
  100% { transform: scale(1); }
}

/* 无障碍：减弱动画 */
@media (prefers-reduced-motion: reduce) {
  .stamp-unlock-img {
    animation: none;
  }
  .stamp-particle {
    animation: none;
    display: none;
  }
  .stamp-unlock-glow {
    animation: none;
  }
  .stamp-unlock-overlay {
    transition: none;
  }
}

/* 收下后提示 toast */
.stamp-toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(137, 79, 58, 0.92);
  color: #fff;
  font-size: 13px;
  padding: 10px 20px;
  border-radius: 20px;
  z-index: 7999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  white-space: nowrap;
}

.stamp-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* 全部收集庆祝弹窗 */
.stamp-celebrate-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.stamp-celebrate-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.stamp-celebrate-content {
  background: #f8f3eb;
  border-radius: 24px;
  padding: 48px 32px 32px;
  text-align: center;
  max-width: 320px;
  width: 100%;
  position: relative;
  overflow: hidden;
  animation: celebratePop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.stamp-celebrate-fireworks {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 30%, rgba(137, 79, 58, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 80% 20%, rgba(212, 165, 116, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 50% 80%, rgba(90, 154, 106, 0.12) 0%, transparent 40%);
  animation: fireworksShimmer 2s ease-in-out infinite;
}

.stamp-celebrate-title {
  font-size: 28px;
  font-weight: 700;
  color: #894f3a;
  margin: 0 0 12px;
  position: relative;
}

.stamp-celebrate-desc {
  font-size: 15px;
  color: #85736e;
  line-height: 1.6;
  margin-bottom: 28px;
  position: relative;
}

.stamp-celebrate-btn {
  display: block;
  width: 100%;
  height: 48px;
  border: none;
  border-radius: 24px;
  background: linear-gradient(135deg, #894f3a, #a8635a);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  box-shadow: 0 4px 16px rgba(137, 79, 58, 0.3);
  cursor: pointer;
  position: relative;
}

@keyframes celebratePop {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes fireworksShimmer {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

/* 弹窗内容滚动条 (WebKit) */
#simple-dialog-overlay div::-webkit-scrollbar {
  width: 4px;
}
#simple-dialog-overlay div::-webkit-scrollbar-track {
  background: transparent;
}
#simple-dialog-overlay div::-webkit-scrollbar-thumb {
  background: #c4a98e;
  border-radius: 2px;
}
