:root{--popup-bg:#fff;--popup-fg:#181818;--popup-border:#ddd;--popup-hover:#f0f2f1;--popup-selected:#e3f5eb}
[data-theme="dark"]{--popup-bg:#202422;--popup-fg:#f4f5f4;--popup-border:#454b47;--popup-hover:#303832;--popup-selected:#164b30}
select[data-rounded]{display:none!important}
.rounded-select-trigger{width:100%;min-height:44px;padding:11px 38px 11px 14px;text-align:left;border:1px solid var(--popup-border);border-radius:14px;background:var(--popup-bg);color:var(--popup-fg);font:inherit;position:relative;cursor:pointer;white-space:normal}
.rounded-select-trigger:after{content:'';position:absolute;right:17px;top:50%;width:7px;height:7px;border-right:1.7px solid currentColor;border-bottom:1.7px solid currentColor;transform:translateY(-70%) rotate(45deg);opacity:.65;transition:transform .16s}.rounded-select-trigger[aria-expanded="true"]:after{transform:translateY(-20%) rotate(225deg)}
.rounded-select-trigger:disabled{opacity:.5;cursor:default}
.rounded-select-trigger:focus-visible,.rounded-option:focus-visible,.empty-image-tile:focus-visible{outline:2px solid #00a75b;outline-offset:3px}
.rounded-select-popup{position:fixed;z-index:10000;box-sizing:border-box;padding:8px;overflow:auto;border:1px solid var(--popup-border);border-radius:18px;background:var(--popup-bg);color:var(--popup-fg);box-shadow:0 14px 45px #0003;overscroll-behavior:contain}
.rounded-option{display:block;width:100%;border:0;border-radius:11px;padding:11px 12px;margin:2px 0;text-align:left;background:transparent;color:inherit;font:inherit;cursor:pointer;white-space:normal}
.rounded-option:hover,.rounded-option:focus-visible{background:var(--popup-hover)}
.rounded-option.is-selected{background:var(--popup-selected);font-weight:600}
.rounded-search{width:100%;box-sizing:border-box;padding:10px;border:1px solid var(--popup-border);border-radius:12px;background:var(--popup-bg);color:inherit;margin-bottom:6px}
.rounded-heading{display:block;padding:10px 12px}
dialog{border-radius:24px!important}
dialog input:not([type="checkbox"]):not([type="file"]),dialog textarea{border-radius:12px}
.empty-image-tile{min-height:240px;border:2px dashed var(--popup-border);border-radius:18px;background:var(--popup-bg);color:var(--popup-fg);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;font:inherit;cursor:pointer}
.empty-image-tile span{font-size:36px;color:#00a75b}
#product-trash-dialog{width:min(960px,calc(100vw - 40px));max-width:960px;max-height:88vh;overflow:auto}
.trash-toolbar{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px 0}
.trash-toolbar label{display:flex;align-items:center;gap:8px}
.restore-preview{max-height:40vh;overflow:auto}.restore-preview-row{display:flex;align-items:center;gap:12px;padding:10px 0}.restore-preview-row img{width:56px;height:56px;object-fit:cover;border-radius:12px}
[hidden]{display:none!important}

.trash-grid{display:grid;grid-template-columns:minmax(0,1fr);gap:10px}

.removal-confirm{width:min(520px,calc(100vw - 32px))}.removal-confirm h2{margin-bottom:16px}.removal-confirm p{line-height:1.8;color:var(--muted);margin-top:16px}.removal-images{display:flex;gap:10px;flex-wrap:wrap}.removal-images img{width:112px;height:112px;object-fit:contain;border-radius:12px;background:var(--popup-hover)}


#product-dialog .image-upload-actions .image-undo-button{display:inline-flex;align-items:center;justify-content:center;width:auto;min-height:40px;height:40px;padding:0 20px;border-radius:22px;border:1px solid var(--accent);background:var(--accent);color:#fff;font-size:13px;font-weight:600;line-height:1;white-space:nowrap}#product-dialog .image-undo-note{font-size:12px;color:var(--muted);line-height:1.5}#product-dialog .image-controls [data-image-remove]{border:1px solid var(--danger);color:var(--danger);background:transparent}#product-dialog .image-controls [data-image-remove]:hover:not(:disabled){background:color-mix(in srgb,var(--danger) 10%,transparent)}

.listing-lock{border:1px solid var(--line);background:var(--selected);padding:16px;border-radius:14px;margin-bottom:16px}.listing-lock>label{display:flex;align-items:center;gap:10px;font-size:14px;color:var(--text)}.listing-lock input{width:20px;height:20px;accent-color:var(--accent)}.listing-manual-fields{margin:20px 0}.listing-manual-fields label{display:grid;gap:8px;align-content:start}.listing-facts{margin-top:20px}.listing-facts summary{cursor:pointer}

.listing-lock.compact-lock{display:flex;align-items:center;gap:14px;padding:12px 0;background:transparent;border:0;border-bottom:1px solid var(--line);border-radius:0;margin-bottom:16px}.compact-lock>div{flex:1}.compact-lock strong{font-size:14px}.compact-lock p{font-size:12px;color:var(--muted);margin:5px 0 0}.compact-lock #listing-save-state{font-size:12px;color:var(--muted)}.listing-lock.compact-lock .listing-switch{position:relative;display:block;flex:none;width:44px;height:26px;margin:0;cursor:pointer}.listing-lock .listing-switch input{position:absolute;width:44px;height:26px;margin:0;opacity:0;cursor:pointer;z-index:1}.listing-switch>span{display:block;width:44px;height:26px;border-radius:20px;background:var(--muted);transition:background .15s}.listing-switch>span:after{content:'';display:block;position:absolute;left:3px;top:3px;width:20px;height:20px;border-radius:50%;background:#fff;transition:transform .15s}.listing-switch input:checked+span{background:var(--accent)}.listing-switch input:checked+span:after{transform:translateX(18px)}.listing-switch input:focus-visible+span{outline:2px solid var(--accent);outline-offset:3px}.listing-count{font-size:12px;color:var(--muted);margin-bottom:12px}.listing-group-title{font-size:12px;color:var(--muted)}

.category-picker .rounded-search{position:sticky;top:0;z-index:2}.category-group-tabs{display:flex;flex-wrap:wrap;gap:6px;padding:4px 2px 12px;border-bottom:1px solid var(--popup-border);margin-bottom:8px}.category-group-tab{width:auto;padding:8px 12px;border:1px solid var(--popup-border);border-radius:20px;background:transparent;color:inherit;font:inherit;font-size:12px;cursor:pointer}.category-group-tab[aria-pressed="true"]{background:var(--popup-selected);border-color:#00a75b}.category-empty{padding:12px;color:var(--muted)}.category-option-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px}.category-option-list .rounded-option{font-size:13px;margin:0}.brand-filter-label>.rounded-select-trigger{width:190px}.selection-shop-settings{font-size:12px;color:var(--muted);text-decoration:none;border:1px solid var(--line);padding:6px 12px;border-radius:18px;white-space:nowrap}.store-target-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}#product-dialog .image-upload-actions{justify-content:flex-end}.marketbar{justify-content:flex-start} @media(max-width:600px){.category-option-list{grid-template-columns:1fr}}

#shops-page{width:min(640px,calc(100vw - 32px));max-width:640px;max-height:80vh;overflow:auto;padding:24px;margin:auto;border:1px solid var(--line);box-sizing:border-box}#shops-page::backdrop{background:#0007;backdrop-filter:blur(5px)}#shops-page .catalog-heading{margin-bottom:18px;gap:14px}#shops-page h2{margin:0;font-size:22px}#shops-page .shop-card{padding:14px 16px;margin-bottom:8px;min-height:64px}#shops-page .shop-row-name h3{font-size:14px}#shops-page #close-shops{font-size:12px;white-space:nowrap}.brand-filter-label #clear-brand{font-size:12px;padding:8px 12px}

/* Center circular close/remove controls and unify image-copy action. */
button.remove,#batch-close,#facts-batch-close,#listing-close,button[aria-label^="关闭"]{display:inline-flex;align-items:center;justify-content:center;padding:0;line-height:1;text-align:center;flex-shrink:0}
.selected-row button.remove{width:26px;height:26px;min-width:26px;min-height:26px;font-size:18px;font-family:Arial,sans-serif}
#product-dialog .image-upload-actions #copy-all-images{background:#18181b;border-color:#18181b;color:#fff}#product-dialog .image-upload-actions #copy-all-images:hover:not(:disabled){background:#303036;border-color:#303036}
#product-dialog #image-preview>.image-upload-actions{justify-content:flex-end}
