/* PickIt · 图片水印 · 工具专属样式  author: ruan
 * 公共部分见 /shared/base.css */

/* 图片列表（.strip）已移到 /shared/base.css，多个工具共用 */

/* 贴纸卡片 */
.icon-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.icon-card img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 6px;
  background-color: var(--surface);
  background-image:
    linear-gradient(45deg, var(--stage-check) 25%, transparent 25%),
    linear-gradient(-45deg, var(--stage-check) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--stage-check) 75%),
    linear-gradient(-45deg, transparent 75%, var(--stage-check) 75%);
  background-size: 12px 12px;
  background-position: 0 0, 0 6px, 6px -6px, -6px 0;
}
.icon-card-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.icon-card-text strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 颜色：预设色板 + 取色器 + 十六进制 */
.color-row {
  display: grid;
  grid-template-columns: 1fr 44px 96px;
  gap: 8px;
  align-items: center;
}
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.swatch-btn {
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 999px;
  cursor: pointer;
  box-shadow: inset 0 0 0 2px var(--surface);
  transition: transform 0.1s;
}
.swatch-btn:hover { transform: scale(1.1); }
.swatch-btn.is-active { outline: 2px solid var(--accent); outline-offset: 2px; }
.color-row input[type="color"] { width: 44px; height: 36px; padding: 2px; }
.color-row input[type="text"] { padding: 7px 10px; font-family: var(--mono); font-size: 13px; }

/* 九宫格定位 */
.pos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  width: 132px;
  padding: 4px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.pos-grid button {
  aspect-ratio: 1;
  border: 0;
  border-radius: 5px;
  background: var(--surface-2);
  cursor: pointer;
  position: relative;
}
.pos-grid button::after {
  content: "";
  position: absolute;
  inset: 50%;
  width: 8px;
  height: 8px;
  transform: translate(-50%, -50%);
  border-radius: 2px;
  background: var(--line-strong);
}
.pos-grid button:hover { background: var(--accent-soft); }
.pos-grid button:hover::after, .pos-grid button.is-active::after { background: var(--accent); }
.pos-grid button.is-active { background: var(--accent-soft); }

/* 模板 */
.template-save {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}
.template-save input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.template-save input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.template-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.template-list:empty { display: none; }
.template-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.template-item .swatch {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
}
.template-item .swatch img { width: 100%; height: 100%; object-fit: contain; }
.template-item .t-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.template-item .t-text strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.template-item .t-text small { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.template-item .t-actions { display: flex; gap: 4px; }

@media (pointer: coarse) {
  .swatch-btn { width: 36px; height: 36px; }
  .pos-grid { width: 156px; gap: 6px; }
  .color-row { grid-template-columns: 1fr 48px 110px; }
  .color-row input[type="color"] { width: 48px; height: 44px; }
  .color-row input[type="text"] { min-height: 44px; }
  .template-item .t-actions .btn { min-height: 40px; }
}

/* 预览：单个模式可拖动 */
.stage.is-draggable canvas { cursor: move; touch-action: none; }
/* 窄屏：画布默认把纵向滑动交回浏览器；切到「布局」标签才接管二维拖动 */
body.has-dock .stage.is-draggable canvas { touch-action: pan-y; }
body.has-dock.dock-canvas-drag .stage.is-draggable canvas { touch-action: none; }
/* 双指放大后画布接管全部手势，靠复位按钮或双击退出 */
body.has-dock .stage canvas.is-pinched { touch-action: none; }
.zoom-reset {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 3;
  background: var(--surface);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.stage.is-dragging canvas { cursor: grabbing; }

/* 导出按钮：四个 */
.export-actions-wm { grid-template-columns: 1fr 1fr; }

@media (max-width: 640px) {
  .export-actions-wm { grid-template-columns: 1fr; }
}
