:root {
  color-scheme: light;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: #242a24;
  background: #f6f5ef;
  --paper: #fffefa;
  --border: #dadbd1;
  --muted: #686d64;
  --green: #345546;
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
button, input, textarea { font: inherit; }
a, button, input, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid #3c725a; outline-offset: 3px; }
.site-header { border-bottom: 1px solid var(--border); }
.header-inner, .layout { width: min(100% - 72px, 1264px); margin-inline: auto; }
.header-inner { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-weight: 700; letter-spacing: -.025em; }
.brand-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: #2a4438; }
.brand-icon::before { content: ""; width: 12px; height: 12px; border: 1px solid #dbe6d5; transform: skewY(-15deg); box-shadow: 3px 3px 0 -1px #2a4438, 4px 4px 0 -1px #dbe6d5; }
.connection { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .875rem; font-weight: 500; }
.connection > span { width: 7px; height: 7px; background: #a66c2e; border-radius: 50%; }
.layout { padding-block: 42px 48px; }
.intro { margin-bottom: 26px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(2.125rem, 5vw, 3.3rem); line-height: 1.15; letter-spacing: -.065em; }
.intro p { margin-top: 12px; color: var(--muted); line-height: 1.6; }
.workspace { display: grid; grid-template-columns: minmax(335px, .86fr) minmax(0, 1.5fr); gap: 20px; align-items: stretch; }
.controls, .preview { border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.controls { display: flex; flex-direction: column; padding: 23px; background: var(--paper); }
.section-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 9px; }
.section-heading label, legend { font-weight: 650; font-size: .9375rem; }
.text-button { padding: 0; border: 0; background: transparent; color: var(--green); cursor: pointer; font-size: .875rem; font-weight: 650; }
.text-button:hover { text-decoration: underline; }
textarea { width: 100%; min-height: 105px; padding: 12px; resize: vertical; border: 1px solid var(--border); border-radius: 9px; color: inherit; background: #f9f8f3; line-height: 1.55; }
textarea::placeholder { color: #757a70; }
.reference, fieldset { margin-top: 20px; }
.optional { margin-left: 4px; color: var(--muted); font-size: .8125rem; font-weight: 400; }
.dropzone { position: relative; display: flex; align-items: center; gap: 10px; min-height: 68px; padding: 10px 12px; border: 1px dashed #adb6a9; border-radius: 9px; background: #fafaf5; }
.dropzone:focus-within, .dropzone.dragging, .dropzone:hover { border-color: var(--green); background: #edf2e9; }
.dropzone input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dropzone img { display: block; width: 44px; height: 44px; object-fit: cover; border-radius: 5px; }
.dropzone-text { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
#reference-label { overflow: hidden; color: #394b3b; text-overflow: ellipsis; white-space: nowrap; font-size: .875rem; font-weight: 650; }
.dropzone small, .field-status, .generate-status { color: var(--muted); font-size: .8125rem; line-height: 1.4; }
.upload-icon { margin-left: auto; color: var(--green); font-size: 1.2rem; }
.field-status:not(:empty) { margin-top: 6px; color: #9b402c; }
fieldset { min-width: 0; padding: 0; border: 0; margin-inline: 0; }
legend { padding: 0; margin-bottom: 9px; }
.choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.choices label { position: relative; }
.choices input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.choices span { display: block; padding: 9px 4px; border: 1px solid var(--border); border-radius: 7px; color: #555d51; text-align: center; font-size: .875rem; white-space: nowrap; cursor: pointer; }
.choices input:checked + span { border-color: #7f9a85; background: #e9efe6; color: #274833; font-weight: 650; }
.choices input:focus-visible + span { outline: 2px solid #3c725a; outline-offset: 2px; }
.generate { width: 100%; margin-top: 23px; padding: 12px; border: none; border-radius: 8px; background: #345546; color: #fff; font-weight: 650; }
.generate:disabled { background: #e2e7df; color: #5c675c; }
.generate-status { margin-top: 7px; text-align: center; }
.preview { display: flex; flex-direction: column; min-height: 500px; border-color: #303f34; background: #1f2923; color: #f8faf5; }
.preview-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 63px; padding: 0 22px; border-bottom: 1px solid #3c483e; }
.preview-heading h2 { font-size: .9375rem; font-weight: 650; }
.preview-heading output { font-size: .875rem; font-variant-numeric: tabular-nums; color: #d3ded0; }
.canvas { display: grid; place-items: center; flex: 1; padding: 27px; background-image: radial-gradient(#546055 1px, transparent 1px); background-size: 20px 20px; }
.preview-frame { display: grid; place-content: center; justify-items: center; gap: 17px; width: min(100%, 560px); aspect-ratio: 3 / 2; border: 1px dashed #667669; border-radius: 10px; background: #253128; }
.preview-frame[data-ratio="1:1"] { width: min(100%, 395px); aspect-ratio: 1; }
.preview-frame[data-ratio="2:3"] { width: min(64%, 275px); aspect-ratio: 2 / 3; }
.preview-frame p { margin-inline: 12px; text-align: center; color: #cbd7c9; font-size: .875rem; }
.frame-icon { position: relative; width: 44px; height: 34px; border: 1px solid #95ab95; border-radius: 5px; overflow: hidden; }
.frame-icon::before, .frame-icon::after { content: ""; position: absolute; width: 25px; height: 25px; border-left: 1px solid #95ab95; border-top: 1px solid #95ab95; transform: rotate(45deg); }
.frame-icon::before { bottom: -14px; left: 0; }
.frame-icon::after { bottom: -17px; right: -2px; }
.frame-icon i { position: absolute; top: 7px; right: 9px; width: 6px; height: 6px; border: 1px solid #95ab95; border-radius: 50%; }
@media (max-width: 820px) {
  .header-inner, .layout { width: min(100% - 36px, 680px); }
  .layout { padding-block: 28px 36px; }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .preview { min-height: 390px; }
  .canvas { padding: 20px; }
}
@media (max-width: 390px) {
  .header-inner, .layout { width: calc(100% - 24px); }
  .controls { padding: 16px; }
  .choices span { font-size: .8125rem; }
}
