.mobile-steps{display:none}
.replace-button{height:31px;padding:0 8px;border:1px solid #d9e1ec;border-radius:8px;background:#fff;color:#54667f;font-size:10px}
.replace-button:disabled,.icon-button:disabled{opacity:.42;cursor:not-allowed}
.tool-card:disabled{cursor:not-allowed;opacity:.78}
@media(min-width:1001px){
  html,body{height:100%;overflow:hidden}
  .topbar{height:64px}
  .page-shell{height:calc(100vh - 64px);padding:8px 24px 10px;overflow:hidden}
  .breadcrumb{height:28px}
  .workspace{height:calc(100% - 28px);min-height:0}
  .panel{height:100%;min-height:0}
  .panel-title{height:46px;margin-top:7px}
  .panel-body{padding:10px 12px 12px}
  .drop-zone,.result-preview{height:clamp(180px,calc(100vh - 475px),520px);min-height:0;flex:0 0 auto}
  .control-body{padding:3px 0 0}
  .tool-section{padding:10px 16px 8px}
  .tool-grid{margin-top:7px;max-height:154px;gap:5px}
  .setting-card{margin:10px 19px 0;padding:12px}
  .setting-head{padding-bottom:8px}
  .setting-card>p{margin:8px 0}
  .setting-facts span{padding:6px 8px}
  .run-area{padding:10px 19px}
  .run-button{height:44px}
  .run-area>p{margin-top:4px}
  .current-file,.result-file{margin-top:8px;padding:7px 9px}
  .thumb-strip{min-height:53px;margin-top:8px}
  .thumb,.add-thumb{height:49px}
  .queue-footer{margin-top:5px}
  .job-status{margin-top:8px;padding:7px 10px}
  .result-switcher{height:53px!important;margin-top:6px!important}
  .result-actions{margin-top:8px}
  .secondary-button,.primary-download,.batch-download{height:36px}
  .batch-download{margin-top:6px}
}
.control-body{padding-top:5px}.result-switcher{height:61px;margin-top:9px;display:grid;grid-template-columns:28px minmax(0,1fr) 28px;gap:6px;align-items:center}.result-switcher>button{width:28px;height:38px;border:1px solid #d9e1eb;border-radius:7px;background:#fff;color:#566780}.result-switcher>button:disabled{opacity:.35;cursor:not-allowed}.result-thumbs{display:flex;gap:7px;padding:3px;overflow-x:auto}.result-thumb{position:relative;width:42px;height:48px;flex:0 0 42px;padding:0;overflow:hidden;border:1px solid #d6deea;border-radius:6px;background:#eef2f6}.result-thumb img{width:100%;height:100%;object-fit:cover}.result-thumb.active{outline:2px solid #38aa84;outline-offset:1px}.result-thumb span{position:absolute;right:2px;bottom:2px;width:13px;height:13px;border-radius:50%;display:grid;place-items:center;background:#18a477;color:#fff;font-size:8px}.modal-modes{position:absolute;left:50%;top:14px;z-index:5;transform:translateX(-50%);border-color:rgba(255,255,255,.18);background:rgba(20,26,35,.8)}.modal-modes button{color:#bac5d4}.modal-modes button.active{background:#fff;color:#4d67dc}.modal-canvas{position:absolute;inset:57px 70px 102px;overflow:hidden}.modal-canvas>img{position:absolute;left:50%;top:50%;max-width:90%;max-height:90%;object-fit:contain;transform:translate(-50%,-50%) scale(1);transform-origin:center;user-select:none;-webkit-user-drag:none}.modal-compare{position:absolute;inset:0;overflow:hidden}.modal-compare>img,.modal-compare>div img{position:absolute;inset:5%;width:90%;height:90%;object-fit:contain}.modal-compare>div{position:absolute;inset:0;clip-path:inset(0 0 0 50%)}#modal-compare-line{position:absolute;top:3%;bottom:3%;left:50%;width:2px;background:#fff;box-shadow:0 0 0 1px rgba(0,0,0,.25);z-index:3}#modal-compare-line:after{content:"↔";position:absolute;left:50%;top:50%;width:34px;height:34px;border-radius:50%;display:grid;place-items:center;transform:translate(-50%,-50%);background:#fff;color:#526ee7;box-shadow:0 4px 14px rgba(0,0,0,.3)}#modal-compare-range{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:ew-resize;z-index:4}.modal-compare i{position:absolute;bottom:10px;z-index:3;padding:4px 7px;border-radius:5px;background:rgba(18,24,32,.72);color:#fff;font-size:10px;font-style:normal}.modal-original-label{left:10px}.modal-result-label{right:10px}.modal-nav{position:absolute;top:50%;z-index:5;width:42px;height:64px;border:1px solid rgba(255,255,255,.18);border-radius:10px;transform:translateY(-50%);background:rgba(20,26,35,.7);color:#fff;font-size:30px}.modal-prev{left:14px}.modal-next{right:14px}.modal-nav:disabled{opacity:.25;cursor:not-allowed}.modal-filmstrip{position:absolute;left:70px;right:70px;bottom:39px;height:56px;display:flex;justify-content:center;gap:8px;overflow-x:auto;z-index:5}.modal-thumb{width:44px;height:50px;flex:0 0 44px;padding:0;overflow:hidden;border:1px solid rgba(255,255,255,.28);border-radius:6px;background:#303744}.modal-thumb img{width:100%;height:100%;object-fit:cover}.modal-thumb.active{outline:2px solid #51d1a8;outline-offset:1px}
.avatar-button b{font-weight:500}.account-modal{position:fixed;inset:0;z-index:90;display:none;align-items:center;justify-content:center;background:rgba(18,24,33,.45);backdrop-filter:blur(5px)}.account-modal.open{display:flex}.account-card{position:relative;width:min(390px,calc(100vw - 28px));padding:25px;border:1px solid #dbe2ec;border-radius:15px;background:#fff;box-shadow:0 24px 60px rgba(35,46,65,.24)}.account-card>strong{display:block;font-size:19px}.account-card>p{margin:5px 0 18px;color:#7b889a;font-size:11px}.account-card label{display:block;margin-top:11px;color:#4e5c72;font-size:12px}.account-card input{width:100%;height:40px;margin-top:5px;padding:0 10px;border:1px solid #d7dfe9;border-radius:8px;outline:0}.account-card input:focus{border-color:#7d8ef0;box-shadow:0 0 0 3px rgba(91,111,229,.12)}.account-submit{width:100%;height:42px;margin-top:17px;border:0;border-radius:8px;background:linear-gradient(105deg,#665bfa,#a94feb);color:#fff;font-weight:700}.account-switch,.account-logout{width:100%;margin-top:10px;border:0;background:transparent;color:#5e70c7;font-size:11px}.account-logout{color:#c14d59}.account-close{position:absolute;right:13px;top:12px;width:31px;height:31px;border:0;border-radius:8px;background:#f0f3f7;color:#5c697d;font-size:18px}
.result-body{position:relative}
.compare-toolbar{position:absolute;left:24px;right:24px;top:22px;z-index:7;margin:0;pointer-events:none}
.compare-toolbar>*{pointer-events:auto}
.compare-toolbar>span{margin-right:auto;padding:5px 8px;border-radius:6px;background:rgba(18,24,32,.78);box-shadow:0 3px 10px rgba(0,0,0,.2);color:#e6edf7;font-size:0}
.compare-toolbar>span:after{content:"处理结果 · 点击放大";font-size:11px}
.compare-toolbar .segmented{border-color:rgba(255,255,255,.2);background:rgba(18,24,32,.78);box-shadow:0 3px 10px rgba(0,0,0,.2)}
.compare-toolbar .segmented button{color:#cbd5e2}
.compare-toolbar .segmented button.active{background:#fff;color:#4d67dc}
.result-preview>.preview-label{display:none}
.title-copy small,.header-action,.tool-ready,.result-state{font-size:12px}
.empty-upload small,.empty-result small{font-size:13px}
.file-copy strong{font-size:13px}.file-copy small{font-size:12px}
.queue-footer,.workflow-step,.tool-categories button,.tool-card{font-size:12px}
.tool-toolbar>strong{font-size:15px}.tool-search{font-size:12px}
.setting-head strong{font-size:16px}.setting-head span{font-size:12px}
.setting-card>p{font-size:13px}.setting-facts span{font-size:11px}.setting-facts b{font-size:12px}
.setting-options{margin:10px 0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
.setting-option{min-width:0;padding:7px 8px;display:flex;align-items:center;justify-content:space-between;gap:6px;border:1px solid #e1e5ed;border-radius:8px;background:#fff;color:#596980;font-size:12px}
.setting-option select,.setting-option input,.setting-option textarea{min-width:0;max-width:140px;height:30px;padding:0 7px;border:1px solid #d9dfeb;border-radius:6px;background:#f8f9fc;color:#415069;font-size:12px;outline:0}
.setting-option textarea{width:100%;max-width:220px;height:54px;padding:7px;resize:vertical;line-height:1.35}
.setting-option select:focus,.setting-option input:focus,.setting-option textarea:focus{border-color:#9a83ef;box-shadow:0 0 0 2px rgba(122,88,231,.12)}
.processing-mask-field{grid-column:1/-1;display:flex;align-items:center;gap:12px;padding:10px 11px;border:1px dashed #e9ad84;border-radius:9px;background:#fff8f2;color:#8e5a36}
.processing-mask-field.ready{border-style:solid;border-color:#93dac5;background:#effaf6;color:#247c62}
.processing-mask-field>span{min-width:0;flex:1}.processing-mask-field b,.processing-mask-field small{display:block}.processing-mask-field b{font-size:12px}.processing-mask-field small{margin-top:2px;color:#7f8997;font-size:11px}
.processing-mask-field button{height:32px;padding:0 11px;border:1px solid currentColor;border-radius:7px;background:#fff;color:inherit;font-weight:700;font-size:12px;white-space:nowrap}
.upscale-warning{
  grid-column:1/-1;
  margin:0;
  padding:9px 11px;
  border:1px solid #f1d5a8;
  border-radius:8px;
  background:linear-gradient(135deg,#fff9e9,#fff4e4);
  color:#9a601d;
  font-size:12px;
  line-height:1.55;
}
.upscale-warning.experimental{
  border-color:#efc3c8;
  background:linear-gradient(135deg,#fff5f6,#fff0f4);
  color:#b34755;
  font-weight:650;
}
.run-area>p,.progress-summary,.job-status{font-size:12px}
.compare-toolbar>span:after{font-size:12px}
.segmented button{height:27px;font-size:12px}
.modal-tools button{min-width:34px;padding:0 8px}.modal-tools button.active{background:#fff;color:#344bca}
.modal-tools span{font-size:12px}
.modal-stage.pan-active{cursor:grab}.modal-stage.pan-active.dragging{cursor:grabbing}
.modal-stage.pan-active #modal-compare-range{pointer-events:none}
@media(max-width:600px){
  .mobile-steps{margin-bottom:8px;padding:3px;display:grid;grid-template-columns:repeat(3,1fr);border:1px solid #dce3ed;border-radius:9px;background:#fff;position:sticky;top:5px;z-index:18}
  .mobile-steps button{height:34px;border:0;border-radius:7px;background:transparent;color:#718096;font-size:11px}
  .mobile-steps button.active{background:linear-gradient(105deg,#665bfa,#a94feb);color:#fff;font-weight:700}
  .workspace>.panel{display:none}
  .workspace>.panel.mobile-active{display:flex}
  .drop-zone,.result-preview{height:auto;min-height:350px;flex:1}
  .modal-canvas{inset:58px 45px 97px}.modal-prev{left:5px}.modal-next{right:5px}.modal-filmstrip{left:42px;right:42px}.modal-modes{top:54px}.modal-canvas{top:94px}
}

/* Full-screen result thumbnails stay lightweight while their worker preview is prepared. */
.modal-thumb-number{width:100%;height:100%;display:grid;place-items:center;background:linear-gradient(145deg,#394353,#242b36);color:#dce5f1;font-size:13px;font-weight:800}
.modal-thumb-number.hidden{display:none}

/* Soft glass workbench theme */
body{background:radial-gradient(circle at 13% 12%,rgba(255,181,161,.2),transparent 25%),radial-gradient(circle at 51% 8%,rgba(158,129,255,.17),transparent 27%),radial-gradient(circle at 88% 12%,rgba(91,216,175,.18),transparent 25%),#f3f7fc}
.topbar{border-bottom-color:rgba(207,218,232,.72);background:rgba(255,255,255,.84);box-shadow:0 8px 28px rgba(82,98,123,.06)}
.workspace{gap:16px}
.panel{border-color:rgba(213,221,233,.9);border-radius:23px;background:rgba(255,255,255,.9);box-shadow:0 18px 46px rgba(53,69,95,.12),inset 0 1px rgba(255,255,255,.95)}
.source-panel{background:linear-gradient(145deg,rgba(255,248,246,.97),rgba(255,255,255,.92) 42%,rgba(255,247,244,.9))}
.control-panel{background:linear-gradient(145deg,rgba(249,247,255,.98),rgba(255,255,255,.93) 45%,rgba(247,245,255,.9))}
.result-panel{background:linear-gradient(145deg,rgba(246,255,251,.98),rgba(255,255,255,.93) 45%,rgba(243,252,249,.92))}
.panel-title,.source-title,.control-title,.result-title{height:64px;margin:10px 12px 0;padding:0 8px;border-radius:13px;background:transparent;box-shadow:none;color:#14213b}
.step-number{width:46px;height:46px;flex:0 0 46px;border:1px solid rgba(255,255,255,.55);border-radius:14px;color:#fff;font-size:17px;box-shadow:inset 0 1px 1px rgba(255,255,255,.38)}
.source-title .step-number{background:linear-gradient(145deg,#ff806d,#f4553f);box-shadow:0 8px 17px rgba(239,91,68,.28),inset 0 1px 1px rgba(255,255,255,.42)}
.control-title .step-number{background:linear-gradient(145deg,#8c66f3,#643ad8);box-shadow:0 8px 17px rgba(104,62,217,.28),inset 0 1px 1px rgba(255,255,255,.42)}
.result-title .step-number{background:linear-gradient(145deg,#55d5b2,#22aa83);box-shadow:0 8px 17px rgba(34,171,132,.26),inset 0 1px 1px rgba(255,255,255,.42)}
.title-copy{display:block;line-height:1.2}
.title-copy strong{display:block;color:#14213b;font-size:20px;font-weight:800}
.title-copy small{display:block!important;margin-top:5px;color:#7b879b!important;font-size:12px}
.header-action,.tool-ready,.result-state{border-width:1px;border-style:solid;background:#fff;font-size:12px;font-weight:700;box-shadow:0 7px 16px rgba(71,85,109,.1)}
.source-title .header-action{border-color:#ffc9ba;background:#fff3ee;color:#e45d43}
.control-title .header-action,.control-title .tool-ready{border-color:#d9cdfc;background:#f4f0ff;color:#7049d7}
.result-title .result-state{border-color:#bdebdc;background:#edfbf6;color:#20906e}
.panel-body{background:transparent}
.drop-zone,.result-preview{border-color:#485260;box-shadow:0 10px 24px rgba(33,42,57,.13)}
.current-file,.result-file,.setting-card{border-color:rgba(215,223,234,.92);background:rgba(255,255,255,.84);box-shadow:0 7px 20px rgba(63,77,101,.06)}
.tool-section{border-bottom-color:#e6e3ef}
.tool-card{border-color:#e1e3ec;background:rgba(255,255,255,.78)}
.tool-card:hover:not(:disabled){border-color:#c8bafb;background:#faf8ff}
.tool-card.selected{border-color:#9a7af0;background:linear-gradient(105deg,#f1edff,#fbf8ff);color:#663fc8;box-shadow:0 5px 12px rgba(102,63,200,.1),inset 0 0 0 1px #d6cdf9}
.tool-categories button.active{border-color:#b4a4f5;background:#f1edff;color:#6846ce}
.setting-card{background:linear-gradient(145deg,rgba(255,255,255,.92),rgba(248,246,255,.88))}
.run-button{background:linear-gradient(105deg,#7658ed,#9a51e7 52%,#c85bc5);box-shadow:0 10px 20px rgba(118,75,218,.25)}
.primary-download{background:linear-gradient(105deg,#24b797,#49c779);box-shadow:0 8px 16px rgba(32,168,129,.2)}
.batch-download{border-color:#c5e8dd;background:#f1fbf7;color:#27866a}
.job-status{border:1px solid #ccecdf;background:#effaf6;color:#2d8265}
.compare-toolbar>span,.compare-toolbar .segmented{background:rgba(24,31,43,.85);backdrop-filter:blur(10px)}
.brand-mark{background:linear-gradient(145deg,#8b67ef,#6942da);box-shadow:0 7px 17px rgba(105,66,218,.25)}
@media(min-width:1001px){
  .panel-title{height:64px;margin-top:9px}
}
@media(max-width:600px){
  .panel{border-radius:17px}
  .panel-title{height:54px;margin:7px 8px 0}
  .step-number{width:39px;height:39px;flex-basis:39px;border-radius:11px;font-size:14px}
  .title-copy strong{font-size:17px}
  .title-copy small{display:none!important}
}

/* Layout A: compact source, large result canvas, right action rail */
@media(min-width:1001px){
  .workspace{grid-template-columns:minmax(240px,16%) minmax(430px,25%) minmax(0,59%)}
  .source-title .title-copy small,.source-title .header-action{display:none!important}
  .source-panel .panel-title{padding-left:6px}
  .source-panel .source-body{padding-left:10px;padding-right:10px}
  .source-panel .current-file{gap:5px}
  .source-panel .current-file .file-kind{display:none}
  .source-panel .icon-button{width:29px;flex-basis:29px}
  .source-panel .replace-button{padding:0 6px}
  .control-title .title-copy small{display:none!important}
  .tool-toolbar{grid-template-columns:1fr}
  .tool-search{justify-self:stretch;width:100%}
  .tool-grid{grid-template-columns:repeat(4,minmax(0,1fr));max-height:188px}
  .setting-facts{grid-template-columns:1fr}
  .setting-facts span{display:flex;align-items:center;justify-content:space-between}
  .result-body{padding:10px 12px 12px}
  .result-main-layout{height:100%;min-height:0;display:grid;grid-template-columns:minmax(0,1fr) 154px;gap:10px}
  .result-canvas-column{position:relative;min-width:0;min-height:0}
  .result-canvas-column .result-preview{width:100%;height:100%;min-height:0;flex:none}
  .result-canvas-column .single-preview img{max-width:98%;max-height:98%}
  .result-canvas-column .compare-preview>img,.result-canvas-column .compare-result-layer img{inset:1%;width:98%;height:98%}
  .result-canvas-column .compare-line{top:1%;bottom:1%}
  .result-action-rail{min-width:0;padding:10px;display:flex;flex-direction:column;gap:9px;border:1px solid #dbe6e2;border-radius:13px;background:rgba(248,252,250,.92);box-shadow:0 8px 20px rgba(46,81,68,.07)}
  .result-action-rail .job-status{margin:0;padding:9px 8px;display:block;text-align:center}
  .result-action-rail .job-status span,.result-action-rail .job-status strong{display:block}
  .result-action-rail .job-status strong{margin-top:2px}
  .result-action-rail .result-switcher{height:auto!important;margin:0!important;grid-template-columns:25px minmax(0,1fr) 25px;gap:4px}
  .result-action-rail .result-switcher>button{width:25px;height:42px}
  .result-action-rail .result-thumbs{padding:3px;gap:5px}
  .result-action-rail .result-thumb{width:38px;height:46px;flex-basis:38px}
  .result-action-rail .result-file{margin:0;padding:8px;display:grid;grid-template-columns:30px minmax(0,1fr);gap:7px}
  .result-action-rail .result-file .file-kind{width:30px;height:30px;grid-row:1/3}
  .result-action-rail .result-file .icon-button{display:none}
  .result-action-rail .result-actions{margin-top:auto;display:grid;grid-template-columns:1fr;gap:7px}
  .result-action-rail .secondary-button,.result-action-rail .primary-download,.result-action-rail .batch-download{width:100%;height:43px;flex:none}
  .result-action-rail .batch-download{margin:0}
  .retention-note{display:block;color:#7c8b84;font-size:11px;text-align:center}
  .result-canvas-column .compare-toolbar{left:12px;right:12px;top:12px}
}
@media(min-width:1001px) and (max-width:1320px){
  .workspace{grid-template-columns:minmax(215px,17%) minmax(390px,27%) minmax(0,56%)}
  .result-main-layout{grid-template-columns:minmax(0,1fr) 138px}
  .tool-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(max-width:1000px){
  .result-main-layout{display:flex;flex-direction:column;min-height:0;flex:1}
  .result-canvas-column{position:relative;display:flex;min-height:0;flex:1}
  .result-canvas-column .result-preview{flex:1}
  .result-action-rail{display:flex;flex-direction:column}
  .retention-note{display:block;margin-top:7px;color:#7c8b84;font-size:12px;text-align:center}
}

/* Processing feedback: keep the primary action vivid while a task is running. */
.run-button.is-processing:disabled{
  opacity:1;
  cursor:progress;
  color:#fff;
  background:linear-gradient(105deg,#ff4d79,#ff9a3d,#8b5cf6,#3b82f6,#20c997,#ff4d79);
  background-size:320% 100%;
  box-shadow:0 10px 24px rgba(111,76,224,.3);
  animation:run-color-flow 2s linear infinite,run-soft-pulse 1.15s ease-in-out infinite;
}
@keyframes run-color-flow{to{background-position:100% 0}}
@keyframes run-soft-pulse{50%{filter:saturate(1.18) brightness(1.08);transform:translateY(-1px)}}

/* The settings panel changes palette with the selected tool. */
.setting-card{
  position:relative;
  overflow:hidden;
  isolation:isolate;
  transition:background .22s ease,border-color .22s ease,box-shadow .22s ease;
}
.setting-card:before{
  content:"";
  position:absolute;
  left:0;
  top:0;
  bottom:0;
  width:5px;
  background:var(--setting-accent,#7658ed);
  z-index:2;
  pointer-events:none;
}
.setting-card .setting-option,.setting-card .setting-facts span{
  border-color:var(--setting-line,#ded8f6);
  background:rgba(255,255,255,.8);
}
.setting-card .setting-head span{
  background:var(--setting-pill,#eee9ff);
  color:var(--setting-ink,#6943cb);
}
.setting-card.setting-theme-watermark{
  --setting-accent:linear-gradient(#7558ef,#4b7df5);
  --setting-line:#d7d9fb;
  --setting-pill:#ebeaff;
  --setting-ink:#6048ca;
  border-color:#d4d5fa;
  background:linear-gradient(135deg,rgba(239,237,255,.95),rgba(245,249,255,.9));
  box-shadow:0 9px 24px rgba(93,75,200,.1);
}
.setting-card.setting-theme-handwritten_erase{
  --setting-accent:linear-gradient(#ff6b6b,#ff9f68);
  --setting-line:#f5d8d3;
  --setting-pill:#fff0eb;
  --setting-ink:#c75d49;
  border-color:#f2d3cd;
  background:linear-gradient(135deg,rgba(255,240,236,.96),rgba(255,249,242,.9));
  box-shadow:0 9px 24px rgba(211,96,76,.09);
}
.setting-card.setting-theme-crop_enhance{
  --setting-accent:linear-gradient(#3587ff,#20b7d7);
  --setting-line:#cfe6f3;
  --setting-pill:#e9f7fc;
  --setting-ink:#247eaa;
  border-color:#cbe4f1;
  background:linear-gradient(135deg,rgba(235,246,255,.96),rgba(239,252,252,.9));
  box-shadow:0 9px 24px rgba(40,136,182,.09);
}
.setting-card.setting-theme-photo_scan{
  --setting-accent:linear-gradient(#19b88c,#82c843);
  --setting-line:#cce9da;
  --setting-pill:#e9f8ef;
  --setting-ink:#228560;
  border-color:#c7e7d5;
  background:linear-gradient(135deg,rgba(235,251,244,.97),rgba(248,252,235,.9));
  box-shadow:0 9px 24px rgba(32,144,101,.09);
}
.setting-card.setting-theme-id_card_scan{
  --setting-accent:linear-gradient(#f59e0b,#f06c47);
  --setting-line:#f0ddc6;
  --setting-pill:#fff4df;
  --setting-ink:#b86c19;
  border-color:#efdbc1;
  background:linear-gradient(135deg,rgba(255,248,231,.97),rgba(255,242,235,.91));
  box-shadow:0 9px 24px rgba(190,113,32,.09);
}
.setting-card.setting-theme-cutout{
  --setting-accent:linear-gradient(#00a9b7,#35c979);
  --setting-line:#c8e8df;
  --setting-pill:#e7f9f4;
  --setting-ink:#17806f;
  border-color:#c5e7de;
  background:linear-gradient(135deg,rgba(232,250,249,.97),rgba(241,253,244,.91));
  box-shadow:0 9px 24px rgba(25,143,123,.09);
}

@media(prefers-reduced-motion:reduce){
  .run-button.is-processing:disabled{animation:none}
}

/* Compact tool toolbar: title, All filter and search share one row. */
.tool-toolbar{
  display:flex;
  align-items:center;
  gap:8px;
}
.tool-toolbar>strong{
  margin-right:auto;
  white-space:nowrap;
}
.tool-categories{
  grid-column:auto;
  flex:0 0 auto;
  overflow:visible;
}
.tool-search{
  width:min(190px,46%)!important;
  flex:0 1 190px;
  justify-self:auto;
}
.tool-card{
  color:#172033;
  font-family:"Microsoft YaHei","PingFang SC","SimHei",sans-serif;
  font-weight:700;
}
.tool-card.coming{
  color:#30394a;
  font-weight:700;
}
@media(min-width:1001px){
  .tool-grid{max-height:260px}
}
@media(max-width:600px){
  .tool-toolbar{display:grid;grid-template-columns:auto minmax(0,1fr)}
  .tool-toolbar>strong{grid-column:1/-1}
  .tool-search{width:100%!important;max-width:none}
}

.result-version-picker{
  display:grid;
  gap:5px;
  padding:8px;
  border:1px solid #ddd8f0;
  border-radius:9px;
  background:linear-gradient(135deg,#faf8ff,#f5f9ff);
  color:#68758a;
  font-size:11px;
}
.result-version-picker span{font-weight:700;color:#4d5a70}
.result-version-picker select{
  min-width:0;
  width:100%;
  height:30px;
  padding:0 6px;
  border:1px solid #d8ddeb;
  border-radius:7px;
  background:#fff;
  color:#28364d;
  font-size:11px;
  outline:0;
}
.result-version-picker select:focus{border-color:#8c76e9;box-shadow:0 0 0 2px rgba(116,88,220,.12)}

/* Immersive result preview: all controls float above a viewport-sized canvas. */
.modal{
  background:rgba(9,13,20,.94);
  backdrop-filter:blur(12px);
}
.modal-stage{
  width:100vw;
  height:100vh;
  height:100dvh;
  border:0;
  border-radius:0;
  box-shadow:none;
}
.modal-canvas{
  inset:0;
}
.modal-canvas>img{
  max-width:100%;
  max-height:100%;
}
.modal-compare>img,.modal-compare>div img{
  inset:0;
  width:100%;
  height:100%;
}
.modal-close,.modal-tools,.modal-modes,.modal-nav,.modal-filmstrip,.modal-stage>p{
  box-shadow:0 7px 24px rgba(0,0,0,.34);
}
.modal-filmstrip{
  left:84px;
  right:84px;
  bottom:42px;
}
.modal-stage>p{
  bottom:10px;
}
@media(max-width:600px){
  .modal-stage{width:100vw;height:100vh;height:100dvh}
  .modal-canvas{inset:0}
  .modal-filmstrip{left:42px;right:42px}
}

/* Non-destructive cutout edge editor. It edits the existing alpha mask locally. */
.mask-editor{
  position:absolute;
  left:14px;
  bottom:14px;
  z-index:9;
  width:min(430px,calc(100% - 28px));
  padding:10px;
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px 10px;
  border:1px solid rgba(255,255,255,.2);
  border-radius:13px;
  background:rgba(17,24,34,.9);
  box-shadow:0 12px 34px rgba(0,0,0,.38);
  color:#f4f8fb;
  text-align:left;
  backdrop-filter:blur(16px);
}
.mask-editor-head{grid-column:1/-1;display:flex;align-items:center;gap:8px}
.mask-editor-head strong{font-size:13px}
.mask-editor-head span{padding:3px 7px;border-radius:999px;background:rgba(65,211,164,.13);color:#78e4c0;font-size:10px}
.mask-editor-head button{margin-left:auto;height:25px;padding:0 9px;border:1px solid rgba(255,255,255,.18);border-radius:7px;background:rgba(255,255,255,.08);color:#fff;font-size:11px}
.mask-editor-head button:disabled{opacity:.4;cursor:not-allowed}
.mask-editor label{min-width:0;display:grid;grid-template-columns:1fr auto;gap:4px 8px;align-items:center;font-size:11px;color:#dce5ef}
.mask-editor label span{display:contents}
.mask-editor output{color:#72e2bd;font-size:10px;font-weight:750;text-align:right}
.mask-editor input[type=range]{grid-column:1/-1;width:100%;height:16px;margin:0;accent-color:#42cfa2;cursor:ew-resize}
.mask-editor small{grid-column:1/-1;display:block;color:#8e9dad;font-size:9px;text-align:center}
.mask-editor.processing{border-color:rgba(88,225,181,.55)}
.mask-editor.processing .mask-editor-head span{animation:mask-status-pulse .9s ease-in-out infinite}
@keyframes mask-status-pulse{50%{opacity:.5}}
.modal-mask-editor{left:auto;right:20px;top:62px;bottom:auto;width:min(390px,calc(100% - 40px));z-index:12}
@media(max-width:1000px){
  .mask-editor{width:min(390px,calc(100% - 24px));left:12px;bottom:12px}
  .modal-mask-editor{left:auto;right:12px;top:100px;bottom:auto}
}
@media(max-width:600px){
  .mask-editor{left:8px;right:8px;bottom:8px;width:auto;padding:8px;gap:6px 8px}
  .modal-mask-editor{left:8px;right:8px;top:auto;bottom:106px;width:auto}
  .mask-editor-head strong{font-size:12px}
  .mask-editor label{font-size:10px}
}

/* 图片处理 original ID-photo controls and its 200-piece style library. */
.setting-card.setting-theme-id_photo{
  --setting-accent:linear-gradient(#6d4cf1,#b44cd1);
  --setting-line:#dcd4f6;
  --setting-pill:#eee9ff;
  --setting-ink:#6943cb;
  border-color:#d8d0f2;
  background:linear-gradient(145deg,rgba(247,244,255,.97),rgba(255,251,255,.92));
  box-shadow:0 9px 25px rgba(103,75,184,.11);
  min-height:0;
  flex:1;
  display:flex;
  flex-direction:column;
}
.setting-card.setting-theme-id_photo>.setting-head{flex:0 0 auto}
.setting-card.setting-theme-id_photo>p{display:none}
.id-photo-settings{
  min-height:0;
  max-height:none;
  flex:1;
  padding:2px 3px 3px 2px;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
  overflow:auto;
  scrollbar-width:thin;
}
.id-photo-group{
  min-width:0;
  padding:9px;
  border:1px solid #e0d9f4;
  border-radius:10px;
  background:rgba(255,255,255,.8);
  box-shadow:0 4px 12px rgba(78,59,126,.045);
}
.id-photo-group-wide{grid-column:1/-1}
.id-photo-group-title{display:block;margin-bottom:7px;color:#2f3450;font-size:12px;font-weight:800}
.id-photo-group-body{min-width:0;display:grid;gap:7px}
.id-photo-control-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
.id-photo-group-wide .id-photo-control-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
.id-photo-compact-field,.id-photo-color-field{
  min-width:0;
  height:34px;
  padding:0 7px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:5px;
  border:1px solid #e3e0ed;
  border-radius:7px;
  background:#fbfaff;
  color:#6b7184;
  font-size:11px;
}
.id-photo-compact-field select,.id-photo-compact-field input{
  min-width:0;
  width:58%;
  height:26px;
  padding:0 5px;
  border:1px solid #ded9eb;
  border-radius:6px;
  background:#fff;
  color:#3d465e;
  font-size:11px;
  outline:0;
}
.id-photo-compact-field select:focus,.id-photo-compact-field input:focus{border-color:#9b83ea;box-shadow:0 0 0 2px rgba(117,86,218,.1)}
.id-photo-range-field{min-width:0;display:grid;grid-template-columns:1fr auto;gap:2px 7px;align-items:center;color:#636b80;font-size:11px}
.id-photo-range-field output{color:#724fd1;font-weight:800;font-size:11px}
.id-photo-range-field input{grid-column:1/-1;width:100%;height:14px;margin:0;accent-color:#7956dc}
.id-photo-color-field input{width:25px;height:25px;padding:2px;border:1px solid #ded9eb;border-radius:6px;background:#fff}
.id-photo-color-field output{margin-left:auto;color:#5f6678;font-size:9px;font-weight:700}
.id-photo-template-choice{min-width:0;display:grid;grid-template-columns:40px minmax(0,1fr) auto;gap:7px;align-items:center}
.id-photo-template-choice img{width:40px;height:48px;border:1px solid #e0dbea;border-radius:7px;background:#f5f3f9;object-fit:cover}
.id-photo-template-choice img.is-loading{background:linear-gradient(110deg,#eeeaf7 30%,#faf8ff 45%,#eeeaf7 60%);background-size:240% 100%;animation:id-photo-loading 1.2s linear infinite}
@keyframes id-photo-loading{to{background-position:-160% 0}}
.id-photo-template-choice span{min-width:0}
.id-photo-template-choice b,.id-photo-template-choice small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.id-photo-template-choice b{color:#343b52;font-size:11px}.id-photo-template-choice small{margin-top:2px;color:#858ca0;font-size:9px}
.id-photo-template-choice button{height:30px;padding:0 8px;border:1px solid #cfc2f4;border-radius:7px;background:#f3efff;color:#6843ce;font-size:10px;font-weight:750;white-space:nowrap}
.id-photo-template-choice button:hover{border-color:#9f86ec;background:#eae3ff}
.id-photo-template-pair{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.id-photo-style-note{margin:0;padding:10px 12px;border:1px solid #ded7f5;border-radius:9px;background:linear-gradient(120deg,#f7f3ff,#fff);color:#615b73;font-size:11px;line-height:1.65}
.id-photo-template-card.image-missing img{background:linear-gradient(135deg,#f4f1fb,#ebe7f6)}
.id-photo-consistency-note{display:block;margin-top:-2px;color:#8a809e;font-size:9px;line-height:1.35}
.idphoto-upload-download{display:block;margin-top:8px;text-align:center;background:linear-gradient(105deg,#13a86b,#38c78a)!important}

.id-photo-picker{position:fixed;inset:0;z-index:96;display:none;place-items:center}
.id-photo-picker.open{display:grid}
.id-photo-picker-backdrop{position:absolute;inset:0;background:rgba(18,22,31,.76);backdrop-filter:blur(9px)}
.id-photo-picker-panel{position:relative;width:min(1320px,94vw);height:min(880px,90vh);display:flex;flex-direction:column;overflow:hidden;border:1px solid rgba(255,255,255,.8);border-radius:20px;background:#f8f9fc;box-shadow:0 30px 90px rgba(0,0,0,.42)}
.id-photo-picker-panel>header{height:70px;flex:0 0 auto;padding:0 20px;display:flex;align-items:center;border-bottom:1px solid #e1e5ed;background:linear-gradient(110deg,#fff,#f6f2ff)}
.id-photo-picker-panel>header span{min-width:0}.id-photo-picker-panel>header strong,.id-photo-picker-panel>header small{display:block}
.id-photo-picker-panel>header strong{color:#232b42;font-size:20px}.id-photo-picker-panel>header small{margin-top:3px;color:#7c879a;font-size:11px}
.id-photo-picker-panel>header button{margin-left:auto;width:36px;height:36px;border:1px solid #dfe3eb;border-radius:10px;background:#fff;color:#5f6b7e;font-size:21px}
.id-photo-picker-toolbar{padding:12px 18px;display:flex;align-items:center;gap:12px;border-bottom:1px solid #e4e7ed;background:#fff}
.id-photo-picker-categories{min-width:0;display:flex;gap:7px;overflow-x:auto}
.id-photo-picker-categories button{height:32px;padding:0 11px;border:1px solid #dfe3ea;border-radius:8px;background:#fff;color:#606d80;font-size:11px;white-space:nowrap}
.id-photo-picker-categories button.active{border-color:#9c85ea;background:#eee9ff;color:#6947cd;font-weight:800}
.id-photo-picker-search{margin-left:auto;width:min(240px,28vw);height:34px;flex:0 0 auto;padding:0 9px;display:flex;align-items:center;gap:5px;border:1px solid #dce1e9;border-radius:8px;background:#f8f9fb;color:#8290a2}
.id-photo-picker-search input{min-width:0;width:100%;border:0;outline:0;background:transparent;color:#37445a;font-size:12px}
.id-photo-picker-grid{min-height:0;flex:1;padding:16px 18px;display:grid;grid-template-columns:repeat(auto-fill,minmax(118px,1fr));align-content:start;gap:12px;overflow:auto}
.id-photo-template-card{min-width:0;height:220px;padding:6px 6px 8px;position:relative;overflow:hidden;border:1px solid #dfe3ea;border-radius:11px;background:#fff;color:#374258;text-align:left;box-shadow:0 5px 13px rgba(45,58,78,.05)}
.id-photo-template-card:hover{border-color:#b8a9ed;transform:translateY(-1px);box-shadow:0 9px 20px rgba(74,54,137,.11)}
.id-photo-template-card.selected{border-color:#7555d9;box-shadow:0 0 0 2px #d9cff9,0 9px 20px rgba(74,54,137,.13)}
.id-photo-template-card.selected:after{content:"✓";position:absolute;right:10px;top:10px;width:23px;height:23px;display:grid;place-items:center;border-radius:50%;background:#7150d3;color:#fff;font-weight:900}
.id-photo-template-card img{width:100%;height:168px;display:block;border-radius:7px;background:#f0f1f4;object-fit:contain}
.id-photo-template-card strong,.id-photo-template-card small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.id-photo-template-card strong{margin-top:7px;font-size:11px}.id-photo-template-card small{margin-top:2px;color:#8a94a4;font-size:9px}
.id-photo-picker-empty{grid-column:1/-1;margin:80px 0;text-align:center;color:#7f8b9d}
.id-photo-picker-panel>footer{height:46px;flex:0 0 auto;padding:0 19px;display:flex;align-items:center;justify-content:space-between;border-top:1px solid #e2e6ed;background:#fff;color:#657287;font-size:11px}
.id-photo-picker-panel>footer small{color:#8a95a6}
@media(max-width:900px){
  .id-photo-settings{max-height:none;grid-template-columns:1fr}
  .id-photo-group,.id-photo-group-wide{grid-column:1}
  .id-photo-group-wide .id-photo-control-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .id-photo-picker-panel{width:96vw;height:92vh}
  .id-photo-picker-toolbar{align-items:stretch;flex-direction:column}
  .id-photo-picker-search{margin-left:0;width:100%}
}
@media(min-width:1001px){.tool-grid{max-height:190px}}
@media(max-width:520px){
  .id-photo-control-grid,.id-photo-group-wide .id-photo-control-grid{grid-template-columns:1fr}
  .id-photo-template-pair{grid-template-columns:1fr}
  .id-photo-picker-grid{padding:11px;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
  .id-photo-picker-panel>footer small{display:none}
}

/* Progressive settings layout: tool library -> compact selection -> grouped settings. */
.tool-section.collapsed{padding:8px 16px;border-bottom-color:#e5e0f3}
.tool-section.collapsed .tool-toolbar,.tool-section.collapsed .tool-grid,.tool-section.collapsed .tool-empty{display:none!important}
.selected-tool-bar{min-height:48px;display:flex;align-items:center;gap:10px;padding:7px 8px 7px 10px;border:1px solid #d9cff7;border-radius:11px;background:linear-gradient(105deg,rgba(242,238,255,.96),rgba(252,248,255,.94));box-shadow:0 5px 15px rgba(91,65,169,.07)}
.selected-tool-state{flex:0 0 auto;padding:4px 7px;border-radius:6px;background:#7451df;color:#fff;font-size:10px;font-weight:800}
.selected-tool-copy{min-width:0;flex:1}
.selected-tool-copy strong,.selected-tool-copy small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.selected-tool-copy strong{color:#252d44;font-size:14px}
.selected-tool-copy small{margin-top:2px;color:#777e91;font-size:10px}
.selected-tool-bar>button{height:31px;flex:0 0 auto;padding:0 10px;border:1px solid #cfc3f4;border-radius:8px;background:#fff;color:#6945cc;font-size:11px;font-weight:750}
.selected-tool-bar>button:hover{border-color:#a38bed;background:#f7f4ff}

.setting-card-slot{min-height:0;flex:1;display:flex}
.setting-card-slot>.setting-card{width:calc(100% - 38px);min-height:0;flex:1;display:flex;flex-direction:column}
.setting-card-slot .setting-options{min-height:0;overflow:auto;scrollbar-width:thin}
.setting-head{gap:10px}
.setting-head>strong{flex:0 0 auto;white-space:nowrap}
.setting-head-actions{margin-left:auto;display:flex;align-items:center;gap:7px}
.setting-head-actions>span{min-width:0;max-width:170px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.setting-head-actions>button{height:27px;padding:0 8px;border:1px solid #cec3f1;border-radius:7px;background:#fff;color:#6945cc;font-size:10px;font-weight:750;white-space:nowrap}
.setting-head-actions>button:hover{border-color:#9d84e9;background:#f6f2ff}

.setting-group-tabs{grid-column:1/-1;display:flex;gap:6px;padding:2px 1px 5px;overflow-x:auto;scrollbar-width:none}
.setting-group-tabs::-webkit-scrollbar{display:none}
.setting-group-tabs button{height:30px;flex:1 0 auto;padding:0 10px;border:1px solid #dddfea;border-radius:8px;background:rgba(255,255,255,.72);color:#6e778b;font-size:11px;white-space:nowrap}
.setting-group-tabs button.active{border-color:#9075e8;background:linear-gradient(105deg,#7454e7,#9b55df);box-shadow:0 5px 12px rgba(110,76,207,.18);color:#fff;font-weight:800}
.setting-group-panel:not(.active){display:none}
.id-photo-settings>.setting-group-panel.active,.setting-options>.generic-setting-group.active{grid-column:1/-1}
.generic-setting-group{min-width:0;padding:10px;border:1px solid #ddd9ed;border-radius:10px;background:rgba(255,255,255,.72)}
.generic-setting-group-title{display:block;margin-bottom:8px;color:#333a50;font-size:12px}
.generic-setting-group-body{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
.generic-setting-group-body .setting-option{min-width:0}

.settings-modal{position:fixed;inset:0;z-index:94;display:none;place-items:center}
.settings-modal.open{display:grid}
.settings-modal-backdrop{position:absolute;inset:0;background:rgba(15,20,30,.74);backdrop-filter:blur(10px)}
.settings-modal-panel{position:relative;width:min(1120px,94vw);height:min(860px,92vh);display:flex;flex-direction:column;overflow:hidden;border:1px solid rgba(255,255,255,.72);border-radius:20px;background:#f8f8fc;box-shadow:0 30px 90px rgba(0,0,0,.42)}
.settings-modal-panel>header{height:68px;flex:0 0 auto;padding:0 20px;display:flex;align-items:center;border-bottom:1px solid #e0e3eb;background:linear-gradient(110deg,#fff,#f3efff)}
.settings-modal-panel>header span{min-width:0}.settings-modal-panel>header strong,.settings-modal-panel>header small{display:block}
.settings-modal-panel>header strong{color:#20283e;font-size:19px}.settings-modal-panel>header small{margin-top:3px;color:#808b9d;font-size:11px}
.settings-modal-panel>header button{margin-left:auto;width:36px;height:36px;border:1px solid #dce1e9;border-radius:10px;background:#fff;color:#59677b;font-size:21px}
.settings-modal-body{min-height:0;flex:1;padding:16px;display:flex;overflow:hidden}
.settings-modal-body>.setting-card{width:100%;height:100%;margin:0;padding:16px;display:flex;flex-direction:column}
.settings-modal-body>.setting-card>p{display:block;margin:10px 0;color:#69768a}
.settings-modal-body>.setting-card>.setting-options{min-height:0;max-height:none;flex:1;align-content:start;overflow:auto}
.setting-card.expanded .setting-group-tabs{display:none}
.setting-card.expanded .setting-head-actions>button{display:none}
.setting-card.expanded .setting-group-panel{display:block}
.setting-card.expanded .id-photo-settings{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.setting-card.expanded .generic-setting-group{grid-column:auto}
.setting-card.expanded .generic-setting-group-body{grid-template-columns:repeat(2,minmax(0,1fr))}
.settings-modal-panel>footer{min-height:70px;flex:0 0 auto;padding:12px 18px;display:grid;grid-template-columns:150px minmax(0,1fr);gap:10px;border-top:1px solid #dfe3ea;background:#fff}
.settings-modal-done,.settings-modal-run{height:45px;border-radius:9px;font-size:13px;font-weight:800}
.settings-modal-done{border:1px solid #d8dfe9;background:#fff;color:#53637a}
.settings-modal-run{border:0;background:linear-gradient(105deg,#7658ed,#9a51e7 52%,#c85bc5);box-shadow:0 9px 18px rgba(118,75,218,.23);color:#fff}
.settings-modal-run:disabled{background:#aeb7c6;box-shadow:none;cursor:not-allowed}
.settings-modal-run.is-processing:disabled{opacity:1;cursor:progress;background:linear-gradient(105deg,#ff4d79,#ff9a3d,#8b5cf6,#3b82f6,#20c997,#ff4d79);background-size:320% 100%;box-shadow:0 10px 24px rgba(111,76,224,.3);animation:run-color-flow 2s linear infinite,run-soft-pulse 1.15s ease-in-out infinite}

@media(max-width:700px){
  .tool-section.collapsed{padding:8px 10px}
  .selected-tool-state{display:none}
  .selected-tool-copy small{max-width:45vw}
  .setting-card-slot>.setting-card{width:calc(100% - 20px)}
  .setting-head{align-items:flex-start;flex-direction:column}
  .setting-head-actions{width:100%;margin-left:0;justify-content:space-between}
  .generic-setting-group-body{grid-template-columns:1fr}
  .settings-modal-panel{width:100vw;height:100vh;height:100dvh;border:0;border-radius:0}
  .settings-modal-body{padding:8px}
  .settings-modal-body>.setting-card{padding:12px}
  .setting-card.expanded .id-photo-settings{grid-template-columns:1fr}
  .setting-card.expanded .id-photo-group,.setting-card.expanded .id-photo-group-wide{grid-column:1}
  .settings-modal-panel>footer{grid-template-columns:110px minmax(0,1fr);padding:9px}
}

/* Tool-picking mode owns the full control panel until a tool is selected. */
.control-panel.tool-browsing .control-body{padding-top:5px}
.control-panel.tool-browsing .tool-section{min-height:0;flex:1;padding:14px 16px 16px;display:flex;flex-direction:column;border-bottom:0;background:linear-gradient(155deg,rgba(252,250,255,.82),rgba(247,248,255,.56))}
.control-panel.tool-browsing .tool-toolbar{flex:0 0 auto}
.control-panel.tool-browsing .tool-grid{min-height:0;max-height:none!important;flex:1;margin-top:14px;padding:3px 7px 4px 3px;grid-auto-rows:minmax(40px,52px);align-content:start;gap:8px}
.control-panel.tool-browsing .tool-card{height:auto;min-height:40px;font-size:13px}
.control-panel.tool-browsing .setting-card-slot,.control-panel.tool-browsing .run-area{display:none}

/* ID-photo settings have enough room for readable controls and useful previews. */
.setting-card.setting-theme-id_photo .setting-group-tabs button{height:34px;font-size:12px}
.setting-card.setting-theme-id_photo .id-photo-group{padding:12px}
.setting-card.setting-theme-id_photo .id-photo-group-title{margin-bottom:10px;font-size:14px}
.setting-card.setting-theme-id_photo .id-photo-group-body{gap:10px}
.setting-card.setting-theme-id_photo .id-photo-control-grid{gap:8px}
.setting-card.setting-theme-id_photo .id-photo-compact-field,.setting-card.setting-theme-id_photo .id-photo-color-field{height:39px;padding:0 9px;font-size:13px}
.setting-card.setting-theme-id_photo .id-photo-compact-field select,.setting-card.setting-theme-id_photo .id-photo-compact-field input{height:30px;font-size:13px}
.setting-card.setting-theme-id_photo .id-photo-compact-field[data-option-key="preset_size"]{grid-column:1/-1}
.setting-card.setting-theme-id_photo .id-photo-compact-field[data-option-key="preset_size"] select{width:min(72%,330px)}
.setting-card.setting-theme-id_photo .id-photo-range-field{gap:4px 8px;font-size:13px}
.setting-card.setting-theme-id_photo .id-photo-range-field output{font-size:13px}
.setting-card.setting-theme-id_photo .id-photo-range-field input{height:18px}
.setting-card.setting-theme-id_photo .id-photo-color-field output{font-size:11px}
.setting-card.setting-theme-id_photo .id-photo-template-choice{grid-template-columns:104px minmax(0,1fr) auto;gap:11px;min-height:128px}
.setting-card.setting-theme-id_photo .id-photo-template-choice img{width:104px;height:126px;border-radius:10px;object-fit:contain}
.setting-card.setting-theme-id_photo .id-photo-template-choice b{font-size:14px}
.setting-card.setting-theme-id_photo .id-photo-template-choice small{margin-top:4px;font-size:12px}
.setting-card.setting-theme-id_photo .id-photo-template-choice button{height:36px;padding:0 11px;font-size:12px}
.setting-card.setting-theme-id_photo .id-photo-consistency-note{font-size:11px;line-height:1.55}
.setting-card.setting-theme-id_photo_layout .setting-option[data-option-key="preset_size"]{grid-column:1/-1}
.setting-card.setting-theme-id_photo_layout .setting-option[data-option-key="preset_size"] select{width:min(72%,330px);max-width:330px}

@media(max-width:600px){
  .control-panel.tool-browsing .tool-section{padding:12px 10px}
  .control-panel.tool-browsing .tool-grid{grid-auto-rows:44px;gap:7px}
  .control-panel.tool-browsing .tool-card{font-size:12px}
  .setting-card.setting-theme-id_photo .id-photo-template-choice{grid-template-columns:88px minmax(0,1fr);align-items:start}
  .setting-card.setting-theme-id_photo .id-photo-template-choice img{width:88px;height:108px;grid-row:1/3}
  .setting-card.setting-theme-id_photo .id-photo-template-choice button{grid-column:2;width:max-content}
}

/* Readable control typography is shared by every tool. */
.setting-group-tabs button{height:34px;font-size:12px}
.generic-setting-group-title{font-size:14px}
.setting-option{min-height:39px;padding:8px 10px;font-size:13px}
.setting-option select,.setting-option input,.setting-option textarea{height:32px;font-size:13px}
.setting-option textarea{height:62px}

/* 高清放大高级版：让计算结果与自动路由一眼可见。 */
.setting-theme-advanced_upscale{border-color:#8b72ef;background:linear-gradient(145deg,#fff 0,#f5f1ff 48%,#eef9ff 100%)}
.setting-theme-advanced_upscale .setting-options{align-items:stretch}
.setting-theme-advanced_upscale .setting-option{border-color:#d8cff8;background:rgba(255,255,255,.92)}
.setting-theme-advanced_upscale .setting-option>span{color:#433b67;font-weight:800}
.setting-theme-advanced_upscale .setting-option[data-option-key="upscale_mode"]{grid-column:1/-1;gap:6px;padding-left:8px;padding-right:8px}
.setting-theme-advanced_upscale .advanced-upscale-mode-label{width:28px;flex:0 0 28px;text-align:center;line-height:1.2;white-space:normal}
.setting-theme-advanced_upscale .setting-option[data-option-key="upscale_mode"] select{width:calc(100% - 34px);max-width:none;flex:1;padding-left:7px;padding-right:22px;font-size:12px;letter-spacing:0}
.advanced-upscale-overview{grid-column:1/-1;min-width:0;padding:13px 15px;display:grid;gap:5px;border:1px solid #8d74ef;border-radius:11px;background:linear-gradient(110deg,#5f45dc,#8b4fe4 56%,#158ebf);box-shadow:0 8px 18px rgba(103,71,210,.2);color:#fff}
.advanced-upscale-overview strong{font-size:14px;line-height:1.35}
.advanced-upscale-overview strong i{padding:0 6px;color:#8ff0e3;font-style:normal}
.advanced-upscale-overview small{color:rgba(255,255,255,.88);font-size:11px;line-height:1.45}
.advanced-upscale-physical{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin:3px 0}
.advanced-upscale-physical span{min-width:0;padding:7px 8px;border:1px solid rgba(255,255,255,.28);border-radius:8px;background:rgba(255,255,255,.12)}
.advanced-upscale-physical small,.advanced-upscale-physical b{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.advanced-upscale-physical small{font-size:10px}.advanced-upscale-physical b{margin-top:2px;font-size:12px;color:#fff}
.processing-mask-field b{font-size:13px}.processing-mask-field small{font-size:12px}
.processing-mask-field button{height:35px;font-size:13px}
.upscale-warning{font-size:13px}

/* Current tool is a strong heading; its former summary line is intentionally hidden. */
.selected-tool-bar{min-height:56px}
.selected-tool-copy strong{font-size:18px;font-weight:850;line-height:1.2}
.selected-tool-copy small{display:none}
.selected-tool-state{font-size:11px}
.selected-tool-bar>button{height:34px;font-size:12px}

/* Long tool names stay complete by progressively condensing the text, never ellipsizing it. */
.tool-card{padding-left:3px;padding-right:3px;text-overflow:clip}
.tool-card-label{display:block;width:100%;overflow:visible;white-space:nowrap;line-height:1;transform-origin:center}
.tool-card.tool-name-long .tool-card-label{font-size:11px;letter-spacing:-.35px;transform:scaleX(.9)}
.tool-card.tool-name-ultra .tool-card-label{width:128%;margin-left:-14%;font-size:10px;letter-spacing:-.45px;transform:scaleX(.78)}

/* Clothing and hairstyle previews are now twice the previous desktop dimensions. */
.setting-card.setting-theme-id_photo .id-photo-template-choice{grid-template-columns:208px minmax(0,1fr);grid-template-rows:auto auto;gap:12px 10px;min-height:254px;align-items:center}
.setting-card.setting-theme-id_photo .id-photo-template-choice img{width:208px;height:252px;grid-row:1/3;border-radius:12px}
.setting-card.setting-theme-id_photo .id-photo-template-choice span{align-self:end;padding-bottom:3px}
.setting-card.setting-theme-id_photo .id-photo-template-choice button{grid-column:2;align-self:start;width:max-content;max-width:100%;height:38px;padding:0 10px;font-size:12px}

@media(max-width:600px){
  .selected-tool-copy strong{font-size:17px}
  .setting-card.setting-theme-id_photo .id-photo-template-choice{grid-template-columns:176px minmax(0,1fr);min-height:218px}
  .setting-card.setting-theme-id_photo .id-photo-template-choice img{width:176px;height:216px;grid-row:1/3}
  .tool-card.tool-name-long .tool-card-label{font-size:10.5px;transform:scaleX(.88)}
  .tool-card.tool-name-ultra .tool-card-label{font-size:9.5px;transform:scaleX(.74)}
}

/* The primary way back to the tool library should be impossible to miss. */
.selected-tool-bar{min-height:68px;padding:10px 10px 10px 12px}
#change-tool-button{height:44px;padding:0 18px;border:0;border-radius:11px;background:linear-gradient(110deg,#ff4f74,#ff783f 52%,#f2a51c);box-shadow:0 9px 20px rgba(238,91,53,.28);color:#fff;font-size:14px;font-weight:850}
#change-tool-button:hover{background:linear-gradient(110deg,#f53e68,#ff6935 52%,#ec9610);box-shadow:0 11px 23px rgba(238,91,53,.36);transform:translateY(-1px)}

/* Every tool keeps its explanation visible; provider badges are replaced by Tutorial. */
.setting-card.setting-theme-id_photo>p{display:block;font-size:13px;line-height:1.6}
.setting-head-actions .tutorial-button{border:0;background:linear-gradient(110deg,#7254e6,#a64cdd);box-shadow:0 5px 12px rgba(112,76,202,.2);color:#fff}
.setting-head-actions .tutorial-button:hover{background:linear-gradient(110deg,#6243d9,#9440d1);color:#fff}

/* One HD-upscale entry, three independently configured real workflow engines. */
.setting-card.setting-theme-upscale{--setting-accent:linear-gradient(#315ff4,#8a52e8);--setting-line:#d6dcfb;--setting-pill:#ecefff;--setting-ink:#5264d4;border-color:#d3d9f7;background:linear-gradient(145deg,rgba(242,245,255,.97),rgba(250,246,255,.93));box-shadow:0 9px 25px rgba(72,87,183,.1)}
.upscale-engine-section{grid-column:1/-1;padding:11px;border:1px solid #d8ddf5;border-radius:11px;background:rgba(255,255,255,.78)}
.upscale-engine-section>strong{display:block;margin-bottom:9px;color:#28334d;font-size:14px}
.upscale-engine-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.upscale-engine-grid button{min-width:0;min-height:78px;padding:9px 7px;border:1px solid #dce1ef;border-radius:9px;background:#fff;color:#4f5e76;text-align:left}
.upscale-engine-grid button b,.upscale-engine-grid button small{display:block}
.upscale-engine-grid button b{font-size:13px;color:#27344d}.upscale-engine-grid button small{margin-top:4px;font-size:10px;line-height:1.4;color:#7d899b}
.upscale-engine-grid button.active{border-color:#8067eb;background:linear-gradient(145deg,#eeeaff,#f8f4ff);box-shadow:0 0 0 2px rgba(120,91,224,.13),0 6px 14px rgba(91,67,175,.12)}
.upscale-engine-grid button.active b{color:#6542cc}

/* Prewritten per-tool tutorial dialog. */
.tutorial-modal{position:fixed;inset:0;z-index:98;display:none;place-items:center}
.tutorial-modal.open{display:grid}
.tutorial-modal-backdrop{position:absolute;inset:0;background:rgba(14,19,29,.72);backdrop-filter:blur(10px)}
.tutorial-modal-panel{position:relative;width:min(720px,92vw);max-height:88vh;display:flex;flex-direction:column;overflow:hidden;border:1px solid rgba(255,255,255,.75);border-radius:20px;background:#f8f9fc;box-shadow:0 30px 90px rgba(0,0,0,.4)}
.tutorial-modal-panel>header{height:70px;flex:0 0 auto;padding:0 20px;display:flex;align-items:center;border-bottom:1px solid #e1e5ed;background:linear-gradient(110deg,#fff,#f4f0ff)}
.tutorial-modal-panel>header span{min-width:0}.tutorial-modal-panel>header strong,.tutorial-modal-panel>header small{display:block}
.tutorial-modal-panel>header strong{font-size:20px;color:#202a42}.tutorial-modal-panel>header small{margin-top:3px;font-size:12px;color:#7c889b}
.tutorial-modal-panel>header button{margin-left:auto;width:38px;height:38px;border:1px solid #dde2ea;border-radius:10px;background:#fff;color:#59687d;font-size:21px}
.tutorial-modal-content{min-height:0;padding:20px;overflow:auto}
.tutorial-intro{margin:0 0 19px;padding:14px 16px;border:1px solid #dcd5f7;border-radius:11px;background:linear-gradient(120deg,#f1edff,#faf8ff);color:#4f5970;font-size:14px;line-height:1.7}
.tutorial-modal-content h3{margin:18px 0 10px;color:#28334b;font-size:15px}.tutorial-modal-content h3:first-of-type{margin-top:0}
.tutorial-modal-content ol{margin:0;padding:0;display:grid;gap:9px;list-style:none}
.tutorial-modal-content ol li{padding:11px 13px;display:grid;grid-template-columns:34px minmax(0,1fr);gap:10px;align-items:center;border:1px solid #e1e5ed;border-radius:10px;background:#fff}
.tutorial-modal-content ol li>span{width:34px;height:34px;display:grid;place-items:center;border-radius:9px;background:linear-gradient(145deg,#7658ed,#a04edc);color:#fff;font-size:12px;font-weight:850}
.tutorial-modal-content ol p{margin:0;color:#46546b;font-size:13px;line-height:1.6}
.tutorial-modal-content ul{margin:0;padding:12px 15px 12px 34px;border:1px solid #d4eadf;border-radius:10px;background:#f1faf6;color:#3d6859;font-size:13px;line-height:1.8}
.tutorial-modal-panel>footer{padding:12px 18px;border-top:1px solid #e1e5ed;background:#fff}
.tutorial-modal-panel>footer button{width:100%;height:43px;border:0;border-radius:9px;background:linear-gradient(110deg,#7658ed,#a64edc);color:#fff;font-size:14px;font-weight:800}

@media(max-width:600px){
  .selected-tool-bar{min-height:62px;padding:8px}
  #change-tool-button{height:40px;padding:0 13px;font-size:13px}
  .upscale-engine-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:5px}
  .upscale-engine-grid button{min-height:82px;padding:7px 5px}
  .upscale-engine-grid button b{font-size:11px}.upscale-engine-grid button small{font-size:9px;line-height:1.3}
  .tutorial-modal-panel{width:100vw;max-height:100vh;height:100vh;height:100dvh;border:0;border-radius:0}
  .tutorial-modal-content{padding:14px}
}

/* Legibility pass: operation text is at least 13px and supporting copy is at least 12px. */
.brand small{font-size:12px}
.quota,.quota strong,.breadcrumb{font-size:13px}
.title-copy small,.header-action,.tool-ready,.result-state{font-size:13px}
.preview-label,.file-copy small,.queue-footer,.workflow-step{font-size:13px}
.replace-button{height:34px;padding:0 10px;font-size:12px;font-weight:700}
.tool-categories button,.tool-search,.tool-search input{font-size:13px}
.control-panel.tool-browsing .tool-card{min-height:48px;padding:4px 3px;font-size:13px;white-space:normal}
.control-panel.tool-browsing .tool-card-label,
.control-panel.tool-browsing .tool-card.tool-name-long .tool-card-label,
.control-panel.tool-browsing .tool-card.tool-name-ultra .tool-card-label{width:100%;margin:0;font-size:13px;line-height:1.25;letter-spacing:0;white-space:normal;transform:none}
.control-panel.tool-browsing .tool-card.coming{padding-bottom:14px}
.tool-card.coming:after{right:50%;top:auto;bottom:2px;padding:0 3px;border-radius:4px;background:#eef1f5;font-size:10px;line-height:12px;transform:translateX(50%)}
.selected-tool-state{font-size:12px}
.setting-head>strong{font-size:17px}
.setting-head-actions>button{height:36px;padding:0 13px;font-size:14px;font-weight:800}
.setting-head-actions .tutorial-button{min-width:56px}
.setting-group-tabs button{font-size:13px}
.upscale-engine-grid button b{font-size:14px}
.upscale-engine-grid button small{font-size:12px;line-height:1.45}
.run-area>p,.progress-summary,.job-status{font-size:13px}
.compare-toolbar>span:after,.segmented button{font-size:13px}
.segmented button{height:30px;padding:0 9px}
.result-version-picker,.result-version-picker select{font-size:13px}
.file-kind{font-size:12px}
.compare-side,.modal-tools span,.modal-stage>p{font-size:12px}
.toast{font-size:13px}
.result-action-rail .secondary-button,.result-action-rail .primary-download,.result-action-rail .batch-download{font-size:13px}
.result-switcher+* small,.retention-note{font-size:12px}

/* Vertical batch result navigator: use the tall action rail instead of a tiny horizontal strip. */
.result-action-rail .result-switcher{
  min-height:120px!important;
  flex:1 1 180px;
  display:block!important;
  overflow:hidden;
}
.result-action-rail .result-switcher>button{display:none!important}
.result-action-rail .result-thumbs{
  width:100%;
  height:100%;
  padding:4px 5px 4px 3px!important;
  display:grid!important;
  grid-template-columns:1fr;
  align-content:start;
  gap:9px!important;
  overflow-x:hidden!important;
  overflow-y:auto!important;
  scrollbar-gutter:stable;
}
.result-action-rail .result-thumb{
  position:relative;
  width:100%!important;
  height:88px!important;
  min-height:88px;
  padding:4px!important;
  flex:none!important;
  border-radius:9px!important;
  background-color:var(--checker-b)!important;
  background-image:linear-gradient(45deg,var(--checker-a) 25%,transparent 25%,transparent 75%,var(--checker-a) 75%),linear-gradient(45deg,var(--checker-a) 25%,var(--checker-b) 25%,var(--checker-b) 75%,var(--checker-a) 75%)!important;
  background-size:16px 16px!important;
  background-position:0 0,8px 8px!important;
}
.result-action-rail .result-thumb img{width:100%;height:100%;object-fit:contain;border-radius:5px}
.result-action-rail .result-thumb.active{outline:3px solid #26b488!important;outline-offset:1px;box-shadow:0 5px 14px rgba(25,157,116,.22)}
.result-action-rail .result-thumb .result-thumb-status{
  position:absolute;
  right:5px;
  bottom:5px;
  width:auto;
  min-width:22px;
  height:19px;
  padding:0 5px;
  border-radius:10px;
  display:grid;
  place-items:center;
  background:#7d899a;
  color:#fff;
  font-size:10px;
  font-weight:800;
  line-height:19px;
}
.result-action-rail .result-thumb .result-thumb-status.succeeded{background:#18a477}
.result-action-rail .result-thumb .result-thumb-status.failed{background:#da5863}
.result-action-rail .result-thumb .result-thumb-status.processing,.result-action-rail .result-thumb .result-thumb-status.uploading,.result-action-rail .result-thumb .result-thumb-status.queued{background:#e39335}
@media(max-width:1000px){
  .result-action-rail .result-switcher{flex:0 0 auto;max-height:280px}
  .result-action-rail .result-thumbs{max-height:280px}
  .result-action-rail .result-thumb{height:96px!important;min-height:96px}
}
.history-drawer header small,.history-item small,.history-item a{font-size:12px}
.history-item strong{font-size:13px}
.account-card>p,.account-card label,.account-switch,.account-logout{font-size:13px}
.settings-modal-panel>header small{font-size:13px}
.setting-card.setting-theme-id_photo .id-photo-color-field output,
.setting-card.setting-theme-id_photo .id-photo-template-choice small,
.setting-card.setting-theme-id_photo .id-photo-template-choice button,
.setting-card.setting-theme-id_photo .id-photo-consistency-note{font-size:13px}
.id-photo-picker-panel>header small,.id-photo-picker-categories button,.id-photo-picker-panel>footer{font-size:13px}
.id-photo-template-card strong{font-size:13px}.id-photo-template-card small{font-size:12px}
.tutorial-modal-panel>header small{font-size:13px}
.tutorial-modal-content ol li>span{font-size:13px}

/* The mask editor uses a dark canvas, so its guidance must remain readable too. */
.mask-editor-head span{font-size:12px}
.mask-editor-head button,.mask-editor label,.mask-editor output{font-size:12px}
.mask-editor small{font-size:11px}

@media(max-width:600px){
  .breadcrumb{font-size:12px}
  .selected-tool-state{font-size:12px}
  .setting-head-actions>button{height:34px;padding:0 11px;font-size:13px}
  .upscale-engine-grid button{min-height:84px;padding:6px 5px}
  .upscale-engine-grid button b{font-size:12px}
  .upscale-engine-grid button small{font-size:11px;line-height:1.35}
  .segmented button{height:30px;padding:0 7px;font-size:12px}
}

/* 高清放大 913 的目标尺寸默认留空，未填写时必须清楚提示。 */
.setting-card.setting-theme-upscale_913 .setting-option[data-option-key="target_cm"].required-missing{
  border:2px solid #df3346;
  background:#fff2f4;
  box-shadow:0 0 0 3px rgba(223,51,70,.11);
}
.setting-card.setting-theme-upscale_913 .setting-option[data-option-key="target_cm"].required-missing>span{color:#b51f31;font-weight:900}
.setting-card.setting-theme-upscale_913 .setting-option[data-option-key="target_cm"].required-missing input{
  border:2px solid #df3346;background:#fff;color:#9d1728;box-shadow:inset 0 0 0 1px rgba(223,51,70,.05);font-weight:800;
}
.setting-card.setting-theme-upscale_913 .setting-option[data-option-key="target_cm"].required-missing input::placeholder{color:#c93c4d;opacity:.9}

/* Top upscale model variants are always visible; selecting one never opens a dropdown. */
.setting-option.upscale-913-model-field{grid-column:1/-1;display:grid;grid-template-columns:1fr;align-items:stretch;gap:8px}.setting-option.upscale-913-model-field>span{display:block}.upscale-913-model-choice{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.upscale-model-card{min-width:0;min-height:68px;padding:8px 10px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;border:2px solid #ddd8ef;border-radius:12px;background:#fff;color:#514b68;text-align:center;cursor:pointer;transition:.15s}.upscale-model-card:hover{border-color:#a48ce9;background:#faf8ff}.upscale-model-card span{font-size:16px;font-weight:950;white-space:nowrap}.upscale-model-card strong{color:#6b45df;font-size:13px;white-space:nowrap}.upscale-model-card small{color:#8a849b;font-size:10px}.upscale-model-card.selected{border-color:#704ce8;background:linear-gradient(120deg,#f5f0ff,#fff7fb);box-shadow:0 5px 16px rgba(99,65,203,.16)}.upscale-model-card.selected small{color:#6b45df;font-weight:850}
@media(max-width:760px){.upscale-913-model-choice{grid-template-columns:repeat(2,minmax(0,1fr))}.upscale-model-card{padding:8px}.upscale-model-card strong{font-size:12px}.upscale-model-card small{display:none}}
