/* photo-input.js 的視覺樣式 */
.photo-input-wrap {
  display: block;
}
.photo-input-buttons {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: nowrap;
  min-width: 0;
}
.photo-input-btn {
  font-size: 14px;
  flex: 0 0 auto;
}
.photo-input-hint {
  font-size: 12px;
  color: var(--muted, #888);
  margin-left: 4px;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 420px) {
  .photo-input-buttons { flex-wrap: wrap; }
  .photo-input-hint { flex-basis: 100%; margin-left: 0; }
}
.photo-input-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.photo-input-preview:empty { display: none; }
.photo-input-item {
  position: relative;
  width: 88px; height: 88px;
  border-radius: 8px;
  overflow: hidden;
  background: #f3f3f3;
  border: 1px solid var(--line, #e5e5e5);
}
.photo-input-item img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.photo-input-del {
  position: absolute;
  top: 2px; right: 2px;
  width: 22px; height: 22px;
  border: none; border-radius: 50%;
  background: rgba(0,0,0,.65); color: #fff;
  font-size: 16px; line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.photo-input-del:hover { background: rgba(220,20,20,.85); }

/* ── 裁切視窗 ── */
.photo-crop-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.7);
  z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.photo-crop-modal {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 720px;
  max-height: calc(100vh - 32px);
  display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  overflow: hidden;
}
.photo-crop-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  font-weight: 600;
  border-bottom: 1px solid var(--line, #eee);
}
.photo-crop-close {
  background: transparent; border: none;
  font-size: 24px; line-height: 1; cursor: pointer;
  color: var(--muted, #666);
  padding: 0 6px;
}
.photo-crop-close:hover { color: #c00; }
.photo-crop-body {
  flex: 1;
  min-height: 280px;
  max-height: 60vh;
  background: #222;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.photo-crop-img {
  display: block;
  max-width: 100%;
}
.photo-crop-tools {
  display: flex; gap: 6px; align-items: center;
  padding: 8px 16px;
  border-top: 1px solid var(--line, #eee);
  background: var(--bg, #fafafa);
}
.photo-crop-actions {
  display: flex; gap: 8px; justify-content: flex-end;
  padding: 12px 16px;
  border-top: 1px solid var(--line, #eee);
}
@media (max-width: 480px) {
  .photo-crop-actions { flex-direction: column-reverse; }
  .photo-crop-actions .btn { width: 100%; }
}

/* ── 相機視窗 ── */
.photo-cam-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.85);
  z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.photo-cam-modal {
  background: #111;
  color: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 720px;
  max-height: calc(100vh - 32px);
  display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
  overflow: hidden;
}
.photo-cam-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  font-weight: 600;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.photo-cam-close {
  background: transparent; border: none;
  color: #fff; font-size: 24px; line-height: 1;
  cursor: pointer; padding: 0 6px;
}
.photo-cam-close:hover { color: #ff7676; }
.photo-cam-body {
  flex: 1; min-height: 280px;
  background: #000;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  max-height: 70vh;
}
.photo-cam-body video {
  display: block;
  width: 100%;
  height: auto;
  max-height: 70vh;
  object-fit: contain;
  background: #000;
}
.photo-cam-actions {
  display: flex; gap: 8px; align-items: center;
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,.08);
  background: #1a1a1a;
}
.photo-cam-snap {
  font-size: 16px;
  padding: 10px 22px;
  border-radius: 999px;
}
@media (max-width: 480px) {
  .photo-cam-body { max-height: 60vh; }
}
