* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, Noto Sans TC;
  color: #222;
  background: #fff;
}
#three-container {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}
#three-container canvas {
  display: block;
  image-rendering: auto;
}
#loading-screen {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background-color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}
.spinner {
  width: 60px;
  height: 60px;
  border: 6px solid #ccc;
  border-top-color: #333;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}
.loading-text {
  font-size: 1.2rem;
  color: #333;
  animation: blink 1.5s ease-in-out infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes blink {
  0%,
  to {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}
.panel {
  position: fixed;
  top: 16px;
  right: 16px;
  width: min(380px, 92vw);
  max-height: calc(100vh - 32px);
  overflow: auto;
  z-index: 10;
  background: #ffffffe0;
  -webkit-backdrop-filter: saturate(120%) blur(6px);
  backdrop-filter: saturate(120%) blur(6px);
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  box-shadow: 0 12px 32px #0000001f;
  padding: 12px;
}
.panel-title {
  margin: 4px 0 10px;
  font-size: 18px;
}
.panel-subtitle {
  margin: 12px 0 8px;
  font-size: 15px;
}
.field-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
}
.field-row label {
  min-width: 96px;
  color: #555;
  font-size: 14px;
}
.field-row input[type="color"] {
  width: 36px;
  height: 32px;
  padding: 0;
  border: none;
  background: none;
}
.btn-row {
  display: flex;
  gap: 8px;
  margin: 8px 0 4px;
}
button {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: 600;
  cursor: pointer;
}
button:hover:not(:disabled) {
  background: #f3f3f3;
}
button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.gallery-vertical {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}
.gallery-card {
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}
.gallery-card__title {
  padding: 8px 10px;
  font: 600 14px/1.4 system-ui, -apple-system, Segoe UI, Roboto, Arial,
    Noto Sans TC;
  border-bottom: 1px solid #eee;
}
.gallery-card__img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}
.gallery-card__meta {
  padding: 8px 10px;
  font: 12px/1.4 system-ui;
  color: #666;
  word-break: break-all;
}
#ar-loading-overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: #ffffffe6;
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}
.ar-loading-box {
  text-align: center;
}
.ar-spinner {
  width: 60px;
  height: 60px;
  border: 6px solid #bbb;
  border-top-color: #444;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}
.ar-loading-message {
  font-size: 1.2rem;
  color: #444;
}
@media (max-width: 640px) {
  .panel {
    width: min(96vw, 520px);
    background: #fffffff0;
  }
}
