/* === 加载页 === */
.loading-page {
  background: #fff8f0;
  align-items: center;
  justify-content: center;
}

.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.loading-mascot {
  animation: mascot-bounce 1.2s ease-in-out infinite;
}

.mascot-img {
  width: 120px;
  height: 120px;
}

@keyframes mascot-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-18px); }
}

.loading-spinner {
  width: 56px;
  height: 56px;
  border: 5px solid #f0d0b0;
  border-top: 5px solid #e87b35;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-text {
  font-size: 22px;
  font-weight: 600;
  color: #e87b35;
}

/* === 结果页 === */
.result-page {
  background: #fff8f0;
  align-items: center;
}

.result-image-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 16px;
}

.result-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 16px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.15);
}

.result-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 14px 16px 20px;
  flex-shrink: 0;
}

.btn-result {
  min-height: 60px;
  padding: 12px 20px;
  font-size: 20px;
  font-weight: 600;
  border: none;
  border-radius: 24px;
  cursor: pointer;
  transition: transform 0.1s;
  white-space: nowrap;
}

.btn-result:active {
  transform: scale(0.95);
}

.btn-save-qr {
  background: #e87b35;
  color: #fff;
}

.btn-redraw {
  background: #f0f0f0;
  color: #555;
}

.btn-print {
  background: #f0f0f0;
  color: #555;
}

/* === 二维码浮层 === */
.qr-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 100;
  align-items: center;
  justify-content: center;
}

.qr-modal.active {
  display: flex;
}

.qr-modal-mask {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
}

.qr-modal-content {
  position: relative;
  background: #fff;
  border-radius: 20px;
  padding: 28px 24px 24px;
  text-align: center;
  max-width: 320px;
  width: 90%;
}

.qr-modal-title {
  font-size: 20px;
  font-weight: 700;
  color: #e87b35;
  margin-bottom: 16px;
}

.qr-canvas {
  width: 200px !important;
  height: 200px !important;
  margin-bottom: 14px;
}

.qr-modal-hint {
  font-size: 15px;
  color: #666;
  line-height: 1.6;
  margin-bottom: 18px;
}

.qr-modal-close {
  min-height: 48px;
  padding: 10px 32px;
  font-size: 18px;
  font-weight: 600;
  border: none;
  border-radius: 24px;
  background: #f0f0f0;
  color: #555;
  cursor: pointer;
}

.qr-modal-close:active {
  transform: scale(0.95);
}

/* === 标签浮层 === */
.tag-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 100;
  align-items: end;
  justify-content: center;
}

.tag-overlay.active {
  display: flex;
}

.tag-overlay-mask {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
}

.tag-overlay-content {
  position: relative;
  background: #fff;
  border-radius: 24px 24px 0 0;
  padding: 24px 20px 28px;
  text-align: center;
  width: 100%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
}

.tag-overlay-title {
  font-size: 24px;
  font-weight: 700;
  color: #333;
  margin-bottom: 6px;
}

.tag-overlay-subtitle {
  font-size: 15px;
  color: #999;
  margin-bottom: 20px;
}

.tag-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 22px;
}

.btn-tag {
  min-height: 56px;
  padding: 12px 22px;
  font-size: 20px;
  font-weight: 600;
  border: 2px solid #e0e0e0;
  border-radius: 28px;
  background: #fafafa;
  color: #555;
  cursor: pointer;
  transition: background 0.1s, border-color 0.1s, color 0.1s;
  white-space: nowrap;
}

.btn-tag:active {
  transform: scale(0.96);
}

.btn-tag.selected {
  background: #fff0e0;
  border-color: #e87b35;
  color: #e87b35;
}

.tag-overlay-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
}

.btn-tag-cancel,
.btn-tag-confirm {
  min-height: 56px;
  font-size: 20px;
  font-weight: 600;
  border: none;
  border-radius: 28px;
  cursor: pointer;
}
.btn-tag-cancel { padding: 12px 28px; background: #f0f0f0; color: #555; }
.btn-tag-confirm { padding: 12px 36px; background: #e87b35; color: #fff; transition: opacity 0.15s; }
.btn-tag-cancel:active,
.btn-tag-confirm:active { transform: scale(0.95); }
.btn-tag-confirm:disabled { opacity: 0.4; cursor: default; }
