diff --git a/frontend/index.html b/frontend/index.html
index 4f22ce4..93d33f7 100644
--- a/frontend/index.html
+++ b/frontend/index.html
@@ -214,7 +214,7 @@
const checked = selectedTags[tag.id] !== undefined;
const optionsHtml = tag.options.map(o => `
`).join('');
@@ -255,7 +255,18 @@
}
function selectTagOption(tagId, optionId) {
- selectedTags[tagId] = optionId;
+ if (selectedTags[tagId] === optionId) {
+ // 再次点击已选中的选项 → 取消选择(需要 renderTags 重建 DOM 以取消 radio 的 checked 状态)
+ delete selectedTags[tagId];
+ renderTags();
+ } else {
+ selectedTags[tagId] = optionId;
+ // 同步勾选父标签复选框
+ const checkbox = document.querySelector(`#tag-options-${tagId}`)
+ ?.closest('.mb-2')
+ ?.querySelector('input[type="checkbox"]');
+ if (checkbox) checkbox.checked = true;
+ }
updatePreview();
}