/* =========================================================
   ATO V3 · 新建画布弹窗（少女可爱风：马卡龙粉彩 / 果冻圆角 / 柔和粉影）
   复用 tokens.css 设计变量
   ========================================================= */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;                 /* 由 JS 切换为 flex 显示 */
  align-items: center;
  justify-content: center;
  background: rgba(90, 55, 74, 0.34);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  padding: 20px;
}
.modal-mask.nc-open { display: flex; animation: ncFade 0.18s ease; }
@keyframes ncFade { from { opacity: 0; } to { opacity: 1; } }

.modal-card {
  width: 460px;
  max-width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--bg-2);
  border: 1px solid var(--border-1);
  border-radius: var(--r-4);
  box-shadow: var(--sh-float);
  padding: 0;
  animation: ncPop 0.2s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes ncPop { from { transform: translateY(10px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 12px;
  position: sticky;
  top: 0;
  background: var(--bg-2);
  z-index: 2;
}
.modal-title { font-size: var(--fs-20); font-weight: 800; color: var(--text-1); letter-spacing: .5px; }
.modal-x {
  border: none; background: var(--bg-0); color: var(--text-2);
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer; font-size: 14px;
  transition: background .15s, color .15s;
}
.modal-x:hover { background: var(--bg-hover); color: var(--danger); }

.modal-body { padding: 4px 22px 8px; }

.nc-field { margin-bottom: 18px; }
.nc-label {
  display: block; font-size: var(--fs-13); font-weight: 700;
  color: var(--text-2); margin-bottom: 9px;
}

/* ---- 分段控件（比例 / 背景类型）---- */
.nc-seg {
  display: flex; gap: 6px; background: var(--bg-0);
  padding: 5px; border-radius: var(--r-3); border: 1px solid var(--border-1);
}
.nc-seg-btn {
  flex: 1; border: none; cursor: pointer;
  padding: 10px 8px; border-radius: var(--r-2);
  font-size: var(--fs-13); font-weight: 700; color: var(--text-2);
  background: transparent; transition: all .15s;
}
.nc-seg-btn:hover { background: var(--bg-hover); color: var(--text-1); }
.nc-seg-btn.active {
  background: var(--bg-2); color: var(--accent-strong);
  box-shadow: var(--sh-1);
}

/* ---- 马卡龙预设色板 ---- */
.nc-presets {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
.nc-preset {
  border: 2px solid transparent; cursor: pointer; border-radius: var(--r-2);
  padding: 0; overflow: hidden; background: var(--bg-0);
  transition: transform .12s, border-color .15s;
}
.nc-preset:hover { transform: translateY(-2px); }
.nc-preset.active { border-color: var(--accent-strong); }
.nc-preset .sw {
  height: 46px; display: block; width: 100%;
}
.nc-preset .nm {
  display: block; font-size: 11px; color: var(--text-2);
  padding: 5px 0; font-weight: 600;
}

/* ---- 自定义颜色 ---- */
.nc-colors { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.nc-color { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--text-2); font-weight: 600; }
.nc-color input[type="color"] {
  width: 56px; height: 38px; border: 1px solid var(--border-2);
  border-radius: var(--r-2); background: var(--bg-2); cursor: pointer; padding: 3px;
}
.nc-color input[type="range"] { width: 120px; accent-color: var(--accent); }
.nc-color b { color: var(--accent-strong); font-weight: 800; }

/* ---- 透明提示 ---- */
.nc-transparent-note {
  display: none;
  font-size: 12px; line-height: 1.6; color: var(--text-2);
  background: var(--bg-0); border: 1px dashed var(--border-2);
  border-radius: var(--r-2); padding: 10px 12px;
}
.nc-transparent-note.show { display: block; }

/* ---- 占位文案开关 ---- */
.nc-switch-row { margin-top: 4px; }
.nc-switch { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.nc-switch input { display: none; }
.nc-switch-track {
  width: 44px; height: 24px; border-radius: 999px;
  background: var(--border-2); position: relative; transition: background .18s; flex: 0 0 auto;
}
.nc-switch-thumb {
  position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: transform .18s;
}
.nc-switch input:checked + .nc-switch-track { background: var(--accent); }
.nc-switch input:checked + .nc-switch-track .nc-switch-thumb { transform: translateX(20px); }
.nc-switch-label { font-size: var(--fs-13); color: var(--text-1); font-weight: 600; }

/* ---- 操作按钮 ---- */
.modal-actions {
  display: flex; gap: 10px; justify-content: flex-end;
  padding: 14px 22px 20px; position: sticky; bottom: 0; background: var(--bg-2);
  border-top: 1px solid var(--border-1);
}
.nc-btn {
  border: none; cursor: pointer; padding: 11px 22px; border-radius: var(--r-2);
  font-size: var(--fs-14); font-weight: 700; transition: all .15s;
}
.nc-btn-ghost { background: var(--bg-0); color: var(--text-2); }
.nc-btn-ghost:hover { background: var(--bg-hover); color: var(--text-1); }
.nc-btn-primary { background: var(--accent); color: #fff; box-shadow: var(--sh-1); }
.nc-btn-primary:hover { background: var(--accent-strong); }
