/* 舌象采集页面专属样式 —— 不影响其他页面 */
.preview-container {
  position: relative;
  background: #000;
  width: 100%;
  padding-top: 100%; /* 3:4 比例 = 4/3 ≈ 133.33% */
  overflow: hidden;
  border-radius: 0.5rem;
  border: 2px dashed #cbd5e1; /* 使用 HTML 内联配置的颜色 */
}

.preview-container video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1); /* 前置摄像头镜像翻转 */
}

.tongue-guide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 10;
  background: rgba(0, 0, 0, 0.3);
}

.tongue-shape {
  width: 85%;
  max-width: 250px;
  aspect-ratio: 3/4;
  margin-bottom: 15px;
}

.tongue-shape svg {
  width: 100%;
  height: 100%;
  display: block;
}

.guide-text {
  color: white;
  font-weight: 600;
  text-align: center;
  font-size: 0.9rem;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  padding: 0 10px;
}

.low-res-warning {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid #ef4444;
  color: #b91c1c;
  border-radius: 0.5rem;
  padding: 0.5rem;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  display: none;
}

.control-bar {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  background: #f1f5f9; /* 使用 HTML 内联配置的 secondary */
  border-radius: 0.5rem;
  margin-top: 0.5rem;
}

.btn-camera {
  flex: 1;
  max-width: 120px;
  padding: 0.5rem 0;
  border: none;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  transition: all 0.2s;
  color: white;
}

.btn-primary-camera {
  background: #4A807A; /* 使用 HTML 内联配置的 primary */
}

.btn-secondary-camera {
  background: #64748b;
}

.btn-switch-camera {
  background: #94a3b8;
}

.btn-switch-camera.active {
  background: #4A807A;
}

.btn-camera:active {
  opacity: 0.9;
}

.preview-result {
  text-align: center;
}

.preview-result img {
  max-width: 100%;
  border-radius: 0.5rem;
  margin: 0.5rem auto;
  border: 2px solid #cbd5e1;
  aspect-ratio: 3/4;
  object-fit: contain;
}

body {
  padding-bottom: env(safe-area-inset-bottom, 0);
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}
.pulse {
  animation: pulse 0.5s ease-in-out;
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.animate-fade-in-up {
  animation: fade-in-up 0.6s ease-out forwards;
}