:root {
    color-scheme: light;
    --ink: #292532;
    --muted: #686272;
    --line: #dedbe2;
    --accent: #655189;
    font: 16px/1.6 "DM Sans", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
    color: var(--ink);
    background: #f8f7f9;
}
* {box-sizing: border-box}
body {margin: 0}
[hidden] {display: none !important}
h1,h2,h3,p {margin: 0}
h1 {font-size: clamp(2rem, 3.3vw, 3.2rem); line-height: 1.22; letter-spacing: -.055em; font-weight: 660}
h2 {font-size: 1.05rem}
input,button,select,textarea {font: inherit; color: inherit}
button,a,summary {cursor: pointer}
:focus-visible {outline: 3px solid #8f74bb; outline-offset: 3px}
.bar {height: 74px; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(20px,5vw,84px); border-bottom: 1px solid var(--line); background: #fff}
.brand {display: flex; align-items: center; gap: 10px}
.brand b {font-size: 1.28rem; letter-spacing: .05em}
.brand span,.eyebrow,.bar-meta,.cover-title span {font-family: "IBM Plex Mono", ui-monospace, monospace}
.brand span {font-size: .76rem; letter-spacing: .12em; margin-left: 3px; padding-left: 14px; border-left: 1px solid var(--line)}
.mark {width: 28px; height: 28px; border-radius: 50%; background: repeating-linear-gradient(125deg, var(--accent) 0 3px, transparent 3px 5px); transform: rotate(-8deg)}
.bar-meta {font-size: .84rem; color: var(--muted)}
.login {width: min(1140px,90%); margin: clamp(34px,7vh,80px) auto; display: grid; grid-template-columns: 1fr 1fr; background: #fff; border: 1px solid var(--line); border-radius: 18px; overflow: hidden}
.cover {position: relative; height: clamp(500px,69vh,730px); overflow: hidden}
.cover img,.sample-img img {width: 100%; height: 100%; object-fit: cover; display: block}
.cover-title {position: absolute; bottom: 6%; left: 8%; color: #fff9f7; font-family: "Songti SC", "Noto Serif CJK SC", serif; font-size: clamp(1.9rem,3vw,3rem); letter-spacing: .12em}
.cover-title span {display: block; font-size: .8rem; letter-spacing: .06em}
.entry {display: grid; align-items: center; padding: clamp(30px,5vw,76px)}
.entry-inner {width: 100%; max-width: 400px; margin: auto}
.eyebrow {color: var(--accent); font-size: .78rem; font-weight: 650; letter-spacing: .14em; margin-bottom: 12px}
.lead {color: var(--muted); margin: 14px 0 34px}
label {display: block; font-size: .92rem; font-weight: 600}
input:not([type=file]),textarea,select {display: block; width: 100%; background: #fff; border: 1px solid #cfcbd5; border-radius: 8px; padding: 10px 12px; margin-top: 7px; font-size: 1rem; font-weight: 400}
textarea {min-height: 133px; resize: vertical}
input::placeholder,textarea::placeholder {color: #827b89}
select {appearance: none; padding-right: 33px; background: linear-gradient(45deg,transparent 50%,#665e70 50%) calc(100% - 17px) 52% / 5px 5px no-repeat,linear-gradient(135deg,#665e70 50%,transparent 50%) calc(100% - 12px) 52% / 5px 5px no-repeat,#fff}
.primary {display: block; width: 100%; background: var(--accent); color: white; border: 0; border-radius: 8px; padding: 12px; margin-top: 22px; font-weight: 600}
.primary:hover {background: #513e74}
.primary:disabled {opacity: .7; cursor: progress}
.notice {font-size: .9rem; color: #824520; background: #fff4e9; border-radius: 6px; padding: 8px 12px; margin-top: 12px; overflow-wrap: anywhere}
.quiet {font-size: .88rem; text-decoration: none; color: var(--accent); background: #f5f2f8; border: 1px solid #e5dfeb; padding: 5px 12px; border-radius: 6px}
.quiet:hover {background: #ebe5f1}
.studio {width: min(1280px,90%); margin: 36px auto 60px}
.workspace {display: grid; grid-template-columns: minmax(330px,.85fr) minmax(0,1.15fr); gap: 24px; align-items: start; margin-top: 25px}
.editor,.preview {padding: clamp(18px,2.1vw,32px); background: white; border: 1px solid var(--line); border-radius: 14px}
.reference-head,.preview-head,.caption {display: flex; align-items: center; justify-content: space-between; gap: 12px}
.reference-head {margin: 18px 0 7px}
.reference-head span,.preview-head span,small {font-size: .8rem; color: var(--muted)}
.upload {position: relative; text-align: center; background: #faf8fc; border: 1px dashed #b9acc8; border-radius: 8px; padding: 13px; color: var(--accent)}
.upload:focus-within {outline: 3px solid #8f74bb}
.upload input {position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; opacity: 0}
.upload strong,.upload small {display: block}
.upload strong {font-size: .94rem}
#references {padding: 0; margin: 0; list-style: none}
#references li {display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line)}
#references img {width: 42px; height: 42px; object-fit: cover; border-radius: 5px}
#references span {flex: 1; overflow-wrap: anywhere; font-size: .9rem}
.fields {display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-top: 18px}
details {margin-top: 20px; border-top: 1px solid var(--line); padding-top: 12px}
summary {color: var(--muted); font-size: .9rem}
.preview-head {margin-bottom: 18px}
.sample-img {aspect-ratio: 1.23; overflow: hidden; border-radius: 8px}
.sample-img img {object-position: 50% 52%}
.caption {margin-top: 12px}
.caption h3 {font-size: 1.1rem}
#results article + article {margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line)}
#results img {display: block; max-width: 100%; max-height: 75vh; margin: auto}
@media (max-width: 760px) {
    .bar {height: 60px}
    .login {grid-template-columns: 1fr; max-width: 510px; margin: 20px auto}
    .cover {height: clamp(160px,32vh,280px)}
    .cover img {object-position: center 56%}
    .entry {padding: 28px}
    .workspace {grid-template-columns: 1fr}
    .studio {margin-top: 24px; width: 93%}
}
@media (max-width: 380px) {
    .brand span {display: none}
    .fields {grid-template-columns: 1fr}
}
.workspace-nav {display: flex; align-items: center; gap: 16px; font-size: .9rem}
.workspace-nav a,.archive a {color: var(--accent)}
.archive > h1 {margin: 12px 0}
.archive-list {background: white; border: 1px solid var(--line); border-radius: 12px; padding: 8px 20px; margin: 22px 0}
.archive-list > p {padding: 16px 0}
.archive-row {display: grid; gap: 3px; padding: 14px 0; text-decoration: none}
.archive-row + .archive-row {border-top: 1px solid var(--line)}
.archive-row strong {color: var(--ink); overflow-wrap: anywhere}
.archive-row:hover strong {text-decoration: underline}
.archive-time {color: var(--muted); font-size: .88rem}
.full-prompt,.archive pre {white-space: pre-wrap; overflow-wrap: anywhere; margin: 8px 0 20px}
.archive .workspace > * {min-width: 0; overflow-wrap: anywhere}
.param-list {display: grid; grid-template-columns: auto 1fr; column-gap: 14px; font-size: .9rem}
.param-list dt,.param-list dd {margin: 0; padding: 6px 0; border-bottom: 1px solid var(--line)}
.param-list dt {color: var(--muted)}
@media (max-width: 550px) {.bar:has(.workspace-nav) .brand span {display: none}}
