#products .history-button{margin-left:12px;padding:3px 10px;font-size:12px;color:#294b75;border:1px solid #c5d5e9;background:#f4f8ff;border-radius:4px}
#products .history-button.history-has-change{color:#fff;background:#2563eb;border-color:#2563eb;font-weight:600}
#spu-history{width:96vw;max-width:1280px;max-height:96dvh;padding:0;border:1px solid #cbd6e5;border-radius:12px;color:#263c59;background:#fff}
#spu-history::backdrop{background:#182b4599}#spu-history header{display:flex;justify-content:space-between;align-items:center;padding:10px 16px;background:#f5f8fc}#spu-history header>div{display:flex;gap:20px;align-items:center}#spu-history h2{font-size:18px;margin:0}#spu-history header p{margin:0}.history-content{padding:12px}
.image-history-controls{display:flex;gap:18px;align-items:center;margin-bottom:12px}.image-history-controls label{display:flex;align-items:center;gap:8px;min-width:0}.image-history-controls label:first-child{flex:1}.image-history-controls select{min-width:0;max-width:100%}.image-history-controls label:first-child select{flex:1}.image-history-controls>span{font-size:12px;color:#708098}
.history-images{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;align-items:start}.history-image-day{border:1px solid #dce4ed;border-radius:6px;overflow:hidden}.history-image-day h3{margin:0;padding:10px;background:#f0f4f9;font-size:15px;text-align:center}.history-image-day h3 span{color:#94631b;font-size:12px}.history-image-day img{display:block;width:100%;height:auto}.history-image-day img[hidden]{display:none}.history-image-empty,.image-load-error{padding:60px 12px;text-align:center;color:#7b8795}.history-warning{color:#9a5800}
#spu-history select.history-selected-changed,#spu-history option.history-option-changed{color:#a63b00;background:#fff3e8}#spu-history option{color:#263c59;background:#fff}.spu-subsidy-cards{display:inline-flex;gap:6px;margin:0 0 0 10px;vertical-align:middle}.spu-subsidy-card{display:inline-block;padding:4px 12px;border:1px solid #bbd1ed;border-radius:5px;background:#edf5ff;color:#245888;font-size:12px;font-weight:600}.spu-subsidy-card.self{background:#fff4e8;border-color:#efd1af;color:#995511}
@media(max-width:700px){#spu-history{width:100vw;max-width:100vw}.image-history-controls{flex-wrap:wrap;gap:8px}.image-history-controls label:first-child{flex-basis:100%}.history-images{grid-template-columns:repeat(2,minmax(260px,1fr));overflow-x:auto}#spu-history header>div{display:block}#spu-history header p{font-size:12px;margin-top:4px}}

.history-change-note{margin:0 0 12px;padding:10px 14px;background:#fff8ec;border:1px solid #efdbb8;border-radius:6px;font-size:13px;overflow-wrap:anywhere}.history-change-note p{margin:5px 0}.history-change-note ul{margin:8px 0 0;padding-left:20px;max-height:160px;overflow:auto}.history-change-note li{margin:8px 0;line-height:1.7}.history-change-note del{color:#955044;text-decoration:none}.history-change-note ins{color:#196f45;text-decoration:none}.history-diff-hint{font-size:12px;color:#7b7468}

/* Fit both original images into the available screen height without cropping. */
#spu-history[open]{height:96dvh;max-height:96dvh;display:flex;flex-direction:column;overflow:hidden;box-sizing:border-box}
#spu-history header{flex:none;padding:8px 14px}
#spu-history .history-content{flex:1;min-height:0;display:flex;flex-direction:column;padding:8px 12px;overflow:hidden}
#spu-history .image-history-controls{flex:none;margin-bottom:6px;gap:12px}
#spu-history .image-history-controls select{padding:4px 8px;min-height:30px;font-size:12px}
#spu-history .history-change-note{flex:none;max-height:34dvh;overflow-y:auto;overscroll-behavior:contain;box-sizing:border-box;margin-bottom:6px;padding:6px 10px;font-size:12px}
#spu-history .history-change-note p{margin:2px 0}
#spu-history .history-change-note ul{margin:3px 0 0;padding-left:18px;max-height:none;overflow:visible}
#spu-history .history-change-note li{margin:2px 0;line-height:1.35}
#spu-history .history-images{flex:1;min-height:0;grid-template-columns:repeat(2,minmax(0,1fr));align-items:stretch;overflow:hidden;gap:10px}
#spu-history .history-image-day{min-height:0;display:flex;flex-direction:column}
#spu-history .history-image-day h3{flex:none;padding:6px;font-size:13px}
#spu-history .history-image-day img{flex:1;min-height:0;height:0;width:100%;object-fit:contain;background:white}
#spu-history .history-image-empty{padding:12px}

.history-diff-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:6px;margin-top:5px}.history-diff-card{background:#fff;border:1px solid #ead9bb;border-radius:5px;padding:5px 8px;min-width:0}.history-diff-card h4{margin:0 0 3px;color:#344b66;font-size:12px}.history-diff-pair{padding:3px 0;line-height:1.4}.history-diff-pair+.history-diff-pair{border-top:1px dashed #e2e6ec}.history-diff-pair>div{display:flex;gap:8px}.history-diff-pair span{flex:none;width:72px;color:#718198}.history-diff-pair del,.history-diff-pair ins{min-width:0;overflow-wrap:anywhere}

#spu-history .history-diff-card{padding:8px 12px}#spu-history .history-diff-card h4{margin:0 0 8px;font-size:13px}#spu-history .history-diff-pair{padding:0;line-height:1.5}#spu-history .history-diff-pair>div{display:grid;grid-template-columns:88px minmax(0,1fr);align-items:start;gap:10px;padding:5px 0}#spu-history .history-diff-pair span{width:auto;color:#263c59}#spu-history .history-diff-pair del,#spu-history .history-diff-pair ins{display:block;color:#263c59;text-decoration:none}#spu-history .history-diff-pair+.history-diff-pair{margin-top:5px;padding-top:5px}

#spu-history .history-diff-pair .history-upgrade-copy{justify-self:start;max-width:100%;box-sizing:border-box;padding:3px 8px;background:#eaf3ff;border:1px solid #bcd5f5;border-radius:4px;color:#244d7b;line-height:1.5}

.history-diff-copy{min-width:0;display:flex;flex-direction:column;align-items:flex-start;gap:3px}.history-base-copy{line-height:1.5;color:#263c59;overflow-wrap:anywhere}

#spu-history .history-keyword-change{color:#d51d2c;background:transparent;font-weight:700;padding:0}

.spu-info-card{display:inline-flex;align-items:center;gap:10px;padding:5px 10px;border:1px solid #cbd9ea;border-radius:5px;background:#f5f8fc;vertical-align:middle;white-space:nowrap}.spu-info-card .spu-subsidy-cards{margin:0;gap:6px}.spu-info-card .spu-subsidy-card{padding:0 9px 0 0;border:0;border-right:1px solid #d4dfec;border-radius:0;background:transparent;font-weight:600}.spu-info-card .spu-subsidy-card.self{background:transparent;border-color:#d4dfec}
