.compressor-page {
    --bench-bg: #edf2f8;
    --bench-paper: #fff;
    --bench-ink: #172840;
    --bench-muted: #52647d;
    --bench-line: #ced9e7;
    --bench-blue: #2563eb;
    --bench-accent: #194caf;
    --bench-tint: #eff5ff;
    --bench-grid: #dde5f0;
    --bench-success: #176247;
    --bench-issue: #903b20;
    color: var(--bench-ink);
    background: var(--bench-bg);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 15px;
}
.compressor-page.dark-mode {
    color-scheme: dark;
    --bench-bg: #111b2a;
    --bench-paper: #1a293d;
    --bench-ink: #eef4ff;
    --bench-muted: #b5c4da;
    --bench-line: #41536d;
    --bench-accent: #adcaff;
    --bench-tint: #223652;
    --bench-grid: #2c3e57;
    --bench-success: #9ce0be;
    --bench-issue: #ffc5a8;
}
.compressor-page [hidden] { display: none !important; }
.compressor-page main {
    box-sizing: border-box;
    width: min(1320px, calc(100% - 80px));
    margin: 0 auto 48px;
    padding: 146px 0 0;
    overflow: visible;
}
.workbench-heading { margin-bottom: 24px; }
.workbench-heading h1 { margin: 0 0 8px; font-size: clamp(1.65rem, 3.5vw, 2.25rem); line-height: 1.22; }
.workbench-heading p, .workbench p { margin: 0; color: var(--bench-muted); }
.workbench {
    display: grid;
    grid-template-columns: minmax(0, 1.9fr) minmax(280px, 1fr);
    background: var(--bench-paper);
    border: 1px solid var(--bench-line);
    border-radius: 14px;
}
.workspace, .settings { min-width: 0; padding: clamp(18px, 2.3vw, 30px); }
.workspace { position: relative; }
.workspace-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.compressor-page .workbench h2 { margin: 0; font-size: 18px; line-height: 1.35; }
.settings { border-left: 1px solid var(--bench-line); }
.settings label { display: block; margin: 17px 0 6px; font-weight: 650; }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone {
    display: flex;
    min-height: 330px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px dashed var(--bench-line);
    border-radius: 8px;
    background: var(--bench-tint);
    text-align: center;
    cursor: pointer;
}
.dropzone svg { width: 29px; height: 29px; margin-bottom: 7px; color: var(--bench-accent); }
.workspace.is-busy .dropzone, .workspace.is-busy .file-control { cursor: wait; }
.dropzone.is-dragging { border-color: var(--bench-accent); outline: 2px solid var(--bench-accent); }
.pick-image, .file-control { color: var(--bench-accent); font-weight: 700; cursor: pointer; }
.pick-image { background: var(--bench-paper); padding: 7px 17px; border: 1px solid var(--bench-line); border-radius: 6px; }
.file-control { padding: 6px 10px; border: 1px solid var(--bench-line); border-radius: 6px; white-space: nowrap; }
.file-hint { color: var(--bench-muted); font-size: 14px; }
.previews { display: grid; gap: 14px; }
.previews:has(#output-card:not([hidden])) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.previews figure { min-width: 0; margin: 0; }
.previews figcaption { display: flex; gap: 8px; align-items: baseline; font-weight: 700; }
#source-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 400; color: var(--bench-muted); }
.image-stage {
    display: grid;
    place-items: center;
    height: clamp(210px, 29vw, 365px);
    margin: 8px 0;
    padding: 12px;
    box-sizing: border-box;
    border: 1px solid var(--bench-line);
    border-radius: 8px;
    background: repeating-conic-gradient(var(--bench-grid) 0% 25%, var(--bench-paper) 0% 50%) 50% / 20px 20px;
}
.image-stage img { display: block; width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.previews p, .result p { font-variant-numeric: tabular-nums; font-size: 14px; overflow-wrap: anywhere; }
#source-error { margin-top: 10px; color: var(--bench-issue); }
.size-input { position: relative; }
.size-input span { position: absolute; right: 13px; top: 10px; color: var(--bench-muted); pointer-events: none; }
.settings input, .settings select, .settings button, #download {
    box-sizing: border-box;
    min-height: 42px;
    border: 1px solid var(--bench-line);
    border-radius: 6px;
    background-color: var(--bench-paper);
    color: var(--bench-ink);
    font: inherit;
}
.settings input, .settings select { width: 100%; padding: 8px 12px; }
.settings input { appearance: textfield; padding-right: 48px; font-variant-numeric: tabular-nums; }
.settings input::-webkit-inner-spin-button { appearance: none; }
.settings select {
    appearance: none;
    padding-right: 42px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%237087a5' stroke-width='1.6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 11px center;
}
.presets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.settings button { cursor: pointer; }
.presets button[aria-pressed="true"] { color: var(--bench-accent); background: var(--bench-tint); border-color: var(--bench-accent); font-weight: 700; }
.settings #compress { width: 100%; margin-top: 16px; border-color: var(--bench-blue); background: var(--bench-blue); color: #fff; font-weight: 700; }
.settings #compress:disabled { opacity: .62; cursor: default; }
.result { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--bench-line); }
.result p { margin: 6px 0 0; }
.result[data-state="success"] p { color: var(--bench-success); }
.result[data-state="warning"] p, .result[data-state="error"] p { color: var(--bench-issue); }
#download { display: inline-flex; align-items: center; justify-content: center; width: 100%; margin-top: 10px; color: var(--bench-accent); border-color: var(--bench-accent); font-weight: 700; }
.workbench :focus-visible, .file-input:focus-visible ~ .dropzone:not([hidden]), .workspace:has(.file-input:focus-visible) .file-control:not([hidden]) {
    outline: 2px solid var(--bench-accent);
    outline-offset: 3px;
}
.workbench-guide { max-width: 760px; margin-top: 40px; }
.workbench-guide h2 { font-size: 21px; margin: 24px 0 10px; }
.workbench-guide h3 { font-size: 16px; margin: 18px 0 4px; }
.workbench-guide p { margin: 0 0 10px; line-height: 1.75; }
.workbench-guide a { color: var(--bench-accent); text-decoration: underline; }
@media (max-width: 880px) {
    .compressor-page main { width: calc(100% - 40px); }
    .workbench { grid-template-columns: minmax(0, 1fr); }
    .settings { border-left: 0; border-top: 1px solid var(--bench-line); }
    .dropzone { min-height: 190px; }
}
@media (max-width: 768px) {
    .compressor-page #header-container, .compressor-page #header-container .navbar { position: relative; }
    .compressor-page #header-container .sub-navbar { margin-top: 0; }
    .compressor-page .mega-menu { box-sizing: border-box; }
    .compressor-page #header-container .search-box input { box-sizing: border-box; }
    .compressor-page main { padding-top: 22px; width: calc(100% - 28px); }
    .workbench-heading { margin-bottom: 16px; }
    .image-stage { height: 170px; }
}
@media (prefers-reduced-motion: reduce) {
    .compressor-page, .compressor-page * { transition: none !important; animation: none !important; }
}
