:root{font-family:system-ui,-apple-system,"Noto Sans TC","PingFang TC",sans-serif;color:#25243a;background:#f8f8fb;font-synthesis:none}*{box-sizing:border-box}body{margin:0}button,input,select{font:inherit}a{color:#5543bf}header{background:#fff;border-bottom:1px solid #e7e6ef}.head{max-width:980px;margin:auto;padding:15px 20px;display:flex;justify-content:space-between;align-items:center}.logo{font-weight:850;color:#25243a;text-decoration:none}.privacy{font-size:12px;color:#5c5780}main{max-width:980px;margin:auto;padding:36px 20px 72px}.eyebrow{font-size:12px;color:#5748b4;font-weight:750;letter-spacing:.09em}h1{font-size:clamp(30px,6vw,46px);letter-spacing:-.04em;margin:9px 0}.intro{max-width:750px;line-height:1.7;color:#686579;margin-bottom:24px}.panel{background:#fff;border:1px solid #e6e5ef;border-radius:20px;padding:24px;box-shadow:0 12px 32px #2b215708}.drop{display:block;border:2px dashed #c9c4e1;border-radius:16px;padding:24px;text-align:center;background:#faf9ff;cursor:pointer}.drop:hover,.drop:focus-within{border-color:#6555be;background:#f5f3ff}.drop strong{display:block;font-size:18px}.drop span{display:block;color:#77738a;font-size:13px;margin-top:5px}.drop input{position:absolute;inline-size:1px;block-size:1px;opacity:0}.file-info{margin-top:14px;padding:12px;border-radius:11px;background:#f5f4fa;color:#514d64;font-size:13px;line-height:1.75}.section{margin-top:20px;padding-top:18px;border-top:1px solid #eceaf2}.section h2{font-size:16px;margin:0 0 12px}.controls{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.field label,.field .field-label{display:block;font-weight:750;margin-bottom:7px}.field select,.field input[type=color],.field input[type=number]{width:100%;min-height:46px;border:1px solid #cbc8d7;border-radius:10px;background:#fff;padding:9px}.quality-row,.inline-fields{display:flex;gap:10px;align-items:center}.quality-row input{flex:1}.quality-row output{min-width:44px;font-variant-numeric:tabular-nums}.check{display:flex;gap:9px;align-items:flex-start;line-height:1.5}.check input{margin-top:.3em}.warning{padding:12px;border-radius:10px;background:#fff4dc;color:#745626;font-size:13px;line-height:1.65}.actions{display:flex;gap:10px;margin-top:20px;flex-wrap:wrap}button,.download{border:0;border-radius:11px;padding:13px 19px;background:#5443b9;color:#fff;font-weight:750;cursor:pointer;text-decoration:none;text-align:center}button:hover,.download:hover{background:#443397}button:disabled{cursor:not-allowed;background:#aaa6ba}.secondary{background:#eeebfb;color:#45368f}.danger{background:#a63d35}.secondary:hover{background:#dfdaf7}.status{display:none;margin-top:16px;padding:13px 14px;border-radius:11px;background:#f0eef9;color:#403785;line-height:1.6}.status.show{display:block}.status.error{background:#fff0ee;color:#a53830}.status.success{background:#eaf8ef;color:#22633a}.preview-grid{display:none;grid-template-columns:1fr 1fr;gap:14px;margin-top:20px}.preview-grid.show{display:grid}.preview-card{border:1px solid #e6e5ef;border-radius:14px;padding:14px;min-width:0}.preview-card h2{font-size:15px;margin:0 0 10px}.preview-frame{height:260px;border-radius:10px;background:linear-gradient(45deg,#eee 25%,transparent 25%) 0 0/18px 18px,linear-gradient(45deg,transparent 75%,#eee 75%) 0 0/18px 18px,linear-gradient(45deg,transparent 75%,#eee 75%) 9px -9px/18px 18px,linear-gradient(45deg,#eee 25%,#fff 25%) 9px -9px/18px 18px;display:grid;place-items:center;overflow:hidden}.preview-frame img{max-width:100%;max-height:100%;object-fit:contain}.meta{font-size:12px;color:#77738a;line-height:1.6;margin:9px 0 0}.note{margin-top:20px;border:1px solid #efd9a8;background:#fff9ed;border-radius:13px;padding:15px;color:#745626;font-size:13px;line-height:1.75}.hidden{display:none!important}footer{margin-top:28px;color:#8b8998;font-size:12px;line-height:1.8}@media(max-width:640px){main{padding:28px 16px 60px}.head{padding:14px 16px}.panel{padding:17px}.controls,.preview-grid{grid-template-columns:1fr}.preview-frame{height:220px}.actions>*{width:100%}.inline-fields{align-items:stretch;flex-direction:column}}

/* Purpose-led navigation and progressively disclosed options. */
.tool-nav{max-width:980px;margin:0 auto;padding:0 20px 10px;display:flex;gap:6px;overflow-x:auto;scrollbar-width:thin;white-space:nowrap}
.tool-nav a{flex:none;display:inline-flex;align-items:center;min-height:42px;padding:9px 14px;border-radius:9px;color:#5e5877;font-size:14px;font-weight:650;text-decoration:none}
.tool-nav a:hover{background:#f3f0fc;color:#443397}.tool-nav a[aria-current=page]{background:#eeebfb;color:#49349f;font-weight:800}
.secondary-nav{display:flex;gap:16px;flex-wrap:wrap;margin-top:18px}.secondary-nav a[aria-current=page]{font-weight:800;text-decoration-thickness:2px}.switch-note{margin:10px 0;font-size:12px;color:#77738a}
a:focus-visible,button:focus-visible,summary:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #8070ce;outline-offset:3px}
body[data-tool] main{max-width:880px}body[data-tool] .intro{max-width:670px}body[data-tool] .drop{padding:30px 20px;transition:background .15s,border-color .15s}body[data-tool] .drop strong{font-size:21px;color:#49349f}body[data-tool] .drop span{line-height:1.65}
.task-settings{margin-top:22px}.advanced-options,.result-options{margin-top:20px;border:1px solid #e6e2f0;border-radius:12px;background:#fcfbff;padding:0 16px}
.advanced-options>summary,.result-options>summary{min-height:48px;padding:13px 0;cursor:pointer;color:#514568;font-size:14px;font-weight:700;line-height:1.6}
.advanced-options[open],.result-options[open]{padding-bottom:16px}.advanced-options>.section:first-of-type,.result-options>.section:first-of-type{margin-top:0}
.condition-summary{margin:18px 0 0;padding:12px 14px;border-left:3px solid #c4b9ed;background:#f5f3fb;border-radius:0 9px 9px 0;font-size:14px;line-height:1.75;color:#504660;overflow-wrap:anywhere}
.transparent-confirm{padding:14px;background:#fff8e8;border:1px solid #e9cf98;border-radius:12px;margin-top:18px;line-height:1.65}.transparent-confirm .check{margin-top:10px}
.failure-actions{margin-top:14px;padding:14px;border:1px solid #edd2cd;border-radius:12px;background:#fffaf9;line-height:1.65}.failure-actions button{margin:6px 6px 0 0;font-size:14px}
.result-options .note,.advanced-options .note{margin-top:12px}.result-options .drop{padding:20px 16px}.result-options .drop strong{font-size:17px}
.panel>details:not(.advanced-options):not(.result-options){margin-top:16px}.panel summary{cursor:pointer;line-height:1.65}.panel p{overflow-wrap:anywhere}.panel .check input{flex:none;min-width:18px;min-height:18px}.panel .check span{min-width:0}
@media(max-width:640px){.tool-nav{padding:0 12px 8px;gap:2px}.tool-nav a{padding:8px 11px;font-size:13px;min-height:42px}body[data-tool] main{padding:24px 14px 50px}body[data-tool] h1{font-size:30px;line-height:1.25}body[data-tool] .intro{font-size:14px;line-height:1.65;margin-bottom:20px}body[data-tool] .panel{padding:17px 14px}body[data-tool] .drop{padding:26px 14px}body[data-tool] .drop span{font-size:12px}.advanced-options,.result-options{padding:0 12px}.advanced-options[open],.result-options[open]{padding-bottom:12px}.condition-summary{font-size:13px}.failure-actions button{width:100%;margin:7px 0 0}.secondary-nav{gap:12px}.quality-row input{min-width:0}.field,.controls>*{min-width:0}}

.locked-format{font-size:14px;color:#5d5278;margin:18px 0 0;line-height:1.65}

.batch-limits{font-size:12px;color:#686579;line-height:1.65;margin:12px 0}.batch-items{list-style:none;padding:0;margin:16px 0;display:grid;gap:12px}.batch-item{border:1px solid #e6e2f0;border-radius:12px;padding:14px;overflow-wrap:anywhere}.batch-item strong{display:block;font-size:14px}.batch-item p{font-size:13px;line-height:1.6;margin:8px 0}.batch-error{border-color:#e6b5af;background:#fff8f6}.batch-error p{color:#96372d}.batch-success{border-color:#badbc4}.batch-item-actions{display:flex;gap:8px;flex-wrap:wrap}.batch-item-actions>*{font-size:13px;padding:10px 14px;min-height:42px}#batch-zip-status{font-size:13px;line-height:1.65}#batch-preview{margin-top:18px}@media(max-width:640px){.batch-item-actions>*{flex:1;min-width:105px}.batch-items{gap:10px}.batch-item{padding:12px}}

.drop-help{color:#686579;font-size:12px;line-height:1.65}.drag-active{outline:3px solid #6555be;outline-offset:3px;background:#f0edff}.file-drop-overlay{position:fixed;inset:12px;z-index:1000;pointer-events:none;display:grid;place-items:center;border:4px dashed #6555be;border-radius:20px;background:#eeebfbdd;padding:24px}.file-drop-overlay>div{max-width:540px;background:#fff;border:1px solid #d2cbed;border-radius:16px;padding:24px;box-shadow:0 8px 36px #30205a26;text-align:center;line-height:1.65}.file-drop-overlay strong{font-size:clamp(22px,5vw,32px);color:#49349f}.file-drop-overlay p{margin:12px 0 0;color:#514d64}@media(max-width:640px){.file-drop-overlay{inset:7px;padding:12px}.file-drop-overlay>div{padding:18px}}

.source-preview-grid.show{grid-template-columns:minmax(0,1fr)}.source-preview-card{display:grid;grid-template-columns:180px minmax(0,1fr);gap:8px 18px;align-items:center}.source-preview-card h2{grid-column:1/-1}.source-preview-card .preview-frame{height:150px;grid-row:2/4}.source-preview-card .meta{overflow-wrap:anywhere}.batch-source-frame{width:180px;max-width:100%;min-height:110px;float:left;margin:0 16px 10px 0;border-radius:10px;background:repeating-conic-gradient(#eee 0% 25%,#fff 0% 50%) 0 0/16px 16px;display:flex;flex-direction:column;align-items:center;justify-content:center;overflow:hidden}.batch-source-thumb{display:block;width:100%;height:120px;object-fit:contain}.batch-source-frame .meta{background:#fff9;width:100%;text-align:center;padding:4px;margin:0;font-size:11px}.batch-item:after{content:"";display:block;clear:both}#output-card{margin-top:20px}@media(max-width:480px){.source-preview-card{display:block}.source-preview-card .preview-frame{height:180px}.batch-source-frame{width:100%;float:none;margin:0 0 10px}.batch-source-thumb{height:150px}}

/* Keep selected sources in the exact picker location; output previews stay separate. */
body[data-tool] .source-picker{padding:16px;cursor:default;text-align:left}
.source-picker-trigger{display:block;padding:12px;border-radius:10px;text-align:center;cursor:pointer;min-height:48px}
.source-picker-trigger:hover,.source-picker-trigger:focus-within{background:#eeebfb}
.source-picker.has-selection{border-style:solid;border-color:#b7abd9}
body[data-tool] .source-picker.has-selection .source-picker-trigger strong{font-size:16px}
.source-picker.has-selection .source-picker-trigger{display:table;margin:0 auto;padding:10px 16px;border:1px solid #c9bfdf;background:#fff}
.picker-status{margin:12px 0 0;font-size:14px;line-height:1.6;font-weight:700;color:#49349f;overflow-wrap:anywhere}
.picker-status.error{color:#a53830;background:#fff0ee;padding:10px;border-radius:9px}
.picker-status.loading:before{content:'…';display:inline-block;margin-right:6px}
.picker-limits{font-size:11px;line-height:1.6;color:#77738a;margin:12px 0 0;text-align:center}
.source-picker .source-preview-grid{margin-top:10px}
.source-picker .source-preview-card{grid-template-columns:120px minmax(0,1fr);gap:5px 12px;border:0;padding:0;display:grid}
.source-picker .source-preview-card h2{font-size:12px;margin:0;color:#686579}
.source-picker .source-preview-card .preview-frame{height:120px;grid-row:2/4}
.source-picker .source-preview-card .meta{font-size:12px;margin:0}
.source-picker #batch-section{margin-top:10px;padding-top:0;border-top:0}
.source-picker #batch-title{font-size:12px;margin:0;color:#686579}
.source-picker #batch-section>p.meta{font-size:11px;margin:6px 0}
.source-picker #batch-summary{font-size:12px;line-height:1.6;margin:6px 0}
.source-picker .batch-items{grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:8px;margin:8px 0 0;max-height:350px;overflow:auto;overscroll-behavior:contain;padding:2px}
.source-picker .batch-item{padding:8px;background:#fff;min-width:0;text-align:left}
body[data-tool] .source-picker .batch-item strong{font-size:13px;color:#423c55;overflow-wrap:anywhere}
.source-picker .batch-item p{font-size:11px;margin:5px 0;line-height:1.5}
.source-picker .batch-source-frame{float:none;width:100%;min-height:80px;margin:0 0 7px}
.source-picker .batch-source-thumb{height:96px}
.source-picker .batch-source-frame .meta{font-size:10px;margin:0;padding:2px}
.source-picker .batch-item-actions{gap:5px}
.source-picker .batch-item-actions>*{font-size:12px;padding:8px;min-width:0;min-height:44px}
.source-details{font-size:12px;color:#686579;margin-top:12px}.source-details summary{min-height:44px;padding:10px 0}
@media(max-width:480px){body[data-tool] .source-picker{padding:12px}.source-picker .source-preview-card{grid-template-columns:104px minmax(0,1fr)}.source-picker .source-preview-card .preview-frame{height:112px}.source-picker .source-preview-card .meta{font-size:11px}.source-picker .batch-items{grid-template-columns:repeat(2,minmax(0,1fr));max-height:320px}.source-picker .batch-source-thumb{height:88px}.source-picker .batch-item-actions>*{width:100%}.picker-status{font-size:13px}}
.source-picker .source-preview-card .preview-frame img{display:block;width:100%;height:120px;max-height:120px;min-height:0;object-fit:contain}
@media(max-width:480px){.source-picker .source-preview-card .preview-frame img{height:112px;max-height:112px}}

.local-diagnostics pre { white-space: pre-wrap; overflow-wrap: anywhere; font: 0.85rem/1.6 ui-monospace, monospace; margin: 12px 0; }

/* Keep complete result images inside the visible frame; never crop the preview. */
#output-card .preview-frame,#batch-preview .preview-frame{grid-template-rows:minmax(0,1fr);grid-template-columns:minmax(0,1fr)}
#output-preview,#batch-preview-image{display:block;width:100%;height:100%;min-width:0;min-height:0;object-fit:contain}

/* Helpful copy below the interactive tool; separate from controls and results. */
main > .section{margin-top:28px;padding:22px;border:1px solid #e6e5ef;border-radius:16px;background:#fff}
main > .section h2{margin-top:22px}main > .section h2:first-child{margin-top:0}
main > .section p,main > .section li{color:#686579;line-height:1.75}
@media(max-width:640px){main > .section{padding:18px 15px}main > .section ol{padding-left:22px}}
