/* SparkDream original generation workbench and account menu. */
:root { --studio-bg:#111; --studio-surface:#252525; --studio-raised:#333; --studio-border:#ffffff14; --studio-text:#eee; --studio-muted:#93989e; --studio-accent:#72d6ff; }
.brand-home { background:none; color:inherit; padding:0; font-size:16px; font-weight:700; white-space:nowrap; letter-spacing:-.5px; }
.brand-row .brand-home { flex:1; text-align:left; }
.sidebar-collapsed .brand-home { display:none; }
.studio-entry { color:#c9d5dc; }
.studio-entry b { opacity:1; }
#cloudHistory { flex:1; min-height:0; overflow-y:auto; padding:20px 4px 12px; margin:0; scrollbar-width:thin; }
#cloudHistory:empty { display:none; }
.sidebar-bottom { margin-top:auto; }
.generation-view .promo-bar { display:none; }
.generation-view .sidebar { padding-top:18px; }
.generation-view .main-area { padding-top:0; }
.generation-view .topbar { background:var(--studio-bg); border:0; }
.generation-view .app-footer { display:none; }
#page-generate.active { display:flex; flex-direction:column; position:relative; min-height:0; overflow:hidden; background:var(--studio-bg); }
.generation-toolbar { display:flex; align-items:center; justify-content:space-between; gap:20px; padding:4px 28px 12px; flex-shrink:0; }
.generation-toolbar h1 { font-size:17px; font-weight:600; margin:4px 0 0; }
.workspace-kicker { font-size:9px; color:var(--studio-muted); letter-spacing:2px; }
.generation-tools { display:flex; align-items:center; gap:7px; }
.generation-tools .secondary-btn { padding:8px 11px; background:var(--studio-surface); color:var(--studio-text); border:1px solid var(--studio-border); font-size:12px; }
.generation-search { display:flex; gap:7px; align-items:center; background:var(--studio-surface); border:1px solid var(--studio-border); border-radius:8px; padding:7px 10px; color:var(--studio-muted); }
.generation-search input { width:190px; min-width:0; border:0; outline:0; background:none; font-size:12px; color:var(--studio-text); }
.generation-filters { display:flex; align-items:center; gap:16px; padding:8px 28px 14px; flex-shrink:0; border-bottom:1px solid var(--studio-border); }
.generation-filters[hidden],.profile-submenu[hidden] { display:none; }
.generation-filters label { font-size:12px; color:var(--studio-muted); display:flex; gap:8px; align-items:center; }
.generation-filters select { background:var(--studio-surface); color:var(--studio-text); border:1px solid var(--studio-border); border-radius:7px; padding:6px; font-size:12px; }
.generation-filters small { color:var(--studio-muted); font-size:11px; }
.generation-timeline { flex:1; min-height:0; overflow:auto; padding:0 max(24px, calc((100% - 1020px) / 2)) 32px; scrollbar-width:thin; scrollbar-color:#444 transparent; scroll-padding:24px; }
.generation-stream { padding-top:12px; }
.generation-day { font-size:22px; font-weight:600; margin:20px 0 28px; color:var(--studio-text); }
.generation-card { padding:0 0 40px; margin-bottom:22px; border-bottom:1px solid var(--studio-border); transition:background .15s; }
.generation-card.highlight { background:#73d6ff0a; border-radius:12px; }
.generation-card-header { display:flex; align-items:center; gap:12px; margin-bottom:12px; font-size:11px; color:var(--studio-muted); }
.generation-card-header .text-button { margin-left:auto; font-size:11px; }
.generation-task-status { display:flex; align-items:center; gap:7px; }
.generation-task-status i { width:6px; height:6px; border-radius:50%; background:#8c9299; }
.generation-task-status.succeeded i { background:#83dcb0; }
.generation-task-status.running i,.generation-task-status.queued i { background:#75d3ff; }
.generation-task-status.failed i,.generation-task-status.needs_attention i { background:#eeaf8d; }
.generation-prompt { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:4; line-clamp:4; max-height:7.2em; overflow:hidden; margin:0 0 10px; color:var(--studio-text); font-size:14px; line-height:1.8; white-space:pre-wrap; overflow-wrap:anywhere; }
.generation-meta { display:flex; flex-wrap:wrap; gap:0; font-size:12px; color:var(--studio-muted); margin-bottom:16px; }
.generation-meta span + span:before { content:'·'; padding:0 9px; opacity:.55; }
.generation-meta .text-button { display:inline-flex; align-items:center; gap:4px; margin-left:0; font-size:11px; white-space:nowrap; }
.generation-meta .text-button:before { content:'·'; padding:0 9px; opacity:.55; }
.generation-images { container-type:inline-size; display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:2px; width:calc(100% - 12px); margin:0 6px; overflow:hidden; }
.generation-images figure { min-width:0; margin:0; position:relative; aspect-ratio:var(--generation-ratio,1 / 1); overflow:hidden; }
.generation-images figure.single-image { grid-column:span 2; }
.generation-image-shell { position:relative; width:100%; height:100%; overflow:hidden; background:#121212; }
.generation-images figure> .generation-image-shell > button { width:100%; height:100%; padding:0; overflow:hidden; border:0; background:#121212; display:block; border-radius:0; cursor:pointer; }
.generation-images img { display:block; width:100%; height:100%; max-width:none; max-height:none; object-fit:cover; transition:opacity .1s,transform .18s ease; }
.generation-images figure:nth-child(4n+1),.generation-images figure:nth-child(4n+1) .generation-image-shell { border-top-left-radius:2px; border-bottom-left-radius:2px; }
.generation-images figure:last-child,.generation-images figure:nth-child(4n),.generation-images figure:last-child .generation-image-shell,.generation-images figure:nth-child(4n) .generation-image-shell { border-top-right-radius:2px; border-bottom-right-radius:2px; }
.generation-images figure> .generation-image-shell > button:hover img,.generation-images figure> .generation-image-shell > button:focus-visible img { transform:scale(1.015); }
.generation-images figure> .generation-image-shell > button:focus-visible { outline:2px solid #d9f3ff; outline-offset:-2px; }
.generation-image-hover-actions { position:absolute; right:8px; bottom:8px; z-index:2; display:flex; align-items:center; gap:2px; padding:2px; border:.5px solid #ccddff14; border-radius:8px; background:rgba(24,25,29,.9); opacity:0; pointer-events:none; transform:translateY(4px); transition:opacity .16s ease,transform .16s ease,border-color .16s ease; }
.generation-image-shell:hover .generation-image-hover-actions,.generation-image-shell:focus-within .generation-image-hover-actions { opacity:1; pointer-events:auto; transform:translateY(0); }
.generation-image-hover-actions:hover { border-color:#ffffff26; }
.generation-image-hover-actions button,.generation-image-hover-actions a { display:grid; place-items:center; width:28px; height:28px; padding:0; border:0; border-radius:6px; background:transparent; color:#f5fbff; text-decoration:none; cursor:pointer; }
.generation-image-hover-actions button:hover,.generation-image-hover-actions a:hover,.generation-image-hover-actions button:focus-visible,.generation-image-hover-actions a:focus-visible { background:#ffffff1c; outline:none; }
.generation-image-hover-actions .is-active { color:#ffd66e; }
.studio-action-icon { display:inline-block; width:14px; height:14px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; vertical-align:-3px; pointer-events:none; }
.generation-image-icon { display:block; width:16px; height:16px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; pointer-events:none; }
.generation-images figcaption { display:flex; flex-wrap:wrap; justify-content:space-between; gap:5px; padding:8px 3px 0; color:var(--studio-muted); font-size:10px; }
.generation-images a { color:var(--studio-muted); text-decoration:none; }
.generation-images a:hover { color:var(--studio-accent); }
.generation-card-actions { display:flex; flex-wrap:wrap; gap:7px; margin-top:16px; }
.generation-card-actions button { display:inline-flex; align-items:center; gap:6px; padding:9px 12px; border-radius:7px; background:var(--studio-surface); color:var(--studio-text); font-size:12px; }
.generation-card-actions .generation-image-icon { display:inline-block; width:14px; height:14px; }
.generation-card-actions button:hover { background:var(--studio-raised); }
.generation-card-actions button:disabled { opacity:.4; cursor:not-allowed; }
.generation-card-actions .task-delete { color:var(--studio-muted); background:transparent; }
.generation-working { display:flex; align-items:center; gap:20px; min-height:160px; background:var(--studio-surface); border:1px solid var(--studio-border); border-radius:12px; padding:28px; }
.generation-working strong { font-size:14px; font-weight:500; }
.generation-working p { font-size:12px; line-height:1.8; color:var(--studio-muted); margin-bottom:0; }
.generation-spinner { width:25px; height:25px; border:2px solid var(--studio-border); border-top-color:var(--studio-accent); border-radius:50%; animation:workspace-spin 1.2s linear infinite; flex-shrink:0; }
@keyframes workspace-spin { to { transform:rotate(360deg); } }
.generation-error { padding:14px; color:#e9ae95; background:#7647351a; font-size:12px; line-height:1.7; border-radius:8px; white-space:pre-wrap; overflow-wrap:anywhere; }
.generation-empty { min-height:100%; display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; gap:14px; padding:36px 16px; }
.empty-spark { width:64px; height:64px; display:grid; place-items:center; border-radius:20px; background:var(--studio-surface); color:var(--studio-accent); font-size:32px; }
.empty-spark .generation-image-icon { width:30px; height:30px; }
.generation-empty h2 { font-size:22px; font-weight:500; margin:5px 0 0; }
.generation-empty p { color:var(--studio-muted); font-size:13px; line-height:1.7; max-width:380px; margin:0 0 10px; }
.text-button { padding:0; border:0; background:none; color:var(--studio-muted); font-size:12px; }
.text-button:hover { color:var(--studio-accent); }
.generation-dock { flex-shrink:0; padding:12px 28px 9px; background:var(--studio-bg); }
.generation-dock .composer-wrap { max-width:1020px; width:100%; margin:0 auto; }
.generation-dock .composer { min-height:146px; padding:14px 16px 12px; border-radius:22px; border:1px solid var(--studio-border); background:linear-gradient(180deg,#1b1b1b,#222); box-shadow:none; }
.generation-dock .composer:focus-within { border-color:#ffffff30; box-shadow:0 0 0 1px #ffffff08; }
.generation-dock .prompt-editor { min-height:70px; max-height:150px; padding-top:3px; font-size:14px; line-height:1.7; }
.generation-dock .composer-meta { padding-top:2px; padding-bottom:5px; font-size:10px; }
.generation-dock .preview-note,.generation-dock .hero-suggestions,.generation-dock #composerSuggestions { display:none; }
.generation-dock .send-button,.generation-dock #sendPrompt { border-radius:50%; width:34px; height:34px; min-width:34px; padding:0; }
.generation-disclaimer { color:var(--studio-muted); text-align:center; font-size:9px; margin:7px 0 0; }
.generation-bottom { display:none; position:absolute; right:30px; bottom:210px; padding:9px 13px; border:1px solid var(--studio-border); border-radius:20px; background:var(--studio-surface); color:var(--studio-text); font-size:11px; box-shadow:0 4px 20px #0003; }
.generation-bottom.visible { display:block; }
#page-create #generationResult { display:none; }
.profile-panel { width:280px; max-width:calc(100vw - 24px); max-height:calc(100dvh - 100px); overflow-y:auto; scrollbar-width:thin; background:var(--studio-surface); border:1px solid var(--studio-border); border-radius:14px; padding:12px; color:var(--studio-text); box-shadow:0 12px 40px #0005; z-index:45; }
.profile-panel>button { display:flex; align-items:center; justify-content:flex-start; gap:10px; width:100%; min-height:40px; padding:9px 10px; border-radius:7px; background:none; color:inherit; font-size:12px; text-align:left; }
.profile-panel>button:not(.profile-head)>span:not(.menu-badge) { flex:0 1 auto; margin-left:0; text-align:left; }
.profile-panel>button:not(.profile-head)>.inline-arrow { margin-left:auto; }
.profile-panel>button:hover { background:var(--studio-raised); }
.profile-panel .profile-head { margin:0 0 12px; padding:4px; gap:11px; }
.profile-head>div:nth-child(2) { min-width:0; }
.profile-head b { display:block; max-width:115px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:13px; }
.profile-head span { display:block; color:var(--studio-muted); font-size:10px; margin-top:4px; }
.profile-head small { margin-left:auto; white-space:nowrap; color:var(--studio-muted); font-size:10px; }
.menu-badge { color:var(--studio-muted); font-size:9px; border:1px solid var(--studio-border); padding:2px 4px; border-radius:4px; }
.profile-panel button i { margin-left:auto; color:var(--studio-muted); font-style:normal; }
.profile-panel .menu-icon { width:16px; text-align:center; font-size:16px; flex-shrink:0; }
.profile-panel em { font-style:normal; font-size:9px; color:var(--studio-accent); padding:2px 3px; background:#72d6ff10; border-radius:4px; margin-left:3px; }
.profile-separator { height:1px; margin:9px 4px; background:var(--studio-border); }
.profile-submenu { display:grid; padding:4px 0 6px 25px; gap:3px; }
.profile-submenu button { padding:8px; text-align:left; font-size:11px; color:var(--studio-muted); border-radius:6px; background:none; }
.profile-submenu button:hover,.profile-submenu button.selected { background:var(--studio-raised); color:var(--studio-text); }
.workspace-info { font-size:13px; line-height:1.8; color:var(--studio-text); }
.workspace-info h3 { font-size:16px; font-weight:600; margin:20px 0 10px; }
.workspace-info p { color:var(--studio-muted); }
.workspace-info pre { margin:20px 0; overflow:auto; background:var(--studio-bg); border:1px solid var(--studio-border); border-radius:9px; padding:16px; font-size:11px; color:var(--studio-text); }
.workspace-details { display:grid; grid-template-columns:110px minmax(0,1fr); gap:13px 16px; font-size:12px; }
.workspace-details dt { color:var(--studio-muted); }
.workspace-details dd { margin:0; overflow-wrap:anywhere; }
.preferences-form .preference-check { display:flex; flex-direction:row; align-items:center; gap:12px; line-height:1.6; }
.preferences-form input[type="checkbox"] { width:16px; height:16px; accent-color:#75c4e1; }
.workspace-profile { display:flex; flex-direction:column; align-items:center; gap:8px; padding:10px 0; }
.workspace-profile h3 { margin:0; }
.workspace-profile span { font-size:11px; color:var(--studio-muted); }
.workspace-statistics { display:flex; gap:14px; margin:20px 0; }
.workspace-statistics>div { flex:1; background:var(--studio-surface); border-radius:10px; padding:16px; display:grid; gap:8px; }
.workspace-statistics b { font-size:19px; font-weight:500; }
.workspace-statistics span { font-size:11px; color:var(--studio-muted); }
html[data-show-sizes="false"] .actual-image-size { display:none; }
html[data-density="compact"] .generation-card { padding-bottom:22px; margin-bottom:12px; }
html[data-density="compact"] .generation-day { margin:12px 0 18px; font-size:18px; }
html[data-density="compact"] .generation-images img { max-height:270px; }
html[data-theme="light"] { --studio-bg:#f8f9fb; --studio-surface:#fff; --studio-raised:#edf0f4; --studio-border:#23304616; --studio-text:#28313b; --studio-muted:#677481; --studio-accent:#167da8; --bg:#f8f9fb; --cyan:#167da8; color-scheme:light; }
html[data-theme="dark"] { color-scheme:dark; }
html[data-theme="light"] body,html[data-theme="light"] .app-shell,html[data-theme="light"] .main-area { background:var(--studio-bg); color:var(--studio-text); }
html[data-theme="light"] .sidebar { background:#f0f2f5; border-color:var(--studio-border); color:var(--studio-text); }
html[data-theme="light"] .topbar { background:var(--studio-bg); color:var(--studio-text); border-color:var(--studio-border); }
html[data-theme="light"] .nav-item,html[data-theme="light"] .section-label,html[data-theme="light"] .side-link,html[data-theme="light"] .cloud-history-item,html[data-theme="light"] .history-heading { color:var(--studio-text); }
html[data-theme="light"] .nav-item.active,html[data-theme="light"] .nav-item:hover,html[data-theme="light"] .cloud-history-item.active { background:#dce4eb; }
html[data-theme="light"] .nav-icon,html[data-theme="light"] .nav-icon.sparkle,html[data-theme="light"] .sidebar-collapse { color:#52606d; }
html[data-theme="light"] .hero-create h1,html[data-theme="light"] .hero-create h1 span,html[data-theme="light"] .section-heading h2,html[data-theme="light"] .gallery-heading h2,html[data-theme="light"] .subpage-head h1,html[data-theme="light"] .item-info h3 { color:var(--studio-text); }
html[data-theme="light"] .composer,html[data-theme="light"] .generation-dock .composer { background:var(--studio-surface); border-color:#b6c5d3; }
html[data-theme="light"] .prompt-editor { color:var(--studio-text); }
html[data-theme="light"] .mode-switch { background:#e3e8ed; border-color:var(--studio-border); }
html[data-theme="light"] .mode-btn { color:var(--studio-muted); }
html[data-theme="light"] .mode-btn.active { background:#fff; color:#21536a; }
html[data-theme="light"] .top-pill,html[data-theme="light"] .top-icon,html[data-theme="light"] .points-pill,html[data-theme="light"] .gallery-search,html[data-theme="light"] .popover,html[data-theme="light"] .notification-panel,html[data-theme="light"] .workspace-dialog:not(.auth-dialog),html[data-theme="light"] .cloud-task,html[data-theme="light"] .gallery-item { background:var(--studio-surface); color:var(--studio-text); border-color:var(--studio-border); }
html[data-theme="light"] .popover button,html[data-theme="light"] .tool-select,html[data-theme="light"] .breadcrumb,html[data-theme="light"] .breadcrumb #pageTitle,html[data-theme="light"] .category,html[data-theme="light"] .asset-tabs button,html[data-theme="light"] .asset-summary strong,html[data-theme="light"] .task-prompt,html[data-theme="light"] .task-meta { color:var(--studio-text); }
html[data-theme="light"] .popover button:hover,html[data-theme="light"] .category.active { background:var(--studio-raised); }
html[data-theme="light"] .workspace-dialog:not(.auth-dialog) input,html[data-theme="light"] .workspace-dialog:not(.auth-dialog) select { background:var(--studio-bg); color:var(--studio-text); border-color:var(--studio-border); }
html[data-theme="light"] .parameter-panel { background:var(--studio-surface); border-color:var(--studio-border); }
html[data-theme="light"] .param-choice span,html[data-theme="light"] .inline-segments span { background:var(--studio-raised); color:var(--studio-text); }
html[data-theme="light"] .secondary-btn,html[data-theme="light"] .ghost-btn { color:var(--studio-text); border-color:var(--studio-border); background:var(--studio-raised); }
@media (max-width:760px) {
  .brand-home { display:none; }
  .generation-toolbar { padding:4px 14px 10px; gap:8px; }
  .generation-toolbar>div:first-child { display:none; }
  .generation-tools { width:100%; gap:5px; }
  .generation-search { min-width:0; flex:1; padding:7px; }
  .generation-search input { width:100%; font-size:11px; }
  .generation-tools .secondary-btn { padding:7px 8px; font-size:11px; }
  .generation-filters { padding:7px 14px; flex-wrap:wrap; gap:8px; }
  .generation-filters small { font-size:10px; }
  .generation-timeline { padding:0 14px 20px; }
  .generation-day { font-size:18px; margin:14px 0 20px; }
  .generation-prompt { font-size:13px; }
  .generation-images { grid-template-columns:repeat(min(2,var(--image-count)),minmax(0,1fr)); gap:6px; }
  .generation-images figure:only-child { width:100%; }
  .generation-card-actions button { font-size:11px; padding:8px; }
  .generation-dock { padding:8px 12px 5px; }
  .generation-dock .composer { padding:10px; border-radius:16px; }
  .generation-dock .prompt-editor { min-height:55px; max-height:110px; padding-left:0; font-size:13px; }
  .generation-dock .upload-tile { display:none; }
  .generation-dock .composer-meta { font-size:9px; }
  .generation-disclaimer { font-size:8px; line-height:1.6; }
  .generation-bottom { right:18px; bottom:240px; }
  .generation-empty h2 { font-size:18px; }
  .profile-panel { right:12px; top:84px; max-height:calc(100dvh - 100px); }
  .generation-view .profile-panel { top:58px; max-height:calc(100dvh - 70px); }
  .workspace-details { grid-template-columns:80px minmax(0,1fr); }
}
@media (max-height:650px) and (min-width:761px) {
  .generation-toolbar { padding-bottom:6px; }
  .generation-dock .prompt-editor { min-height:50px; max-height:85px; }
  .generation-dock .composer { min-height:115px; }
  .generation-disclaimer { display:none; }
}
@media (prefers-reduced-motion:reduce) { .generation-spinner { animation:none; } .generation-card { transition:none; } }
.history-thumbnail { width:28px; height:28px; object-fit:cover; border-radius:5px; flex-shrink:0; }
.cloud-history-item { min-height:40px; }
.brand-symbol { flex-shrink:0; }
@media(max-width:760px) { #cloudHistory { display:none; } }
/* The shared composer contains the legacy single-result wrapper; the stream owns results now. */
#generationResult,.generation-dock .suggestion-row { display:none !important; }

/* Light controls retain an obvious selected state and legible account data. */
html[data-theme="light"] .parameter-panel .param-grid,
html[data-theme="light"] .inline-ratios,
html[data-theme="light"] .inline-segments { background:#e2e8ee; }
html[data-theme="light"] .parameter-panel .param-choice input:checked+span,
html[data-theme="light"] .inline-ratios input:checked+span,
html[data-theme="light"] .inline-segments input:checked+span { background:#c7e6f4; color:#164a64; box-shadow:inset 0 0 0 1px #619fba; }
html[data-theme="light"] .parameter-panel .param-choice i { border-color:#768795; }
html[data-theme="light"] .parameter-panel .param-toggle { color:var(--studio-text); }
html[data-theme="light"] .account-summary,
html[data-theme="light"] .key-block,
html[data-theme="light"] .key-choice { background:var(--studio-raised); color:var(--studio-text); border-color:var(--studio-border); }
html[data-theme="light"] .account-summary strong,
html[data-theme="light"] .key-row code,
html[data-theme="light"] .copy-btn { color:var(--studio-text); background:var(--studio-surface); border-color:#b6c5d3; }
@media (max-width:400px) {
  .generation-view .breadcrumb { display:none; }
  .generation-view .top-actions { margin-left:auto; }
  .generation-view .points-pill em { display:none; }
}

/* The legacy menu styles color every span muted; keep actual actions readable. */
.profile-panel>button:not(.profile-head)>span:not(.menu-badge) { color:var(--studio-text); }
.profile-panel>button:not(.profile-head) { font-size:13px; }
/* JiMeng-style generated result detail and second-level image preview. */
.result-detail-dialog,.result-preview-dialog{width:min(1280px,96vw);max-width:96vw;height:min(860px,92vh);max-height:92vh;padding:0;border:1px solid #343740;border-radius:18px;background:#17181c;color:#f2f3f5;overflow:hidden;box-shadow:0 28px 100px #000b}
.result-detail-dialog::backdrop{background:#050608cc;backdrop-filter:blur(8px)}
.result-preview-dialog{width:min(1180px,94vw);height:min(900px,92vh);background:#111216;border-color:#41434c}
.result-preview-dialog::backdrop{background:#050608e6;backdrop-filter:blur(14px)}
.result-detail-shell,.result-preview-shell{height:100%;display:flex;flex-direction:column;min-height:0}
.result-detail-header,.result-preview-header{height:62px;display:flex;align-items:center;gap:18px;padding:0 22px;border-bottom:1px solid #2c2e35;flex:0 0 auto}
.result-detail-header h2,.result-preview-header h2{margin:0;font-size:17px;font-weight:600;flex:1;text-align:center}
.result-detail-back{border:0;background:none;color:#c6c9d1;font-size:13px;cursor:pointer;padding:8px 0}.result-detail-back:hover{color:#fff}
.result-detail-header-actions{display:flex;gap:7px;min-width:112px;justify-content:flex-end}.result-icon-btn{width:34px;height:34px;border:1px solid #3b3e47;border-radius:9px;background:#22242a;color:#e8e9ed;font-size:20px;line-height:1;cursor:pointer}.result-icon-btn:hover{background:#32353e}.result-detail-body{overflow:auto;min-height:0;flex:1;padding:28px}
.result-detail-main{display:grid;grid-template-columns:minmax(0,1fr) 330px;gap:28px;max-width:1160px;margin:0 auto;min-height:100%}
.result-detail-art{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:0;background:#0e0f12;border:1px solid #282a31;border-radius:14px;padding:18px}
.result-detail-image-button{display:flex;align-items:center;justify-content:center;width:100%;height:100%;min-height:380px;border:0;background:none;cursor:zoom-in}.result-detail-image-button img{display:block;max-width:100%;max-height:calc(92vh - 170px);width:auto;height:auto;object-fit:contain;border-radius:5px}
.result-detail-pager{display:flex;align-items:center;gap:18px;margin-top:14px;color:#aeb2bc}.result-detail-pager button,.result-preview-nav{width:32px;height:32px;border:1px solid #444750;border-radius:50%;background:#24262d;color:#fff;font-size:23px;line-height:1;cursor:pointer}.result-detail-pager button:disabled,.result-preview-nav:disabled{opacity:.3;cursor:default}
.result-detail-info{padding:8px 4px;overflow:auto}.result-detail-status{display:flex;justify-content:space-between;color:#8ee5d1;font-size:12px;padding-bottom:20px;border-bottom:1px solid #2b2e35}.result-detail-status span{color:#a8acb6}.result-detail-info h3{font-size:13px;margin:24px 0 9px}.result-detail-prompt{font-size:14px;line-height:1.75;color:#dbdde3;white-space:pre-wrap;overflow-wrap:anywhere;margin:0}.result-detail-meta{display:grid;gap:11px;margin:25px 0}.result-detail-meta div{display:flex;justify-content:space-between;gap:14px;font-size:12px}.result-detail-meta dt{color:#888e9a}.result-detail-meta dd{margin:0;text-align:right;color:#d9dce3;overflow-wrap:anywhere}.result-detail-actions{display:flex;gap:8px}.result-detail-actions button{flex:1;white-space:nowrap}.result-tool-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:18px}.result-tool-grid button{border:1px solid #383b44;background:#22242a;color:#c8cad1;border-radius:8px;padding:9px 6px;font-size:12px;cursor:pointer}.result-tool-grid button:hover{border-color:#68717e;color:#fff}.result-detail-note{color:#737985;font-size:11px;line-height:1.6;margin:15px 0}
.result-preview-body{display:flex;flex-direction:column;min-height:0;flex:1;padding:18px 22px 20px}.result-preview-image-wrap{flex:1;min-height:0;display:flex;align-items:center;justify-content:center;gap:18px}.result-preview-image-wrap img{max-width:min(88vw,1050px);max-height:calc(92vh - 180px);width:auto;height:auto;object-fit:contain;border-radius:5px}.result-preview-footer{display:flex;align-items:center;gap:16px;border-top:1px solid #2c2e35;padding-top:14px;color:#aeb2bc;font-size:12px}.result-preview-footer p{margin:0;flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#d1d4db}.result-preview-footer a{text-decoration:none;white-space:nowrap}.result-preview-nav{flex:0 0 auto;width:38px;height:38px}.result-preview-nav.next{order:3}
@media(max-width:760px){.result-detail-dialog,.result-preview-dialog{width:100vw;max-width:100vw;height:100dvh;max-height:100dvh;border-radius:0}.result-detail-header,.result-preview-header{padding:0 14px;gap:10px}.result-detail-header h2,.result-preview-header h2{font-size:15px}.result-detail-back{font-size:11px}.result-detail-header-actions{min-width:100px}.result-detail-body{padding:14px}.result-detail-main{display:flex;flex-direction:column;gap:16px}.result-detail-art{min-height:46vh;padding:8px}.result-detail-image-button{min-height:0}.result-detail-image-button img{max-height:45vh}.result-detail-info{overflow:visible}.result-preview-body{padding:10px}.result-preview-image-wrap{gap:5px}.result-preview-image-wrap img{max-width:calc(100vw - 82px);max-height:calc(100dvh - 190px)}.result-preview-footer{flex-wrap:wrap;gap:8px}.result-preview-footer p{flex-basis:100%}}
.result-icon-btn.is-active{color:#ff9ca7;border-color:#77434c;background:#3a2027}
/* Full-screen result detail matches JiMeng's generated-work detail route: left canvas, fixed right panel. */
body.result-detail-open{overflow:hidden}
body.result-detail-open .main-area>.topbar{position:relative;z-index:230;background:transparent;pointer-events:none}
body.result-detail-open .main-area>.topbar .breadcrumb{visibility:hidden}
body.result-detail-open .main-area>.topbar .top-actions{pointer-events:auto}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
/* Preview follows JiMeng's centered dark image surface, left title and bottom metadata bar. */
.result-preview-dialog{width:min(1050px,calc(100vw - 32px));max-width:calc(100vw - 32px);height:min(782px,calc(100vh - 32px));max-height:calc(100vh - 32px);border-radius:16px;resize:none}
.result-preview-shell{overflow:hidden}
.result-preview-header{height:76px;padding:0 26px;border-bottom:0}
.result-preview-header h2{font-size:18px;text-align:left}
.result-preview-body{padding:0 26px 12px;gap:16px}
.result-preview-image-wrap{position:relative;flex:0 0 min(598px,calc(100vh - 220px));height:min(598px,calc(100vh - 220px));min-height:0;background:#101113;border-radius:12px;overflow:hidden;gap:0;touch-action:none;user-select:none;cursor:grab}
.result-preview-image-wrap img{max-width:100%;max-height:100%;border-radius:0;transform-origin:center center;will-change:transform;user-select:none;pointer-events:none}.result-preview-image-wrap.is-dragging{cursor:grabbing}
.result-preview-nav{display:none}
.result-preview-footer{flex:0 0 62px;padding:0;border-top:0;gap:16px}.result-preview-meta{display:flex;align-items:center;gap:14px;min-width:0;flex:1;white-space:nowrap;overflow:hidden}.result-preview-meta span{overflow:hidden;text-overflow:ellipsis;color:#f2f3f5}.result-preview-size{flex:0 0 auto;font-size:16px;color:#f2f3f5}
.result-preview-footer p{font-size:12px;color:#f2f3f5}
.result-preview-footer span{font-size:16px;color:#f2f3f5}
.result-preview-footer a{background:#8bdcff;color:#13202a;border:0;border-radius:9px;padding:10px 15px;font-weight:600}
.result-detail-view{position:fixed;left:240px;right:0;top:0;bottom:0;z-index:220;background:#111;color:#f3f4f6;display:block}
.result-detail-view[hidden]{display:none}
.result-detail-stage{position:relative;width:100%;height:100%;background:#111}
.result-detail-stage>.result-detail-back{position:absolute;z-index:3;left:14px;top:20px;display:grid;place-items:center;width:52px;height:38px;padding:0;border:0;border-radius:0;background:transparent;color:#f2f3f5;line-height:1;cursor:pointer;transition:color .16s ease,opacity .16s ease}
.result-detail-stage>.result-detail-back svg{display:block;width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.result-detail-stage>.result-detail-back:hover,.result-detail-stage>.result-detail-back:focus-visible{background:transparent;color:#fff;opacity:.78;outline:none}
.result-detail-view .result-detail-body{height:100%;padding:0;overflow:hidden}
.result-detail-layout{height:100%;display:grid;grid-template-columns:minmax(0,1fr) 440px;gap:0}
.result-detail-canvas{position:relative;display:flex;align-items:center;justify-content:center;min-width:0;min-height:0;padding:56px 7% 34px;background:#111}
.result-detail-image-button{display:flex;align-items:center;justify-content:center;width:100%;height:100%;min-height:0;border:0;background:none;cursor:zoom-in}
.result-detail-image-button img{display:block;max-width:100%;max-height:calc(100vh - 110px);width:auto;height:auto;object-fit:contain;border-radius:14px}
.result-image-pager{position:absolute;left:50%;bottom:24px;transform:translate(-50%,6px);z-index:2;display:flex;align-items:center;gap:12px;padding:7px 10px;border:1px solid #ffffff1c;border-radius:9px;background:#17181acc;color:#f3f4f6;backdrop-filter:blur(10px);opacity:0;visibility:hidden;pointer-events:none;transition:opacity .18s ease,transform .18s ease,visibility .18s ease}
.result-detail-canvas:hover .result-image-pager,.result-detail-canvas:focus-within .result-image-pager,.result-image-pager:focus-within{opacity:1;visibility:visible;pointer-events:auto;transform:translate(-50%,0)}
@media(hover:none){.result-image-pager{opacity:1;visibility:visible;pointer-events:auto;transform:translate(-50%,0)}}
.result-image-pager button{display:grid;place-items:center;width:28px;height:28px;padding:0;border:0;border-radius:5px;background:transparent;color:#f3f4f6;line-height:1;cursor:pointer}.result-action-icon{display:block;flex:none;width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}.result-image-pager .result-action-icon{width:15px;height:15px;stroke-width:1.8}
.result-image-pager button:hover:not(:disabled){background:#ffffff24}
.result-image-pager button:disabled{opacity:.35;cursor:default}
.result-image-pager span{min-width:38px;text-align:center;font-size:12px;font-variant-numeric:tabular-nums}
.result-group-pager{position:absolute;right:20px;top:50%;z-index:2;display:flex;flex-direction:column;align-items:center;gap:18px;transform:translateY(-50%)}
.result-group-pager button{display:grid;place-items:center;width:36px;height:36px;padding:0;border:0;border-radius:8px;background:transparent;color:#f4f5f7;cursor:pointer;transition:background-color .16s ease,color .16s ease}
.result-group-pager button svg{display:block;width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.result-group-pager button:hover:not(:disabled),.result-group-pager button:focus-visible:not(:disabled){background:#ffffff1c;color:#fff;outline:none}
.result-group-pager button:disabled{opacity:.3;cursor:default}
.result-detail-pager{position:absolute;right:24px;top:50%;display:flex;flex-direction:column;gap:28px;align-items:center;color:#969ba5}
.result-detail-pager button{width:34px;height:34px;border:0;background:none;color:#d8dbe1;font-size:26px;cursor:pointer}.result-detail-pager button:disabled{opacity:.28;cursor:default}.result-detail-pager span{font-size:11px;writing-mode:vertical-rl;color:#707681}
.result-detail-panel{scrollbar-width:thin;scrollbar-color:#555b64 transparent;border-left:1px solid #292b30;background:#111;display:flex;flex-direction:column;min-width:0;overflow:auto;margin-top:56px;height:calc(100% - 56px);padding:0 30px 20px}
.result-panel-toolbar{display:flex;align-items:center;justify-content:flex-end;gap:24px;height:48px;border-bottom:1px solid #24262b}.result-panel-toolbar button{display:inline-flex;align-items:center;gap:6px;border:0;background:none;color:#f2f3f5;cursor:pointer;font-size:13px;line-height:1}.result-panel-toolbar button:first-child{margin-right:auto;font-weight:500}.result-panel-toolbar button:hover{color:#fff}.result-panel-favorite .result-action-icon{width:20px;height:20px;stroke-width:1.55}.result-panel-favorite.is-active{color:#ffd66e}
.result-panel-thumbs{display:flex;gap:6px;overflow-x:auto;padding:20px 0 16px;scrollbar-width:none}.result-panel-thumbs::-webkit-scrollbar{display:none}.result-panel-thumbs button{width:84px;height:84px;flex:0 0 84px;padding:0;border:2px solid transparent;border-radius:10px;background:#24262a;overflow:hidden;cursor:pointer}.result-panel-thumbs button.active{border-color:#fff}.result-panel-thumbs img{width:100%;height:100%;object-fit:cover}
.result-panel-copy{border-top:1px solid #24262b;padding:18px 0 10px}.result-panel-copy h3{margin:0 0 12px;color:#a8b4d3;font-size:14px;font-weight:500}.result-panel-copy p{margin:0;color:#f0f1f4;font-size:14px;line-height:1.75;max-height:230px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere}.result-panel-meta{display:flex;align-items:center;gap:7px;flex-wrap:wrap;margin-top:14px;color:#979da8;font-size:12px}.result-panel-meta span+span:before{content:'·';margin-right:7px;color:#555a64}.result-panel-meta button{display:inline-flex;align-items:center;gap:4px;border:0;background:none;padding:0;color:#9ba1ad;cursor:pointer}.result-panel-meta button .result-action-icon{width:14px;height:14px;stroke-width:1.55}
.result-panel-tools{display:flex;flex-direction:column;gap:8px;margin-top:20px}.result-tool-row{display:grid;grid-template-columns:1fr 1fr;gap:8px}.result-panel-tools button{display:flex;align-items:center;gap:8px;border:0;border-radius:12px;background:#292a2d;color:#f2f3f5;min-height:42px;text-align:left;padding:10px 13px;cursor:pointer;font-family:PingFang SC,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;font-size:13px;line-height:20px}.result-panel-tools button:hover{background:#35373b}.result-panel-tools b{font-weight:500;margin-left:0}.result-panel-tools .result-tool-suffix{margin-left:auto;width:14px;height:14px;stroke-width:1.6}.result-panel-tools small{margin-left:0;padding:2px 4px;border-radius:4px;background:#81b4d9;color:#07131c;font-size:9px;line-height:12px}.result-panel-tools .wide-tool{width:100%}.result-tool-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}.result-detail-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:auto;padding-top:20px}.result-detail-actions button{display:inline-flex;align-items:center;justify-content:center;gap:7px;white-space:nowrap}.result-detail-actions .result-action-icon{width:15px;height:15px}
.result-preview-dialog{z-index:260}
@media(max-width:760px){.result-preview-dialog{width:100vw;max-width:100vw;height:100dvh;max-height:100dvh;border-radius:0}.result-preview-image-wrap{flex-basis:min(100%,calc(100dvh - 220px));height:min(100%,calc(100dvh - 220px))}}
@media(max-width:850px){.result-detail-view{left:0}.result-detail-layout{grid-template-columns:1fr}.result-detail-canvas{height:62vh;padding:52px 32px 20px}.result-detail-image-button img{max-height:55vh}.result-detail-panel{height:38vh;margin-top:0;border-left:0;border-top:1px solid #292b30;padding:18px 20px}.result-panel-thumbs{padding:10px 0}.result-panel-thumbs button{width:56px;height:56px;flex-basis:56px}.result-detail-actions{margin-top:10px}.result-detail-pager{right:6px}}


.result-detail-canvas{overflow:hidden}
.result-detail-image-button{position:relative;z-index:1}
.result-detail-backdrop{position:absolute;inset:0;z-index:0;width:100%;height:100%;max-width:none!important;max-height:none!important;object-fit:cover;filter:blur(28px) brightness(.56);opacity:.78;transform:scale(1.12);pointer-events:none;user-select:none}
.result-preview-image-wrap>img:not(.result-preview-backdrop){position:relative;z-index:1}
.result-preview-image-wrap>.result-preview-backdrop{position:absolute;inset:0;z-index:0;width:100%;height:100%;max-width:none!important;max-height:none!important;object-fit:cover;filter:blur(28px) brightness(.56);opacity:.78;transform:scale(1.12);pointer-events:none;user-select:none}

.generation-images figure>button{position:relative;min-height:0;background:#101114}
.generation-images .generation-image-backdrop{position:absolute;inset:0;z-index:0;width:100%;height:100%;max-width:none;max-height:none;object-fit:cover;filter:blur(24px) brightness(.58);opacity:.8;transform:scale(1.1);pointer-events:none;user-select:none}
.generation-images .generation-image-original{position:relative;z-index:1}

.generation-images .generation-image-original{display:block;width:100%;height:100%;max-height:none;object-fit:cover}
.generation-images .generation-image-backdrop,.result-detail-backdrop,.result-preview-backdrop{display:none!important}
.result-detail-image-button{height:auto;min-height:0}
.result-detail-image-button img{max-width:100%;max-height:calc(100vh - 110px);width:auto;height:auto;object-fit:contain}

.generation-images .generation-image-original{position:relative;z-index:1;display:block;width:100%;height:100%;max-height:none;object-fit:cover}
.generation-images .generation-image-backdrop,.result-detail-backdrop,.result-preview-backdrop{display:none!important}
.result-detail-image-button{height:100%;min-height:0}
.result-detail-image-button img{max-width:100%;max-height:calc(100vh - 110px);width:auto;height:auto;object-fit:contain}@media (max-width:800px) {
  .generation-images { grid-template-columns:repeat(2,minmax(0,1fr)); gap:2px; }
  .generation-images figure:nth-child(4n+1),.generation-images figure:nth-child(4n),.generation-images figure:nth-child(4n+1) .generation-image-shell,.generation-images figure:nth-child(4n) .generation-image-shell { border-radius:0; }
  .generation-images figure:nth-child(2n+1),.generation-images figure:nth-child(2n+1) .generation-image-shell { border-top-left-radius:2px; border-bottom-left-radius:2px; }
  .generation-images figure:last-child,.generation-images figure:nth-child(2n),.generation-images figure:last-child .generation-image-shell,.generation-images figure:nth-child(2n) .generation-image-shell { border-top-right-radius:2px; border-bottom-right-radius:2px; }
}
@media (max-width:760px) { .generation-images { width:100%; margin:0; } }

/* recovery picker on generation cards */
.generation-card .task-recovery-inline{margin:0 16px 16px;padding:12px;border-radius:12px;background:rgba(255,185,169,.08)}
.generation-card .recovery-file-choice{display:inline-flex;align-items:center;justify-content:center;min-height:36px;padding:8px 14px;border-radius:10px;background:#3dd9c8;color:#102326;font-weight:600}
