:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #203336;
  background: #f5f7f6;
  font-synthesis: none;
  --accent: #236b70;
  --accent-dark: #185358;
  --muted: #647477;
  --border: #dce4e1;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 0; }
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled, input:disabled { cursor: not-allowed; }
a { color: inherit; }
img { max-width: 100%; }
:focus-visible { outline: 3px solid #4b939a; outline-offset: 4px; }
h1, h2, h3, p, figure { margin: 0; }
p { line-height: 1.8; }
.site-header, main, .site-footer { width: min(1440px, calc(100% - 80px)); margin-inline: auto; }
.site-header { min-height: 100px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--border); }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-size: 19px; font-weight: 650; letter-spacing: .08em; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 44px; background: var(--accent); color: #fff; border-radius: 12px 12px 12px 3px; font-size: 22px; }
.brand small { display: block; margin-top: 5px; font-size: 9px; font-weight: 500; letter-spacing: .14em; color: var(--muted); }
.header-actions { display: flex; align-items: center; gap: 22px; }
.privacy-tag { font-size: 12px; color: var(--muted); }
.button { min-height: 44px; padding: 11px 17px; border: 1px solid transparent; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; gap: 16px; font-size: 14px; font-weight: 600; line-height: 1.45; text-decoration: none; transition: background-color .15s, border-color .15s; }
.button.primary { background: var(--accent); color: #fff; }
.button.primary:hover:enabled { background: var(--accent-dark); }
.button.secondary { background: #fff; border-color: var(--border); color: #27494d; }
.button.secondary:hover { background: #edf4f2; border-color: #adc8c6; }
.button.quiet { color: var(--accent); background: transparent; }
.button.quiet:hover:enabled { background: #e9f0ed; }
.button:disabled { opacity: .5; }
.full-width { width: 100%; justify-content: space-between; }
.eyebrow { display: block; font-size: 12px; font-weight: 600; letter-spacing: .12em; color: var(--accent); }
.login-layout { max-width: 1120px; margin: 96px auto 110px; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: center; gap: 100px; }
.login-intro h1 { font-size: clamp(36px, 4.1vw, 58px); font-weight: 550; letter-spacing: -.04em; line-height: 1.35; margin: 20px 0 24px; }
.login-intro > p { max-width: 410px; font-size: 15px; color: var(--muted); }
.privacy-note { display: flex; gap: 12px; margin-top: 42px; padding-top: 25px; border-top: 1px solid var(--border); max-width: 430px; color: var(--muted); font-size: 12px; }
.privacy-note strong { font-weight: 550; color: #36565a; }
.note-marker { font-size: 23px; color: var(--accent); }
.login-card { background: #fff; padding: 36px; border: 1px solid var(--border); border-radius: 18px; box-shadow: 0 14px 45px #263a3610; }
.login-card h2 { font-size: 25px; font-weight: 600; margin: 10px 0; }
.muted { color: var(--muted); font-size: 13px; }
#login-form { margin-top: 28px; }
.field { min-width: 0; margin-bottom: 19px; }
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 9px; }
input:not([type="radio"]), textarea, select { width: 100%; min-width: 0; background: #fcfdfc; border: 1px solid #d5dfdc; color: #203336; border-radius: 8px; padding: 11px 12px; min-height: 44px; line-height: 1.5; font-size: 14px; }
textarea { display: block; resize: vertical; min-height: 144px; max-height: 480px; }
input::placeholder, textarea::placeholder { color: #879390; opacity: 1; }
input:hover, textarea:hover, select:hover { border-color: #9bb9b6; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
input[type="file"] { font-size: 12px; padding: 9px; }
input[type="file"]::file-selector-button { border: 0; background: #e7efec; color: #28595c; padding: 7px 10px; border-radius: 5px; margin-right: 8px; cursor: pointer; }
.status { color: #476165; font-size: 13px; line-height: 1.8; overflow-wrap: anywhere; }
.status:empty { margin: 0; }
.status[data-kind="error"] { color: #a04435; }
.status[data-kind="success"] { color: #236b58; }
.login-card > .status { margin-top: 19px; }
.workspace { padding: 32px 0 48px; }
.workspace-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.workspace-heading h1 { font-size: 28px; font-weight: 600; letter-spacing: -.03em; margin-top: 9px; }
.workspace-heading > p { color: var(--muted); font-size: 12px; }
.studio-grid { display: grid; grid-template-columns: minmax(340px, 410px) minmax(0, 1fr); align-items: start; gap: 24px; }
.panel { background: #fff; border: 1px solid var(--border); border-radius: 14px; min-width: 0; overflow: hidden; }
.configuration { padding: 24px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 23px; }
.panel-heading h2 { font-size: 16px; font-weight: 650; }
.step-label { color: #7b8988; font-size: 10px; letter-spacing: .08em; white-space: nowrap; }
.mode-fieldset { border: 0; padding: 0; margin: 0 0 23px; min-width: 0; }
.mode-switch { display: flex; background: #f0f4f2; border: 1px solid #e7edeb; border-radius: 9px; padding: 4px; }
.mode-switch label { flex: 1; position: relative; margin: 0; text-align: center; cursor: pointer; min-width: 0; }
.mode-switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.mode-switch span { display: block; padding: 10px 3px; border-radius: 6px; color: var(--muted); font-size: 13px; }
.mode-switch input:checked + span { background: #fff; color: var(--accent); box-shadow: 0 1px 5px #293c3910; }
.mode-switch input:focus-visible + span { outline: 3px solid #4b939a; outline-offset: 1px; }
.mode-switch input:disabled + span { opacity: .55; cursor: not-allowed; }
.required-note { color: #7d8c89; font-size: 10px; font-weight: 400; margin-left: 5px; }
.field-help { font-size: 11px; color: var(--muted); margin-top: 7px; line-height: 1.75; overflow-wrap: anywhere; }
.settings-divider { display: flex; align-items: center; justify-content: space-between; margin: 25px 0 20px; padding-top: 22px; border-top: 1px solid #e8edeb; font-size: 13px; font-weight: 600; gap: 8px; }
.memory-badge { font-size: 10px; font-weight: 400; color: var(--accent); background: #edf5f2; border-radius: 5px; padding: 4px 7px; white-space: nowrap; }
.field-row { display: grid; grid-template-columns: minmax(0, 1fr) 140px; gap: 12px; }
#model { font-size: 12px; }
.size-field select { padding-inline: 7px; font-size: 12px; }
.trust-note { border-left: 2px solid #a1c2ba; padding: 1px 0 1px 12px; font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
.trust-note strong { color: #405e60; font-weight: 600; }
#trusted-hosts { color: #375d62; margin: 3px 0; }
.capability-note { font-size: 11px; color: var(--muted); margin: 15px 0 20px; }
.reference-field { margin-bottom: 20px; border: 1px dashed #bfd0c9; background: #f9fbfa; border-radius: 9px; padding: 14px; }
.reference-field .field-help { margin-bottom: 9px; }
.reference-preview-wrap { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.reference-preview-wrap img { object-fit: contain; width: 74px; height: 74px; background: #edf1ef; border-radius: 5px; }
.compact { font-size: 11px; margin-top: 8px; }
.results { min-height: 740px; display: flex; flex-direction: column; padding: 24px; position: sticky; top: 24px; }
.empty-state, .waiting-state { flex: 1; display: flex; align-items: center; justify-content: center; flex-direction: column; padding: 65px 20px; text-align: center; min-height: 550px; }
.empty-state h3, .waiting-state h3 { font-size: 19px; font-weight: 550; margin-bottom: 14px; letter-spacing: .02em; }
.empty-state p, .waiting-state > p { color: var(--muted); font-size: 13px; max-width: 340px; }
.empty-caption { color: #83908e; font-size: 11px; margin-top: 32px; }
.empty-art { width: 112px; height: 128px; background: #f1f6f3; border: 1px solid #d5e2dc; border-radius: 48px 48px 8px 8px; position: relative; overflow: hidden; margin-bottom: 32px; }
.empty-sun { width: 20px; height: 20px; background: #bdd0c7; border-radius: 50%; position: absolute; top: 30px; right: 23px; }
.empty-horizon { position: absolute; width: 140px; height: 100px; border: 1px solid #b3cbc0; border-radius: 50%; left: -65px; top: 68px; transform: rotate(-24deg); }
.empty-dot { position: absolute; width: 125px; height: 90px; border: 1px solid #c5d9cf; border-radius: 50%; left: 40px; top: 81px; transform: rotate(30deg); }
.waiting-indicator { display: block; width: 42px; height: 42px; border-radius: 50%; border: 3px solid #e3eeea; border-top-color: var(--accent); margin-bottom: 27px; animation: spin 1.3s linear infinite; }
.waiting-state .elapsed { font-variant-numeric: tabular-nums; color: var(--accent); margin-bottom: 15px; }
.waiting-state .button { margin-top: 26px; }
.waiting-state #abort-help { margin-top: 14px; font-size: 11px; }
.result-figure { margin-top: 1px; flex: 1; display: flex; flex-direction: column; justify-content: center; min-height: 550px; }
.image-button { display: flex; align-items: center; justify-content: center; border: 1px solid #e5ebe8; border-radius: 9px; padding: 0; overflow: hidden; width: 100%; background: #f3f5f3; cursor: zoom-in; min-height: 260px; }
.image-button img { display: block; object-fit: contain; max-height: 680px; width: 100%; }
figcaption { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin-top: 18px; font-size: 13px; font-weight: 600; }
.caption-detail { display: block; margin-top: 5px; font-size: 11px; color: var(--muted); font-weight: 400; }
.result-footer { margin-top: 20px; border-top: 1px solid #edf0ee; padding-top: 16px; }
.retention-note { font-size: 11px; color: #7b8986; margin-top: 5px; }
.site-footer { border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: 15px; padding-block: 23px; color: #7c8885; font-size: 11px; }
dialog { width: min(1140px, calc(100% - 40px)); max-height: calc(100dvh - 40px); padding: 20px; border: 1px solid var(--border); border-radius: 14px; color: #203336; background: #fff; }
dialog::backdrop { background: #132b32b3; }
.dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.dialog-header h2 { font-size: 16px; font-weight: 600; }
.dialog-image-wrap { background: #f1f4f2; display: flex; justify-content: center; border-radius: 8px; overflow: auto; }
.dialog-image-wrap img { display: block; object-fit: contain; max-height: calc(100dvh - 160px); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.noscript-note { padding: 30px; color: #a04435; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (min-width: 1600px) { .results { min-height: 790px; } }
@media (max-width: 1100px) {
  .site-header, main, .site-footer { width: calc(100% - 48px); }
  .login-layout { gap: 50px; }
  .studio-grid { grid-template-columns: minmax(310px, 370px) minmax(0, 1fr); gap: 18px; }
  .configuration, .results { padding: 20px; }
  .field-row { grid-template-columns: minmax(0, 1fr); gap: 0; }
}
@media (max-width: 760px) {
  .site-header, main, .site-footer { width: calc(100% - 32px); }
  .site-header { min-height: 82px; gap: 10px; }
  .brand { font-size: 16px; gap: 9px; }
  .brand-mark { width: 35px; height: 39px; font-size: 20px; }
  .brand small { font-size: 8px; letter-spacing: .08em; }
  .privacy-tag { display: none; }
  .header-actions .button { padding-inline: 9px; font-size: 12px; }
  .login-layout { margin: 40px auto 50px; grid-template-columns: minmax(0, 1fr); gap: 30px; max-width: 470px; }
  .login-intro h1 { font-size: 36px; margin: 14px 0 16px; }
  .login-intro h1 br { display: none; }
  .login-intro > p { font-size: 13px; }
  .privacy-note { margin-top: 22px; padding-top: 17px; max-width: none; }
  .login-card { padding: 26px 23px; }
  .workspace { padding-top: 26px; }
  .workspace-heading { margin-bottom: 22px; }
  .workspace-heading h1 { font-size: 25px; }
  .workspace-heading > p { display: none; }
  .studio-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .configuration, .results { padding: 21px 18px; }
  .field-row { grid-template-columns: minmax(0, 1fr) 140px; gap: 12px; }
  .results { position: static; min-height: 470px; }
  .empty-state, .waiting-state { min-height: 340px; padding: 35px 10px; }
  .empty-art { width: 95px; height: 106px; margin-bottom: 25px; }
  .empty-state h3, .waiting-state h3 { font-size: 18px; }
  .empty-caption { margin-top: 22px; }
  .result-figure { min-height: 300px; }
  .image-button { min-height: 200px; }
  .site-footer { font-size: 10px; gap: 10px; }
  dialog { width: calc(100% - 20px); padding: 12px; max-height: calc(100dvh - 20px); }
  .dialog-image-wrap img { max-height: calc(100dvh - 130px); }
  input:not([type="radio"]), textarea, select { font-size: 16px; }
}
@media (max-width: 360px) {
  .field-row { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .site-header, main, .site-footer { width: calc(100% - 24px); }
  .login-card { padding: 24px 18px; }
  .site-footer { flex-direction: column; gap: 5px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
