/* =========================================================
 * 图片查看页样式（暗色背景，突出商品细节）
 * ========================================================= */

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  overflow: hidden;
  background: #0e0f13;
  color: #e8e8ec;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  -webkit-tap-highlight-color: transparent;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* ---------------- 顶栏 ---------------- */
#topbar {
  height: 52px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  background: rgba(18, 19, 25, .92);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}

#title {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  color: #cfd2da;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btns {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.btns button {
  min-width: 36px;
  height: 34px;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 8px;
  background: rgba(255, 255, 255, .06);
  color: #e8e8ec;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: background .15s;
}

.btns button:hover { background: rgba(255, 255, 255, .16); }
.btns button:active { background: rgba(255, 255, 255, .24); }

#scale-label {
  min-width: 54px;
  text-align: center;
  font-size: 12.5px;
  color: #9aa0ad;
  font-variant-numeric: tabular-nums;
}

/* ---------------- 画布 ---------------- */
#stage {
  flex: 1;
  position: relative;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
  background: radial-gradient(1200px 800px at 50% 40%, #171923 0%, #0e0f13 70%);
}

#stage.dragging { cursor: grabbing; }

#img {
  position: absolute;
  left: 50%;
  top: 50%;
  max-width: none;
  user-select: none;
  -webkit-user-drag: none;
  will-change: transform;
  box-shadow: 0 8px 40px rgba(0, 0, 0, .5);
}

/* ---------------- 提示 / 加载 / 错误 ---------------- */
#hint {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .55);
  color: #b9bdc9;
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity .6s;
  opacity: 0;
}

#hint.show { opacity: 1; }

#loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(255, 255, 255, .15);
  border-top-color: #7aa2ff;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

#load-error {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  color: #9aa0ad;
  font-size: 14px;
}

@media (max-width: 560px) {
  #topbar { padding: 0 10px; gap: 6px; }
  .btns button { min-width: 32px; height: 32px; padding: 0 8px; font-size: 12px; }
  #scale-label { min-width: 44px; font-size: 11.5px; }
}
