:root { color-scheme: light; --ink: #17191d; --muted: #737780; --line: #e1e3e7; --soft: #f2f3f5; --accent: #ff5a36; --accent-dark: #db4423; --white: #fff; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: #f8f8f7; color: var(--ink); font-family: "Segoe UI", "Microsoft YaHei UI", sans-serif; }
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { height: 78px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(24px, 6vw, 96px); background: rgba(248,248,247,.88); }
.brand { font-family: "Segoe UI", "Microsoft YaHei UI", sans-serif; font-weight: 700; letter-spacing: 0; font-size: 18px; display: flex; align-items: center; gap: 10px; }
.brand-mark { color: var(--accent); font-size: 24px; line-height: 1; }
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.model-chip { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.logout-button { background: transparent; border: 1px solid var(--line); color: var(--muted); font-size: 12px; padding: 8px 11px; }
.logout-button:hover { background: var(--soft); color: var(--ink); }
.status-dot { width: 7px; height: 7px; background: #34b27b; border-radius: 50%; }
.workspace { width: min(920px, calc(100% - 40px)); margin: 0 auto; padding: clamp(58px, 10vw, 112px) 0 80px; flex: 1; }
.intro { max-width: 680px; margin-bottom: 42px; }
.eyebrow { margin: 0 0 12px; color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: .14em; }
h1, h2 { font-family: "Segoe UI", "Microsoft YaHei UI", sans-serif; letter-spacing: 0; margin: 0; }
h1 { font-size: clamp(42px, 7vw, 76px); line-height: .98; }
h2 { font-size: 30px; }
.lede { color: var(--muted); font-size: 17px; margin: 22px 0 0; line-height: 1.6; }
.composer { background: var(--white); border: 1px solid var(--line); padding: 22px; box-shadow: 0 18px 50px rgba(23,25,29,.06); }
.composer label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 10px; font-weight: 600; }
textarea { display: block; width: 100%; min-height: 154px; resize: vertical; border: 0; outline: 0; font: inherit; font-size: 17px; line-height: 1.6; color: var(--ink); background: transparent; }
textarea::placeholder { color: #b5b8bd; }
.reference-field { border-top: 1px solid var(--line); padding-top: 17px; margin-top: 8px; }
.reference-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.reference-heading label { margin: 0; }
.reference-heading span { color: #a0a3aa; font-size: 12px; }
#reference-image { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.reference-picker { min-height: 76px; border: 1px dashed #c9ccd1; color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; font-size: 13px; transition: border-color .2s, color .2s, background .2s; }
.reference-picker:hover, .reference-picker:focus-within, .reference-picker.is-dragging { border-color: var(--accent); color: var(--accent); background: #fff9f7; }
.upload-icon { font-size: 22px; line-height: 1; font-weight: 400; }
.reference-previews { display: grid; gap: 10px; margin-top: 10px; }
.reference-preview { display: flex; align-items: center; gap: 14px; min-width: 0; padding: 8px; border: 1px solid var(--line); }
.reference-preview img { width: 64px; height: 64px; object-fit: cover; display: block; flex: 0 0 auto; }
.reference-meta { min-width: 0; flex: 1; }
.reference-meta strong, .reference-meta span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reference-meta strong { font-size: 13px; margin-bottom: 5px; }
.reference-meta span { color: var(--muted); font-size: 12px; }
button.remove-reference { background: var(--soft); color: var(--ink); font-size: 12px; font-weight: 600; padding: 9px 12px; }
button.remove-reference:hover { background: #e6e7e9; }
button.remove-reference:disabled { cursor: wait; }
.composer-footer { border-top: 1px solid var(--line); padding-top: 17px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.controls { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.control-group { display: flex; align-items: center; gap: 10px; }
.controls .select-label { margin: 0; white-space: nowrap; }
select { border: 1px solid var(--line); background: var(--soft); color: var(--ink); padding: 10px 32px 10px 12px; font: inherit; font-size: 13px; border-radius: 4px; }
button, .download { border: 0; background: var(--accent); color: white; font: inherit; font-weight: 700; cursor: pointer; padding: 12px 18px; border-radius: 4px; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; transition: background .2s, transform .2s; }
button:hover, .download:hover { background: var(--accent-dark); }
button:disabled { cursor: wait; opacity: .7; transform: none; }
.button-icon { font-size: 16px; }
.notice { min-height: 26px; margin: 15px 2px 0; color: var(--muted); font-size: 13px; }
.notice.error { color: #c53d28; }
.history { margin-top: 64px; }
.history-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 22px; }
.clear-history { background: transparent; border: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 600; padding: 9px 12px; }
.clear-history:hover { background: var(--soft); color: var(--ink); }
.history-empty { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 54px 20px; text-align: center; color: #9a9da3; }
.history-empty span { color: var(--accent); font-size: 24px; }
.history-empty p { margin: 12px 0 0; font-size: 14px; }
.history-list { display: grid; gap: 34px; }
.history-entry { border-top: 1px solid var(--line); padding-top: 20px; }
.entry-header { margin-bottom: 16px; }
.entry-identity { display: flex; align-items: flex-start; gap: 13px; min-width: 0; }
.entry-references { display: grid; grid-template-columns: repeat(2, 20px); gap: 3px; flex: 0 0 auto; }
.entry-reference { width: 20px; height: 20px; object-fit: cover; }
.entry-references .entry-reference:only-child { width: 44px; height: 44px; grid-column: span 2; grid-row: span 2; }
.entry-identity > div { min-width: 0; }
.entry-prompt { margin: 0; font-size: 15px; line-height: 1.55; white-space: pre-wrap; }
.entry-meta { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.entry-image { display: block; width: 100%; max-height: 720px; object-fit: contain; background: #eceef0; cursor: zoom-in; }
.entry-text { color: var(--muted); line-height: 1.6; font-size: 13px; white-space: pre-wrap; margin: 13px 0 0; }
.entry-status { border-left: 3px solid var(--accent); background: #fff7f4; color: #994027; padding: 14px; font-size: 13px; margin-bottom: 14px; }
.entry-status.error { border-color: #c53d28; background: #fff4f2; color: #a12d1d; }
.entry-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.history-action { background: var(--soft); color: var(--ink); font-size: 12px; font-weight: 600; padding: 9px 12px; }
.history-action:hover { background: #e4e6e9; }
.history-action:disabled { opacity: .55; cursor: wait; }
.history-entry.is-error { border-color: #edbdb5; }
footer { border-top: 1px solid var(--line); color: #9a9da3; font-size: 12px; padding: 20px clamp(24px, 6vw, 96px); }
.auth-gate { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(23, 25, 29, .54); backdrop-filter: blur(8px); }
.auth-panel { width: min(420px, 100%); background: var(--white); border: 1px solid var(--line); padding: 30px; box-shadow: 0 24px 70px rgba(23, 25, 29, .2); }
.auth-mark { display: block; color: var(--accent); font-size: 28px; margin-bottom: 18px; }
.auth-panel h2 { font-size: 27px; margin-bottom: 26px; }
.auth-panel label { display: block; color: var(--muted); font-size: 13px; font-weight: 600; margin-bottom: 9px; }
.auth-panel input { width: 100%; height: 46px; border: 1px solid var(--line); border-radius: 4px; padding: 0 12px; color: var(--ink); background: var(--soft); font: inherit; outline: none; }
.auth-panel input:focus { border-color: var(--accent); background: var(--white); }
.auth-panel button { width: 100%; justify-content: center; margin-top: 8px; }
.auth-error { min-height: 22px; margin: 8px 0 0; color: #c53d28; font-size: 12px; }
body.auth-locked, body.lightbox-open { overflow: hidden; }
.image-lightbox { position: fixed; inset: 0; z-index: 200; display: grid; grid-template-rows: minmax(0, calc(100vh - 126px)) auto; justify-items: stretch; gap: 18px; padding: 22px 72px 20px; background: rgba(12, 13, 15, .94); }
.lightbox-stage { position: relative; width: 100%; height: 100%; min-width: 0; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.lightbox-stage > img { display: block; width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; }
.lightbox-close { position: fixed; top: 18px; right: 18px; z-index: 2; width: 42px; height: 42px; padding: 0; justify-content: center; border: 1px solid rgba(255,255,255,.35); background: rgba(23,25,29,.72); color: var(--white); font-size: 28px; line-height: 1; }
.lightbox-close:hover { background: rgba(23,25,29,.94); }
.lightbox-toolbar { min-height: 46px; display: flex; justify-content: center; align-items: center; }
.crop-controls { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 12px; color: var(--white); }
.crop-ratio { display: flex; align-items: center; gap: 7px; }
.crop-ratio label { color: #c8cbd0; font-size: 12px; }
.crop-ratio input { width: 66px; height: 40px; border: 1px solid #555a63; border-radius: 4px; padding: 0 8px; background: #24272c; color: var(--white); font: inherit; text-align: center; }
.crop-lock { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; cursor: pointer; }
.crop-lock input { width: 17px; height: 17px; accent-color: var(--accent); }
.crop-size { min-width: 110px; color: #c8cbd0; font-size: 12px; text-align: center; }
.lightbox-secondary { background: #3b3f46; }
.lightbox-secondary:hover { background: #4a4f57; }
.crop-selection { position: absolute; z-index: 1; border: 2px solid var(--white); box-shadow: 0 0 0 9999px rgba(0,0,0,.58); cursor: move; touch-action: none; }
.crop-grid { position: absolute; background: rgba(255,255,255,.55); pointer-events: none; }
.crop-grid-v1, .crop-grid-v2 { top: 0; bottom: 0; width: 1px; }
.crop-grid-v1 { left: 33.333%; } .crop-grid-v2 { left: 66.666%; }
.crop-grid-h1, .crop-grid-h2 { left: 0; right: 0; height: 1px; }
.crop-grid-h1 { top: 33.333%; } .crop-grid-h2 { top: 66.666%; }
.crop-handle { position: absolute; width: 20px; height: 20px; padding: 0; border: 3px solid var(--white); background: var(--accent); border-radius: 50%; touch-action: none; }
.crop-handle.is-nw { left: -11px; top: -11px; cursor: nwse-resize; }
.crop-handle.is-ne { right: -11px; top: -11px; cursor: nesw-resize; }
.crop-handle.is-sw { left: -11px; bottom: -11px; cursor: nesw-resize; }
.crop-handle.is-se { right: -11px; bottom: -11px; cursor: nwse-resize; }
@media (max-width: 600px) { .image-lightbox { grid-template-rows: minmax(0, calc(100vh - 190px)) auto; padding: 64px 14px 14px; gap: 12px; } .crop-controls { gap: 9px; } .crop-ratio input { width: 54px; } .crop-size { width: 100%; order: 3; } .workspace { width: min(100% - 28px, 920px); padding-top: 54px; } .topbar { padding: 0 18px; height: 68px; } .model-chip { display: none; } .composer { padding: 16px; } .composer-footer, .history-heading { align-items: stretch; flex-direction: column; } .controls { justify-content: space-between; } .control-group { justify-content: space-between; width: 100%; } #generate-button { justify-content: center; width: 100%; } .reference-heading { align-items: flex-start; flex-direction: column; } .reference-preview { gap: 10px; } .reference-preview img { width: 56px; height: 56px; } .clear-history { width: 100%; } .entry-image { max-height: 520px; } h1 { font-size: 48px; } }
