
.ref-camera-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 99999;
  display: none;
  align-items: stretch;
  justify-content: stretch;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  color: #eafff9;
}
.ref-camera-overlay.ref-camera-open {
  display: flex;
}
.ref-camera-shell {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  height: 100dvh;
  background: #000;
  overflow: hidden;
}
.ref-camera-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: calc(env(safe-area-inset-top, 8px) + 8px) calc(env(safe-area-inset-right, 12px) + 12px) 8px calc(env(safe-area-inset-left, 12px) + 12px);
  background: linear-gradient(180deg, #001a14 0%, rgba(0,26,20,0.75) 100%);
  border-bottom: 1px solid rgba(23,158,132,0.35);
  flex: 0 0 auto;
}
.ref-camera-hint {
  flex: 1 1 auto;
  text-align: center;
  font-size: 14px;
  line-height: 1.4;
  color: #9fe8d6;
  letter-spacing: 0.02em;
}
.ref-camera-close,
.ref-camera-done {
  flex: 0 0 auto;
  border: 1px solid rgba(63,209,178,0.65);
  background: rgba(14,100,82,0.35);
  color: #eafff9;
  border-radius: 999px;
  padding: 6px 12px;
  min-width: 52px;
  font-size: 14px;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.15s ease;
  appearance: none;
  -webkit-appearance: none;
}
.ref-camera-done {
  background: #0f9b7a;
  border-color: #0f9b7a;
}
.ref-camera-close:active,
.ref-camera-done:active {
  background: #12b594;
}
.ref-camera-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.ref-camera-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  display: block;
}
.ref-camera-error {
  position: absolute;
  inset: auto 12px 12px 12px;
  background: rgba(40,10,10,0.88);
  border: 1px solid rgba(240,100,90,0.7);
  border-radius: 10px;
  padding: 10px 12px;
  color: #ffe1de;
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
  z-index: 5;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.ref-camera-fallback-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}
.ref-camera-fallback-row button {
  border: 1px solid #79dac4;
  background: #0f9b7a;
  color: #fff;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 14px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}
.ref-camera-controls {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 6px 8px calc(env(safe-area-inset-bottom, 10px) + 10px);
  background: linear-gradient(0deg, #001a14 0%, rgba(0,26,20,0.85) 100%);
  border-top: 1px solid rgba(23,158,132,0.35);
  overflow: hidden;
}
.ref-camera-count {
  font-size: 13px;
  color: #9fe8d6;
  letter-spacing: 0.02em;
}
.ref-camera-shutter {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 4px solid #eafff9;
  background: #0f9b7a;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 0 0 4px rgba(15,155,122,0.35), 0 6px 18px rgba(0,0,0,0.45);
  transition: transform 0.08s ease, opacity 0.15s ease;
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 auto;
}
.ref-camera-shutter:active {
  transform: scale(0.92);
}
.ref-camera-shutter:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.ref-camera-strip {
  display: flex;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px max(8px, env(safe-area-inset-left, 8px)) 2px max(8px, env(safe-area-inset-right, 8px));
  min-height: 58px;
  align-items: center;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #0f9b7a transparent;
}
.ref-camera-strip::-webkit-scrollbar {
  height: 4px;
}
.ref-camera-strip::-webkit-scrollbar-thumb {
  background: #0f9b7a;
  border-radius: 4px;
}
.ref-camera-thumb {
  position: relative;
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  border-radius: 8px;
  overflow: visible;
  border: 2px solid rgba(63,209,178,0.6);
  background: #002e25;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
}
.ref-camera-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}
.ref-camera-thumb-del {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: #d94f45;
  color: #fff;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 5px rgba(0,0,0,0.45);
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
@media (orientation: landscape) and (max-height: 560px) {
  .ref-camera-shell {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .ref-camera-topbar {
    flex: 1 0 100%;
  }
  .ref-camera-stage {
    flex: 1 1 65%;
    min-width: 0;
    min-height: 0;
  }
  .ref-camera-controls {
    flex: 1 1 35%;
    min-width: 0;
    min-height: 0;
    justify-content: center;
    border-top: none;
    border-left: 1px solid rgba(23,158,132,0.35);
  }
  .ref-camera-shutter {
    width: 58px;
    height: 58px;
  }
  .ref-camera-strip {
    min-height: 48px;
  }
  .ref-camera-thumb {
    width: 44px;
    height: 44px;
  }
}
@media (max-width: 420px) {
  .ref-camera-hint {
    font-size: 12px;
  }
  .ref-camera-close,
  .ref-camera-done {
    font-size: 12px;
    padding: 5px 10px;
    min-width: 44px;
  }
  .ref-camera-shutter {
    width: 62px;
    height: 62px;
    font-size: 13px;
  }
  .ref-camera-count {
    font-size: 11px;
  }
}
