/* ============================================================
   滤镜 菜单 对话框面板：真机「滤镜」菜单 10 组 66 项（52 个参数化对话框 + 14 个无对话框滤镜）
   只作用于 .filter-dialog / .filter-backdrop 与「滤镜」菜单的子菜单，
   不覆盖 app.css / adjust-dialogs.css 的既有外壳。
   真机依据：docs/reference/menus/menu-滤镜.png 与 sub-滤镜-*.png（子菜单 252x500 @2x => 126 逻辑像素宽）。
   ============================================================ */

/* ---------- 滤镜菜单子菜单（只收窄滤镜菜单，不影响 图像 > 调整 的 226px 子菜单） ---------- */
#menu-layer .menu-popup[data-menu-popup="filter"] .menu-submenu { min-width: 132px; }
#menu-layer .menu-popup[data-menu-popup="filter"] .menu-submenu .menu-entry { padding-right: 10px; }

/* ---------- 对话框主体 ---------- */
.filter-dialog { min-width: 420px; max-height: 88vh; }
.filter-dialog .dialog-body { gap: 10px; overflow-y: auto; }
.filter-dialog .dialog-footer { padding-top: 4px; }

/* ---------- 参数行：标签 + 滑杆 + 数字框 + 单位 ---------- */
.filter-row { display: flex; align-items: center; gap: 10px; }
.filter-label { width: 72px; flex: 0 0 auto; font-size: 12px; color: #dcdcdc; }
.filter-range {
  flex: 1 1 auto; min-width: 140px; height: 18px; margin: 0;
  accent-color: var(--accent); background: transparent; cursor: pointer;
}
.filter-number {
  width: 64px; flex: 0 0 auto; text-align: right; padding: 0 6px;
  height: 24px; font-size: 12px;
}
.filter-unit { width: 30px; flex: 0 0 auto; font-size: 11px; color: #9a9a9a; }
.filter-select { width: 150px; }

/* ---------- 勾选项（添加杂色 > 单色 / 凸出 > 立方体正面 / 油画 > 光照） ---------- */
.filter-check-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: #dcdcdc; cursor: pointer;
}
.filter-check-row input { accent-color: var(--accent); margin: 0; }

/* ---------- 5x5 卷积核（滤镜 > 其它 > 自定） ---------- */
.filter-kernel-row { display: flex; align-items: flex-start; gap: 10px; }
.filter-kernel { display: grid; grid-template-columns: repeat(5, 54px); gap: 4px; }
.filter-kernel-cell {
  width: 54px; height: 24px; text-align: right; padding: 0 4px;
  background: #383838; border: 1px solid #6c6c6c; border-radius: 2px;
  color: #f0f0f0; font: 12px var(--font); outline: none;
}
.filter-kernel-cell:focus { border-color: #7ba7e8; }

/* ---------- 错切曲线编辑器（滤镜 > 扭曲 > 切变；真实鼠标按下/拖动调整行位移） ---------- */
.filter-shear-row { display: flex; align-items: flex-start; gap: 10px; }
.filter-shear {
  width: 360px; height: 180px; background: #383838;
  border: 1px solid #6c6c6c; border-radius: 2px; cursor: crosshair;
}
.filter-shear svg { width: 100%; height: 100%; display: block; }
.filter-shear-axis { stroke: #5a5a5a; stroke-width: 1; stroke-dasharray: 3 3; }
.filter-shear-line { fill: none; stroke: #e6e6e6; stroke-width: 2; vector-effect: non-scaling-stroke; }

/* ---------- 预览开关 / 参数摘要 / 菜单路径 ---------- */
.filter-preview-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border-top: 1px solid #333; padding-top: 8px; margin-top: 2px;
}
.filter-preview { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #dcdcdc; }
.filter-preview input { accent-color: var(--accent); margin: 0; }
.filter-summary { font-size: 11px; color: #9a9a9a; text-align: right; }
.filter-note { font-size: 11px; color: #a8a8a8; line-height: 1.6; }

/* ============================================================
   模糊画廊图钉画布（滤镜 > 模糊画廊 5 项）：真实鼠标拖动图钉
   ============================================================ */
.filter-pin-view { display: flex; flex-direction: column; gap: 6px; }
.filter-pin-canvas {
  width: 100%; max-width: 460px; display: block;
  background: #2b2b2b; border: 1px solid #6c6c6c; border-radius: 2px;
  cursor: crosshair; image-rendering: auto;
}
.filter-pin-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #dcdcdc; }
.filter-pin-coord { min-width: 88px; color: #ffd45e; font-variant-numeric: tabular-nums; }
.filter-pin-hint { color: #9a9a9a; font-size: 11px; }

/* ---------- 外部置换图文件（滤镜 > 扭曲 > 置换） ---------- */
.filter-file-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-file { font-size: 11px; color: #dcdcdc; }
.filter-file-status { font-size: 11px; color: #9a9a9a; }

/* ============================================================
   一级交互式 / 云端滤镜（FL-02…FL-11）对话框
   ============================================================ */
.filter-special-dialog .dialog-body { gap: 8px; overflow-y: auto; max-height: 74vh; }
.filter-special-body { display: flex; flex-direction: column; gap: 8px; }
.filter-special-view { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.filter-special-canvas {
  max-width: 100%; background: #262626;
  border: 1px solid #6c6c6c; border-radius: 2px; cursor: crosshair;
}
.filter-special-tools { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.special-tool {
  background: #3a3a3a; color: #dcdcdc; border: 1px solid #6c6c6c; border-radius: 2px;
  padding: 3px 8px; font: 11px var(--font); cursor: pointer;
}
.special-tool:hover { background: #474747; }
.special-tool.active { background: #4a6a9a; border-color: #7ba7e8; color: #fff; }
.filter-special-columns { display: flex; gap: 10px; align-items: flex-start; }
.filter-special-columns.three { gap: 8px; }
.special-list {
  display: flex; flex-direction: column; gap: 2px; width: 168px;
  max-height: 340px; overflow-y: auto; flex: 0 0 auto;
}
.special-list-item {
  text-align: left; background: #333; color: #dcdcdc; border: 1px solid #555;
  padding: 4px 8px; font: 11px var(--font); cursor: pointer;
}
.special-list-item:hover { background: #3d3d3d; }
.special-list-item.active { background: #4a6a9a; border-color: #7ba7e8; color: #fff; }
.special-thumbs {
  display: grid; grid-template-columns: repeat(3, 78px); gap: 6px;
  max-height: 340px; overflow-y: auto; flex: 0 0 auto;
}
.special-thumb {
  background: #333; border: 1px solid #555; color: #dcdcdc;
  font: 10px var(--font); padding: 2px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.special-thumb:hover { background: #3d3d3d; }
.special-thumb.active { border-color: #7ba7e8; background: #3d4f6a; }
.special-thumb-canvas { width: 56px; height: 42px; image-rendering: pixelated; background: #222; }
.special-detail { flex: 1 1 auto; min-width: 260px; display: flex; flex-direction: column; gap: 6px; }
.special-detail-title { font-size: 12px; color: #fff; font-weight: bold; }
.special-detail-note { font-size: 11px; color: #9a9a9a; line-height: 1.5; }
.special-controls { display: flex; flex-direction: column; gap: 6px; }
.special-section { font-size: 11px; color: #8fb7ea; margin-top: 6px; border-top: 1px solid #3a3a3a; padding-top: 6px; }
.filter-special-scroll {
  max-height: 420px; overflow-y: auto; display: flex; flex-direction: column;
  gap: 6px; padding-right: 6px;
}

/* ============================================================
   图层行：智能滤镜（滤镜 > 转换为智能滤镜 后挂在图层下）
   ============================================================ */
.layer-row.smart-filter-row {
  padding-left: 34px; font-size: 11px; background: #2f2f2f;
  border-top: 1px solid #3a3a3a;
}
.layer-row.smart-filter-row .eye { font-size: 10px; width: 18px; }
.layer-row.smart-filter-row.disabled { opacity: 0.55; }
.smart-filter-indent { width: 8px; display: inline-block; }
.smart-filter-menu {
  position: fixed; z-index: 4000; background: #2d2d2d; border: 1px solid #5a5a5a;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5); padding: 4px 0; min-width: 176px;
}
.smart-filter-menu-item {
  display: block; width: 100%; text-align: left; background: transparent; border: 0;
  color: #dcdcdc; font: 12px var(--font); padding: 5px 14px; cursor: pointer;
}
.smart-filter-menu-item:hover { background: #4a6a9a; color: #fff; }
.smart-filter-menu-sep { height: 1px; background: #4a4a4a; margin: 4px 0; }
