﻿:root {
  --bg: #f6f7fa;
  --rail: #eef1f7;
  --panel: #ffffff;
  --panel-soft: #fafbfd;
  --ink: #1c1d1f;
  --muted: #737780;
  --muted-2: #9a9fa8;
  --line: #e7e9ef;
  --brand: #246bfe;
  --brand-2: #11a69a;
  --accent: #ff7f45;
  --shadow-card: 0 12px 26px rgba(31, 42, 68, 0.05);
  --shadow-pop: 0 16px 36px rgba(31, 42, 68, 0.1);
}

/* Keep developed image-tool assets complete: no stretching and no crop. */
.tool-card[data-tool-refactored="true"] .tool-thumb img,
body.tool-page.workbench-kit .kit-upload-thumb img,
body.tool-page.workbench-kit .kit-main-card img,
body.tool-page.workbench-kit .kit-context-card img,
body.tool-page.workbench-kit .kit-result-thumb img,
body.tool-page.workbench-kit .kit-output-results-mode .kit-context-card img,
body.tool-page.workbench-kit.kit-fission-mode .kit-main-card > img,
body.tool-page.workbench-kit.kit-fission-mode .kit-context-card img,
body.tool-page.workbench-kit.kit-demo-composite-mode .kit-main-card > img {
  object-fit: contain !important;
  object-position: center center;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

img {
  max-width: 100%;
}

.app-shell {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  min-height: 100vh;
}

.side-rail {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 20px;
  height: 100vh;
  padding: 20px 8px;
  background: #eef1f7;
  border-right: 1px solid #e4e7ef;
}

.rail-logo {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin: 0 auto;
  text-decoration: none;
}

.brand-logo-img {
  display: block;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  filter: drop-shadow(0 8px 16px rgba(9, 12, 18, 0.16));
}

.rail-logo img {
  width: 36px;
  height: 36px;
}

.rail-nav {
  display: grid;
  align-content: start;
  gap: 8px;
}

.rail-nav a,
.rail-more {
  display: grid;
  justify-items: center;
  gap: 5px;
  min-height: 66px;
  padding: 8px 2px;
  border-radius: 8px;
  color: #343941;
  font-size: 12px;
  line-height: 1.2;
  text-decoration: none;
}

.rail-nav a.active,
.rail-nav a:hover,
.rail-more:hover {
  background: #e0e5ef;
  color: #111827;
}

.rail-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: #1f2937;
  font-size: 21px;
  line-height: 1;
}

.rail-icon svg {
  display: block;
  width: 23px;
  height: 23px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-main {
  min-width: 0;
}

body.tool-page {
  height: 100vh;
  overflow: hidden;
  background: #f6f7fa;
}

body.tool-page .side-rail,
body.tool-page .topbar,
body.tool-page .tool-directory,
body.tool-page .jobs-band,
body.tool-page .assets-band {
  display: none;
}

body.tool-page .app-shell {
  display: block;
  min-height: 100vh;
}

body.tool-page .app-main,
body.tool-page .page-shell {
  width: 100%;
  height: 100vh;
  margin: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 25;
  display: grid;
  grid-template-columns: minmax(280px, 440px) minmax(0, 1fr);
  align-items: center;
  min-height: 60px;
  padding: 10px 48px;
  background: rgba(246, 247, 250, 0.94);
  backdrop-filter: blur(14px);
}

.search-wrap {
  position: relative;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 320px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid #dde2eb;
  border-radius: 8px;
  background: #f9fafc;
  color: var(--muted-2);
}

.search-box:focus-within {
  border-color: #c9d7f8;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(36, 107, 254, 0.08);
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
}

.search-popover {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 40;
  display: none;
  grid-template-columns: 1fr;
  gap: 14px;
  width: 310px;
  padding: 14px 16px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-pop);
}

.search-wrap:focus-within .search-popover,
.search-wrap:hover .search-popover {
  display: grid;
}

.search-popover div {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  row-gap: 10px;
  column-gap: 12px;
}

.search-popover strong {
  grid-column: 1 / -1;
  color: rgba(21, 23, 26, 0.48);
  font-size: 14px;
  font-weight: 700;
}

.search-popover button {
  min-height: 26px;
  border: 0;
  background: transparent;
  color: #2f343d;
  padding: 0;
  text-align: left;
  white-space: nowrap;
}

.search-popover button:hover {
  color: var(--brand);
}

.search-popover button.disabled,
.search-popover button:disabled {
  color: #a6abb4;
  cursor: not-allowed;
}

.search-popover button.disabled:hover,
.search-popover button:disabled:hover {
  color: #a6abb4;
}

.account {
  position: relative;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.model-badge {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.notice-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: #1d232d;
  font-size: 17px;
}

.notice-btn b {
  position: absolute;
  top: -6px;
  right: -5px;
  min-width: 17px;
  height: 17px;
  border-radius: 999px;
  background: #ff4a58;
  color: #fff;
  padding: 0 4px;
  font-size: 10px;
  line-height: 17px;
}

.topbar .model-badge {
  overflow: hidden;
}

.credit-btn,
.vip-btn,
.avatar,
.icon-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.credit-btn,
.vip-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 34px;
  border-radius: 8px;
  padding: 0 13px;
  font-size: 13px;
  white-space: nowrap;
}

.credit-btn img {
  width: 16px;
  height: 16px;
}

.credit-icon-img,
.vip-icon-img {
  display: block;
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.credit-icon {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff0de;
  color: #e37b28;
  font-size: 10px;
  font-weight: 800;
}

.vip-btn {
  display: none;
  border-color: #ffd1b6;
  background: #ffd9c3;
  color: #5c321a;
  font-weight: 700;
}

.avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  background: #20242c;
  color: #fff;
  font-weight: 700;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar span {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-weight: 800;
}

.avatar-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.avatar.is-guest {
  background: #f3f5f9;
  color: #1f2937;
}

.account-menu[hidden],
.account-dialog[hidden] {
  display: none;
}

.account-menu {
  position: fixed;
  z-index: 260;
  display: grid;
  gap: 4px;
  width: 156px;
  padding: 8px;
  border: 1px solid #e6eaf2;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(17, 24, 39, 0.14);
}

.account-menu button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #20242c;
  padding: 0 10px;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
}

.account-menu button:hover {
  background: #f3f6fb;
}

.account-menu [data-account-action="logout"] {
  color: #d92d20;
}

.account-dialog {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: grid;
  place-items: center;
  padding: 24px;
}

.account-card {
  width: min(420px, calc(100vw - 32px));
}

.account-balance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  margin: 12px 0 16px;
  padding: 12px 14px;
  border: 1px solid #e7ebf3;
  border-radius: 8px;
  background: #f7f9fc;
  color: #667085;
  font-size: 13px;
}

.account-balance strong {
  color: #1f2937;
  font-size: 22px;
}

.auth-dialog[hidden] {
  display: none;
}

.auth-dialog {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 20, 28, 0.22);
  backdrop-filter: blur(3px);
}

.auth-card {
  position: relative;
  z-index: 1;
  width: min(420px, calc(100vw - 32px));
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(20, 27, 42, 0.18);
}

.auth-card h2 {
  margin: 0 0 8px;
  font-size: 24px;
  line-height: 1.2;
}

.auth-note {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 14px;
}

.auth-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: #353b45;
  font-size: 22px;
  line-height: 1;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-form label {
  display: grid;
  gap: 7px;
  color: #373b43;
  font-size: 14px;
  font-weight: 700;
}

.auth-form [hidden] {
  display: none !important;
}

.auth-form input {
  width: 100%;
  height: 44px;
  padding: 0 13px;
  border: 1px solid #dfe3eb;
  border-radius: 9px;
  background: #fafbfd;
  color: var(--ink);
  outline: none;
}

.auth-form input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(36, 107, 254, 0.12);
}

.auth-code-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 8px;
}

.auth-code-control button {
  height: 44px;
  border: 1px solid #dfe3eb;
  border-radius: 9px;
  background: #f3f6fb;
  color: #1f2937;
  font-weight: 800;
}

.auth-code-control button:disabled {
  color: #98a2b3;
  cursor: wait;
}

.auth-error {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff1f1;
  color: #c62828;
  font-size: 13px;
}

.auth-error.is-success {
  background: #eef8f1;
  color: #287b3e;
}

.auth-submit {
  height: 44px;
  border: 0;
  border-radius: 9px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
}

.auth-submit:disabled {
  opacity: 0.65;
  cursor: wait;
}

.auth-switch {
  width: 100%;
  margin-top: 14px;
  border: 0;
  background: transparent;
  color: var(--brand);
  font-weight: 700;
}

.page-shell {
  width: auto;
  margin: 32px 48px 64px;
}

.tool-directory {
  display: grid;
  gap: 34px;
  scroll-margin-top: 92px;
}

body.home-page .side-rail {
  top: 0;
}

body.home-page .topbar {
  top: 0;
  grid-template-columns: 1fr;
}

body.agent-workspace-page {
  height: 100vh;
  overflow: hidden;
  background: #f6f8fb;
}

body.agent-workspace-page .side-rail,
body.agent-workspace-page .topbar,
body.agent-workspace-page .tool-directory,
body.agent-workspace-page .workspace-dock,
body.agent-workspace-page .jobs-band,
body.agent-workspace-page .assets-band {
  display: none;
}

body.agent-workspace-page .app-shell {
  display: block;
  min-height: 100vh;
}

body.agent-workspace-page .app-main,
body.agent-workspace-page .page-shell {
  width: 100%;
  height: 100vh;
  margin: 0;
}

body.home-page .search-wrap,
body.home-page .directory-head,
body.home-page .category-tabs,
body.home-page .tool-list,
body.home-page .jobs-band,
body.home-page .assets-band,
body.tools-page .home-agent,
body.tools-page .home-quick-actions,
body.tools-page .jobs-band,
body.tools-page .assets-band,
body.tools-page .agent-tab {
  display: none;
}

body.home-page .tool-directory {
  min-height: calc(100vh - 124px);
  align-content: center;
}

body.home-page .home-agent {
  padding: 0 0 36px;
}

body.tools-page .tool-directory {
  gap: 18px;
}

body.tools-page {
  height: 100vh;
  overflow: hidden;
}

body.tools-page .app-shell,
body.tools-page .app-main {
  height: 100vh;
}

body.tools-page .app-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

body.tools-page .page-shell {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  margin-bottom: 0;
}

body.tools-page .tool-directory {
  grid-template-rows: auto auto minmax(0, 1fr);
  height: 100%;
  min-height: 0;
}

body.tools-page .category-tabs {
  position: relative;
  top: auto;
  margin-bottom: 0;
}

body.tools-page .tool-list {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  padding: 0 8px max(320px, calc(100vh - 280px)) 0;
  scrollbar-gutter: stable;
}

body.tools-page .tool-list::-webkit-scrollbar {
  width: 8px;
}

body.tools-page .tool-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #d7dde8;
}

body.tools-page .tool-section {
  scroll-margin-top: 0;
}

.home-agent-workspace {
  display: none;
}

body.agent-workspace-page .home-agent-workspace {
  display: grid;
  grid-template-columns: 420px minmax(0, 1fr);
  width: 100%;
  height: 100vh;
  background:
    radial-gradient(circle, #dfe5ef 1px, transparent 1px) 0 0 / 20px 20px,
    #f7f9fc;
}

.home-agent-chat {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 0;
  height: 100vh;
  border-right: 1px solid #e4e8f0;
  background: #fff;
  box-shadow: 12px 0 32px rgba(31, 42, 68, 0.04);
}

.home-agent-chat-head {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 18px 18px 14px;
}

.home-agent-chat-head a,
.home-agent-chat-head button {
  display: inline-grid;
  place-items: center;
  height: 34px;
  border: 1px solid #e3e8f0;
  border-radius: 8px;
  background: #fff;
  color: #23272f;
  text-decoration: none;
  font-weight: 800;
}

.home-agent-chat-head a {
  width: 34px;
  font-size: 26px;
  line-height: 1;
}

.home-agent-chat-head button {
  padding: 0 12px;
}

.home-agent-chat-head h1 {
  margin: 0;
  color: #202329;
  font-size: 18px;
  line-height: 1.3;
}

.home-agent-chat-head p {
  margin: 2px 0 0;
  color: #8d96a5;
  font-size: 12px;
}

.home-agent-workspace-log {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 18px 18px;
}

.home-agent-workspace-log:empty::before {
  content: "上传图片或直接描述需求，开始后右侧会展示输入图和生成结果。";
  display: block;
  margin-top: 18px;
  color: #9aa3af;
  font-size: 14px;
  line-height: 1.6;
}

.home-agent-workspace-log .message {
  max-width: 94%;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.7;
}

.home-agent-workspace-log .message.agent {
  border: 0;
  background: #f5f6f8;
}

.home-agent-workspace-log .message.user {
  justify-self: stretch;
  background: #f1f3f6;
  color: #202329;
}

.home-agent-workspace-log .message.is-analysis p::before {
  content: "图片分析";
  display: block;
  margin-bottom: 8px;
  color: #667085;
  font-size: 12px;
  font-weight: 800;
}

.home-agent-workspace-log .message.is-analysis {
  max-height: 260px;
  overflow-y: auto;
}

.home-agent-workspace-form {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid #e9edf3;
  background: #fff;
}

.home-agent-workspace-form textarea {
  width: 100%;
  min-height: 92px;
  max-height: 180px;
  border: 1px solid #e1e6ee;
  border-radius: 10px;
  outline: 0;
  resize: vertical;
  padding: 13px 14px;
  color: #202329;
  font-size: 14px;
  line-height: 1.6;
}

.home-agent-actions.workspace {
  height: auto;
  padding: 0;
}

.home-agent-canvas {
  display: grid;
  grid-template-rows: 62px minmax(0, 1fr) 118px;
  min-width: 0;
  height: 100vh;
}

.home-agent-canvas-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
}

.home-agent-canvas-head strong {
  overflow: hidden;
  color: #202329;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-agent-canvas-head div {
  display: flex;
  gap: 8px;
}

.home-agent-canvas-head button {
  height: 34px;
  border: 1px solid #e1e6ee;
  border-radius: 8px;
  background: #fff;
  color: #202329;
  padding: 0 12px;
  font-weight: 800;
}

.home-agent-canvas-head button:disabled {
  opacity: 0.45;
}

.home-agent-canvas-stage {
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 18px 42px;
}

.home-agent-canvas-empty,
.home-agent-canvas-main,
.home-agent-canvas-grid {
  width: min(840px, 86%);
}

.home-agent-canvas-empty {
  display: grid;
  place-items: center;
  min-height: 360px;
  border: 1px dashed #d7dde8;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  color: #98a2b3;
  text-align: center;
}

.home-agent-canvas-main {
  display: grid;
  place-items: center;
  min-height: 0;
}

.home-agent-canvas-main img {
  display: block;
  max-width: min(880px, 100%);
  max-height: calc(100vh - 230px);
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 22px 60px rgba(31, 42, 68, 0.12);
  object-fit: contain;
}

.home-agent-canvas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.home-agent-canvas-grid img {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 38px rgba(31, 42, 68, 0.08);
  object-fit: contain;
}

.home-agent-canvas-loading {
  display: grid;
  place-items: center;
  gap: 14px;
  width: min(640px, 78%);
  min-height: 420px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 18px 46px rgba(31, 42, 68, 0.08);
  color: #667085;
}

.home-agent-canvas-loading span {
  width: 30px;
  height: 30px;
  border: 3px solid #d8e3f4;
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.home-agent-canvas-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  overflow-x: auto;
  padding: 16px 24px 24px;
}

.home-agent-canvas-thumb {
  position: relative;
  flex: 0 0 88px;
  height: 88px;
  border: 2px solid transparent;
  border-radius: 10px;
  background: #fff;
  padding: 4px;
  box-shadow: 0 8px 22px rgba(31, 42, 68, 0.08);
}

.home-agent-canvas-thumb.active {
  border-color: var(--brand);
}

.home-agent-canvas-thumb img {
  width: 100%;
  height: 100%;
  border-radius: 7px;
  object-fit: cover;
}

.home-agent-canvas-thumb span {
  position: absolute;
  left: 6px;
  top: 6px;
  border-radius: 999px;
  background: rgba(20, 24, 31, 0.72);
  color: #fff;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 800;
}

.home-agent {
  display: grid;
  justify-items: center;
  gap: 18px;
  padding: 52px 0 22px;
}

.home-agent h1 {
  margin: 0;
  color: #202329;
  font-size: 34px;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: 0;
  text-align: center;
}

.home-agent-upload,
.home-agent-send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #2a2e36;
  white-space: nowrap;
}

.home-agent-box {
  display: flex;
  flex-direction: column;
  width: min(1180px, 100%);
  min-height: 262px;
  border: 1px solid #dfe4ec;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(31, 42, 68, 0.08);
}

.home-agent-log {
  display: grid;
  gap: 10px;
  max-height: 150px;
  overflow-y: auto;
  padding: 18px 22px 0;
}

.home-agent-log:empty {
  display: none;
}

.home-agent-log .message {
  max-width: 78%;
  margin: 0;
}

.home-agent-log .message.user {
  justify-self: end;
}

.home-agent-log .message.image-message img {
  max-width: 220px;
}

.home-agent-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 18px 12px;
}

.home-agent-attachments[hidden] {
  display: none;
}

.home-agent-attachment {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 8px;
  max-width: 260px;
  min-height: 46px;
  padding: 6px;
  border: 1px solid #e3e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

.home-agent-attachment img,
.home-agent-file-icon {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  object-fit: cover;
  background: #eef2f7;
}

.home-agent-file-icon {
  display: grid;
  place-items: center;
  color: #657080;
  font-size: 10px;
  font-weight: 900;
}

.home-agent-attachment strong,
.home-agent-attachment small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-agent-attachment strong {
  color: #242830;
  font-size: 12px;
}

.home-agent-attachment small {
  color: #8f97a5;
  font-size: 11px;
}

.home-agent-attachment button {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: #e7ecf3;
  color: #2a2e36;
  font-size: 15px;
  line-height: 1;
}

#homeAgentInput {
  flex: 1 1 160px;
  width: 100%;
  min-height: 156px;
  padding: 24px 26px 12px;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.6;
}

#homeAgentInput::placeholder {
  color: #a5abb5;
}

.home-agent-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 68px;
  padding: 12px 16px 16px;
}

.home-agent-tools,
.home-agent-submit {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.home-agent-upload,
.home-agent-send {
  min-height: 40px;
  padding: 0 14px;
}

.home-agent-ratio-select {
  position: relative;
  flex: 0 0 auto;
}

.home-agent-ratio-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 86px;
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  background: #f1f3f0;
  color: #282c33;
  padding: 0 14px;
  font-size: 16px;
  font-weight: 800;
}

.home-agent-ratio-toggle[aria-expanded="true"] span:last-child {
  transform: rotate(180deg);
}

.home-agent-ratio-toggle span:last-child {
  transition: transform 0.16s ease;
}

.home-agent-ratio-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 25;
  display: grid;
  min-width: 210px;
  overflow: hidden;
  border: 1px solid #e5e8ee;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 46px rgba(31, 42, 68, 0.14);
}

.home-agent-ratio-menu[hidden] {
  display: none;
}

.home-agent-ratio-menu button {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 56px;
  border: 0;
  background: #fff;
  color: #20242b;
  padding: 0 48px 0 28px;
  font-size: 19px;
  text-align: left;
}

.home-agent-ratio-menu button.active {
  background: #f0f2f5;
  font-weight: 800;
}

.home-agent-ratio-menu button.active::after {
  content: "✓";
  position: absolute;
  right: 26px;
  color: #20242b;
  font-size: 22px;
  font-weight: 900;
}

.home-agent-send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 999px;
  background: #262a31;
  color: #fff;
  padding: 0 20px;
  font-weight: 800;
}

.home-quick-actions {
  display: grid;
  grid-template-columns: minmax(240px, 360px) minmax(240px, 360px) minmax(420px, 1fr);
  gap: 16px;
  align-items: stretch;
  margin-bottom: 4px;
}

.home-create-card,
.home-tool-grid {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(31, 42, 68, 0.04);
}

.home-create-card {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 164px;
  padding: 26px 28px;
  cursor: pointer;
}

.home-create-card strong {
  font-size: 18px;
  line-height: 1.3;
}

.home-create-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.home-create-card span {
  align-self: end;
  color: #272b32;
  font-size: 24px;
}

.home-tool-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(112px, 1fr));
  overflow: hidden;
}

.home-tool-grid button {
  min-height: 82px;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
  color: #242830;
  padding: 0 22px;
  text-align: left;
  font-weight: 800;
  white-space: nowrap;
}

.home-tool-grid button:nth-child(5n) {
  border-right: 0;
}

.home-tool-grid button:nth-last-child(-n + 5) {
  border-bottom: 0;
}

.home-agent-upload:hover,
.home-agent-ratio-toggle:hover,
.home-agent-ratio-menu button:hover,
.home-agent-attachment button:hover,
.home-create-card:hover,
.home-tool-grid button:hover {
  border-color: #cfd8eb;
  background: #f8faff;
}

.directory-head {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  min-height: 1px;
  margin-bottom: 0;
}

.directory-head > div {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.directory-head h1 {
  margin: 0 0 8px;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: 0;
}

.directory-head p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.directory-head span {
  display: none;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.category-tabs {
  position: sticky;
  top: 100px;
  z-index: 20;
  display: flex;
  gap: 24px;
  overflow-x: auto;
  margin-bottom: 16px;
  padding: 0 0 14px;
  background: rgba(246, 247, 250, 0.94);
  backdrop-filter: blur(12px);
  scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar,
.search-popover::-webkit-scrollbar,
.main-nav::-webkit-scrollbar,
.hot-board::-webkit-scrollbar {
  display: none;
}

.category-tab {
  position: relative;
  flex: 0 0 auto;
  min-height: 32px;
  border: 0;
  background: transparent;
  color: #60656f;
  padding: 0;
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
}

.category-tab.active {
  color: var(--ink);
}

.category-tab.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -8px;
  height: 3px;
  border-radius: 999px;
  background: var(--ink);
}

.agent-tab {
  color: var(--brand);
}

.tool-list {
  display: grid;
  gap: 50px;
}

.tool-section {
  scroll-margin-top: 124px;
}

.tool-section-title {
  margin: 0 0 16px;
  color: #999fa8;
  font-size: 16px;
  font-weight: 800;
}

.tool-section:first-child .tool-section-title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.tool-card {
  position: relative;
  display: grid;
  grid-template-rows: 165px 114px;
  width: 100%;
  min-height: 279px;
  min-width: 0;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 16px;
  background: #f6f7fa;
  color: inherit;
  padding: 0;
  text-align: left;
  text-decoration: none;
  box-shadow: none;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.tool-card:hover {
  box-shadow: var(--shadow-card);
  transform: translateY(-1px);
}

.tool-card.disabled {
  border-color: #eceff4;
  background: #f3f5f8;
  color: #9aa1ad;
  cursor: not-allowed;
  filter: grayscale(0.92);
  opacity: 0.58;
}

.tool-card.disabled:hover {
  box-shadow: none;
  transform: none;
}

.tool-card.active {
  border-color: transparent;
}

.tool-thumb {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--thumb-bg, #eaf4ff);
}

.tool-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tool-card[data-tool-refactored="true"] .tool-thumb {
  background: #f4f6fa;
}

.tool-card[data-tool-refactored="true"] .tool-thumb img {
  position: absolute;
  inset: 0;
  box-sizing: border-box;
  object-fit: contain;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  padding: 4px;
}

.tool-card.disabled .tool-thumb img {
  opacity: 0.7;
}

.tool-thumb::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 46px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.62));
}

.tool-icon {
  position: absolute;
  left: 20px;
  top: 136px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: #2f343d;
  box-shadow: 0 8px 18px rgba(31, 42, 68, 0.08);
  font-size: 18px;
  font-weight: 900;
}

.tool-icon-img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.tool-icon svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tool-status {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 3;
  display: inline-grid;
  place-items: center;
  min-width: 58px;
  min-height: 26px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #7d858f;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
}

.tool-copy {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 30px 20px 14px;
}

.tool-copy strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  line-height: 22px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool-copy p {
  display: -webkit-box;
  min-height: 38px;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.tool-card.disabled .tool-icon,
.tool-card.disabled .tool-copy strong,
.tool-card.disabled .tool-copy p {
  color: #9aa1ad;
}

.tool-tags {
  display: none;
  gap: 5px;
  overflow: hidden;
}

.tool-tags span {
  flex: 0 0 auto;
  border-radius: 6px;
  background: #f2f5fa;
  color: #7b8290;
  padding: 4px 7px;
  font-size: 11px;
}

.empty-state {
  min-height: 160px;
  display: grid;
  place-items: center;
  border: 1px dashed #d7dde8;
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
}

.workspace-dock {
  display: none;
}

body.agent-open:not(.tool-page)::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(18, 24, 38, 0.22);
}

body.agent-open:not(.tool-page) .workspace-dock {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 80;
  display: grid;
  width: min(640px, calc(100vw - 32px));
  height: min(720px, calc(100vh - 32px));
  margin: 0;
  overflow: hidden;
  transform: translate(-50%, -50%);
}

body.agent-open:not(.tool-page) .workspace-panel {
  display: none;
}

body.agent-open:not(.tool-page) .agent-panel {
  position: static;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  height: 100%;
  max-height: none;
  border: 0;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 18px 50px rgba(31, 42, 68, 0.16);
}

body.agent-open:not(.tool-page) .agent-close {
  display: inline-grid;
  place-items: center;
}

body.tool-page .workspace-dock {
  position: relative;
  display: grid;
  grid-template-rows: 54px minmax(0, 1fr);
  width: 100%;
  height: 100vh;
  margin: 0;
  overflow: hidden;
  scroll-margin-top: 0;
}

.workspace-panel,
.agent-panel,
.jobs-band,
.assets-band {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.workspace-panel {
  min-width: 0;
  padding: 22px;
}

body.tool-page .workspace-panel {
  min-height: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #f6f7fa;
  padding: 0;
}

body.tool-page .agent-panel {
  display: none;
}

body.tool-page.agent-open::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(18, 24, 38, 0.18);
}

body.tool-page.agent-open .agent-panel {
  position: fixed;
  top: 70px;
  right: 16px;
  bottom: 16px;
  z-index: 80;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  width: min(420px, calc(100vw - 32px));
  max-height: none;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(31, 42, 68, 0.18);
}

body.tool-page.agent-open .agent-close {
  display: inline-grid;
  place-items: center;
}

.editor-topbar {
  display: none;
}

body.tool-page .editor-topbar {
  position: relative;
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 54px;
  padding: 0 16px 0 20px;
  border-bottom: 1px solid #e8ebf2;
  background: #fff;
}

.editor-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin-right: 10px;
  color: #17181a;
  font-size: 16px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.editor-brand img {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.editor-tool-name {
  color: #30343b;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}

.editor-topbar > .record-btn {
  margin-left: auto;
}

.editor-header-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: #f3f5f7;
  color: #17181a;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.editor-history-actions {
  display: inline-flex;
  gap: 10px;
  margin-left: 26px;
  padding-left: 18px;
  border-left: 1px solid #e8ebf2;
}

.editor-history-actions button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #8c929d;
  font-size: 22px;
}

.editor-account {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 0;
}

.editor-download {
  background: #cfe3ff;
  color: #fff;
}

.workspace-header,
.workspace-actions,
.stage-toolbar,
.tool-icons,
.panel-title,
.section-head,
.agent-head {
  display: flex;
  align-items: center;
}

.workspace-header {
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

body.tool-page .workspace-header {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.tool-variant {
  display: none;
}

body.workbench-kit .kit-workbench,
body.workbench-tryon .tryon-workbench,
body.workbench-upload .upload-workbench,
body.workbench-batch .batch-workbench,
body.workbench-collage .collage-workbench,
body.workbench-design .design-workbench {
  display: grid;
}

body.workbench-kit .editor-grid,
body.workbench-tryon .editor-grid,
body.workbench-upload .editor-grid,
body.workbench-batch .editor-grid,
body.workbench-collage .editor-grid,
body.workbench-design .editor-grid {
  display: none;
}

body.workbench-kit .workspace-panel,
body.workbench-tryon .workspace-panel,
body.workbench-upload .workspace-panel,
body.workbench-batch .workspace-panel,
body.workbench-collage .workspace-panel,
body.workbench-design .workspace-panel {
  background: #f6f7fa;
}

body.workbench-kit .editor-tool-name,
body.workbench-tryon .editor-tool-name,
body.workbench-upload .editor-tool-name,
body.workbench-batch .editor-tool-name,
body.workbench-collage .editor-tool-name,
body.workbench-design .editor-tool-name {
  display: inline-flex;
  align-items: center;
  height: 34px;
  margin-right: 12px;
  color: #17181a;
  font-size: 16px;
  font-weight: 700;
}

.kit-workbench {
  grid-template-columns: 88px 400px minmax(0, 1fr);
  height: calc(100vh - 54px);
}

.kit-rail,
.tryon-rail {
  display: grid;
  align-content: start;
  gap: 12px;
  border-right: 1px solid #e8ebf2;
  background: #fff;
}

.kit-rail {
  padding: 16px 8px;
}

.kit-rail button,
.tryon-rail button {
  display: grid;
  justify-items: center;
  gap: 6px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #17181a;
  padding: 8px 2px;
  font-size: 12px;
  line-height: 1.3;
}

.kit-rail button {
  min-height: 74px;
}

.kit-rail button span,
.tryon-rail button span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  font-size: 20px;
}

.kit-rail button.active,
.kit-rail button:hover,
.tryon-rail button.active,
.tryon-rail button:hover {
  background: #eef5ff;
  font-weight: 800;
}

.kit-rail button.disabled,
.kit-rail button:disabled,
.tryon-rail button.disabled,
.tryon-rail button:disabled {
  color: #a6abb4;
  cursor: not-allowed;
  filter: grayscale(1);
  opacity: 0.45;
}

.kit-rail button.disabled:hover,
.kit-rail button:disabled:hover,
.tryon-rail button.disabled:hover,
.tryon-rail button:disabled:hover {
  background: transparent;
  font-weight: 400;
}

.kit-config {
  height: calc(100vh - 54px);
  overflow: auto;
  padding: 22px 20px 0;
  border-right: 1px solid #e8ebf2;
  background: #fff;
}

.kit-upload-block,
.kit-form-block {
  margin-bottom: 24px;
}

.kit-upload-block h3,
.kit-form-block h3 {
  margin: 0 0 12px;
  color: #17181a;
  font-size: 15px;
}

.kit-upload-card {
  display: grid;
  place-items: center;
  height: 104px;
  border: 1px dashed #d9dde7;
  border-radius: 12px;
  background: #fff;
}

.kit-upload-card button {
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: #f3f5f7;
  color: #17181a;
  padding: 0 16px;
  font-weight: 700;
}

.kit-upload-card p {
  margin: 0;
  color: #8c929d;
  font-size: 13px;
}

.kit-select-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.kit-select-grid label {
  display: grid;
  gap: 6px;
  color: #60656f;
  font-size: 12px;
}

.kit-select-grid select,
.kit-form-block textarea {
  border: 1px solid #e4e7ef;
  border-radius: 12px;
  background: #f7f8fb;
  color: #17181a;
}

.kit-select-grid select {
  height: 40px;
  padding: 0 12px;
}

.kit-row-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kit-row-title button {
  border: 0;
  border-radius: 8px;
  background: #eef5ff;
  color: #3388ff;
  padding: 6px 10px;
  font-weight: 700;
}

.kit-form-block textarea {
  width: 100%;
  min-height: 160px;
  padding: 12px;
  resize: vertical;
}

.kit-option {
  display: grid;
  gap: 5px;
  width: 100%;
  min-height: 74px;
  margin-bottom: 10px;
  border: 1px solid #e4e7ef;
  border-radius: 12px;
  background: #fff;
  color: #17181a;
  padding: 12px 14px;
  text-align: left;
}

.kit-option.active {
  border-color: #3388ff;
  box-shadow: 0 0 0 1px #3388ff inset;
}

.kit-option span {
  color: #8c929d;
  font-size: 13px;
}

.kit-generate {
  position: sticky;
  bottom: 0;
  width: 100%;
  height: 44px;
  border-radius: 8px;
}

.kit-analysis {
  width: 100%;
  height: 34px;
  margin: 0 0 12px;
  border-color: #dfe7f4;
  background: #fff;
  color: #17181a;
}

.kit-stage {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 18px;
  min-width: 0;
  height: calc(100vh - 54px);
  overflow: hidden;
  background: #f6f7fa;
  padding: 40px;
  text-align: center;
}

.kit-stage h1 {
  margin: 0;
  color: #17181a;
  font-size: 40px;
}

.kit-stage p {
  margin: 0 0 34px;
  color: #6d747e;
  font-size: 16px;
}

.kit-preview-board {
  position: relative;
  display: grid;
  grid-template-columns: 1.2fr 0.85fr;
  gap: 18px;
  width: min(760px, 70vw);
  min-height: 360px;
  overflow: hidden;
  border-radius: 24px;
  background: #fff;
  padding: 28px;
  box-shadow: 0 12px 40px rgba(31, 42, 68, 0.06);
}

.kit-preview-board img {
  width: 100%;
  height: 100%;
  border-radius: 18px;
  object-fit: cover;
}

.kit-preview-main {
  object-position: center;
}

.tryon-workbench {
  grid-template-columns: 82px minmax(0, 1fr);
  height: calc(100vh - 54px);
  background: #f6f7fa;
}

.tryon-rail {
  padding: 22px 8px;
}

.tryon-rail button {
  min-height: 68px;
}

.tryon-stage {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 0;
  overflow: hidden;
}

.tryon-tabs {
  position: absolute;
  left: 50%;
  top: 170px;
  display: grid;
  grid-template-columns: repeat(3, 136px);
  gap: 0;
  padding: 3px;
  border-radius: 10px;
  background: #edf0f5;
  transform: translateX(-50%);
}

.tryon-tabs button {
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #60656f;
  font-weight: 700;
}

.tryon-tabs button.active {
  background: #fff;
  color: #17181a;
  box-shadow: 0 2px 8px rgba(31, 42, 68, 0.08);
}

.tryon-upload-card {
  display: grid;
  justify-items: center;
  align-content: center;
  width: 512px;
  min-height: 480px;
  border-radius: 24px;
  background: #fff;
  padding: 46px 40px;
  text-align: center;
}

.tryon-upload-card img {
  width: 126px;
  height: 126px;
  margin-bottom: 26px;
  border-radius: 16px;
  object-fit: cover;
}

.tryon-upload-card h1 {
  margin: 0 0 16px;
  font-size: 20px;
}

.tryon-upload-card p {
  margin: -8px 0 18px;
  color: #8c929d;
}

.try-samples.inline {
  position: static;
  margin-top: 24px;
  transform: none;
}

body.workbench-tryon .try-samples.inline,
body.workbench-upload .try-samples.inline {
  left: auto;
  top: auto;
  grid-column: auto;
  margin-inline: auto;
}

.upload-workbench {
  height: calc(100vh - 54px);
  background: #fff;
}

.upload-tool-page {
  display: grid;
  align-content: center;
  justify-items: center;
  width: 100%;
  height: 100%;
  padding: 60px 40px 80px;
  text-align: center;
}

.upload-tool-page h1 {
  margin: 0 0 12px;
  color: #17181a;
  font-size: 44px;
  line-height: 1.2;
}

.upload-tool-page > p {
  margin: 0 0 44px;
  color: #555d68;
  font-size: 18px;
}

.upload-tool-content {
  display: grid;
  grid-template-columns: 450px 600px;
  gap: 40px;
  align-items: stretch;
}

.upload-demo-panel,
.upload-tool-panel {
  height: 450px;
  overflow: hidden;
  border-radius: 24px;
}

.upload-demo-panel {
  background: #f6f7fa;
}

.upload-demo-panel img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload-tool-panel {
  display: grid;
  place-items: center;
  align-content: center;
  border: 1px dashed #8c929d;
  background: #fff;
}

.upload-tool-actions {
  display: grid;
  justify-items: center;
  gap: 14px;
  width: 240px;
}

.upload-tool-actions .primary-action,
.upload-tool-actions .secondary-action {
  width: 240px;
  height: 52px;
  border-radius: 12px;
}

.upload-tool-actions .secondary-action {
  border-color: #dcdfe6;
  background: #fff;
  color: #17181a;
}

.upload-folder-link {
  border: 0;
  background: transparent;
  color: #60656f;
}

.batch-workbench,
.collage-workbench,
.design-workbench {
  height: calc(100vh - 54px);
  min-height: 0;
  background: #f6f7fa;
}

.batch-editor-shell {
  display: grid;
  height: 100%;
  background: #f3f5f8;
}

.batch-stage {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 34px;
  min-width: 0;
  min-height: 0;
  padding: 40px;
}

.batch-headline {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  color: #17181a;
  font-size: 18px;
  line-height: 1.3;
}

.batch-headline strong {
  font-weight: 700;
}

.batch-headline span {
  font-size: 18px;
  font-weight: 800;
}

.batch-headline em {
  color: #60656f;
  font-size: 14px;
  font-style: normal;
}

.batch-upload-card {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 14px;
  width: min(620px, 60vw);
  min-height: 420px;
  border: 1px dashed #c9ced8;
  border-radius: 16px;
  background: #fff;
  padding: 40px;
  text-align: center;
}

.batch-upload-visual {
  display: grid;
  place-items: center;
  width: 142px;
  height: 110px;
  overflow: hidden;
  border-radius: 14px;
  background: #eef1f6;
}

.batch-upload-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.batch-upload-card p {
  margin: 10px 0 0;
  color: #17181a;
  font-size: 16px;
  font-weight: 700;
}

.batch-upload-card small {
  color: #8c929d;
}

.collage-editor-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 300px;
  height: 100%;
  min-height: 0;
  background: #eff1f5;
}

.collage-left-panel,
.collage-right-panel {
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 0;
  overflow: auto;
  background: #fff;
  padding: 20px;
}

.collage-left-panel {
  border-right: 1px solid #e8ebf2;
}

.collage-right-panel {
  border-left: 1px solid #e8ebf2;
}

.collage-layouts {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.collage-layouts button,
.collage-right-panel button,
.design-setting-list button {
  min-height: 40px;
  border: 1px solid #e4e7ef;
  border-radius: 8px;
  background: #fff;
  color: #17181a;
  padding: 0 12px;
  text-align: left;
}

.collage-layouts button.active {
  border-color: #3388ff;
  background: #eef5ff;
  color: #246bfe;
  font-weight: 800;
}

.collage-canvas-stage {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  padding: 40px;
}

.collage-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  width: min(720px, 58vw);
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 12px solid #fff;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(31, 42, 68, 0.08);
}

.collage-board img,
.collage-board > div {
  min-width: 0;
  min-height: 0;
  border-radius: 8px;
}

.collage-board img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.collage-board > div {
  display: grid;
  place-items: center;
  align-content: center;
  background: #f7f8fb;
  padding: 24px;
  text-align: center;
}

.collage-board h1 {
  margin: 0 0 12px;
  font-size: 34px;
}

.collage-board p,
.collage-right-panel p {
  margin: 0;
  color: #60656f;
}

.collage-right-panel label {
  display: grid;
  gap: 8px;
  color: #60656f;
  font-size: 13px;
}

.design-editor-shell {
  display: grid;
  grid-template-columns: 72px 260px minmax(0, 1fr) 292px;
  height: 100%;
  min-height: 0;
  background: #eef0f4;
}

.design-left-rail {
  display: grid;
  align-content: start;
  gap: 8px;
  border-right: 1px solid #e6e9f0;
  background: #fff;
  padding: 12px 8px;
}

.design-left-rail button {
  display: grid;
  place-items: center;
  min-height: 54px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #343941;
  font-size: 12px;
}

.design-left-rail button.active,
.design-left-rail button:hover {
  background: #eef5ff;
  color: #246bfe;
  font-weight: 800;
}

.design-resource-panel,
.design-right-panel {
  min-height: 0;
  overflow: auto;
  background: #fff;
  padding: 16px;
}

.design-resource-panel {
  border-right: 1px solid #e6e9f0;
}

.design-resource-panel h3,
.design-right-panel h3 {
  margin: 18px 0 8px;
  font-size: 16px;
}

.design-resource-panel p,
.design-right-panel p {
  margin: 0 0 16px;
  color: #60656f;
  font-size: 13px;
  line-height: 1.55;
}

.design-resource-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.design-resource-grid img {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  object-fit: cover;
  background: #f3f5f8;
}

.design-canvas-stage {
  display: grid;
  grid-template-rows: 44px minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  padding: 18px 24px 28px;
}

.design-doc-title {
  display: flex;
  align-items: center;
  color: #343941;
  font-size: 14px;
  font-weight: 700;
}

.design-canvas {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  width: min(560px, 52vw);
  aspect-ratio: 4 / 5;
  margin: auto;
  overflow: hidden;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(31, 42, 68, 0.12);
  text-align: center;
}

.design-canvas img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.design-canvas::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(0, 0, 0, 0.18));
}

.design-canvas h1,
.design-canvas p {
  position: relative;
  z-index: 1;
  max-width: 82%;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.26);
}

.design-canvas h1 {
  margin: 0 0 10px;
  font-size: 38px;
  line-height: 1.15;
}

.design-canvas p {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.design-right-panel {
  border-left: 1px solid #e6e9f0;
}

.design-setting-list {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h2,
h3,
p {
  margin-top: 0;
}

.workspace-header h2,
.agent-head h2,
.section-head h2 {
  margin-bottom: 0;
  font-size: 20px;
}

.workspace-header p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.workspace-actions {
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: max-content;
  padding: 8px 12px;
  border-radius: 8px;
  background: #f4f8f6;
  color: #1a806f;
  font-size: 13px;
  font-weight: 700;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-2);
}

.primary-action,
.secondary-action,
.ghost-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 16px;
  font-weight: 700;
  white-space: nowrap;
}

.primary-action {
  background: var(--brand);
  color: #fff;
}

.primary-action.compact {
  min-height: 38px;
  padding-inline: 14px;
}

.secondary-action {
  background: #edf4ff;
  color: var(--brand);
}

.ghost-action {
  background: #fff;
  color: #303846;
  border-color: var(--line);
}

.editor-grid {
  display: grid;
  grid-template-columns: minmax(240px, 330px) minmax(0, 1fr);
  gap: 18px;
}

body.tool-page .editor-grid {
  position: relative;
  display: grid;
  grid-template-columns: 432px minmax(0, 1fr);
  height: calc(100vh - 54px);
  gap: 0;
}

body.tool-page:not(.has-upload) .editor-grid {
  display: block;
}

.input-column,
.canvas-column {
  display: grid;
  gap: 16px;
  align-content: start;
}

body.tool-page .input-column {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: 72px 360px;
  gap: 0;
  min-height: 0;
  overflow: hidden;
  border-right: 1px solid #e8ebf2;
  background: #fff;
}

body.tool-page:not(.has-upload) .input-column {
  display: block;
  width: 100%;
  height: calc(100vh - 54px);
  border-right: 0;
  background: transparent;
}

body.tool-page .canvas-column {
  position: relative;
  min-width: 0;
  height: calc(100vh - 54px);
  overflow: hidden;
  background: #f6f7fa;
}

body.tool-page:not(.has-upload) .canvas-column {
  display: none;
}

.editor-tool-menu {
  display: none;
}

body.tool-page .editor-tool-menu {
  display: grid;
  align-content: start;
  gap: 6px;
  width: 72px;
  padding: 16px 8px;
  border-right: 1px solid #eef0f5;
  background: #fff;
}

body.tool-page:not(.has-upload) .editor-tool-menu {
  display: none;
}

.editor-tool-menu button {
  display: grid;
  justify-items: center;
  gap: 6px;
  min-height: 62px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #17181a;
  padding: 7px 2px;
  font-size: 13px;
}

.editor-tool-menu button span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  font-size: 18px;
  font-weight: 800;
}

.editor-tool-menu button.active,
.editor-tool-menu button:hover {
  background: #eef5ff;
}

.upload-zone,
.settings-panel,
.preview-stage,
.quality-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.upload-zone {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 246px;
  padding: 24px;
  text-align: center;
  border-style: dashed;
}

body.tool-page .upload-zone {
  grid-column: 2;
  align-content: center;
  min-height: auto;
  margin: 16px 16px 10px;
  padding: 16px;
  border-color: #e8ebf2;
  border-radius: 16px;
  background: #f8f9fb;
}

body.tool-page:not(.has-upload) .upload-zone {
  position: absolute;
  left: 50%;
  top: 42%;
  width: 580px;
  height: 380px;
  min-height: 380px;
  margin: 0;
  border: 0;
  border-radius: 24px;
  background: #fff;
  padding: 54px 40px;
  text-align: center;
  transform: translate(-50%, -50%);
}

.upload-zone.drag-over {
  border-color: var(--brand);
  background: #f2f7ff;
}

.upload-zone input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.upload-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-bottom: 12px;
  border-radius: 8px;
  background: #fff;
  color: var(--brand);
  font-size: 30px;
  box-shadow: inset 0 0 0 1px var(--line);
}

body.tool-page .upload-icon {
  width: 74px;
  height: 64px;
  margin-bottom: 12px;
  background: transparent;
  box-shadow: none;
}

body.tool-page:not(.has-upload) .upload-icon {
  width: 128px;
  height: 110px;
  margin-bottom: 18px;
}

.upload-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.upload-zone h3 {
  margin-bottom: 8px;
  font-size: 18px;
}

body.tool-page .upload-zone h3 {
  margin-bottom: 6px;
  color: #17181a;
  font-size: 14px;
  font-weight: 600;
}

body.tool-page:not(.has-upload) .upload-zone h3 {
  margin-bottom: 14px;
  font-size: 18px;
  font-weight: 500;
}

.upload-zone p {
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

body.tool-page .upload-zone p {
  margin-bottom: 12px;
  color: rgba(23, 24, 26, 0.35);
  font-size: 12px;
}

.upload-actions {
  display: inline-flex;
  justify-content: center;
  gap: 8px;
}

body.tool-page .upload-actions .primary-action,
body.tool-page .upload-actions .secondary-action {
  width: 140px;
  min-height: 40px;
  border-radius: 10px;
}

body.tool-page .upload-actions .secondary-action {
  border-color: #dcdfe6;
  background: #fff;
  color: #17181a;
}

.try-samples {
  display: none;
}

body.tool-page .try-samples {
  grid-column: 2;
  display: grid;
  justify-items: center;
  gap: 10px;
  margin: 0 16px 14px;
  color: rgba(23, 24, 26, 0.45);
  font-size: 12px;
}

body.tool-page:not(.has-upload) .try-samples {
  position: absolute;
  left: 50%;
  top: calc(42% + 244px);
  margin: 0;
  transform: translateX(-50%);
}

.try-samples > span {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.try-samples > span::before,
.try-samples > span::after {
  content: "";
  width: 58px;
  height: 1px;
  background: #e8ebf2;
}

.try-samples div {
  display: flex;
  gap: 8px;
}

.try-samples button,
.scene-gallery button {
  border: 0;
  background: transparent;
  padding: 0;
}

.try-samples img {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
}

body.tool-page.workbench-tryon:not(.has-upload) .try-samples.inline,
body.tool-page.workbench-upload:not(.has-upload) .try-samples.inline,
body.tool-page.workbench-tryon .try-samples.inline,
body.tool-page.workbench-upload .try-samples.inline {
  position: static;
  left: auto;
  top: auto;
  grid-column: auto;
  margin: 24px auto 0;
  transform: none;
}

.settings-panel,
.quality-panel {
  padding: 16px;
}

body.tool-page .settings-panel {
  grid-column: 2;
  height: 100%;
  min-height: 0;
  overflow: auto;
  padding: 16px;
  border: 0;
  border-radius: 0;
  background: #fff;
}

body.tool-page:not(.has-upload) .settings-panel {
  display: none;
}

.editor-panel-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-bottom: 16px;
  padding: 3px;
  border-radius: 10px;
  background: #f3f5f7;
}

.editor-panel-tabs button {
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #60656f;
  font-weight: 700;
}

.editor-panel-tabs button.active {
  background: #fff;
  color: #17181a;
  box-shadow: 0 2px 8px rgba(31, 42, 68, 0.08);
}

.panel-search {
  margin-bottom: 12px;
}

.panel-search input {
  width: 100%;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: #f3f4f7;
  padding: 0 12px;
}

.scene-filter-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 16px;
  scrollbar-width: none;
}

.scene-filter-row::-webkit-scrollbar {
  display: none;
}

.scene-filter-row button {
  flex: 0 0 auto;
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  background: #fff;
  color: #17181a;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px #edf0f5;
}

.scene-filter-row button.active {
  background: #eef5ff;
  color: #3388ff;
}

.scene-gallery {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.scene-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
}

.scene-row-head button {
  color: #8c929d;
  font-size: 12px;
}

.scene-gallery > div:last-child {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.scene-gallery img {
  display: block;
  width: 76px;
  aspect-ratio: 1;
  border-radius: 10px;
  object-fit: cover;
}

.panel-title {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-title h3 {
  margin-bottom: 0;
  font-size: 16px;
}

.settings-hint {
  margin: -6px 0 12px;
  color: rgba(23, 24, 26, 0.45);
  font-size: 12px;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
}

.settings-panel label {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  color: #333b48;
  font-size: 13px;
  font-weight: 700;
}

.settings-panel label span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.settings-panel select,
.chat-form input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
}

.settings-panel input[type="range"] {
  accent-color: var(--brand);
}

.check-row {
  grid-template-columns: auto 1fr;
  align-items: center;
  font-weight: 500;
}

.check-row input {
  width: 17px;
  height: 17px;
  accent-color: var(--brand);
}

.generate-bar {
  width: 100%;
  height: 48px;
  margin-top: 6px;
  border-radius: 12px;
}

.preview-stage {
  padding: 14px;
}

body.tool-page .preview-stage {
  position: relative;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.stage-toolbar {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

body.tool-page .stage-toolbar {
  position: absolute;
  left: 50%;
  top: 12px;
  z-index: 8;
  justify-content: center;
  width: auto;
  margin: 0;
  padding: 0;
  transform: translateX(-50%);
}

.segmented {
  display: inline-grid;
  grid-template-columns: repeat(3, 72px);
  gap: 4px;
  padding: 4px;
  border-radius: 8px;
  background: #eef1f5;
}

body.tool-page .segmented {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 36px;
  padding: 3px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(31, 42, 68, 0.08);
}

.segmented button {
  flex: 0 0 auto;
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

body.tool-page .segmented button {
  min-height: 30px;
  border-radius: 15px;
  padding: 0 12px;
  font-size: 13px;
}

.segmented button.active {
  background: #fff;
  color: var(--brand);
  box-shadow: 0 1px 6px rgba(34, 43, 60, 0.08);
}

.tool-icons {
  gap: 8px;
}

body.tool-page .stage-toolbar .tool-icons {
  display: none;
}

.preview-frame {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 470px;
  overflow: hidden;
  border-radius: 8px;
  background:
    linear-gradient(45deg, #edf0f5 25%, transparent 25%),
    linear-gradient(-45deg, #edf0f5 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #edf0f5 75%),
    linear-gradient(-45deg, transparent 75%, #edf0f5 75%);
  background-color: #fff;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
}

body.tool-page .preview-frame {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(58vw, calc(100vh - 166px));
  min-height: 0;
  aspect-ratio: 1;
  border-radius: 0;
  transform: translate(-50%, -50%);
  box-shadow: 0 12px 48px rgba(31, 42, 68, 0.08);
}

.preview-frame img {
  display: block;
  width: min(74%, 620px);
  max-height: 430px;
  object-fit: contain;
  filter: drop-shadow(0 22px 34px rgba(21, 28, 42, 0.18));
}

body.tool-page .preview-frame img {
  width: min(62%, 520px);
  max-height: 74%;
  filter: drop-shadow(0 20px 32px rgba(21, 28, 42, 0.18));
}

.preview-frame.after img {
  filter: saturate(1.08) contrast(1.04) drop-shadow(0 24px 34px rgba(21, 28, 42, 0.18));
}

.preview-frame.fit-mode img {
  width: min(92%, 760px);
  max-height: 520px;
}

.preview-frame.grid-mode {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 22px;
}

.preview-frame.grid-mode img {
  width: 100%;
  max-height: 200px;
  border-radius: 8px;
  background: #fff;
}

.processing-mask {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  align-content: center;
  gap: 14px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--brand);
  backdrop-filter: blur(8px);
}

.processing-mask.active {
  display: grid;
}

.processing-mask span {
  width: 44px;
  height: 44px;
  border: 4px solid rgba(36, 107, 254, 0.15);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.processing-mask small {
  color: #657083;
  font-weight: 700;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.prompt-drawer {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

body.tool-page .prompt-drawer {
  position: absolute;
  left: 24px;
  right: 292px;
  bottom: 14px;
  z-index: 8;
  margin: 0;
  border-radius: 10px;
  opacity: 0.94;
}

.prompt-drawer summary {
  padding: 10px 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  list-style-position: inside;
  cursor: pointer;
}

.prompt-drawer pre {
  max-height: 180px;
  margin: 0;
  overflow: auto;
  border-top: 1px solid var(--line);
  padding: 12px;
  color: #303846;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.result-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

body.tool-page .result-strip {
  position: absolute;
  left: 50%;
  bottom: 16px;
  z-index: 9;
  display: flex;
  width: auto;
  margin: 0;
  padding: 6px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 8px 22px rgba(31, 42, 68, 0.1);
  transform: translateX(-50%);
}

.result-thumb {
  border: 2px solid transparent;
  border-radius: 8px;
  background: #fff;
  padding: 6px;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.result-thumb.active {
  border-color: var(--brand);
}

.result-thumb:hover {
  transform: translateY(-1px);
}

.result-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
}

body.tool-page .result-thumb {
  width: 46px;
  height: 46px;
  padding: 3px;
}

.metric-list {
  display: grid;
  gap: 12px;
}

body.tool-page .quality-panel {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 10;
  width: 260px;
  min-height: 160px;
  padding: 16px;
  border: 0;
  border-radius: 12px;
  background: #fff;
}

.metric-item {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.delivery-note {
  margin: 14px 0 0;
  color: #657083;
  font-size: 13px;
  line-height: 1.55;
}

.audit-box {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #dce6f9;
  border-radius: 8px;
  background: #f7faff;
}

.audit-box strong {
  display: block;
  margin-bottom: 6px;
  color: #3265c9;
}

.audit-box p {
  margin: 0;
  color: #4d5a6d;
  font-size: 13px;
  line-height: 1.55;
}

progress {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: #e7ecf3;
}

progress::-webkit-progress-bar {
  background: #e7ecf3;
}

progress::-webkit-progress-value {
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
}

.agent-panel {
  position: sticky;
  top: 88px;
  display: grid;
  grid-template-rows: auto auto minmax(280px, calc(100vh - 390px)) auto;
  gap: 14px;
  max-height: calc(100vh - 110px);
  padding: 18px;
}

.agent-head {
  justify-content: space-between;
  gap: 12px;
}

.agent-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.agent-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.agent-live {
  padding: 6px 9px;
  border-radius: 8px;
  background: #e9f9f5;
  color: #0f8d77;
  font-size: 12px;
  font-weight: 800;
}

.agent-close {
  display: none;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #303846;
  font-size: 18px;
  line-height: 1;
}

.agent-suggestions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.agent-suggestions button {
  border: 1px solid #dce6f9;
  border-radius: 8px;
  background: #f7faff;
  color: #3265c9;
  padding: 8px 10px;
  font-size: 12px;
}

.chat-log {
  display: grid;
  align-content: start;
  gap: 10px;
  overflow: auto;
  padding: 12px;
  border-radius: 8px;
  background: #f7f8fb;
}

.message {
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.55;
}

.message p {
  margin: 0;
}

.message.agent {
  background: #fff;
  border: 1px solid var(--line);
}

.message.user {
  justify-self: end;
  background: var(--brand);
  color: #fff;
}

.message.image-message {
  display: grid;
  gap: 10px;
  max-width: min(360px, 100%);
}

.message.image-message img {
  width: 100%;
  border-radius: 8px;
  background: #f3f5f7;
  object-fit: contain;
}

.message-actions {
  display: flex;
  justify-content: flex-end;
}

.message-actions button {
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: #1f2937;
  color: #fff;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 700;
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
}

.chat-form button {
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
}

body.generation-record-page {
  overflow: hidden;
  background: #f5f6fa;
}

body.tool-page.generation-record-page .workspace-panel {
  height: calc(100vh - 54px);
  overflow-x: auto;
  overflow-y: auto;
  background: #f5f6fa;
}

.generation-records {
  min-width: 1040px;
  min-height: calc(100vh - 54px);
  padding: 28px 24px 40px;
  color: #25272d;
}

.record-toolbar {
  display: grid;
  grid-template-columns: auto minmax(240px, 320px) 1fr;
  align-items: center;
  gap: 14px;
  margin-bottom: 26px;
}

.record-tabs {
  display: inline-flex;
  gap: 0;
  overflow: hidden;
  border-radius: 8px;
  background: #eceff4;
  padding: 2px;
}

.record-tabs button {
  height: 34px;
  min-width: 96px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #4b5563;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 700;
}

.record-tabs button.active {
  background: #fff;
  color: #25272d;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

.record-search {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  height: 38px;
  border: 1px solid #dfe4ec;
  border-radius: 8px;
  background: #fff;
  padding: 0 12px;
  color: #6b7280;
}

.record-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #25272d;
  font-size: 14px;
}

.record-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.record-actions button,
.record-group-actions button {
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: #fff;
  color: #25272d;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 700;
}

.record-actions label,
.record-group-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #25272d;
  font-weight: 700;
}

.generation-record-list {
  display: grid;
  gap: 28px;
}

.record-group {
  display: grid;
  gap: 18px;
}

.record-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.record-group-actions {
  display: flex;
  gap: 8px;
}

.record-group-actions button:last-child,
.record-actions [data-record-bulk-download] {
  background: #1f2937;
  color: #fff;
}

.record-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 320px));
  gap: 16px;
  align-items: start;
}

.record-image-card {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  border: 1px solid #e5e9f0;
  border-radius: 8px;
  background: #fff;
}

.record-image-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.record-image-card.source img {
  object-fit: contain;
}

.record-image-card > span {
  position: absolute;
  left: 10px;
  top: 10px;
  z-index: 2;
  border-radius: 6px;
  background: rgba(31, 41, 55, 0.5);
  color: #fff;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 700;
}

.record-image-card.result {
  cursor: zoom-in;
}

.record-image-card.result button {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: rgba(17, 24, 39, 0.9);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
}

.record-empty {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 260px;
  border: 1px dashed #d7dde8;
  border-radius: 8px;
  background: #fff;
  color: #667085;
}

.record-load-more {
  display: grid;
  place-items: center;
  min-height: 56px;
  border-radius: 12px;
  background: #fff;
  color: #6b7280;
  font-size: 14px;
  font-weight: 700;
}

.record-load-more[data-record-load-more] {
  cursor: pointer;
}

.record-load-more.done {
  background: transparent;
  color: #9aa1ad;
}

.jobs-band,
.assets-band {
  margin-top: 18px;
  padding: 20px;
}

.section-head {
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.job-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.job-card {
  min-height: 132px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.job-card strong {
  display: block;
  margin-bottom: 8px;
}

.job-card p {
  min-height: 40px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.job-status {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 6px;
  background: #f1f4f9;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.job-status.running {
  background: #edf4ff;
  color: var(--brand);
}

.job-status.done {
  background: #e9f9f5;
  color: #0f8d77;
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.asset-card {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 126px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.asset-card img {
  width: 96px;
  height: 96px;
  border-radius: 8px;
  object-fit: cover;
  background: #f1f4f9;
}

.asset-card strong {
  display: block;
  margin-bottom: 8px;
}

.asset-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

@media (max-width: 1580px) {
  .tool-grid {
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  }
}

@media (max-width: 1320px) {
  .tool-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }

  .home-quick-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-tool-grid {
    grid-column: 1 / -1;
  }

  body:not(.tool-page) .workspace-dock {
    grid-template-columns: 1fr;
  }

  .agent-panel {
    position: static;
    grid-template-rows: auto auto 320px auto;
    max-height: none;
  }
}

@media (max-width: 1080px) {
  .tool-grid {
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  }

  .home-agent {
    padding-top: 34px;
  }

  .home-agent h1 {
    font-size: 30px;
  }

  .home-tool-grid {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
  }

  .home-tool-grid button:nth-child(5n) {
    border-right: 1px solid var(--line);
  }

  .home-tool-grid button:nth-child(3n) {
    border-right: 0;
  }

  .home-tool-grid button:nth-last-child(-n + 5) {
    border-bottom: 1px solid var(--line);
  }

  .home-tool-grid button:nth-last-child(-n + 3) {
    border-bottom: 0;
  }

  body:not(.tool-page) .editor-grid {
    grid-template-columns: 1fr;
  }

  .job-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .asset-grid {
    grid-template-columns: 1fr;
  }

  body.tool-page .editor-grid {
    grid-template-columns: 360px minmax(0, 1fr);
  }

  body.tool-page .input-column {
    grid-template-columns: 64px 296px;
  }

  body.tool-page .editor-tool-menu {
    width: 64px;
    padding-inline: 6px;
  }

  body.tool-page .scene-gallery img {
    width: 62px;
  }

  body.tool-page .quality-panel {
    display: none;
  }

  body.tool-page .prompt-drawer {
    right: 24px;
  }

  .kit-workbench {
    grid-template-columns: 68px 400px minmax(0, 1fr);
  }

  .kit-preview-board {
    width: min(560px, 58vw);
    min-height: 300px;
  }

  .upload-tool-content {
    grid-template-columns: 360px 480px;
    gap: 28px;
  }

  .upload-demo-panel,
  .upload-tool-panel {
    height: 380px;
  }

  .collage-editor-shell {
    grid-template-columns: 220px minmax(0, 1fr) 240px;
  }

  .design-editor-shell {
    grid-template-columns: 64px 220px minmax(0, 1fr) 240px;
  }

  .collage-board {
    width: min(560px, 50vw);
  }

  .design-canvas {
    width: min(440px, 42vw);
  }
}

@media (max-width: 820px) {
  body.agent-workspace-page {
    height: auto;
    overflow: auto;
  }

  body.agent-workspace-page .app-main,
  body.agent-workspace-page .page-shell {
    height: auto;
    min-height: 100vh;
  }

  body.agent-workspace-page .home-agent-workspace {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
  }

  .home-agent-chat {
    height: auto;
    min-height: 540px;
    border-right: 0;
    border-bottom: 1px solid #e4e8f0;
  }

  .home-agent-canvas {
    grid-template-rows: auto minmax(420px, auto) auto;
    height: auto;
    min-height: 640px;
  }

  .home-agent-canvas-stage {
    padding: 16px;
  }

  .home-agent-canvas-empty,
  .home-agent-canvas-main,
  .home-agent-canvas-grid,
  .home-agent-canvas-loading {
    width: 100%;
  }

  .home-agent-canvas-main img {
    max-height: 520px;
  }

  .app-shell {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .side-rail {
    padding-inline: 6px;
  }

  body.home-page .side-rail {
    height: auto;
  }

  .topbar {
    grid-template-columns: 1fr;
    padding-inline: 16px;
  }

  .search-wrap {
    display: none;
  }

  .page-shell {
    margin: 18px 14px 44px;
  }

  .home-agent {
    padding-top: 18px;
  }

  .home-agent h1 {
    font-size: 26px;
  }

  .home-agent-box {
    min-height: 250px;
  }

  .home-agent-actions {
    align-items: stretch;
    flex-direction: column;
    height: auto;
  }

  .home-agent-tools,
  .home-agent-submit {
    justify-content: space-between;
  }

  .home-quick-actions {
    grid-template-columns: 1fr;
  }

  .home-tool-grid {
    grid-column: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-tool-grid button:nth-child(3n),
  .home-tool-grid button:nth-child(5n) {
    border-right: 1px solid var(--line);
  }

  .home-tool-grid button:nth-child(2n) {
    border-right: 0;
  }

  .home-tool-grid button:nth-last-child(-n + 3) {
    border-bottom: 1px solid var(--line);
  }

  .home-tool-grid button:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  body.tool-page {
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }

  body.tool-page .workspace-dock {
    min-height: 100vh;
    height: auto;
    overflow: visible;
  }

  body.tool-page .editor-topbar {
    gap: 6px;
    overflow-x: auto;
    padding-inline: 10px;
  }

  body.tool-page .editor-brand {
    min-width: max-content;
    margin-right: 4px;
  }

  body.tool-page .editor-history-actions {
    display: none;
  }

  body.tool-page .editor-grid,
  body.tool-page:not(.has-upload) .editor-grid {
    display: block;
    height: auto;
    min-height: calc(100vh - 54px);
  }

  body.tool-page .input-column,
  body.tool-page:not(.has-upload) .input-column {
    display: block;
    height: auto;
    border-right: 0;
    background: transparent;
    overflow: visible;
  }

  body.tool-page .editor-tool-menu {
    display: none;
  }

  body.tool-page .upload-zone,
  body.tool-page:not(.has-upload) .upload-zone {
    position: relative;
    left: auto;
    top: auto;
    width: min(100vw - 28px, 580px);
    height: auto;
    min-height: 300px;
    margin: 32px auto 18px;
    transform: none;
  }

  body.tool-page .try-samples,
  body.tool-page:not(.has-upload) .try-samples {
    position: relative;
    left: auto;
    top: auto;
    margin: 0 auto 18px;
    transform: none;
  }

  body.tool-page .settings-panel {
    width: min(100vw - 28px, 420px);
    height: auto;
    margin: 0 auto 18px;
    border-radius: 12px;
  }

  body.tool-page .canvas-column {
    height: 560px;
    min-height: 560px;
  }

  body.tool-page .preview-frame {
    width: min(82vw, 460px);
  }

  body.tool-page .result-strip {
    max-width: calc(100vw - 28px);
    overflow-x: auto;
  }

  body.tool-page .prompt-drawer {
    display: none;
  }

  body.workbench-kit .kit-workbench,
  body.workbench-tryon .tryon-workbench,
  body.workbench-upload .upload-workbench,
  body.workbench-batch .batch-workbench,
  body.workbench-collage .collage-workbench,
  body.workbench-design .design-workbench {
    display: block;
    height: auto;
    min-height: calc(100vh - 54px);
    overflow: visible;
  }

  .kit-rail,
  .tryon-rail {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    width: 100%;
    padding: 8px 12px;
    border-right: 0;
    border-bottom: 1px solid #e8ebf2;
  }

  .kit-rail button,
  .tryon-rail button {
    min-width: 82px;
    min-height: 48px;
  }

  .kit-config {
    width: min(100vw - 28px, 420px);
    height: auto;
    margin: 18px auto;
    border-right: 0;
    border-radius: 12px;
  }

  .kit-stage {
    height: auto;
    min-height: 520px;
    padding: 24px 14px 42px;
  }

  .kit-stage h1,
  .upload-tool-page h1 {
    font-size: 32px;
  }

  .kit-preview-board {
    grid-template-columns: 1fr;
    width: min(100vw - 28px, 520px);
  }

  .tryon-stage {
    min-height: 720px;
    padding: 32px 14px;
  }

  .tryon-tabs {
    position: static;
    width: min(100vw - 28px, 420px);
    grid-template-columns: repeat(3, 1fr);
    margin-bottom: 24px;
    transform: none;
  }

  .tryon-upload-card {
    width: min(100vw - 28px, 512px);
  }

  .upload-tool-page {
    height: auto;
    min-height: calc(100vh - 54px);
    padding: 42px 14px;
  }

  .upload-tool-content {
    grid-template-columns: 1fr;
    width: min(100vw - 28px, 600px);
  }

  .upload-demo-panel,
  .upload-tool-panel {
    width: 100%;
    height: 360px;
  }

  .batch-editor-shell,
  .collage-editor-shell,
  .design-editor-shell {
    display: block;
    height: auto;
    min-height: calc(100vh - 54px);
    overflow: visible;
  }

  .batch-stage {
    min-height: calc(100vh - 54px);
    padding: 32px 14px;
  }

  .batch-headline {
    flex-wrap: wrap;
    text-align: center;
  }

  .batch-upload-card {
    width: min(100vw - 28px, 620px);
  }

  .collage-left-panel,
  .collage-right-panel,
  .design-resource-panel,
  .design-right-panel {
    width: min(100vw - 28px, 560px);
    margin: 14px auto;
    border: 1px solid #e8ebf2;
    border-radius: 12px;
  }

  .collage-canvas-stage,
  .design-canvas-stage {
    min-height: 560px;
    padding: 24px 14px;
  }

  .collage-board,
  .design-canvas {
    width: min(100vw - 28px, 520px);
  }

  .design-left-rail {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid #e8ebf2;
    padding: 8px 12px;
  }

  .design-left-rail button {
    min-width: 64px;
  }

  .app-shell {
    display: block;
  }

  .side-rail {
    position: sticky;
    top: 0;
    height: auto;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: 1fr;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    overflow: hidden;
  }

  .rail-logo {
    margin: 0;
  }

  .rail-nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .rail-nav::-webkit-scrollbar {
    display: none;
  }

  .rail-nav a,
  .rail-more {
    grid-auto-flow: column;
    align-items: center;
    min-height: 42px;
    min-width: max-content;
    padding: 8px 10px;
    font-size: 12px;
  }

  .rail-icon {
    width: 18px;
    height: 18px;
    font-size: 16px;
  }

  .topbar {
    top: 59px;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px 12px;
  }

  .search-box {
    width: 100%;
  }

  .account {
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .account::-webkit-scrollbar {
    display: none;
  }

  body.agent-open::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 70;
    background: rgba(18, 24, 38, 0.36);
  }

  body.agent-open:not(.tool-page) .agent-panel {
    position: fixed;
    inset: 112px 12px 12px;
    z-index: 80;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    max-height: none;
    overflow: hidden;
    box-shadow: 0 18px 46px rgba(31, 42, 68, 0.18);
  }

  .agent-close {
    display: inline-grid;
    place-items: center;
  }

  .page-shell {
    width: min(100vw - 24px, 720px);
    margin: 20px auto 64px;
  }

  .directory-head {
    align-items: center;
    flex-direction: row;
  }

  .category-tabs {
    gap: 18px;
    top: 139px;
  }

  .category-tab {
    font-size: 15px;
  }

  .tool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .tool-card {
    width: 100%;
    grid-template-rows: 146px minmax(112px, auto);
  }

  body:not(.tool-page) .workspace-header,
  body:not(.tool-page) .stage-toolbar,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .workspace-actions {
    justify-content: flex-start;
  }

  .result-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .job-board {
    grid-template-columns: 1fr;
  }

  .asset-card {
    grid-template-columns: 80px minmax(0, 1fr);
  }

  .asset-card img {
    width: 80px;
    height: 80px;
  }
}

@media (max-width: 540px) {
  .topbar {
    top: 59px;
  }

  .model-badge {
    max-width: 160px;
  }

  .directory-head h1 {
    font-size: 24px;
  }

  .directory-head p {
    font-size: 13px;
    line-height: 1.55;
  }

  .home-agent {
    gap: 14px;
  }

  .home-agent h1 {
    font-size: 24px;
  }

  #homeAgentInput {
    min-height: 132px;
    padding: 18px 18px 8px;
  }

  .home-agent-tools {
    flex-wrap: wrap;
  }

  .home-agent-ratio-select {
    flex: 1 1 100%;
  }

  .home-agent-ratio-toggle {
    width: 100%;
  }

  .home-agent-ratio-menu {
    width: min(100%, 240px);
  }

  .home-agent-send {
    flex: 1 1 auto;
  }

  .home-tool-grid {
    grid-template-columns: 1fr;
  }

  .home-tool-grid button,
  .home-tool-grid button:nth-child(2n),
  .home-tool-grid button:nth-child(3n),
  .home-tool-grid button:nth-child(5n) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .home-tool-grid button:last-child {
    border-bottom: 0;
  }

  .search-popover {
    width: calc(100vw - 24px);
    grid-template-columns: 1fr;
  }

  .tool-grid {
    grid-template-columns: 1fr;
  }

  .tool-card {
    grid-template-rows: 184px minmax(106px, auto);
  }

  body:not(.tool-page) .workspace-panel {
    padding: 14px;
  }

  .preview-frame {
    min-height: 330px;
  }

  .segmented {
    width: 100%;
    grid-template-columns: repeat(3, 1fr);
  }
}

body.home-page .side-rail {
  top: 0;
}

body.home-page .topbar {
  top: 0;
}

body.tool-page.workbench-kit .editor-grid,
body.tool-page.workbench-tryon .editor-grid,
body.tool-page.workbench-upload .editor-grid,
body.tool-page.workbench-batch .editor-grid,
body.tool-page.workbench-collage .editor-grid,
body.tool-page.workbench-design .editor-grid {
  display: none;
}

body.tool-page.workbench-kit .kit-workbench,
body.tool-page.workbench-tryon .tryon-workbench,
body.tool-page.workbench-upload .upload-workbench,
body.tool-page.workbench-batch .batch-workbench,
body.tool-page.workbench-collage .collage-workbench,
body.tool-page.workbench-design .design-workbench {
  display: grid;
}

body.tool-page.workbench-kit {
  --kit-primary: #3388ff;
  --kit-primary-soft: #eef5ff;
  --kit-surface: #fff;
  --kit-shell-bg: #f3f5f7;
  --kit-control-bg: #f3f5f7;
  --kit-text: #1c1d1e;
  --kit-subtle-text: #616266;
  --kit-muted: #929499;
  --kit-disabled: #abadb2;
  --kit-border: #e5e7eb;
  --kit-upload-border: #eaedf2;
  --kit-control-border: #e2e8f0;
  --kit-active-bg: #eef5ff;
  --kit-panel-w: 400px;
  --kit-control-w: 359px;
  --kit-rail-w: 88px;
  --kit-rail-button-w: 87px;
  --kit-section-gap: 28px;
  --kit-title-gap: 12px;
  --kit-title-h: 20px;
  --kit-control-h: 34px;
  --kit-upload-h: 104px;
  --kit-thumb-size: 112px;
  --kit-radius-control: 8px;
  --kit-radius-card: 12px;
  --kit-generate-w: 367px;
  --kit-generate-h: 44px;
  background: var(--kit-shell-bg);
  overflow: hidden;
}

html.workbench-kit,
body.tool-page.workbench-kit {
  overflow-x: hidden;
}

body.tool-page.workbench-kit .app-shell,
body.tool-page.workbench-kit .app-main,
body.tool-page.workbench-kit .page-shell,
body.tool-page.workbench-kit .workspace-dock {
  width: max(1040px, 100vw);
  min-width: 1040px;
  height: 100vh;
}

body.tool-page.workbench-kit .workspace-dock {
  grid-template-rows: 54px minmax(0, calc(100vh - 54px));
  overflow: hidden;
  background: var(--kit-shell-bg);
}

body.tool-page.workbench-kit .editor-topbar {
  width: max(1040px, 100vw);
  min-width: 1040px;
  height: 54px;
  justify-content: flex-start;
  gap: 12px;
  padding: 0 18px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  background: var(--kit-surface);
  font-size: 14px;
}

body.tool-page.workbench-kit .editor-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: auto;
  min-width: 0;
  height: 40px;
  margin: 0;
  overflow: visible;
}

body.tool-page.workbench-kit .editor-brand img {
  display: block;
  width: 34px;
  height: 34px;
  max-width: 34px;
  border-radius: 10px;
}

body.tool-page.workbench-kit .editor-history-actions,
body.tool-page.workbench-kit .editor-download {
  display: none;
}

body.tool-page.workbench-kit .editor-brand span {
  display: inline;
  color: var(--kit-text);
  font-size: 16px;
  font-weight: 800;
}

body.tool-page.workbench-kit .editor-tool-name {
  display: inline-flex;
  align-items: center;
  height: 32px;
  margin-right: 0;
  color: #3d424d;
  font-size: 14px;
  font-weight: 700;
}

body.tool-page.workbench-kit .record-btn {
  width: 96px;
  height: 32px;
  justify-content: center;
  margin: 0 0 0 auto;
  border-radius: 8px;
  padding: 0 14px;
  background: var(--kit-control-bg);
  color: var(--kit-text);
  font-size: 14px;
  font-weight: 500;
}

body.tool-page.workbench-kit .avatar {
  width: 34px;
  height: 34px;
  border: 0;
  background: #f5f7f9;
}

body.tool-page.workbench-kit .editor-account {
  margin-left: 0;
}

body.tool-page.workbench-kit .workspace-panel {
  width: max(1040px, 100vw);
  height: calc(100vh - 54px);
  overflow: hidden;
  background: var(--kit-surface);
}

body.tool-page.workbench-kit.generation-record-page .workspace-panel {
  height: calc(100vh - 54px);
  overflow-x: auto;
  overflow-y: auto;
  background: #f5f6fa;
}

body.tool-page.workbench-kit .kit-workbench {
  grid-template-columns: var(--kit-rail-w) var(--kit-panel-w) minmax(572px, 1fr);
  width: max(1040px, 100vw);
  height: calc(100vh - 54px);
  background: var(--kit-surface);
}

body.tool-page.workbench-kit .kit-rail {
  width: var(--kit-rail-w);
  height: calc(100vh - 54px);
  gap: 8px;
  padding: 8px 0;
  border-right: 1px solid var(--kit-border);
  background: var(--kit-surface);
}

body.tool-page.workbench-kit .kit-rail button {
  width: var(--kit-rail-button-w);
  min-height: 66px;
  gap: 2px;
  border-radius: 0;
  padding: 8px 10px 10px;
  color: var(--kit-text);
  font-size: 12px;
  font-weight: 400;
}

body.tool-page.workbench-kit .kit-rail button.active,
body.tool-page.workbench-kit .kit-rail button:hover {
  background: transparent;
  font-weight: 600;
}

body.tool-page.workbench-kit .kit-rail button.disabled,
body.tool-page.workbench-kit .kit-rail button:disabled {
  color: #a6abb4;
  cursor: not-allowed;
  filter: grayscale(1);
  opacity: 0.42;
}

body.tool-page.workbench-kit .kit-rail button.disabled:hover,
body.tool-page.workbench-kit .kit-rail button:disabled:hover {
  background: transparent;
  font-weight: 400;
}

body.tool-page.workbench-kit .kit-rail button.active span {
  background: var(--kit-active-bg);
}

body.tool-page.workbench-kit .kit-rail button span {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: var(--kit-text);
  font-size: 18px;
}

body.tool-page.workbench-kit .kit-rail button .kit-rail-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: var(--kit-text);
  background: transparent;
}

body.tool-page.workbench-kit .kit-rail button .kit-rail-icon svg {
  display: block;
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
}

body.tool-page.workbench-kit .kit-rail button .kit-rail-label {
  display: block;
  width: 100%;
  height: auto;
  min-height: 14px;
  border-radius: 0;
  color: var(--kit-text);
  background: transparent;
  font-size: 12px;
  line-height: 1.15;
  text-align: center;
  white-space: nowrap;
  word-break: keep-all;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.tool-page.workbench-kit .kit-rail button.active .kit-rail-icon {
  background: var(--kit-active-bg);
}

body.tool-page.workbench-kit .kit-rail button.active .kit-rail-label {
  background: transparent;
}

body.tool-page.workbench-kit .kit-config {
  position: relative;
  width: var(--kit-panel-w);
  height: calc(100vh - 54px);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 20px 20px 88px;
  border-right: 1px solid var(--kit-border);
  background: var(--kit-surface);
  font-size: 14px;
}

body.kit-hide-analysis .kit-analysis-block {
  display: none !important;
}

body.tool-page.workbench-kit .kit-upload-block,
body.tool-page.workbench-kit .kit-form-block {
  margin-bottom: var(--kit-section-gap);
}

body.tool-page.workbench-kit .kit-upload-block h3,
body.tool-page.workbench-kit .kit-form-block h3 {
  display: flex;
  align-items: center;
  gap: 2px;
  height: var(--kit-title-h);
  margin: 0 0 var(--kit-title-gap);
  color: var(--kit-text);
  font-size: 14px;
  font-weight: 700;
}

body.tool-page.workbench-kit .kit-upload-block h3::after,
body.tool-page.workbench-kit .kit-row-title h3::after,
body.tool-page.workbench-kit #kitStructureTitle::after {
  content: none;
  display: none;
  place-items: center;
  width: 14px;
  height: 14px;
  border: 1px solid var(--kit-muted);
  border-radius: 50%;
  color: var(--kit-muted);
  font-size: 10px;
  font-weight: 700;
}

body.tool-page.workbench-kit .kit-upload-card {
  width: var(--kit-control-w);
  height: var(--kit-upload-h);
  gap: 10px;
  border: 2px dashed var(--kit-upload-border);
  border-radius: var(--kit-radius-card);
  background: transparent;
}

body.tool-page.workbench-kit .kit-upload-card.has-files {
  display: block;
  height: auto;
  min-height: 112px;
  border: 0;
  border-radius: 0;
}

body.tool-page.workbench-kit .kit-upload-empty {
  display: grid;
  place-items: center;
  gap: 10px;
  width: 100%;
  height: 100%;
}

body.tool-page.workbench-kit .kit-upload-list {
  display: flex;
  align-items: center;
  gap: 12px;
  width: var(--kit-control-w);
  min-height: var(--kit-thumb-size);
}

body.tool-page.workbench-kit .kit-upload-thumb,
body.tool-page.workbench-kit .kit-upload-add {
  display: grid;
  place-items: center;
  position: relative;
  width: var(--kit-thumb-size);
  height: var(--kit-thumb-size);
  border: 1px solid transparent;
  border-radius: var(--kit-radius-control);
  background: var(--kit-control-bg);
  color: var(--kit-text);
  padding: 0;
  font-size: 28px;
  font-weight: 400;
}

body.tool-page.workbench-kit .kit-upload-thumb.active {
  border-color: #dfe7f2;
  background: var(--kit-surface);
}

body.tool-page.workbench-kit .kit-upload-thumb img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

body.tool-page.workbench-kit .kit-fission-thumb {
  overflow: hidden;
}

body.tool-page.workbench-kit .kit-fission-remove,
body.tool-page.workbench-kit .kit-upload-remove {
  display: block;
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background: rgba(22, 24, 28, 0.76);
  color: transparent;
  font-size: 0;
  line-height: 0;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.2);
}

body.tool-page.workbench-kit .kit-fission-remove::before,
body.tool-page.workbench-kit .kit-fission-remove::after,
body.tool-page.workbench-kit .kit-upload-remove::before,
body.tool-page.workbench-kit .kit-upload-remove::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 11px;
  height: 2px;
  border-radius: 999px;
  background: #fff;
  transform-origin: center;
}

body.tool-page.workbench-kit .kit-fission-remove::before,
body.tool-page.workbench-kit .kit-upload-remove::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

body.tool-page.workbench-kit .kit-fission-remove::after,
body.tool-page.workbench-kit .kit-upload-remove::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

body.tool-page.workbench-kit .kit-fission-remove:hover,
body.tool-page.workbench-kit .kit-upload-remove:hover {
  background: rgba(220, 38, 38, 0.92);
}

body.tool-page.workbench-kit .kit-upload-thumb span {
  position: absolute;
  right: 6px;
  bottom: 6px;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(28, 29, 30, 0.72);
  color: #fff;
  font-size: 11px;
  line-height: 18px;
}

body.tool-page.workbench-kit .kit-upload-add:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

body.tool-page.workbench-kit .kit-upload-empty button {
  height: 32px;
  border-radius: var(--kit-radius-control);
  background: var(--kit-control-bg);
  color: var(--kit-text);
  padding: 0 14px;
  font-size: 14px;
  font-weight: 500;
}

body.tool-page.workbench-kit .kit-upload-card p {
  color: var(--kit-muted);
  font-size: 14px;
}

body.tool-page.workbench-kit .kit-fission-upload-block {
  margin-bottom: var(--kit-section-gap);
}

body.tool-page.workbench-kit .kit-split-upload {
  display: grid;
  gap: 12px;
  width: var(--kit-control-w);
}

body.tool-page.workbench-kit .kit-mini-upload {
  display: grid;
  gap: 10px;
  border: 1px solid var(--kit-upload-border);
  border-radius: var(--kit-radius-card);
  background: var(--kit-surface);
  padding: 12px;
}

body.tool-page.workbench-kit .kit-mini-upload h3 {
  margin: 0;
  color: var(--kit-text);
  font-size: 14px;
  font-weight: 700;
}

body.tool-page.workbench-kit .kit-mini-upload > button {
  width: max-content;
  height: 32px;
  border: 0;
  border-radius: var(--kit-radius-control);
  background: var(--kit-control-bg);
  color: var(--kit-text);
  padding: 0 14px;
  font-size: 14px;
  font-weight: 500;
}

body.tool-page.workbench-kit .kit-mini-upload-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 56px;
}

body.tool-page.workbench-kit .kit-mini-upload-list .kit-upload-thumb,
body.tool-page.workbench-kit .kit-mini-upload-list .kit-upload-add {
  width: 56px;
  height: 56px;
  min-height: 56px;
  font-size: 20px;
}

body.tool-page.workbench-kit .kit-mini-empty {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: var(--kit-radius-control);
  background: #f6f8fb;
  color: var(--kit-muted);
  font-size: 12px;
}

body.tool-page.workbench-kit.kit-fission-mode .kit-config {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding-top: 14px;
  padding-bottom: 0;
}

body.tool-page.workbench-kit.kit-product-mode .kit-config {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding-bottom: 0;
}

body.tool-page.workbench-kit.kit-fission-mode .kit-config::-webkit-scrollbar {
  width: 0;
}

body.tool-page.workbench-kit.kit-fission-mode .kit-fission-upload-block,
body.tool-page.workbench-kit.kit-fission-mode .kit-form-block {
  margin-bottom: 14px;
}

body.tool-page.workbench-kit.kit-hide-analysis .kit-analysis-block {
  display: none;
}

body.tool-page.workbench-kit.kit-fission-mode .kit-split-upload {
  gap: 12px;
}

body.tool-page.workbench-kit.kit-fission-mode .kit-mini-upload {
  display: grid;
  gap: 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

body.tool-page.workbench-kit.kit-fission-mode .kit-mini-upload h3 {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 18px;
  margin: 0;
  font-size: 14px;
}

body.tool-page.workbench-kit.kit-fission-mode .kit-mini-upload h3::after {
  display: none;
}

body.tool-page.workbench-kit.kit-fission-mode .kit-row-title h3::after,
body.tool-page.workbench-kit.kit-fission-mode #kitStructureTitle::after {
  display: none;
}

body.tool-page.workbench-kit.kit-fission-mode .kit-fission-source-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  width: var(--kit-control-w);
  height: 30px;
  border-radius: var(--kit-radius-control);
  background: var(--kit-control-bg);
  overflow: hidden;
}

body.tool-page.workbench-kit.kit-fission-mode .kit-fission-source-tabs button {
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--kit-subtle-text);
  font-size: 14px;
  font-weight: 500;
}

body.tool-page.workbench-kit.kit-fission-mode .kit-fission-source-tabs button.active {
  background: var(--kit-surface);
  color: var(--kit-text);
  box-shadow: inset 0 0 0 1px #dfe7f2;
}

body.tool-page.workbench-kit.kit-fission-mode .kit-fission-source-tabs button:disabled {
  color: var(--kit-disabled);
  cursor: not-allowed;
}

body.tool-page.workbench-kit.kit-fission-mode .kit-fission-upload-card {
  display: grid;
  place-items: center;
  position: relative;
  width: var(--kit-control-w);
  min-height: 82px;
  border: 2px dashed var(--kit-upload-border);
  border-radius: var(--kit-radius-card);
  background: transparent;
  padding: 12px;
  text-align: center;
}

body.tool-page.workbench-kit.kit-fission-mode .kit-fission-upload-card.has-files {
  place-items: stretch;
  min-height: 82px;
  border-style: solid;
  border-width: 1px;
  background: var(--kit-surface);
  text-align: left;
}

body.tool-page.workbench-kit.kit-fission-mode .kit-fission-upload-card > button {
  height: 32px;
  border: 0;
  border-radius: var(--kit-radius-control);
  background: var(--kit-control-bg);
  color: var(--kit-text);
  padding: 0 14px;
  font-size: 14px;
  font-weight: 500;
}

body.tool-page.workbench-kit.kit-fission-mode .kit-fission-upload-card > p {
  margin: 8px 0 0;
  color: var(--kit-muted);
  font-size: 13px;
  line-height: 18px;
}

body.tool-page.workbench-kit.kit-fission-mode .kit-fission-upload-card.has-files > button,
body.tool-page.workbench-kit.kit-fission-mode .kit-fission-upload-card.has-files > p {
  display: none;
}

body.tool-page.workbench-kit.kit-fission-mode .kit-mini-upload-list {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  width: 100%;
  min-height: 0;
  overflow: hidden;
}

body.tool-page.workbench-kit.kit-fission-mode .kit-fission-upload-card:not(.has-files) .kit-mini-upload-list {
  display: none;
}

body.tool-page.workbench-kit.kit-fission-mode .kit-mini-upload-list .kit-upload-thumb,
body.tool-page.workbench-kit.kit-fission-mode .kit-mini-upload-list .kit-upload-add {
  width: 58px;
  height: 58px;
  min-height: 58px;
  flex: 0 0 58px;
  font-size: 20px;
}

body.tool-page.workbench-kit.kit-fission-mode .kit-select-grid {
  display: block;
}

body.tool-page.workbench-kit.kit-fission-mode .kit-row-title {
  margin-bottom: 8px;
}

body.tool-page.workbench-kit.kit-fission-mode .kit-form-block textarea {
  min-height: 64px;
  height: 64px;
  border-color: var(--kit-control-border);
  border-radius: var(--kit-radius-card);
  padding: 8px 10px;
  line-height: 18px;
}

body.tool-page.workbench-kit.kit-fission-mode .kit-choice-groups {
  display: grid;
  gap: 12px;
  width: var(--kit-control-w);
}

body.tool-page.workbench-kit.kit-fission-mode .kit-choice-group {
  display: grid;
  gap: 8px;
  margin: 0;
  border: 0;
  padding: 0;
}

body.tool-page.workbench-kit.kit-fission-mode .kit-choice-group legend {
  margin: 0;
  padding: 0;
  color: var(--kit-muted);
  font-size: 14px;
  line-height: 20px;
}

body.tool-page.workbench-kit.kit-fission-mode .kit-choice-row {
  display: grid;
  gap: 12px;
}

body.tool-page.workbench-kit.kit-fission-mode .kit-choice-row.three {
  grid-template-columns: repeat(3, 1fr);
}

body.tool-page.workbench-kit.kit-fission-mode .kit-choice-row.four {
  grid-template-columns: repeat(4, 1fr);
}

body.tool-page.workbench-kit.kit-fission-mode .kit-choice-row.five {
  grid-template-columns: repeat(5, 1fr);
}

body.tool-page.workbench-kit.kit-fission-mode .kit-language-row {
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

body.tool-page.workbench-kit.kit-fission-mode .kit-choice-row button {
  height: 42px;
  border: 1px solid #d1d5db;
  border-radius: var(--kit-radius-control);
  background: var(--kit-surface);
  color: var(--kit-text);
  padding: 0 8px;
  font-size: 16px;
  font-weight: 500;
}

body.tool-page.workbench-kit.kit-fission-mode .kit-language-row button {
  height: 34px;
  padding: 0 6px;
  font-size: 13px;
}

body.tool-page.workbench-kit.kit-fission-mode .kit-choice-row button.active {
  border-color: var(--kit-primary);
  background: var(--kit-primary-soft);
  color: var(--kit-primary);
  box-shadow: inset 0 0 0 1px var(--kit-primary);
}

body.tool-page.workbench-kit.kit-fission-mode .kit-choice-row button:hover {
  border-color: var(--kit-primary);
}

body.tool-page.workbench-kit.kit-fission-mode .kit-form-block:has(#kitStructureTitle) {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  width: var(--kit-control-w);
  gap: 8px;
}

body.tool-page.workbench-kit.kit-fission-mode #kitStructureTitle {
  grid-column: 1 / -1;
  margin-bottom: 0;
}

body.tool-page.workbench-kit.kit-fission-mode .kit-option {
  width: auto;
  min-height: 92px;
  margin: 0;
  padding: 12px;
}

body.tool-page.workbench-kit.kit-fission-mode .kit-option strong {
  align-items: flex-start;
  font-size: 14px;
}

body.tool-page.workbench-kit.kit-fission-mode .kit-option strong::after {
  display: none;
}

body.tool-page.workbench-kit.kit-fission-mode .kit-option span {
  display: block;
  margin-top: 8px;
  line-height: 18px;
}

body.tool-page.workbench-kit.kit-fission-mode .kit-analysis-block h3 {
  margin-bottom: 8px;
}

body.tool-page.workbench-kit.kit-fission-mode .kit-analysis {
  height: 32px;
  margin-bottom: 0;
}

body.tool-page.workbench-kit.kit-fission-mode .kit-analysis-result {
  max-height: 48px;
  margin-top: 8px;
  overflow: hidden;
  padding: 8px 10px;
  line-height: 18px;
}

body.tool-page.workbench-kit.kit-fission-mode .kit-footer {
  position: sticky;
  bottom: 0;
  z-index: 5;
  width: var(--kit-panel-w);
  min-height: 52px;
  margin: auto -20px -1px;
  padding: 10px 16px 12px;
  border-top: 1px solid var(--kit-border);
  background: var(--kit-surface);
  transform: none;
  box-shadow: 0 -10px 24px rgba(15, 23, 42, 0.06);
}

body.tool-page.workbench-kit.kit-product-mode .kit-footer {
  position: sticky;
  bottom: 0;
  z-index: 5;
  width: var(--kit-panel-w);
  min-height: 58px;
  margin: auto -20px -1px;
  padding: 10px 16px 12px;
  border-top: 1px solid var(--kit-border);
  background: var(--kit-surface);
  transform: none;
  box-shadow: 0 -10px 24px rgba(15, 23, 42, 0.06);
}

body.tool-page.workbench-kit.kit-fission-mode .kit-price {
  display: none;
}

@media (max-height: 860px) {
  body.tool-page.workbench-kit.kit-fission-mode .kit-config {
    padding-top: 10px;
    padding-bottom: 0;
  }

  body.tool-page.workbench-kit.kit-fission-mode .kit-fission-upload-block,
  body.tool-page.workbench-kit.kit-fission-mode .kit-form-block {
    margin-bottom: 9px;
  }

  body.tool-page.workbench-kit.kit-fission-mode .kit-split-upload,
  body.tool-page.workbench-kit.kit-fission-mode .kit-mini-upload {
    gap: 6px;
  }

  body.tool-page.workbench-kit.kit-fission-mode .kit-fission-source-tabs {
    height: 28px;
  }

  body.tool-page.workbench-kit.kit-fission-mode .kit-fission-upload-card {
    min-height: 68px;
    padding: 8px 10px;
  }

  body.tool-page.workbench-kit.kit-fission-mode .kit-fission-upload-card > button {
    height: 30px;
  }

  body.tool-page.workbench-kit.kit-fission-mode .kit-fission-upload-card > p {
    margin-top: 4px;
    font-size: 12px;
    line-height: 16px;
  }

  body.tool-page.workbench-kit.kit-fission-mode .kit-form-block textarea {
    min-height: 52px;
    height: 52px;
  }

  body.tool-page.workbench-kit.kit-fission-mode .kit-choice-groups {
    gap: 8px;
  }

  body.tool-page.workbench-kit.kit-fission-mode .kit-choice-group {
    gap: 6px;
  }

  body.tool-page.workbench-kit.kit-fission-mode .kit-choice-row button {
    height: 36px;
    font-size: 15px;
  }

  body.tool-page.workbench-kit.kit-fission-mode .kit-option {
    min-height: 76px;
    padding: 10px;
  }

  body.tool-page.workbench-kit.kit-fission-mode .kit-option span {
    margin-top: 4px;
    line-height: 16px;
  }

  body.tool-page.workbench-kit.kit-fission-mode .kit-footer {
    min-height: 54px;
    margin: auto -20px -1px;
    padding-top: 6px;
    padding-bottom: 8px;
  }
}

body.tool-page.workbench-kit .kit-select-grid {
  width: var(--kit-control-w);
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

body.tool-page.workbench-kit .kit-select-grid label {
  gap: 0;
  min-width: 0;
}

body.tool-page.workbench-kit .kit-field-spacer {
  display: block;
  min-width: 0;
  min-height: var(--kit-control-h);
}

body.tool-page.workbench-kit .kit-select-grid label span {
  display: none;
}

body.tool-page.workbench-kit .kit-select-grid select {
  width: 100%;
  min-width: 0;
  height: var(--kit-control-h);
  border: 0;
  border-radius: var(--kit-radius-control);
  background: var(--kit-control-bg);
  color: var(--kit-text);
  padding: 0 12px;
  font-size: 14px;
}

body.tool-page.workbench-kit .kit-smart-scene-panel {
  width: var(--kit-control-w);
  margin: 12px 0 16px;
}

body.tool-page.workbench-kit .kit-smart-scene-panel[hidden] {
  display: none;
}

body.tool-page.workbench-kit .kit-smart-scene-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

body.tool-page.workbench-kit .kit-smart-scene-head h3 {
  margin: 0;
  color: var(--kit-text);
  font-size: 14px;
  font-weight: 700;
}

body.tool-page.workbench-kit .kit-smart-scene-head span {
  max-width: 190px;
  overflow: hidden;
  color: var(--kit-primary);
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.tool-page.workbench-kit .kit-smart-scene-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

body.tool-page.workbench-kit .kit-smart-scene-card,
body.tool-page.workbench-kit .kit-smart-scene-custom {
  min-height: 88px;
  border: 1px solid var(--kit-control-border);
  border-radius: var(--kit-radius-card);
  background: var(--kit-surface);
  color: var(--kit-text);
  padding: 10px;
  text-align: left;
}

body.tool-page.workbench-kit .kit-smart-scene-card {
  display: grid;
  align-content: start;
  gap: 5px;
}

body.tool-page.workbench-kit .kit-smart-scene-card span {
  width: max-content;
  max-width: 100%;
  border-radius: 999px;
  background: var(--kit-control-bg);
  color: var(--kit-muted);
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 700;
}

body.tool-page.workbench-kit .kit-smart-scene-card strong {
  overflow: hidden;
  font-size: 14px;
  line-height: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.tool-page.workbench-kit .kit-smart-scene-card small {
  display: -webkit-box;
  overflow: hidden;
  color: var(--kit-muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 17px;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

body.tool-page.workbench-kit .kit-smart-scene-card.active,
body.tool-page.workbench-kit .kit-smart-scene-custom.active {
  border-color: var(--kit-primary);
  background: var(--kit-primary-soft);
  box-shadow: inset 0 0 0 1px var(--kit-primary);
}

body.tool-page.workbench-kit .kit-smart-scene-card.active span {
  background: #dbeafe;
  color: var(--kit-primary);
}

body.tool-page.workbench-kit .kit-smart-scene-custom {
  grid-column: 1 / -1;
  min-height: 38px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
}

body.tool-page.workbench-kit.kit-smart-scene-mode .kit-form-block:has(#kitStructureTitle) {
  display: none;
}

body.tool-page.workbench-kit .kit-row-title {
  width: var(--kit-control-w);
  margin-bottom: var(--kit-title-gap);
}

body.tool-page.workbench-kit .kit-row-title h3 {
  margin: 0;
}

body.tool-page.workbench-kit .kit-row-title button {
  height: 28px;
  border-radius: 6px;
  background: #e8f4ff;
  color: var(--kit-primary);
  padding: 0 12px;
  font-size: 14px;
  font-weight: 600;
}

body.tool-page.workbench-kit .kit-form-block textarea {
  width: var(--kit-control-w);
  min-height: 160px;
  border: 1px solid var(--kit-control-border);
  border-radius: var(--kit-radius-card);
  background: var(--kit-surface);
  color: #334155;
  padding: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  font-size: 12px;
  resize: none;
}

body.tool-page.workbench-kit .kit-option {
  width: var(--kit-control-w);
  min-height: 74px;
  margin-bottom: 8px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--kit-radius-card);
  padding: 15px;
  color: var(--kit-text);
  cursor: pointer;
}

body.tool-page.workbench-kit .kit-option.active {
  border-color: var(--kit-primary);
  box-shadow: none;
}

body.tool-page.workbench-kit .kit-option strong {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 600;
}

body.tool-page.workbench-kit .kit-option.active strong::after,
body.tool-page.workbench-kit .kit-option:not(.active) strong::after {
  content: "";
  width: 16px;
  height: 16px;
  border: 1px solid #d1d5db;
  border-radius: 5px;
}

body.tool-page.workbench-kit .kit-option.active strong::after {
  border-color: var(--kit-primary);
  background: var(--kit-primary);
  box-shadow: inset 0 0 0 4px var(--kit-primary);
}

body.tool-page.workbench-kit .kit-option span {
  color: var(--kit-muted);
  font-size: 12px;
}

body.tool-page.workbench-kit .kit-custom-panel {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

body.tool-page.workbench-kit .kit-custom-panel[hidden],
body.tool-page.workbench-kit .kit-upload-empty[hidden],
body.tool-page.workbench-kit .kit-upload-list[hidden],
body.tool-page.workbench-kit .kit-result-strip[hidden],
body.tool-page.workbench-kit .kit-analysis-result[hidden] {
  display: none;
}

body.tool-page.workbench-kit .kit-count-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 77px;
  border-radius: 10px;
  background: #f6f8fb;
  padding: 12px 14px 12px 16px;
}

body.tool-page.workbench-kit .kit-count-row > div:first-child {
  display: grid;
  gap: 4px;
  min-width: 0;
}

body.tool-page.workbench-kit .kit-count-row strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
}

body.tool-page.workbench-kit .kit-count-row strong::after {
  display: none;
}

body.tool-page.workbench-kit .kit-count-row span {
  color: var(--kit-muted);
  font-size: 12px;
  line-height: 1.35;
}

body.tool-page.workbench-kit .kit-counter {
  display: grid;
  grid-template-columns: 14px 18px 14px;
  align-items: center;
  gap: 4px;
  min-width: 54px;
  color: var(--kit-text);
}

body.tool-page.workbench-kit .kit-counter button {
  display: grid;
  place-items: center;
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--kit-text);
  padding: 0;
  font-size: 16px;
  line-height: 1;
}

body.tool-page.workbench-kit .kit-counter button.disabled,
body.tool-page.workbench-kit .kit-counter button:disabled {
  color: var(--kit-muted);
  cursor: not-allowed;
}

body.tool-page.workbench-kit .kit-counter output {
  color: var(--kit-text);
  font-size: 14px;
  text-align: center;
}

body.tool-page.workbench-kit .kit-analysis {
  width: var(--kit-control-w);
  height: var(--kit-control-h);
  margin: 0 0 12px;
  border: 0;
  border-radius: 10px;
  background: var(--kit-control-bg);
  color: var(--kit-text);
  font-size: 14px;
  font-weight: 500;
}

body.tool-page.workbench-kit .kit-analysis:disabled {
  color: var(--kit-muted);
  cursor: wait;
}

body.tool-page.workbench-kit .kit-analysis-block {
  width: var(--kit-control-w);
  margin-bottom: var(--kit-section-gap);
}

body.tool-page.workbench-kit .kit-analysis-block h3 {
  display: flex;
  align-items: center;
  gap: 2px;
  height: var(--kit-title-h);
  margin: 0 0 var(--kit-title-gap);
  color: var(--kit-text);
  font-size: 14px;
  font-weight: 700;
}

body.tool-page.workbench-kit .kit-analysis-block h3::after {
  content: none;
  display: none;
  place-items: center;
  width: 14px;
  height: 14px;
  border: 1px solid var(--kit-muted);
  border-radius: 50%;
  color: var(--kit-muted);
  font-size: 10px;
  font-weight: 700;
}

body.tool-page.workbench-kit .kit-analysis-result {
  margin: 0;
  border-radius: 10px;
  background: #f6f8fb;
  color: var(--kit-subtle-text);
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.55;
}

body.tool-page.workbench-kit .kit-footer {
  position: sticky;
  left: 0;
  right: 0;
  bottom: -88px;
  display: grid;
  width: var(--kit-panel-w);
  min-height: 69px;
  margin: 0 -20px -88px;
  padding: 12px 16px;
  border-top: 1px solid var(--kit-border);
  background: var(--kit-surface);
  transform: translateY(15px);
}

body.tool-page.workbench-kit .kit-price {
  position: absolute;
  left: 32px;
  top: -18px;
  display: none;
  align-items: flex-end;
  gap: 4px;
  height: 24px;
  color: #653619;
}

body.tool-page.workbench-kit .kit-price img {
  width: 20px;
  height: 20px;
  transform: translateY(-1px);
}

body.tool-page.workbench-kit .kit-price strong {
  font-size: 24px;
  line-height: 1;
}

body.tool-page.workbench-kit .kit-price span {
  font-size: 12px;
  font-weight: 600;
}

body.tool-page.workbench-kit .kit-price del {
  color: #abadb2;
  font-size: 12px;
  text-decoration-thickness: 1px;
}

body.tool-page.workbench-kit .kit-generate {
  position: static;
  width: var(--kit-generate-w);
  height: var(--kit-generate-h);
  justify-content: center;
  border: 0;
  border-radius: var(--kit-radius-control);
  background: var(--kit-primary);
  color: var(--kit-surface);
  padding: 0 12px;
  font-size: 14px;
  font-weight: 600;
}

body.tool-page.workbench-kit .kit-stage {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  gap: 40px;
  width: 100%;
  height: calc(100vh - 54px);
  overflow-x: auto;
  overflow-y: hidden;
  background: #f3f5f7;
  padding: 32px 24px;
  text-align: left;
}

body.tool-page.workbench-kit .kit-stage::-webkit-scrollbar {
  height: 6px;
}

body.tool-page.workbench-kit .kit-stage::-webkit-scrollbar-thumb {
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.2);
}

body.tool-page.workbench-kit .kit-stage::-webkit-scrollbar-track {
  background: transparent;
}

body.tool-page.workbench-kit .kit-stage-copy {
  width: 100%;
  min-height: 100px;
}

body.tool-page.workbench-kit .kit-stage h1 {
  margin: 0 0 8px;
  color: #1c1d1e;
  font-size: 36px;
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
}

body.tool-page.workbench-kit .kit-stage p {
  margin: 0;
  color: #616266;
  font-size: 16px;
  line-height: 1.45;
  text-align: center;
}

body.tool-page.workbench-kit .kit-stage p span {
  color: #3388ff;
}

body.tool-page.workbench-kit .kit-showcase {
  position: relative;
  display: flex;
  gap: 16px;
  width: 765px;
  height: 384px;
  margin: 0 auto;
  border-radius: 24px;
  background: #fff;
  padding: 24px 24px 24px 6px;
}

body.tool-page.workbench-kit .kit-main-card,
body.tool-page.workbench-kit .kit-context-card {
  position: relative;
  overflow: hidden;
  background: #fff;
}

body.tool-page.workbench-kit .kit-main-card {
  width: 336px;
  height: 336px;
  flex: 0 0 336px;
  border-radius: 16px;
}

body.tool-page.workbench-kit .kit-showcase-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 336px;
  flex: 0 0 46px;
  padding-right: 6px;
}

body.tool-page.workbench-kit .kit-showcase-arrow svg {
  display: block;
  width: 40px;
  height: 24px;
}

body.tool-page.workbench-kit .kit-context-grid {
  display: grid;
  grid-template-columns: repeat(2, 164px);
  grid-auto-rows: 164px;
  gap: 12px;
}

body.tool-page.workbench-kit .kit-context-card {
  border: 1px solid #f1f5f9;
  border-radius: 12px;
}

body.tool-page.workbench-kit .kit-main-card img,
body.tool-page.workbench-kit .kit-context-card img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

body.tool-page.workbench-kit .kit-main-card span,
body.tool-page.workbench-kit .kit-context-card span {
  position: absolute;
  left: 8px;
  top: 8px;
  z-index: 1;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  color: #334155;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

body.tool-page.workbench-kit .kit-main-card span {
  background: #f3f5f7;
}

body.tool-page.workbench-kit .kit-result-strip {
  display: flex;
  gap: 10px;
  width: 765px;
  margin: -22px auto 0;
  padding-bottom: 2px;
}

body.tool-page.workbench-kit .kit-result-thumb {
  display: grid;
  gap: 6px;
  width: 88px;
  min-width: 88px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: #fff;
  padding: 6px;
  color: #616266;
  font-size: 11px;
  text-align: left;
}

body.tool-page.workbench-kit .kit-result-thumb.active {
  border-color: #3388ff;
}

body.tool-page.workbench-kit .kit-result-thumb img {
  width: 74px;
  height: 74px;
  border-radius: 8px;
  object-fit: cover;
}

body.tool-page.workbench-kit .kit-result-thumb span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

body.tool-page.workbench-kit.kit-demo-composite-mode .kit-showcase {
  display: block;
  width: 765px;
  height: auto;
  padding: 8px;
  border-radius: 20px;
  box-sizing: border-box;
}

body.tool-page.workbench-kit.kit-demo-composite-mode .kit-main-card {
  width: 100%;
  height: auto;
  border-radius: 16px;
}

body.tool-page.workbench-kit.kit-demo-composite-mode .kit-main-card img {
  width: 100%;
  height: auto;
  display: block;
  background: #fff;
  object-fit: contain;
}

body.tool-page.workbench-kit.kit-demo-composite-mode .kit-main-card span,
body.tool-page.workbench-kit.kit-demo-composite-mode .kit-showcase-arrow,
body.tool-page.workbench-kit.kit-demo-composite-mode .kit-context-grid {
  display: none;
}

body.tool-page.workbench-kit.kit-demo-composite-mode.kit-fission-mode .kit-showcase,
body.tool-page.workbench-kit.kit-demo-composite-mode.kit-translation-mode .kit-showcase {
  display: block;
  width: 765px;
  height: auto;
  padding: 8px;
}

body.tool-page.workbench-kit.kit-demo-composite-mode.kit-fission-mode .kit-main-card,
body.tool-page.workbench-kit.kit-demo-composite-mode.kit-translation-mode .kit-main-card {
  width: 100%;
  height: auto;
  max-width: none;
}

body.tool-page.workbench-kit.kit-demo-composite-mode.kit-fission-mode .kit-main-card img,
body.tool-page.workbench-kit.kit-demo-composite-mode.kit-translation-mode .kit-main-card img {
  object-fit: contain;
}

body.tool-page.workbench-kit.kit-fission-mode .kit-showcase {
  gap: 12px;
  width: 765px;
  height: 384px;
  padding: 16px;
  border-radius: 16px;
  box-sizing: border-box;
}

body.tool-page.workbench-kit.kit-fission-mode .kit-main-card,
body.tool-page.workbench-kit.kit-fission-mode .kit-context-card {
  width: calc((765px - 32px - 28px - 24px) / 2);
  height: 352px;
  flex: 0 0 calc((765px - 32px - 28px - 24px) / 2);
  border: 1px solid #eef2f7;
  border-radius: 12px;
  box-sizing: border-box;
}

body.tool-page.workbench-kit.kit-fission-mode .kit-main-card {
  overflow: hidden;
}

body.tool-page.workbench-kit.kit-fission-mode .kit-main-card > img:not(.kit-fission-product-demo),
body.tool-page.workbench-kit.kit-fission-mode .kit-context-card img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

body.tool-page.workbench-kit.kit-fission-mode .kit-fission-product-demo {
  position: absolute;
  right: -1px;
  bottom: -1px;
  z-index: 2;
  width: calc(100% / 3);
  height: calc(100% / 3);
  border-radius: 10px 0 12px 0;
  background: #fff;
  box-shadow: -8px -8px 22px rgba(15, 23, 42, 0.12);
  overflow: hidden;
}

body.tool-page.workbench-kit.kit-fission-mode .kit-fission-product-demo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

body.tool-page.workbench-kit.kit-fission-mode .kit-fission-product-label {
  position: absolute;
  left: 6px;
  top: 6px;
  z-index: 3;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: #334155;
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

body.tool-page.workbench-kit.kit-fission-mode .kit-showcase-arrow {
  width: 28px;
  height: 352px;
  flex: 0 0 28px;
  padding-right: 0;
}

body.tool-page.workbench-kit.kit-fission-mode .kit-showcase-arrow svg {
  width: 28px;
}

body.tool-page.workbench-kit.kit-fission-mode .kit-context-grid {
  display: grid;
  gap: 10px;
  width: calc((765px - 32px - 28px - 24px) / 2);
  height: 352px;
  flex: 0 0 calc((765px - 32px - 28px - 24px) / 2);
  box-sizing: border-box;
}

body.tool-page.workbench-kit.kit-fission-mode.kit-fission-results-mode .kit-showcase {
  display: block;
  width: 100%;
  min-height: calc(100vh - 110px);
  height: auto;
  margin: 0;
  background: transparent;
  padding: 28px 32px;
  border-radius: 0;
  box-sizing: border-box;
}

body.tool-page.workbench-kit.kit-fission-mode.kit-fission-results-mode .kit-stage {
  justify-content: flex-start;
  gap: 0;
  overflow-y: auto;
  padding: 0;
}

body.tool-page.workbench-kit.kit-fission-mode.kit-fission-results-mode .kit-stage-copy {
  display: none;
}

body.tool-page.workbench-kit.kit-fission-mode.kit-fission-results-mode .kit-output-head {
  display: grid;
  gap: 24px;
  width: 100%;
}

body.tool-page.workbench-kit.kit-fission-mode.kit-fission-results-mode .kit-output-head[hidden] {
  display: none;
}

body.tool-page.workbench-kit.kit-fission-mode.kit-fission-results-mode .kit-output-title-row,
body.tool-page.workbench-kit.kit-fission-mode.kit-fission-results-mode .kit-output-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

body.tool-page.workbench-kit.kit-fission-mode.kit-fission-results-mode .kit-output-title-row h2 {
  margin: 0;
  color: var(--kit-text);
  font-size: 20px;
  font-weight: 700;
  line-height: 28px;
}

body.tool-page.workbench-kit.kit-fission-mode.kit-fission-results-mode .kit-output-meta-row {
  justify-content: flex-start;
}

body.tool-page.workbench-kit.kit-fission-mode.kit-fission-results-mode .kit-output-meta-row strong {
  color: #3f3f46;
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
}

body.tool-page.workbench-kit.kit-fission-mode.kit-fission-results-mode .kit-output-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

body.tool-page.workbench-kit.kit-fission-mode.kit-fission-results-mode .kit-output-actions button {
  min-width: 40px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: #1f2937;
  color: #fff;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 700;
}

body.tool-page.workbench-kit.kit-fission-mode.kit-fission-results-mode .kit-output-actions button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

body.tool-page.workbench-kit.kit-fission-mode.kit-fission-results-mode .kit-main-card,
body.tool-page.workbench-kit.kit-fission-mode.kit-fission-results-mode .kit-showcase-arrow {
  display: none;
}

body.tool-page.workbench-kit.kit-fission-mode.kit-fission-results-mode .kit-context-grid {
  width: 100%;
  height: auto;
  flex: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 288px));
  grid-auto-rows: 288px;
  justify-content: start;
  align-content: start;
  gap: 18px;
  margin-top: 28px;
}

body.tool-page.workbench-kit.kit-fission-mode .kit-context-grid[data-fission-result-count="1"] {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
}

body.tool-page.workbench-kit.kit-fission-mode .kit-context-grid[data-fission-result-count="2"] {
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: 1fr;
}

body.tool-page.workbench-kit.kit-fission-mode .kit-context-grid[data-fission-result-count="3"],
body.tool-page.workbench-kit.kit-fission-mode .kit-context-grid[data-fission-result-count="4"] {
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
}

body.tool-page.workbench-kit.kit-fission-mode .kit-context-grid .kit-context-card {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  flex: none;
}

body.tool-page.workbench-kit.kit-translation-mode.kit-translation-demo-mode .kit-showcase {
  gap: 16px;
  width: 765px;
  height: 384px;
  padding: 24px 24px 24px 6px;
  border-radius: 24px;
  background: #fff;
  box-sizing: content-box;
}

body.tool-page.workbench-kit.kit-translation-mode.kit-translation-demo-mode .kit-main-card {
  width: 336px;
  height: 336px;
  flex: 0 0 336px;
  border: 0;
  border-radius: 16px;
}

body.tool-page.workbench-kit.kit-translation-mode.kit-translation-demo-mode .kit-showcase-arrow {
  width: 46px;
  height: 336px;
  flex: 0 0 46px;
  padding-right: 6px;
}

body.tool-page.workbench-kit.kit-translation-mode.kit-translation-demo-mode .kit-showcase-arrow svg {
  width: 40px;
  height: 24px;
}

body.tool-page.workbench-kit.kit-translation-mode.kit-translation-demo-mode .kit-context-grid {
  display: grid;
  grid-template-columns: repeat(2, 164px);
  grid-auto-rows: 164px;
  gap: 12px;
  width: auto;
  height: auto;
  flex: 0 0 auto;
}

body.tool-page.workbench-kit.kit-translation-mode.kit-translation-demo-mode .kit-context-grid .kit-context-card {
  width: 164px;
  height: 164px;
  border: 1px solid #f1f5f9;
  border-radius: 12px;
  cursor: default;
  box-shadow: none;
}

body.tool-page.workbench-kit.kit-translation-mode.kit-translation-demo-mode .kit-main-card > span,
body.tool-page.workbench-kit.kit-translation-mode.kit-translation-demo-mode .kit-context-card > span {
  display: none;
}

body.tool-page.workbench-kit.kit-demo-composite-mode .kit-showcase-arrow,
body.tool-page.workbench-kit.kit-demo-composite-mode .kit-context-grid,
body.tool-page.workbench-kit.kit-demo-composite-mode .kit-fission-product-demo,
body.tool-page.workbench-kit.kit-demo-composite-mode .kit-fission-product-label {
  display: none !important;
}

body.tool-page.workbench-kit.kit-demo-composite-mode .kit-main-card > img {
  object-fit: contain !important;
}

body.tool-page.workbench-kit.kit-fission-mode.kit-fission-results-mode .kit-context-grid[data-fission-result-count="1"] {
  grid-template-columns: minmax(220px, 288px);
  grid-template-rows: 288px;
}

body.tool-page.workbench-kit.kit-fission-mode.kit-fission-results-mode .kit-context-grid[data-fission-result-count="2"] {
  grid-template-columns: repeat(2, minmax(220px, 288px));
  grid-template-rows: 288px;
}

body.tool-page.workbench-kit.kit-fission-mode.kit-fission-results-mode .kit-context-grid[data-fission-result-count="3"],
body.tool-page.workbench-kit.kit-fission-mode.kit-fission-results-mode .kit-context-grid[data-fission-result-count="4"] {
  grid-template-columns: repeat(2, minmax(220px, 288px));
  grid-auto-rows: 288px;
}

body.tool-page.workbench-kit.kit-fission-mode.kit-fission-results-mode .kit-context-grid .kit-context-card {
  aspect-ratio: 1 / 1;
  height: 100%;
  cursor: zoom-in;
  background: #fff;
  border-color: #d9dee7;
  border-radius: 8px;
  box-shadow: none;
}

body.tool-page.workbench-kit.kit-fission-mode.kit-fission-results-mode .kit-context-grid .kit-context-card:hover {
  border-color: #3388ff;
  box-shadow: 0 16px 36px rgba(51, 136, 255, 0.16);
}

body.tool-page.workbench-kit.kit-fission-mode.kit-fission-results-mode .kit-context-grid .kit-context-card > span {
  display: none;
}

body.tool-page.workbench-kit.kit-output-results-mode .kit-stage {
  justify-content: flex-start;
  gap: 0;
  overflow-y: auto;
  padding: 0;
}

body.tool-page.workbench-kit.kit-output-results-mode .kit-stage-copy {
  display: none;
}

body.tool-page.workbench-kit.kit-output-results-mode .kit-showcase {
  display: block;
  width: 100%;
  min-height: calc(100vh - 110px);
  height: auto;
  margin: 0;
  background: transparent;
  padding: 28px 32px;
  border-radius: 0;
  box-sizing: border-box;
}

body.tool-page.workbench-kit.kit-output-results-mode .kit-main-card,
body.tool-page.workbench-kit.kit-output-results-mode .kit-showcase-arrow {
  display: none;
}

body.tool-page.workbench-kit.kit-output-results-mode .kit-output-head {
  display: grid;
  gap: 24px;
  width: 100%;
}

body.tool-page.workbench-kit.kit-output-results-mode .kit-output-head[hidden] {
  display: none;
}

body.tool-page.workbench-kit.kit-output-results-mode .kit-output-title-row,
body.tool-page.workbench-kit.kit-output-results-mode .kit-output-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

body.tool-page.workbench-kit.kit-output-results-mode .kit-output-title-row h2 {
  margin: 0;
  color: var(--kit-text);
  font-size: 20px;
  font-weight: 700;
  line-height: 28px;
}

body.tool-page.workbench-kit.kit-output-results-mode .kit-output-meta-row {
  justify-content: flex-start;
}

body.tool-page.workbench-kit.kit-output-results-mode .kit-output-meta-row strong {
  color: #3f3f46;
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
}

body.tool-page.workbench-kit.kit-output-results-mode .kit-output-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

body.tool-page.workbench-kit.kit-output-results-mode .kit-output-actions button {
  min-width: 40px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: #1f2937;
  color: #fff;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 700;
}

body.tool-page.workbench-kit.kit-output-results-mode .kit-output-actions button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

body.tool-page.workbench-kit.kit-output-results-mode .kit-context-grid {
  width: 100%;
  height: auto;
  flex: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 288px));
  grid-auto-rows: 288px;
  justify-content: start;
  align-content: start;
  gap: 18px;
  margin-top: 28px;
}

body.tool-page.workbench-kit.kit-output-results-mode .kit-context-grid .kit-context-card {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  aspect-ratio: 1 / 1;
  flex: none;
  border-color: #d9dee7;
  border-radius: 8px;
  background: #fff;
  cursor: zoom-in;
  box-shadow: none;
}

body.tool-page.workbench-kit .kit-card-download {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: rgba(17, 24, 39, 0.9);
  color: #fff;
  padding: 0;
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.22);
}

body.tool-page.workbench-kit .kit-card-download:hover {
  background: #111827;
}

body.tool-page.workbench-kit .kit-card-download[hidden] {
  display: none;
}

body.tool-page.workbench-kit.kit-output-results-mode .kit-context-grid .kit-context-card > span {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  max-width: calc(100% - 54px);
  min-height: 26px;
  border-radius: 8px;
  background: rgba(17, 24, 39, 0.82);
  color: #fff;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.tool-page.workbench-kit.kit-output-results-mode .kit-context-card.is-loading,
body.tool-page.workbench-kit.kit-output-results-mode .kit-context-card.is-error {
  display: grid;
  place-items: center;
  background: #f6f8fb;
  cursor: default;
}

body.tool-page.workbench-kit.kit-output-results-mode .kit-context-card.is-loading img,
body.tool-page.workbench-kit.kit-output-results-mode .kit-context-card.is-error img {
  opacity: 0;
}

body.tool-page.workbench-kit.kit-output-results-mode .kit-fission-result-status {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: var(--kit-primary);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

body.tool-page.workbench-kit.kit-output-results-mode .kit-fission-result-status i {
  width: 24px;
  height: 24px;
  border: 3px solid #d8e9ff;
  border-top-color: var(--kit-primary);
  border-radius: 50%;
  animation: kit-fission-spin 0.8s linear infinite;
}

body.tool-page.workbench-kit.kit-output-results-mode .kit-fission-result-status small {
  color: #64748b;
  font-size: 12px;
  font-weight: 500;
}

body.tool-page.workbench-kit.kit-fission-mode .kit-context-card[hidden] {
  display: none;
}

body.tool-page.workbench-kit.kit-fission-mode .kit-main-card span,
body.tool-page.workbench-kit.kit-fission-mode .kit-context-card span {
  left: 12px;
  top: 12px;
  background: rgba(255, 255, 255, 0.84);
}

body.tool-page.workbench-kit.kit-fission-mode .kit-context-card.is-loading,
body.tool-page.workbench-kit.kit-fission-mode .kit-context-card.is-error {
  display: grid;
  place-items: center;
  background: #f6f8fb;
}

body.tool-page.workbench-kit.kit-fission-mode .kit-context-card.is-loading img,
body.tool-page.workbench-kit.kit-fission-mode .kit-context-card.is-error img {
  opacity: 0;
}

body.tool-page.workbench-kit.kit-fission-mode .kit-fission-result-status {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: var(--kit-primary);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

body.tool-page.workbench-kit.kit-fission-mode .kit-fission-result-status i {
  width: 24px;
  height: 24px;
  border: 3px solid #d8e9ff;
  border-top-color: var(--kit-primary);
  border-radius: 50%;
  animation: kit-fission-spin 0.8s linear infinite;
}

body.tool-page.workbench-kit.kit-fission-mode .kit-fission-result-status small {
  color: #64748b;
  font-size: 12px;
  font-weight: 500;
}

body.tool-page.workbench-kit.kit-fission-mode.kit-generating .kit-showcase::after {
  content: none;
  display: none;
}

.kit-image-viewer {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 18px;
  padding: 24px;
  background: rgba(15, 23, 42, 0.78);
  box-sizing: border-box;
}

.kit-image-viewer[hidden] {
  display: none;
}

.kit-image-viewer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1120px, 100%);
  margin: 0 auto;
  color: #fff;
}

.kit-image-viewer-bar strong {
  font-size: 18px;
  line-height: 1.3;
}

.kit-image-viewer-bar button {
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  padding: 0 14px;
  font-size: 14px;
  cursor: pointer;
}

.kit-image-viewer-stage {
  display: grid;
  place-items: center;
  min-height: 0;
}

.kit-image-viewer-stage img {
  display: block;
  max-width: min(1120px, 100%);
  max-height: calc(100vh - 110px);
  border-radius: 12px;
  background: #fff;
  object-fit: contain;
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.32);
}

@keyframes kit-fission-spin {
  to {
    transform: rotate(360deg);
  }
}

body.tool-page.workbench-kit.kit-generating .kit-showcase::after {
  content: none;
  display: none;
}

body.tool-page.workbench-kit .agent-panel {
  display: none;
}

.kit-confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.42);
}

.kit-confirm-modal[hidden] {
  display: none;
}

.kit-confirm-card {
  position: relative;
  display: grid;
  justify-items: center;
  width: 320px;
  min-height: 248px;
  border-radius: 12px;
  background: #fff;
  padding: 28px 24px 22px;
  box-shadow: 0 18px 60px rgba(15, 23, 42, 0.18);
}

.kit-confirm-card img {
  width: 136px;
  height: 59px;
  object-fit: contain;
}

.kit-confirm-card h2 {
  margin: 20px 0 18px;
  color: #1c1d1e;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
}

.kit-confirm-card p {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  color: #929499;
  font-size: 14px;
}

.kit-confirm-card p span {
  display: grid;
  place-items: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #ffc18d;
  color: #fff;
  font-size: 10px;
}

.kit-confirm-close {
  position: absolute;
  right: 14px;
  top: 12px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #8c929d;
  font-size: 24px;
  line-height: 1;
}

.kit-confirm-run {
  width: 120px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: #ffc18d;
  color: #653619;
  font-size: 14px;
  font-weight: 700;
}

@media (max-width: 820px) {
  body.tool-page.workbench-kit .app-shell,
  body.tool-page.workbench-kit .app-main,
  body.tool-page.workbench-kit .page-shell,
  body.tool-page.workbench-kit .workspace-dock,
  body.tool-page.workbench-kit .workspace-panel,
  body.tool-page.workbench-kit .kit-workbench,
  body.tool-page.workbench-kit .editor-topbar {
    width: 100%;
    min-width: 0;
  }

  body.tool-page.workbench-kit .app-shell,
  body.tool-page.workbench-kit .app-main,
  body.tool-page.workbench-kit .page-shell,
  body.tool-page.workbench-kit .workspace-dock {
    height: auto;
    min-height: 100vh;
  }

  body.tool-page.workbench-kit .workspace-dock {
    grid-template-rows: 54px auto;
    overflow-x: hidden;
    overflow-y: auto;
  }

  body.tool-page.workbench-kit .editor-topbar {
    overflow-x: auto;
    padding: 0 12px;
  }

  body.tool-page.workbench-kit .editor-account {
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    justify-content: flex-start;
  }

  body.tool-page.workbench-kit .managed-batch-btn,
  body.tool-page.workbench-kit .record-btn {
    flex: 0 0 auto;
  }

  body.tool-page.workbench-kit .workspace-panel,
  body.tool-page.workbench-kit .kit-workbench {
    height: auto;
    overflow: visible;
  }

  body.tool-page.workbench-kit.generation-record-page .workspace-panel {
    height: calc(100vh - 54px);
    overflow-x: auto;
    overflow-y: auto;
  }

  body.tool-page.workbench-kit .kit-workbench {
    grid-template-columns: 1fr;
    min-height: calc(100vh - 54px);
  }

  body.tool-page.workbench-kit .kit-rail {
    display: flex;
    width: 100%;
    height: auto;
    gap: 8px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--kit-border);
    padding: 8px 12px;
    scrollbar-width: none;
  }

  body.tool-page.workbench-kit .kit-rail::-webkit-scrollbar {
    display: none;
  }

  body.tool-page.workbench-kit .kit-rail button {
    flex: 0 0 88px;
    width: 88px;
    min-height: 58px;
    padding: 6px 4px;
  }

  body.tool-page.workbench-kit .kit-config {
    width: min(100%, 420px);
    height: auto;
    min-height: 0;
    margin: 0 auto;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--kit-border);
    padding: 16px 14px 88px;
  }

  body.tool-page.workbench-kit .kit-footer {
    margin-right: -14px;
    margin-left: -14px;
  }

  body.tool-page.workbench-kit .kit-stage {
    width: 100%;
    height: auto;
    min-height: 520px;
    overflow: visible;
    gap: 24px;
    padding: 24px 14px 42px;
  }

  body.tool-page.workbench-kit .kit-stage h1 {
    font-size: 28px;
  }

  body.tool-page.workbench-kit .kit-stage p {
    font-size: 14px;
  }

  body.tool-page.workbench-kit .kit-showcase,
  body.tool-page.workbench-kit.kit-fission-mode .kit-showcase,
  body.tool-page.workbench-kit.kit-translation-mode.kit-translation-demo-mode .kit-showcase {
    flex-direction: column;
    align-items: center;
    width: min(100%, calc(100vw - 28px));
    max-width: 420px;
    height: auto;
    min-height: 0;
    gap: 12px;
    border-radius: 18px;
    box-sizing: border-box;
    padding: 14px;
  }

  body.tool-page.workbench-kit .kit-main-card,
  body.tool-page.workbench-kit.kit-fission-mode .kit-main-card,
  body.tool-page.workbench-kit.kit-fission-mode .kit-context-card,
  body.tool-page.workbench-kit.kit-translation-mode.kit-translation-demo-mode .kit-main-card {
    width: min(100%, 336px);
    height: auto;
    aspect-ratio: 1 / 1;
    flex: 0 0 auto;
  }

  body.tool-page.workbench-kit .kit-showcase-arrow,
  body.tool-page.workbench-kit.kit-fission-mode .kit-showcase-arrow,
  body.tool-page.workbench-kit.kit-translation-mode.kit-translation-demo-mode .kit-showcase-arrow {
    width: 100%;
    height: 34px;
    flex: 0 0 34px;
    padding: 0;
    transform: rotate(90deg);
  }

  body.tool-page.workbench-kit .kit-context-grid,
  body.tool-page.workbench-kit.kit-fission-mode .kit-context-grid,
  body.tool-page.workbench-kit.kit-translation-mode.kit-translation-demo-mode .kit-context-grid {
    width: min(100%, 336px);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: auto;
  }

  body.tool-page.workbench-kit .kit-context-card,
  body.tool-page.workbench-kit.kit-translation-mode.kit-translation-demo-mode .kit-context-grid .kit-context-card {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
  }
}

body.tool-page.workbench-kit.kit-demo-composite-mode .kit-showcase,
body.tool-page.workbench-kit.kit-demo-composite-mode.kit-fission-mode .kit-showcase,
body.tool-page.workbench-kit.kit-demo-composite-mode.kit-translation-mode .kit-showcase {
  height: auto;
  padding: 8px;
}

body.tool-page.workbench-kit.kit-demo-composite-mode .kit-main-card,
body.tool-page.workbench-kit.kit-demo-composite-mode.kit-fission-mode .kit-main-card,
body.tool-page.workbench-kit.kit-demo-composite-mode.kit-translation-mode .kit-main-card {
  width: 100%;
  height: auto;
  aspect-ratio: auto;
}

body.tool-page.workbench-kit.kit-demo-composite-mode .kit-main-card > img,
body.tool-page.workbench-kit.kit-demo-composite-mode.kit-fission-mode .kit-main-card > img,
body.tool-page.workbench-kit.kit-demo-composite-mode.kit-translation-mode .kit-main-card > img {
  width: 100%;
  height: auto !important;
}
