.app.image-tool-mode {
  --lab-accent:#128671; --lab-ink:#123a33; --lab-muted:#6e8580;
  --lab-border:#dce9e3; --lab-soft:#eff7f3; --lab-surface:#fff;
}
html[data-theme="warm"] .app.image-tool-mode { --lab-accent:#927038; --lab-ink:#493b29; --lab-muted:#887c68; --lab-border:#e9e1d3; --lab-soft:#f8f4ed; --lab-surface:#fffefa; }
.app.image-tool-mode .image-tool-panel { position:relative; gap:20px; color:var(--lab-ink); }
.app.image-tool-mode input.image-tool-file[type="file"] { position:absolute; top:0; left:0; width:1px; height:1px; min-height:0; min-width:0; padding:0; border:0; clip-path:inset(50%); overflow:hidden; }
.app.image-tool-mode .image-tool-glyph { width:20px; height:20px; display:inline-flex; align-items:center; justify-content:center; flex:none; vertical-align:middle; }
.app.image-tool-mode .image-tool-glyph svg { display:block; width:100%; height:100%; }
.app.image-tool-mode .image-tool-intro { position:relative; overflow:hidden; padding:22px; border:1px solid var(--lab-border); border-radius:18px; background:radial-gradient(ellipse at 105% 0%,#abdfcf57,transparent 65%),linear-gradient(145deg,var(--lab-surface),var(--lab-soft)); box-shadow:0 8px 24px #183e3106; }
.app.image-tool-mode .image-tool-intro::after { content:''; position:absolute; width:104px; height:104px; right:-44px; top:-42px; border:1px solid #66b49e33; border-radius:50%; box-shadow:0 0 0 16px #66b49e09,0 0 0 32px #66b49e06; pointer-events:none; }
.app.image-tool-mode .image-tool-intro-top { display:flex; align-items:center; gap:10px; margin-bottom:18px; }
.app.image-tool-mode .image-tool-intro-icon { display:grid; place-items:center; width:36px; height:36px; border:1px solid #2c8e7540; border-radius:11px; background:var(--lab-surface); color:var(--lab-accent); box-shadow:0 3px 7px #1d664c08; }
.app.image-tool-mode .image-tool-eyebrow { font-size:9px; font-weight:750; letter-spacing:1.8px; color:var(--lab-accent); }
.app.image-tool-mode .image-tool-intro h3 { position:relative; margin:0 0 9px; font-size:20px; font-weight:750; letter-spacing:-.4px; color:var(--lab-ink); line-height:1.5; }
.app.image-tool-mode .image-tool-intro p { position:relative; margin:0; font-size:12px; line-height:1.85; color:var(--lab-muted); }
.app.image-tool-mode .image-tool-facts { display:grid; grid-template-columns:1fr 1fr; margin-top:20px; padding-top:16px; border-top:1px solid var(--lab-border); }
.app.image-tool-mode .image-tool-facts>div { display:grid; gap:7px; }
.app.image-tool-mode .image-tool-facts>div+div { border-left:1px solid var(--lab-border); padding-left:18px; }
.app.image-tool-mode .image-tool-facts small { font-size:10px; color:var(--lab-muted); }
.app.image-tool-mode .image-tool-facts strong { font-size:13px; font-weight:700; }
.app.image-tool-mode .image-tool-label { display:flex; align-items:center; justify-content:space-between; gap:8px; font-size:12px; font-weight:700; color:var(--lab-ink); }
.app.image-tool-mode .image-tool-label small { font-size:9px; font-weight:500; letter-spacing:.3px; color:var(--lab-muted); white-space:nowrap; }
.app.image-tool-mode .image-tool-drop { position:relative; min-height:218px; margin-top:-8px; padding:25px 15px; gap:10px; border:1px dashed #88b9ab; border-radius:16px; background:radial-gradient(ellipse at 50% 0%,#cae9df44,transparent 72%),var(--lab-surface); transition:border-color .2s,box-shadow .2s,background .2s; }
.app.image-tool-mode .image-tool-drop:hover,.app.image-tool-mode .image-tool-drop.is-dragging,.app.image-tool-mode .image-tool-file:focus-visible+.image-tool-drop { border-color:var(--lab-accent); box-shadow:0 0 0 4px #42a78812; background:var(--lab-soft); outline:none; }
.app.image-tool-mode .image-tool-upload-icon { position:relative; width:54px; height:54px; margin-bottom:5px; border-radius:16px; border:1px solid #86bdac55; background:linear-gradient(145deg,#f3fffa,#deeee7); box-shadow:0 5px 12px #1d664c0a; color:var(--lab-accent); }
.app.image-tool-mode .image-tool-upload-icon .image-tool-glyph { width:25px; height:25px; }
.app.image-tool-mode .image-tool-drop strong { font-size:13px; font-weight:700; color:var(--lab-ink); }
.app.image-tool-mode .image-tool-drop small { font-size:10px; color:var(--lab-muted); }
.app.image-tool-mode .image-tool-paste-hint { display:inline-block; margin-top:3px; padding:5px 10px; border:1px solid var(--lab-border); border-radius:6px; font-size:10px; color:var(--lab-muted); background:var(--lab-surface); }
.app.image-tool-mode .image-tool-selected { margin-top:-8px; padding:12px; border-radius:14px; border-color:var(--lab-border); background:var(--lab-surface); box-shadow:0 4px 16px #183e3105; }
.app.image-tool-mode .image-tool-preview { width:64px; height:76px; border-radius:9px; background:var(--lab-soft); }
.app.image-tool-mode .image-tool-selected-info { gap:8px; }
.app.image-tool-mode .image-tool-selected-info strong { font-size:11px; }
.app.image-tool-mode .image-tool-selected-info small { font-size:10px; color:var(--lab-muted); }
.app.image-tool-mode .image-tool-change,.app.image-tool-mode .image-tool-retry,.app.image-tool-mode .image-tool-refresh { display:inline-flex; align-items:center; justify-content:center; gap:7px; border:1px solid var(--lab-border); border-radius:9px; background:var(--lab-surface); padding:9px 11px; font-size:11px; font-weight:600; color:var(--lab-ink); transition:.2s; white-space:nowrap; }
.app.image-tool-mode .image-tool-change:hover,.app.image-tool-mode .image-tool-refresh:hover,.app.image-tool-mode .image-tool-retry:hover { background:var(--lab-soft); border-color:#88b9ab; }
.app.image-tool-mode .image-tool-options { gap:12px; margin:0; }
.app.image-tool-mode .image-tool-options:empty { display:none; }
.app.image-tool-mode textarea.image-tool-prompt { width:100%; min-height:100px; padding:12px; resize:vertical; border:1px solid var(--lab-border); border-radius:10px; background:var(--lab-surface); color:var(--lab-ink); font:inherit; line-height:1.6; }
.app.image-tool-mode textarea.image-tool-prompt:focus-visible { outline:2px solid var(--lab-accent); outline-offset:2px; }
.app.image-tool-mode .image-tool-template-reset { padding:4px 0; border:0; background:none; color:var(--lab-accent); font:inherit; cursor:pointer; }
.app.image-tool-mode .image-tool-template-reset:hover { text-decoration:underline; }
.app.image-tool-mode .image-tool-reference-guide { margin:0; color:var(--lab-muted); font-size:12px; line-height:1.6; }
.app.image-tool-mode .image-tool-reference-index { position:absolute; top:4px; left:4px; right:4px; width:fit-content; max-width:calc(100% - 8px); padding:2px 5px; border-radius:5px; background:#17342eee; color:#fff; font-size:10px; line-height:1.4; pointer-events:none; }
.app.image-tool-mode .image-tool-ratios { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:6px; }
.app.image-tool-mode .image-tool-ratio { position:relative; display:flex; flex-direction:column; gap:9px; min-height:94px; padding:12px 2px 10px; border:1px solid var(--lab-border); border-radius:11px; background:var(--lab-surface); color:var(--lab-muted); transition:.18s; }
.app.image-tool-mode .image-tool-ratio:hover { background:var(--lab-soft); border-color:#8cbcaf; }
.app.image-tool-mode .image-tool-ratio-preview { display:flex; align-items:center; justify-content:center; width:28px; height:28px; }
.app.image-tool-mode .image-tool-ratio-shape { min-width:0; min-height:0; max-width:none; max-height:none; width:21px; height:auto; border:1.5px solid currentColor; border-radius:3px; background:linear-gradient(135deg,#71b9a122,#71b9a108); }
.app.image-tool-mode .image-tool-ratio:nth-child(2) .image-tool-ratio-shape { width:17px; }
.app.image-tool-mode .image-tool-ratio:nth-child(4) .image-tool-ratio-shape { width:14px; }
.app.image-tool-mode .image-tool-ratio-caption { display:grid; gap:4px; text-align:center; }
.app.image-tool-mode .image-tool-ratio-caption strong { font-size:11px; font-weight:650; font-variant-numeric:tabular-nums; }
.app.image-tool-mode .image-tool-ratio-caption small { font-size:9px; font-weight:400; }
.app.image-tool-mode .image-tool-ratio[aria-pressed="true"] { border-color:var(--lab-accent); box-shadow:0 0 0 1px var(--lab-accent); background:var(--lab-soft); color:var(--lab-accent); }
.app.image-tool-mode .image-tool-ratio[aria-pressed="true"]::after { content:''; position:absolute; right:5px; top:5px; width:4px; height:4px; border-radius:50%; background:var(--lab-accent); }
.app.image-tool-mode .image-tool-resolution-picker:not([hidden]) { display:grid; gap:12px; }
.app.image-tool-mode .image-tool-resolution { display:grid; grid-template-columns:repeat(auto-fit,minmax(70px,1fr)); gap:8px; }
.app.image-tool-mode .image-tool-resolution-option { min-height:42px; border:1px solid var(--lab-border); border-radius:10px; background:var(--lab-surface); color:var(--lab-ink); font:inherit; cursor:pointer; transition:background .16s,border-color .16s,color .16s; }
.app.image-tool-mode .image-tool-resolution-option:not(:disabled):hover { border-color:#8cbcaf; background:var(--lab-soft); }
.app.image-tool-mode .image-tool-resolution-option:disabled { opacity:.55; cursor:not-allowed; }
.app.image-tool-mode .image-tool-resolution-option[aria-pressed="true"] { border-color:var(--lab-accent); background:var(--lab-soft); color:var(--lab-accent); box-shadow:0 0 0 1px var(--lab-accent); }
.app.image-tool-mode .image-tool-quantity { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; }
.app.image-tool-mode .image-tool-quantity-option { min-height:40px; border:1px solid var(--lab-border); border-radius:10px; background:var(--lab-surface); color:var(--lab-ink); font:inherit; cursor:pointer; transition:background .16s,border-color .16s,color .16s; }
.app.image-tool-mode .image-tool-quantity-option:hover { border-color:#8cbcaf; background:var(--lab-soft); }
.app.image-tool-mode .image-tool-quantity-option[aria-pressed="true"] { border-color:var(--lab-accent); background:var(--lab-soft); color:var(--lab-accent); box-shadow:0 0 0 1px var(--lab-accent); }
.app.image-tool-mode .image-tool-quantity-option:disabled { opacity:.55; cursor:wait; }
.app.image-tool-mode .image-tool-output { min-width:0; }
.app.image-tool-mode .image-tool-note { position:relative; margin:0; padding:11px 12px 11px 29px; border:1px solid var(--lab-border); border-radius:10px; font-size:10px; line-height:1.8; background:var(--lab-soft); color:var(--lab-muted); }
.app.image-tool-mode .image-tool-note::before { content:'i'; position:absolute; left:11px; top:14px; display:grid; place-items:center; width:12px; height:12px; border:1px solid currentColor; border-radius:50%; font-size:9px; line-height:1; }
.app.image-tool-mode .image-tool-controls { gap:10px; padding-top:16px; border-top-color:var(--lab-border); }
.app.image-tool-mode .image-tool-status { display:flex; align-items:flex-start; gap:7px; font-size:11px; color:var(--lab-muted); }
.app.image-tool-mode .image-tool-status::before { content:''; width:6px; height:6px; margin-top:6px; border-radius:50%; background:#a1b8af; flex:none; }
.app.image-tool-mode .image-tool-panel.is-busy .image-tool-status::before { background:var(--lab-accent); box-shadow:0 0 0 4px #4ca98e18; animation:image-lab-pulse 1.5s ease-in-out infinite; }
.app.image-tool-mode .image-tool-panel.is-busy .image-tool-run-label .image-tool-glyph { animation:image-tool-spin 2s linear infinite; }
.app.image-tool-mode .image-tool-controls .image-tool-run { display:flex; align-items:center; justify-content:space-between; gap:8px; min-height:52px; padding:13px 15px; border:1px solid #227d67; border-radius:12px; background:linear-gradient(120deg,#123f35,#1b6654); color:#fff; box-shadow:0 6px 17px #164c3520,inset 0 1px #ffffff17; transition:.2s; }
.app.image-tool-mode .image-tool-run:not(:disabled):hover { box-shadow:0 8px 23px #164c3533; transform:translateY(-1px); background:linear-gradient(120deg,#175445,#247c65); }
.app.image-tool-mode .image-tool-run-label { display:inline-flex; align-items:center; gap:8px; font-size:12px; font-weight:650; }
.app.image-tool-mode .image-tool-run .generation-cost { font-size:10px; padding:5px 8px; background:#ffffff12; border:1px solid #ffffff18; border-radius:6px; white-space:nowrap; }
.app.image-tool-mode .image-tool-panel button:disabled { opacity:.5; box-shadow:none; transform:none; }
.app.image-tool-mode .image-tool-controls .fine-print { font-size:9px; line-height:1.8; color:var(--lab-muted); text-align:center; }
.app.image-tool-mode .image-tool-history-toolbar { gap:14px; padding:3px 0 20px; border-bottom:1px solid var(--lab-border); }
.app.image-tool-mode .image-tool-history-heading { display:flex; align-items:baseline; flex-wrap:wrap; gap:8px 11px; }
.app.image-tool-mode .image-tool-history-heading .image-tool-eyebrow { width:100%; font-size:9px; letter-spacing:2px; }
.app.image-tool-mode .image-tool-history-heading h4 { font-size:17px; color:var(--lab-ink); letter-spacing:.2px; }
.app.image-tool-mode .image-tool-history-heading small { margin:0; font-size:10px; color:var(--lab-muted); }
.app.image-tool-mode .image-tool-refresh .image-tool-glyph { width:14px; height:14px; }
.app.image-tool-mode .image-tool-history { grid-template-columns:repeat(auto-fill,minmax(min(260px,100%),1fr)); gap:16px; padding-top:20px; }
.app.image-tool-mode .image-tool-empty { position:relative; isolation:isolate; grid-column:1 / -1; min-height:430px; gap:14px; padding:36px 20px; overflow:hidden; border:1px solid var(--lab-border); border-radius:19px; background:radial-gradient(ellipse at 50% 40%,#c9e9dc55,transparent 62%),var(--lab-surface); }
.app.image-tool-mode .image-tool-empty::before { content:''; position:absolute; inset:0; z-index:-1; background-image:linear-gradient(#2c7e6210 1px,transparent 1px),linear-gradient(90deg,#2c7e6210 1px,transparent 1px); background-size:32px 32px; mask-image:radial-gradient(ellipse at center,#000 10%,transparent 72%); }
.app.image-tool-mode .image-tool-empty-icon { width:74px; height:74px; margin-bottom:9px; border:1px solid #8ab9a955; border-radius:22px; background:linear-gradient(145deg,#fff,#e0efe8); box-shadow:0 12px 30px #1b594a0d,inset 0 0 0 5px #ffffff99; color:var(--lab-accent); transform:rotate(-7deg); }
.app.image-tool-mode .image-tool-empty-icon .image-tool-glyph { width:32px; height:32px; transform:rotate(7deg); }
.app.image-tool-mode .image-tool-empty strong { font-size:17px; font-weight:650; color:var(--lab-ink); }
.app.image-tool-mode .image-tool-empty p { margin:0; font-size:11px; text-align:center; line-height:1.8; color:var(--lab-muted); }
.app.image-tool-mode .image-tool-empty-steps { display:flex; flex-wrap:wrap; justify-content:center; gap:20px; margin-top:20px; }
.app.image-tool-mode .image-tool-empty-steps>span { display:flex; align-items:center; gap:7px; font-size:10px; color:var(--lab-muted); }
.app.image-tool-mode .image-tool-empty-steps i { font-size:9px; font-style:normal; color:var(--lab-accent); border:1px solid var(--lab-border); padding:4px; border-radius:5px; background:var(--lab-surface); font-variant-numeric:tabular-nums; }
.app.image-tool-mode .image-tool-job { display:flex; flex-direction:column; gap:14px; padding:16px; border-color:var(--lab-border); border-radius:16px; background:var(--lab-surface); box-shadow:0 5px 18px #123e3005; }
.app.image-tool-mode .image-tool-job-head { gap:7px; margin:0; }
.app.image-tool-mode .image-tool-tag { display:inline-flex; align-items:center; gap:6px; margin-right:auto; padding:5px 8px; border-radius:7px; color:var(--lab-accent); background:var(--lab-soft); font-size:10px; }
.app.image-tool-mode .image-tool-tag .image-tool-glyph { width:13px; height:13px; }
.app.image-tool-mode .image-tool-job-param { padding:4px 6px; background:var(--lab-soft); color:var(--lab-muted); border-radius:5px; font-size:9px; }
.app.image-tool-mode .image-tool-job-status { font-size:9px; background:transparent; color:var(--lab-muted); padding:4px 0; }
.app.image-tool-mode .image-tool-job[data-status="processing"] .image-tool-job-status { color:#8a672d; }
.app.image-tool-mode .image-tool-job[data-status="completed"] .image-tool-job-status { color:var(--lab-accent); }
.app.image-tool-mode .image-tool-job[data-status="failed"] .image-tool-job-status { color:#b25a50; }
.app.image-tool-mode .image-tool-time { width:100%; color:var(--lab-muted); font-size:9px; font-variant-numeric:tabular-nums; }
.app.image-tool-mode .image-tool-source-section { display:grid; gap:7px; }
.app.image-tool-mode .image-tool-source-title { font-size:11px; color:var(--lab-ink); }
.app.image-tool-mode .image-tool-source-list { display:flex; flex-wrap:wrap; gap:7px; }
.app.image-tool-mode .image-tool-source { flex:0 0 56px; min-width:0; margin:0; color:var(--lab-muted); text-align:center; font-size:10px; }
.app.image-tool-mode .image-tool-source figcaption { margin-top:3px; }
.app.image-tool-mode .image-tool-source-prompt { margin:0; color:var(--lab-ink); font-size:12px; line-height:1.6; overflow-wrap:anywhere; white-space:pre-wrap; }
.app.image-tool-mode .image-tool-result,.app.image-tool-mode .image-tool-pending { width:100%; border:1px solid var(--lab-border); border-radius:11px; background:var(--lab-soft); }
.app.image-tool-mode .image-tool-result { position:relative; }
.app.image-tool-mode .image-tool-result > img { position:absolute; inset:0; width:100%; height:100%; object-fit:contain; }
.app.image-tool-mode .image-tool-result::after { content:'放大预览'; position:absolute; right:8px; bottom:8px; border:1px solid #ffffff26; padding:5px 9px; border-radius:6px; background:#11392dcc; color:#fff; font-size:9px; opacity:0; transition:.18s; }
.app.image-tool-mode .image-tool-result:hover::after,.app.image-tool-mode .image-tool-result:focus-visible::after { opacity:1; }
.app.image-tool-mode .image-tool-source-preview { font-size:9px; }
.app.image-tool-mode .image-tool-source-preview::after { content:'放大'; right:3px; bottom:3px; padding:2px 4px; }
.app.image-tool-mode .image-tool-job-actions { margin:0; display:flex; justify-content:flex-end; padding-top:12px; border-top:1px solid var(--lab-border); }
.app.image-tool-mode .image-tool-download { display:inline-flex; gap:6px; align-items:center; padding:9px 13px; border:1px solid #afd1c4; border-radius:9px; background:var(--lab-soft); color:var(--lab-accent); font-size:11px; font-weight:650; }
.app.image-tool-mode .image-tool-download .image-tool-glyph { width:14px; height:14px; }
.app.image-tool-mode .image-tool-pending { background:radial-gradient(ellipse at 50% 40%,#c4e8dc77,transparent 80%),var(--lab-soft); gap:14px; }
.app.image-tool-mode .image-tool-pending strong { color:var(--lab-ink); font-weight:600; font-size:13px; }
.app.image-tool-mode .image-tool-pending small { color:var(--lab-muted); font-size:10px; }
.app.image-tool-mode .image-tool-spinner { width:30px; height:30px; border-color:#bcd9ce; border-top-color:var(--lab-accent); }
.app.image-tool-mode button:focus-visible { outline:2px solid var(--lab-accent); outline-offset:3px; }
.app.image-tool-mode .image-tool-retry[hidden] { display:none; }
@keyframes image-lab-pulse { 50% { opacity:.45; } }
@media (max-width:590px) {
  .app.image-tool-mode .image-tool-intro { padding:18px; border-radius:15px; }
  .app.image-tool-mode .image-tool-intro h3 { font-size:20px; }
  .app.image-tool-mode .image-tool-drop { min-height:204px; }
  .app.image-tool-mode .image-tool-empty { min-height:310px; padding:25px 14px; }
  .app.image-tool-mode .image-tool-empty-steps { gap:12px; }
  .app.image-tool-mode .image-tool-history { gap:14px; }
  .app.image-tool-mode .image-tool-controls .image-tool-run { padding:12px; }
  .app.image-tool-mode .image-tool-run-label { font-size:12px; gap:6px; }
  .app.image-tool-mode .image-tool-run .generation-cost { font-size:9px; padding:5px 6px; }
}
@media (prefers-reduced-motion:reduce) {
  .app.image-tool-mode .image-tool-panel.is-busy .image-tool-status::before,.app.image-tool-mode .image-tool-panel.is-busy .image-tool-run-label .image-tool-glyph { animation:none; }
  .app.image-tool-mode .image-tool-drop,.app.image-tool-mode .image-tool-ratio,.app.image-tool-mode .image-tool-run { transition:none; }
}
