/* 香蕉工厂 shares the site's surface, text and close-button tokens. */
#ai-banana-factory { background: transparent; }
body:has(#ai-banana-factory.panel.active) .container { width: 100%; max-width: 1188px; padding-inline: 28px; }
@media (max-width: 640px) { body:has(#ai-banana-factory.panel.active) .container { padding-inline: 14px; } }
#banana-factory-root, .bf-dialog { --bf-yellow: #ffd43b; --bf-ink: var(--text, #171719); --bf-paper: var(--surface, #fff); --bf-muted: var(--muted, #70747c); --bf-line: color-mix(in srgb, var(--bf-ink) 12%, transparent); color: var(--bf-ink); font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; }
#banana-factory-root [hidden], .bf-dialog [hidden] { display: none !important; }
.bf-shell { max-width: 1100px; margin: 0 auto; padding: 22px 8px 64px; }
.bf-page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.bf-page-head h1 { font-size: 28px; font-weight: 700; letter-spacing: -.6px; margin: 0 0 6px; }
.bf-groups { display: flex; flex-direction: column; gap: 24px; }
.bf-group { position: relative; border: 1px solid var(--bf-line); border-radius: 18px; background: var(--bf-paper); box-shadow: 0 4px 18px rgb(0 0 0 / 3%); animation: bf-enter 220ms cubic-bezier(.23,1,.32,1) both; }
.bf-group-head { min-height: 72px; padding: 16px 40px 16px 20px; box-sizing: border-box; display: flex; align-items: center; gap: 10px; }
.bf-fold { width: 30px; height: 32px; padding: 5px; border: 0; border-radius: 12px; background: transparent; color: inherit; cursor: pointer; }
.bf-fold svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; transition: transform 200ms cubic-bezier(.23,1,.32,1); }
.is-collapsed .bf-fold svg { transform: rotate(-90deg); }
.bf-group-name { width: 155px; min-width: 70px; border: 0; background: transparent; font: inherit; font-weight: 650; color: inherit; padding: 6px 0; text-overflow: ellipsis; }
.bf-group-name:disabled { opacity: 1; -webkit-text-fill-color: var(--bf-ink); }
.bf-summary { color: var(--bf-muted); font-size: 12px; font-variant-numeric: tabular-nums; flex: 1; }
.bf-body { border-top: 1px solid var(--bf-line); padding: 20px; opacity: 1; transition: opacity 160ms ease-out; }
.is-collapsed .bf-body { display: none; }
.bf-controls { position: sticky; top: 74px; z-index: 3; padding-bottom: 14px; background: var(--bf-paper); border-bottom: 1px solid var(--bf-line); }
.bf-controls textarea { display: block; width: 100%; box-sizing: border-box; border: 0; border-radius: 14px; background: color-mix(in srgb, var(--bf-ink) 2%, var(--bf-paper)); padding: 14px 16px; resize: none; height: 112px; min-height: 112px; max-height: 112px; font: inherit; font-size: 14px; line-height: 1.65; color: inherit;  }
#banana-factory-root :focus, #banana-factory-root :focus-visible, .bf-dialog:focus, .bf-dialog :focus, .bf-dialog :focus-visible { outline: none !important; box-shadow: none !important; }
#banana-factory-root .bf-controls textarea, #banana-factory-root .bf-controls textarea:focus { border: 0 !important; outline: none !important; box-shadow: none !important; }
.bf-settings { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.bf-settings label { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--bf-muted); }
.bf-settings select { max-width: 270px; min-height: 36px; padding: 7px 26px 7px 10px; border: 1px solid var(--bf-line); border-radius: 12px; color: var(--bf-ink); background: var(--bf-paper); font: inherit; font-size: 12px; }
.bf-settings-spacer { flex: 1; }
.bf-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 8px 13px; border: 1px solid var(--bf-line); border-radius: 12px; background: var(--bf-paper); color: var(--bf-ink); font: inherit; font-size: 12px; font-weight: 550; cursor: pointer; transition: transform 140ms cubic-bezier(.23,1,.32,1), background 180ms ease, box-shadow 180ms ease; }
.bf-button:active:not(:disabled), .bf-fold:active { transform: scale(.97); }
.bf-button:disabled { cursor: default; opacity: .42; }
.bf-primary { background: var(--bf-yellow); color: #242014; border-color: transparent; min-width: 102px; }
.bf-intake { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 18px 0 12px; }
.bf-dropzone { display: flex; align-items: center; gap: 12px; min-width: 0; min-height: 84px; padding: 18px; border: 1px dashed var(--bf-line); border-radius: 14px; background: color-mix(in srgb, var(--bf-ink) 1%, var(--bf-paper)); color: var(--bf-ink); font: inherit; font-size: 13px; cursor: pointer; transition: background 160ms ease, border-color 160ms ease; }
.bf-drop-plus { color: #b58e19; font-size: 26px; font-weight: 300; }
.bf-intake-count { margin-left: auto; font-size: 12px; color: var(--bf-muted); font-variant-numeric: tabular-nums; }
.bf-dropzone:disabled { opacity: .5; cursor: default; }
.bf-dropzone:hover:not(:disabled), #banana-factory-root .is-dragover { background: color-mix(in srgb, var(--bf-yellow) 12%, var(--bf-paper)); border-color: #d6ac24; }
.bf-list-tools { min-height: 36px; margin-bottom: 12px; display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.bf-list-tools:has(.bf-upload-status:empty):not(:has(button:not([hidden]))) { display: none; }
.bf-upload-status { margin-right: auto; color: var(--bf-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.bf-columns, .bf-row { display: grid; grid-template-columns: 48px minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.3fr); gap: 18px; }
.bf-columns { padding: 0 24px 12px 14px; color: var(--bf-muted); font-size: 11px; }
.bf-rows { position: relative; }
.bf-window { position: absolute; inset: 0 0 auto; }
.bf-row { position: relative; height: 134px; margin-bottom: 12px; padding: 14px 24px 14px 14px; box-sizing: border-box; border: 1px solid var(--bf-line); border-radius: 14px; background: var(--bf-paper); align-items: center; }
.bf-number { font: 12px ui-monospace, "SFMono-Regular", monospace; color: var(--bf-muted); }
.bf-ref-slot { min-width: 0; }
.bf-reference { width: 100%; border: 0; padding: 0; height: 102px; min-width: 0; border-radius: 12px; background: transparent; color: var(--bf-muted); cursor: pointer; text-align: left; display: flex; gap: 10px; align-items: center; }
.bf-reference img { width: 84px; height: 102px; object-fit: contain; background: color-mix(in srgb, var(--bf-ink) 3%, var(--bf-paper)); border-radius: 10px; }
.bf-reference span { font-size: 11px; line-height: 1.5; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.bf-reference.is-empty { border: 1px dashed var(--bf-line); justify-content: center; background: color-mix(in srgb, var(--bf-ink) 1%, var(--bf-paper)); }
.bf-reference.is-empty span { font-size: 20px; font-weight: 300; }
.bf-output { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; min-width: 0; }
.bf-output strong { font-size: 12px; font-weight: 500; color: var(--bf-muted); }
.bf-output small { font-size: 10px; width: 100%; color: var(--bf-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bf-output small:empty { display: none; }
.bf-state-mark { width: 6px; height: 6px; border-radius: 50%; background: var(--bf-line); }
.is-running .bf-state-mark, .is-retrying .bf-state-mark, .is-saving .bf-state-mark { background: #dfb426; animation: bf-pulse 1400ms ease-in-out infinite alternate; }
.is-failed .bf-state-mark, .is-uncertain .bf-state-mark { background: #ff5c60; }
.bf-result-image { height: 102px; width: 108px; border-radius: 12px; padding: 0; border: 0; background: transparent; cursor: zoom-in; }
.bf-result-image img { width: 100%; height: 100%; object-fit: contain; border-radius: 10px; }
.bf-row img { opacity: 0; transition: opacity 180ms ease-out; }
.bf-row img.is-ready { opacity: 1; }
.bf-progress { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bf-elapsed { color: var(--bf-muted); font: 12px ui-monospace, "SFMono-Regular", monospace; font-variant-numeric: tabular-nums; }
.bf-row-actions { display: flex; flex-direction: column; gap: 5px; margin-left: auto; }
.bf-row-actions .bf-button { min-height: 27px; padding: 4px 9px; font-size: 11px; }
.bf-add { width: 100%; margin-top: 22px; min-height: 46px; border-style: dashed; background: transparent; color: var(--bf-muted); }
.bf-toast { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%); background: var(--bf-ink); color: var(--bf-paper); border-radius: 12px; padding: 12px 18px; max-width: min(520px, 85vw); z-index: 11000; font-size: 13px; box-shadow: 0 4px 25px rgb(0 0 0 / 12%); }
.bf-notice { border: 1px solid #dfb426; border-radius: 12px; padding: 12px 16px; font-size: 12px; margin-bottom: 18px; }
.bf-dialog { position: fixed; inset: 0; margin: auto; overflow: auto; width: min(680px, calc(100vw - 40px)); max-height: calc(100dvh - 64px); box-sizing: border-box; border: 1px solid var(--bf-line); border-radius: 18px; padding: 28px; background: var(--bf-paper); box-shadow: 0 24px 80px rgb(0 0 0 / 20%); animation: bf-enter 200ms cubic-bezier(.23,1,.32,1); }
.bf-dialog::backdrop { background: rgb(15 17 22 / 35%); backdrop-filter: blur(6px); }
.bf-dialog h2 { font-size: 19px; margin: 0 0 14px; }
.bf-dialog p { font-size: 13px; color: var(--bf-muted); line-height: 1.6; }
.bf-preview { width: min(1100px, calc(100vw - 40px)); }
.bf-preview-stage img { max-width: 100%; max-height: 78dvh; object-fit: contain; border-radius: 10px; display: block; margin: auto; }
@media (hover: hover) and (pointer: fine) { .bf-button:hover:not(:disabled) { box-shadow: 0 3px 10px rgb(0 0 0 / 7%); background: color-mix(in srgb, var(--bf-ink) 4%, var(--bf-paper)); } .bf-primary:hover:not(:disabled) { background: #ffdb5b; } }
@media (max-width: 900px) { .bf-reference { gap: 6px; } .bf-reference img { width: 65px; } .bf-reference span { font-size: 10px; } .bf-settings select { max-width: 230px; } .bf-result-image { width: 78px; } }
@media (max-width: 640px) {
  .bf-shell { padding: 16px 0 40px; } .bf-page-head h1 { font-size: 24px; }
  .bf-group-head { padding: 18px 30px 14px 10px; gap: 5px; flex-wrap: wrap; } .bf-group-name { width: 120px; } .bf-summary { min-width: 100px; }
  .bf-folder { margin-left: 35px; } .bf-body { padding: 12px; } .bf-controls { top: 64px; }
  .bf-settings { gap: 8px; } .bf-settings label:first-child { width: 100%; } .bf-settings select { max-width: 100%; } .bf-settings label:first-child select { flex: 1; }
  .bf-intake { gap: 8px; } .bf-dropzone { min-height: 76px; padding: 12px; gap: 8px; font-size: 12px; }
  .bf-columns, .bf-row { grid-template-columns: 22px minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.15fr); gap: 8px; }
  .bf-columns { padding: 0 10px 10px 8px; } .bf-row { height: 198px; padding: 16px 10px 10px 8px; }
  .bf-reference { height: 160px; flex-direction: column; gap: 4px; justify-content: center; } .bf-reference img { width: 100%; height: 88px; } .bf-reference span { -webkit-line-clamp: 2; font-size: 9px; }
  .bf-output { flex-direction: column; gap: 4px; } .bf-output strong { font-size: 10px; } .bf-result-image { width: 100%; height: 70px; }
  .bf-row-actions { margin-left: 0; gap: 4px; } .bf-row-actions .bf-button { min-height: 23px; padding: 3px 6px; font-size: 9px; } .bf-progress { justify-content: center; gap: 5px; } .bf-elapsed { font-size: 10px; } .bf-number { font-size: 10px; }
}
@keyframes bf-enter { from { opacity: 0; transform: translateY(5px) scale(.995); } to { opacity: 1; transform: none; } }
@keyframes bf-pulse { from { opacity: .35; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { #banana-factory-root *, .bf-dialog { animation: none !important; transition: none !important; } }
