/* ========================================
   基础样式重置
   ======================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

/* 响应式字体：基于750px设计稿 */
html {
  font-size: calc(100vw / 750 * 16);
  font-size: min(calc(100vw / 750 * 16), 12px);
  background-color: #333333;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  background-color: #333333;
  color: #ffffff;
  display: flex;
  justify-content: center;
}

/* ========================================
   应用容器
   ======================================== */
.app-container {
  width: 100%;
  max-width: 600px;
  height: 100%;
  position: relative;
  overflow: hidden;
}

/* ========================================
   主内容区
   ======================================== */
.main-content {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 5rem; /* 为底部按钮留出空间 */

  /* 隐藏滚动条 */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.main-content::-webkit-scrollbar {
  display: none;
}

.background-image {
  width: 100%;
  height: auto;
  display: block;
}

/* ========================================
   固定底部操作栏
   ======================================== */
.fixed-bottom {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  z-index: 100;
}

.bottom-bar {
  background-color: #000000;
  height: 5rem;
  display: flex;
  align-items: center;
  padding: 0 1rem;
  gap: 0.75rem;
}

/* ========================================
   客服按钮
   ======================================== */
.customer-service {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.customer-service:active {
  transform: scale(0.95);
}

.customer-icon {
  width: 2.5rem;
  height: 2.625rem;
  object-fit: contain;
}

.customer-label {
  margin-top: -0.625rem;
  height: 0.75rem;
  padding: 0 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #00A1D5;
  border-radius: 9999px;
  background: linear-gradient(to right, #baeeff, #38cfff);
}

.customer-label span {
  font-size: 0.375rem;
  color: #003278;
  white-space: nowrap;
}

/* ========================================
   操作按钮组
   ======================================== */
.action-buttons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.btn {
  flex: 1;
  height: 2.375rem;
  border: none;
  border-radius: 9999px;
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.btn:active {
  transform: scale(0.95);
  filter: brightness(1.1);
}

/* PWA 安装按钮（绿色渐变） */
.btn-pwa {
  background: linear-gradient(to bottom, #71DCBC, #0F8C66);
}

/* APK 下载按钮（蓝色渐变） */
.btn-download {
  background: linear-gradient(to bottom, #78AAF6, #3362CE);
}

/* ========================================
   奖励箱动画
   ======================================== */
.reward-container {
  position: absolute;
  top: -1.2rem;
  right: 1rem;
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.reward-box {
  animation: tada 1.5s infinite;
  display: inline-block;
}

.reward-icon {
  width: 2rem;
  height: auto;
}

@keyframes tada {
  from {
    transform: scale3d(1, 1, 1);
  }
  10%, 20% {
    transform: scale3d(0.9, 0.9, 0.9) rotate3d(0, 0, 1, -3deg);
  }
  30%, 50%, 70%, 90% {
    transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, 3deg);
  }
  40%, 60%, 80% {
    transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, -3deg);
  }
  to {
    transform: scale3d(1, 1, 1);
  }
}

/* ========================================
   模态框样式
   ======================================== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 200;
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal.hidden {
  display: none;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.7);
}

.modal-content {
  position: relative;
  background: linear-gradient(to bottom right, #1a1a1a, #000000);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  width: 90%;
  max-width: 400px;
  padding: 1.5rem;
  animation: fade-in-up 0.3s ease-out;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.modal-header h3 {
  font-size: 1.25rem;
  font-weight: bold;
}

.modal-close {
  background: none;
  border: none;
  color: #999;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.modal-close:hover {
  color: #fff;
}

.modal-body {
  color: #ccc;
}

.install-steps p {
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.5;
}

/* ========================================
   Toast 通知样式
   ======================================== */
.toast {
  position: fixed;
  top: 5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  animation: fade-in-down 0.3s ease-out;
}

.toast.hidden {
  display: none;
}

.toast-content {
  background: linear-gradient(to bottom right, #1a1a1a, #000000);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  padding: 2rem;
  text-align: center;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.toast-icon {
  width: 3rem;
  height: 3rem;
  background-color: rgba(59, 130, 246, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

.toast-icon .spinner {
  width: 1.5rem;
  height: 1.5rem;
  color: #60a5fa;
  animation: spin 1s linear infinite;
}

.toast-title {
  font-size: 1.25rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.toast-message {
  font-size: 0.875rem;
  color: #9ca3af;
}

/* ========================================
   动画定义
   ======================================== */
@keyframes fade-in-down {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* ========================================
   隐藏类
   ======================================== */
.hidden {
  display: none !important;
}
