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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: #f0f2f5;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  -webkit-text-size-adjust: 100%;
}

/* 加载动画 */
.container {
  background: #fff;
  border-radius: 16px;
  padding: 44px 32px;
  max-width: 400px;
  width: 100%;
  text-align: center;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.04);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.container.visible {
  opacity: 1;
  transform: translateY(0);
}

h1 {
  font-size: 24px;
  color: #1a1a1a;
  margin-bottom: 8px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* 副标题 */
.subtitle {
  font-size: 14px;
  color: #888;
  margin-bottom: 22px;
  line-height: 1.5;
}

h1 + .wechat-id {
  margin-top: 14px;
}

.wechat-id {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
  font-size: 16px;
}

.wechat-id .label {
  color: #999;
}

.wechat-id .value {
  color: #1a1a1a;
  font-weight: 600;
  font-family: 'SF Mono', 'Menlo', 'Monaco', 'Courier New', monospace;
  letter-spacing: 0.02em;
}

.copy-btn {
  background: #07c160;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.copy-btn:hover {
  background: #06ad56;
  transform: translateY(-1px);
}

.copy-btn:active {
  transform: translateY(0);
}

/* 二维码缩放动画 */
.qrcode-wrapper {
  margin: 0 auto 22px;
  width: min(220px, 65vw);
  height: min(220px, 65vw);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fafafa;
  border: 1px solid #eee;
  border-radius: 12px;
  overflow: hidden;
}

.qrcode-wrapper img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transform: scale(0.85);
  opacity: 0;
  transition: transform 0.4s ease, opacity 0.4s ease;
}

.qrcode-wrapper img.loaded {
  transform: scale(1);
  opacity: 1;
}

.no-qrcode {
  color: #ccc;
  font-size: 14px;
}

.tip {
  color: #bbb;
  font-size: 12px;
  letter-spacing: 0.02em;
}

/* 过期遮罩 */
.expired-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #f0f2f5;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.expired-card {
  background: #fff;
  border-radius: 16px;
  padding: 48px 32px;
  max-width: 360px;
  width: 90%;
  text-align: center;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

.expired-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.expired-card h2 {
  font-size: 22px;
  color: #1a1a1a;
  margin-bottom: 12px;
  font-weight: 700;
}

.expired-card p {
  font-size: 14px;
  color: #999;
}

/* 长按保存提示 */
.save-tip {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13px;
  z-index: 200;
  white-space: nowrap;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 10px 24px;
  border-radius: 20px;
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  z-index: 300;
}

.toast.show {
  opacity: 1;
}

/* 移动端适配 */
@media (max-width: 400px) {
  body {
    padding: 12px;
  }

  .container {
    padding: 32px 20px;
    border-radius: 16px;
  }

  h1 {
    font-size: 21px;
  }

  .subtitle {
    font-size: 13px;
  }

  .wechat-id {
    font-size: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
  }

  .copy-btn {
    padding: 6px 16px;
    font-size: 14px;
  }

  .tip {
    font-size: 12px;
  }
}

/* 超小屏幕 */
@media (max-width: 320px) {
  .container {
    padding: 24px 16px;
  }

  h1 {
    font-size: 19px;
  }

  .wechat-id {
    font-size: 14px;
  }
}

/* 安全区域适配（刘海屏等） */
@supports (padding: env(safe-area-inset-bottom)) {
  body {
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
    padding-top: calc(16px + env(safe-area-inset-top));
  }
}
