

/* ==================== 二维码扫描器样式 ==================== */

/* 扫码覆盖层 */
.qr-scanner-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  display: none;
  flex-direction: column;
  z-index: 10000;
}

/* 扫码容器 */
.qr-scanner-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* 扫码头部 */
.qr-scanner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
}

.qr-scanner-close {
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: white;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-scanner-title {
  font-size: 16px;
  font-weight: 600;
}

.qr-scanner-switch {
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: white;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 扫码视口 */
.qr-scanner-viewport {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.qr-scanner-viewport video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 扫描框 */
.qr-scan-frame {
  position: absolute;
  width: 250px;
  height: 250px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* 扫描框四角 */
.qr-corner {
  position: absolute;
  width: 30px;
  height: 30px;
  border: 4px solid #FF8C42;
}

.qr-corner-tl {
  top: 0;
  left: 0;
  border-right: none;
  border-bottom: none;
  border-top-left-radius: 8px;
}

.qr-corner-tr {
  top: 0;
  right: 0;
  border-left: none;
  border-bottom: none;
  border-top-right-radius: 8px;
}

.qr-corner-bl {
  bottom: 0;
  left: 0;
  border-right: none;
  border-top: none;
  border-bottom-left-radius: 8px;
}

.qr-corner-br {
  bottom: 0;
  right: 0;
  border-left: none;
  border-top: none;
  border-bottom-right-radius: 8px;
}

/* 扫描线动画 */
.qr-scan-line {
  position: absolute;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent, #FF8C42, transparent);
  top: 0;
  left: 0;
  animation: scanLine 2s linear infinite;
  box-shadow: 0 0 10px rgba(255, 140, 66, 0.8);
}

@keyframes scanLine {
  0% {
    top: 0;
  }
  50% {
    top: calc(100% - 3px);
  }
  100% {
    top: 0;
  }
}

/* 扫描提示 */
.qr-scan-hint {
  position: absolute;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 14px;
  white-space: nowrap;
}

/* 扫描成功提示 */
.qr-scan-success {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(0, 0, 0, 0.8);
  padding: 30px 50px;
  border-radius: 16px;
  animation: successPop 0.3s ease-out;
}

@keyframes successPop {
  0% {
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 0;
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

.success-icon {
  font-size: 60px;
  margin-bottom: 10px;
}

.success-text {
  color: white;
  font-size: 18px;
  font-weight: 600;
}

/* 扫码底部操作 */
.qr-scanner-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 30px;
  padding: 20px;
  background: rgba(0, 0, 0, 0.6);
}

.qr-manual-input-btn,
.qr-flash-btn {
  padding: 12px 24px;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border-radius: 25px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.qr-manual-input-btn:active,
.qr-flash-btn:active {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(0.95);
}

/* 扫码错误提示 */
.qr-scanner-error {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 30px;
}

.error-icon {
  font-size: 60px;
  margin-bottom: 16px;
}

.error-text {
  color: white;
  font-size: 16px;
  margin-bottom: 20px;
}

.error-retry-btn {
  padding: 12px 30px;
  border: none;
  background: #FF8C42;
  color: white;
  border-radius: 25px;
  font-size: 14px;
  cursor: pointer;
}

/* 手动输入弹窗 */
.manual-input-modal {
  width: 90%;
  max-width: 360px;
  background: white;
  border-radius: 16px;
  overflow: hidden;
}

.manual-input-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: linear-gradient(135deg, #FF8C42, #FF7A2F);
  color: white;
  font-weight: 600;
  font-size: 16px;
}

.modal-close-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  color: white;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.manual-input-content {
  padding: 20px;
}

/* 移动端适配 */
@media (max-width: 480px) {
  .qr-scan-frame {
    width: 220px;
    height: 220px;
  }
  
  .qr-corner {
    width: 25px;
    height: 25px;
  }
  
  .qr-scan-hint {
    bottom: 80px;
    font-size: 13px;
    padding: 8px 16px;
  }
}

/* 儿童模式适配 */
[data-mode="child"] .qr-scanner-header {
  background: rgba(168, 218, 220, 0.6);
}

[data-mode="child"] .qr-corner {
  border-color: #A8DADC;
}

[data-mode="child"] .qr-scan-line {
  background: linear-gradient(90deg, transparent, #A8DADC, transparent);
  box-shadow: 0 0 10px rgba(168, 218, 220, 0.8);
}

/* 老人模式适配 */
[data-mode="elderly"] .qr-scan-frame {
  width: 280px;
  height: 280px;
}

[data-mode="elderly"] .qr-corner {
  width: 35px;
  height: 35px;
  border-width: 5px;
}

[data-mode="elderly"] .qr-scan-hint {
  font-size: 18px;
  padding: 12px 24px;
}

[data-mode="elderly"] .qr-manual-input-btn,
[data-mode="elderly"] .qr-flash-btn,
[data-mode="elderly"] .error-retry-btn {
  padding: 14px 28px;
  font-size: 16px;
}
