:root{
  --paper:#efebe2;
  --paper-2:#f6f3ec;
  --panel:#fbf9f4;
  --ink:#1a1714;
  --ink-soft:#423c34;
  --muted:#8c8475;
  --faint:#b4ab99;
  --line:#e0dace;
  --line-strong:#d2caba;
  --accent:#b89154;
  --accent-soft:#e3d5bc;
  --success:#71806a;
  --shadow-soft:0 1px 2px rgba(40,32,20,.04),0 10px 30px rgba(40,32,20,.06);
  --shadow-pop:0 18px 50px rgba(40,32,20,.12);
  --ease:cubic-bezier(.22,.61,.36,1);
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  color:var(--ink);
  background:var(--paper);
  font-family:"Helvetica Neue","PingFang SC","Microsoft YaHei",system-ui,sans-serif;
  -webkit-font-smoothing:antialiased;
}
body::before{
  content:"";
  position:fixed;
  inset:0;
  background-image:linear-gradient(var(--line) 1px,transparent 1px);
  background-size:100% 46px;
  opacity:.24;
  pointer-events:none;
  z-index:-1;
  mask-image:linear-gradient(180deg,transparent 0,#000 230px);
}
button,input,select,textarea{font:inherit}
button{color:inherit}
a{color:inherit;text-decoration:none}
[hidden]{display:none!important}

.topbar{
  position:sticky;
  top:0;
  z-index:100;
  min-height:86px;
  padding:0 36px;
  display:grid;
  grid-template-columns:1fr auto 1fr;
  align-items:center;
  gap:22px;
  background:rgba(247,246,242,.93);
  backdrop-filter:blur(18px);
  border-bottom:1px solid rgba(0,0,0,.06);
}
.brand-wrap{display:flex;align-items:center;gap:16px;min-width:250px}
.brand{display:flex;align-items:center;gap:14px;min-width:0}
.brand-logo-img{display:block;width:64px;height:64px;min-width:64px;max-width:64px;min-height:64px;max-height:64px;object-fit:contain;flex:0 0 auto;background:transparent;border-radius:0}
.brand-name{font-size:14px;letter-spacing:.32em;white-space:nowrap}
.workflow-label{font-size:11px;color:var(--muted);letter-spacing:.14em;white-space:nowrap}
.prototype-title{text-align:center;min-width:0}
.prototype-title span{display:block;font-size:10px;letter-spacing:.25em;color:var(--muted);margin-bottom:5px}
.prototype-title strong{display:block;max-width:360px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:15px;font-weight:600}
.top-actions{display:flex;justify-content:flex-end;align-items:center;gap:12px}
.top-link,.lang-toggle{height:40px;border:1px solid var(--line-strong);border-radius:999px;background:var(--panel);transition:.25s var(--ease)}
.top-link{display:inline-flex;align-items:center;justify-content:center;padding:0 16px;font-size:12px;white-space:nowrap}
.top-link:hover,.lang-toggle:hover{background:#111;color:#fff;border-color:#111}
.lang-toggle{width:44px;cursor:pointer}

.page-shell{max-width:1580px;margin:0 auto;padding:26px 28px 54px}
.workspace{
  display:grid;
  grid-template-columns:minmax(230px,.74fr) minmax(330px,1fr) minmax(340px,1.16fr);
  gap:15px;
  align-items:stretch;
}
.panel{
  min-width:0;
  background:rgba(251,249,244,.92);
  border:1px solid var(--line);
  border-radius:23px;
  padding:21px;
  box-shadow:var(--shadow-soft);
}
.panel-heading{display:flex;align-items:center;gap:12px;margin-bottom:15px}
.step-index{display:grid;place-items:center;width:39px;height:39px;flex:none;border:1px solid var(--line-strong);border-radius:12px;color:var(--accent);font-weight:700;background:#fff}
.panel-kicker{margin:0;color:var(--accent);font:600 9px/1.2 ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.22em}
.panel-heading h2{font-size:18px;margin:4px 0 0;line-height:1.25}
.template-summary{margin:-3px 1px 11px;color:var(--ink-soft);font-size:11px;line-height:1.65}

.case-figure{margin:0;background:#fff;border:1px solid var(--line);border-radius:17px;padding:8px}
.case-figure img{width:100%;aspect-ratio:4/5;object-fit:contain;object-position:center;display:block;border-radius:11px;background:#fff;filter:saturate(.84) contrast(.97)}
.case-figure figcaption{padding:8px 3px 2px;color:var(--muted);font-size:10px;line-height:1.5}
.template-tags{display:flex;flex-wrap:wrap;gap:6px;margin-top:11px}
.template-tag{padding:6px 9px;border:1px solid var(--line);border-radius:999px;background:var(--paper-2);font-size:10px;color:var(--ink-soft);line-height:1}
.structure-note{display:flex;gap:9px;margin-top:10px;padding:10px 11px;background:var(--paper-2);border:1px solid var(--line);border-radius:13px}
.note-dot{width:7px;height:7px;border-radius:50%;background:var(--success);margin-top:5px;flex:none}
.structure-note p{margin:0;font-size:10px;line-height:1.55;color:var(--ink-soft)}
.fit-details{margin-top:9px;border-top:1px solid var(--line)}
.fit-details summary{padding:10px 1px 2px;color:var(--ink-soft);font-size:10px;cursor:pointer;list-style:none}
.fit-details summary::-webkit-details-marker{display:none}
.fit-details summary::after{content:"＋";float:right;color:var(--muted)}
.fit-details[open] summary::after{content:"−"}
.fit-grid{display:grid;grid-template-columns:1fr;gap:8px;padding:8px 0 1px}
.fit-grid h3{font-size:11px;margin:0 0 4px}
.fit-grid ul{margin:0;padding:0;list-style:none}
.fit-grid li{position:relative;padding:3px 0 3px 13px;font-size:10px;line-height:1.5;color:var(--ink-soft)}
.fit-grid li::before{content:"";position:absolute;left:1px;top:9px;width:4px;height:4px;border-radius:50%;background:var(--accent)}
.fit-grid .muted-list li{color:var(--muted)}
.fit-grid .muted-list li::before{background:var(--faint)}

.upload-card{position:relative;min-height:218px;border:1px dashed var(--line-strong);border-radius:18px;background:var(--paper-2);cursor:pointer;overflow:hidden;transition:.25s var(--ease);outline:none}
.upload-card:hover,.upload-card:focus-visible,.upload-card.is-dragover{border-color:var(--accent);box-shadow:0 0 0 4px rgba(184,145,84,.1)}
.upload-empty{min-height:218px;padding:24px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center}
.upload-icon{display:grid;place-items:center;width:49px;height:49px;border-radius:15px;border:1px solid var(--line-strong);background:#fff;font-size:26px;font-weight:200;color:var(--accent);margin-bottom:12px}
.upload-empty strong{font-size:15px;margin-bottom:6px}
.upload-empty p{font-size:11px;color:var(--ink-soft);margin:0 0 7px}
.upload-empty small{color:var(--muted);font-size:9px}
.upload-preview{position:absolute;inset:0;background:#fff}
.upload-preview img{width:100%;height:100%;object-fit:contain;display:block;background:#f7f5ef}
.source-preview-grid{width:100%;height:100%;padding:10px 10px 54px;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-auto-rows:1fr;gap:7px;background:#f7f5ef}
.source-preview-grid[hidden]{display:none}
.source-preview-grid img{width:100%;height:100%;min-height:0;object-fit:cover;background:#ebe7df;border-radius:8px}
.source-preview-grid img:first-child{grid-column:span 2;grid-row:span 2}
.preview-overlay{position:absolute;left:10px;right:10px;bottom:10px;padding:10px 12px;border-radius:11px;background:rgba(26,23,20,.82);color:#fff;backdrop-filter:blur(8px);display:flex;justify-content:space-between;gap:10px;align-items:center}
.preview-overlay strong{font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.preview-overlay span{font-size:9px;color:#e9e4da;white-space:nowrap}
.demo-button{margin:8px 1px 0}
.parameter-form fieldset{border:0;margin:13px 0 0;padding:0}
.parameter-form legend{font-size:11px;font-weight:600;margin-bottom:7px}
.parameter-form legend span{font-weight:400;color:var(--muted)}
.dynamic-parameters{display:grid;grid-template-columns:1fr;gap:0}
.select-wrap{position:relative}
.select-wrap::after{content:"⌄";position:absolute;right:14px;top:50%;transform:translateY(-55%);pointer-events:none;color:var(--muted)}
select,textarea{width:100%;border:1px solid var(--line-strong);background:#fff;color:var(--ink);border-radius:12px;outline:none;transition:.2s}
select{appearance:none;height:40px;padding:0 38px 0 13px;font-size:11px}
textarea{height:64px;padding:11px 12px;resize:none;line-height:1.5;font-size:11px}
select:focus,textarea:focus{border-color:var(--accent);box-shadow:0 0 0 4px rgba(184,145,84,.1)}
.segmented{display:grid;grid-template-columns:repeat(3,1fr);gap:6px}
.segmented.segmented-2{grid-template-columns:repeat(2,1fr)}
.segmented button{height:38px;border:1px solid var(--line-strong);border-radius:11px;background:#fff;cursor:pointer;font-size:11px;transition:.22s var(--ease)}
.segmented button:hover{border-color:var(--accent)}
.segmented button.is-active{background:var(--ink);color:#fff;border-color:var(--ink);box-shadow:0 7px 18px rgba(26,23,20,.14)}
.field-meta{display:flex;justify-content:space-between;margin-top:5px;color:var(--muted);font-size:9px}
.advanced-settings{margin-top:11px;border-top:1px solid var(--line)}
.advanced-settings summary{list-style:none;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px 1px 2px;cursor:pointer;font-size:10px;font-weight:600}
.advanced-settings summary::-webkit-details-marker{display:none}
.advanced-settings summary::after{content:"＋";margin-left:auto;color:var(--muted);font-weight:400}
.advanced-settings[open] summary::after{content:"−"}
.advanced-settings-count{margin-left:auto;color:var(--muted);font-size:9px;font-weight:400}
.advanced-settings-hint{margin:6px 1px 0;color:var(--muted);font-size:9px;line-height:1.5}
.advanced-settings .dynamic-parameters{padding-bottom:1px}
.generate-box{display:flex;justify-content:space-between;align-items:center;gap:14px;margin-top:14px;padding-top:13px;border-top:1px solid var(--line)}
.generate-box span{font-size:9px;color:var(--muted);display:block;margin-bottom:3px}
.generate-box strong{font-size:11px}
.primary-button,.secondary-button{display:inline-flex;align-items:center;justify-content:center;gap:10px;border-radius:12px;border:1px solid var(--ink);min-height:42px;padding:0 16px;cursor:pointer;transition:.25s var(--ease)}
.action-primary{min-width:138px}
.primary-button{background:var(--ink);color:#fff;min-width:138px;font-size:12px}
.primary-button:hover:not(:disabled){transform:translateY(-2px);box-shadow:var(--shadow-pop)}
.primary-button:disabled{opacity:.35;cursor:not-allowed}
.secondary-button{background:#fff;color:var(--ink);font-size:11px}
.secondary-button:hover{background:var(--ink);color:#fff}
.text-button,.copy-button{border:0;background:transparent;padding:5px 0;color:var(--ink-soft);cursor:pointer;font-size:10px;text-decoration:underline;text-decoration-color:var(--line-strong);text-underline-offset:4px}
.text-button:hover,.copy-button:hover{color:var(--accent)}

.result-panel{display:flex;flex-direction:column}
.result-stage{position:relative;flex:1;min-height:480px;border:1px solid var(--line);border-radius:18px;background:var(--paper-2);overflow:hidden}
.result-empty,.result-loading{height:100%;min-height:480px;display:flex;align-items:center;justify-content:center;flex-direction:column;text-align:center;padding:26px}
.result-symbol{font-size:33px;color:var(--accent);margin-bottom:12px}
.result-empty strong,.result-loading strong{font-size:15px}
.result-empty p,.result-loading p{margin:7px 0 0;color:var(--muted);font-size:10px;line-height:1.6}
.loading-orbit{width:58px;height:58px;border:1px solid var(--line-strong);border-radius:50%;display:grid;place-items:center;margin-bottom:16px;animation:spin 2.8s linear infinite}
.loading-orbit span{width:14px;height:14px;border-radius:50%;background:var(--accent);transform:translateY(-23px)}
@keyframes spin{to{transform:rotate(360deg)}}
.progress-track{width:min(260px,80%);height:4px;background:var(--line);border-radius:99px;margin-top:18px;overflow:hidden}
.progress-track span{display:block;width:0;height:100%;background:var(--accent);transition:width .7s var(--ease)}
.result-success{padding:9px}
.result-image-wrap{position:relative;background:#fff;border-radius:14px;overflow:hidden}
.result-image-wrap img{width:100%;height:auto;max-height:500px;object-fit:contain;display:block}
.result-label{position:absolute;left:11px;top:11px;padding:7px 9px;border-radius:999px;background:rgba(26,23,20,.78);color:#fff;font-size:8px;letter-spacing:.08em}
.result-actions{display:flex;align-items:center;gap:7px;margin-top:10px;flex-wrap:wrap}
.result-actions .primary-button{min-width:138px}

.detail-grid{display:grid;grid-template-columns:1.25fr .75fr;gap:16px}
.detail-grid article{background:var(--paper-2);border:1px solid var(--line);border-radius:15px;padding:16px;min-width:0}
.detail-heading{display:flex;justify-content:space-between;gap:12px;align-items:center}
.detail-grid h3{font-size:11px;margin:0 0 11px}
pre{margin:0;white-space:pre-wrap;word-break:break-word;color:var(--ink-soft);font:10px/1.7 ui-monospace,SFMono-Regular,Menlo,monospace}
dl{margin:0}
dl div{display:grid;grid-template-columns:78px 1fr;gap:10px;padding:7px 0;border-bottom:1px solid var(--line)}
dl div:last-child{border-bottom:0}
dt{font-size:9px;color:var(--muted)}
dd{margin:0;font-size:9px;word-break:break-word}
.detail-dialog{width:min(960px,calc(100vw - 34px));max-height:min(78vh,760px);padding:0;border:1px solid var(--line);border-radius:22px;background:var(--panel);box-shadow:var(--shadow-pop);color:var(--ink)}
.detail-dialog::backdrop{background:rgba(24,20,15,.38);backdrop-filter:blur(5px)}
.dialog-shell{padding:21px;overflow:auto;max-height:min(78vh,760px)}
.dialog-heading{display:flex;justify-content:space-between;align-items:start;gap:16px;margin-bottom:16px}
.dialog-heading small{display:block;color:var(--accent);font-size:8px;letter-spacing:.2em;margin-bottom:5px}
.dialog-heading h2{margin:0;font-size:19px}
.dialog-close{width:36px;height:36px;border:1px solid var(--line-strong);border-radius:50%;background:#fff;font-size:21px;line-height:1;cursor:pointer}
.dialog-close:hover{background:var(--ink);color:#fff}

/* Desktop fixed workspace: keep three columns from 1000px upward. */
@media (min-width:1000px) and (min-height:700px){
  html,body{height:100%;overflow:hidden}
  .topbar{position:relative;min-height:76px;height:76px;padding:0 30px}
  .brand-logo-img{width:64px;height:64px;min-width:64px;max-width:64px;min-height:64px;max-height:64px}
  .brand-wrap{min-width:240px}
  .brand{min-width:0}
  .workflow-label{font-size:10px}
  .page-shell{height:calc(100vh - 72px);max-width:none;padding:14px 22px 18px;overflow:hidden}
  .workspace{height:100%;min-height:0;grid-template-columns:minmax(210px,.72fr) minmax(315px,1fr) minmax(325px,1.17fr);gap:13px}
  .panel{height:100%;min-height:0;padding:17px;border-radius:20px;overflow:auto;scrollbar-width:thin;scrollbar-color:var(--line-strong) transparent}
  .panel-heading{position:sticky;top:-17px;z-index:3;margin-bottom:11px;padding:17px 0 7px;background:linear-gradient(var(--panel) 76%,rgba(251,249,244,0))}
  .step-index{width:35px;height:35px;border-radius:10px}
  .panel-heading h2{font-size:16px;margin-top:3px}
  .template-summary{font-size:10px;margin-bottom:8px}
  .case-figure{padding:7px;border-radius:14px}
  .case-figure img{aspect-ratio:auto;max-height:36vh;object-fit:contain}
  .case-figure figcaption{padding-top:6px;font-size:9px}
  .template-tags{margin-top:8px;gap:5px}
  .template-tag{padding:5px 7px;font-size:9px}
  .structure-note{margin-top:8px;padding:8px 9px}
  .structure-note p{font-size:9px}
  .fit-details{margin-top:7px}
  .fit-details summary{padding-top:8px;font-size:9px}
  .fit-grid li{font-size:9px;padding-top:2px;padding-bottom:2px}
  .upload-card,.upload-empty{min-height:176px}
  .upload-empty{padding:19px}
  .upload-icon{width:44px;height:44px;margin-bottom:10px}
  .parameter-form fieldset{margin-top:10px}
  .parameter-form legend{font-size:10px;margin-bottom:6px}
  select{height:37px}
  .segmented button{height:35px;font-size:10px}
  textarea{height:55px}
  .generate-box{position:sticky;bottom:-17px;z-index:4;margin-top:10px;padding:11px 0 17px;background:linear-gradient(rgba(251,249,244,0),var(--panel) 18%,var(--panel) 100%)}
  .result-panel{overflow:hidden}
  .result-stage{height:100%;min-height:0;flex:1}
  .result-empty,.result-loading{height:100%;min-height:0}
  .result-success{height:100%;display:flex;flex-direction:column}
  .result-image-wrap{flex:1;min-height:0;display:grid;place-items:center}
  .result-image-wrap img{width:100%;height:100%;max-height:none;object-fit:contain}
  .result-actions{flex:none}
}

@media (min-width:1000px) and (max-width:1180px) and (min-height:700px){
  .upload-card,.upload-empty{min-height:160px}
  .upload-empty{padding:16px}
  .parameter-form fieldset{margin-top:9px}
  textarea{height:50px}
  .result-actions{display:grid;grid-template-columns:1fr 1fr;gap:6px}
  .result-actions .secondary-button{width:100%;padding:0 8px}
  .result-actions .text-button{width:100%;text-align:center}
}

/* Natural-scroll medium layout below the fixed desktop breakpoint. */
@media (max-width:999px) and (min-width:761px){
  .topbar{grid-template-columns:1fr auto}.prototype-title{display:none}
  .brand-wrap{gap:10px}
  .workflow-label{display:none}
  .top-actions{gap:8px}
  .top-link{padding:0 12px;font-size:11px}
  .workspace{grid-template-columns:minmax(260px,.82fr) minmax(390px,1.18fr)}
  .result-panel{grid-column:1/-1}
  .result-stage,.result-empty,.result-loading{min-height:520px}
  .case-figure img{max-height:420px;aspect-ratio:auto}
}

@media(max-width:760px){
  html,body{height:auto;overflow:auto}
  .topbar{grid-template-columns:1fr auto;padding:0 17px;min-height:74px}
  .prototype-title,.workflow-label{display:none}
  .brand-wrap{min-width:auto}
  .brand{min-width:auto}
  .brand-name{font-size:11px;letter-spacing:.22em}
  .brand-logo-img{width:44px;height:44px;min-width:44px;max-width:44px;min-height:44px;max-height:44px}
  .page-shell{padding:20px 14px 48px}
  .workspace{display:block}
  .panel{margin-bottom:13px;padding:18px}
  .case-panel{display:grid;grid-template-columns:145px 1fr;gap:13px}
  .case-panel .panel-heading,.case-panel .template-summary,.case-panel .structure-note,.case-panel .fit-details{grid-column:1/-1}
  .case-figure img{aspect-ratio:3/4}
  .template-tags{align-content:start;margin-top:0}
  .result-stage,.result-empty,.result-loading{min-height:430px}
  .detail-grid{grid-template-columns:1fr}
  .detail-dialog{width:calc(100vw - 22px)}
  .dialog-shell{padding:15px}
}

@media(max-width:520px){
  .source-preview-grid{grid-template-columns:repeat(2,minmax(0,1fr));padding-bottom:58px}
  .source-preview-grid img:first-child{grid-column:span 2;grid-row:span 1}
  .top-actions{gap:5px}.top-link{padding:0 10px;font-size:10px;height:37px}.lang-toggle{width:39px;height:37px}
  .case-panel{display:block}.template-tags{margin-top:10px}
  .generate-box{align-items:stretch;flex-direction:column}.primary-button{width:100%}
  .preview-overlay{display:block}.preview-overlay span{display:block;margin-top:4px}
  .result-actions{display:grid;grid-template-columns:1fr 1fr}
  .result-actions .text-button{grid-column:1/-1}
  .secondary-button{width:100%}
}


/* v376-fixed public-state closure: the page is a workflow demo, not a live generation service. */
.public-status-banner{
  width:min(1460px,calc(100% - 44px));margin:14px auto 0;padding:12px 16px;border:1px solid #d3c6ad;border-radius:14px;
  background:#fffaf0;color:#3d352a;display:flex;align-items:center;gap:12px;box-shadow:var(--shadow-soft)
}
.public-status-banner strong{font-size:12px;white-space:nowrap}
.public-status-banner span{font-size:10px;line-height:1.55;color:var(--muted)}
.generate-box .primary-button:disabled{opacity:.62;background:#6f685e;border-color:#6f685e}
@media (min-width:1000px) and (min-height:700px){
  .public-status-banner{margin-top:8px;padding:8px 14px}
  .page-shell{height:calc(100vh - 118px)}
}
@media (max-width:760px){
  .public-status-banner{width:calc(100% - 24px);margin-top:10px;align-items:flex-start;flex-direction:column;gap:4px}
  .public-status-banner strong{white-space:normal}
}
