:root {
  color-scheme: light;
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: #f4f5f1;
  color: #1a2821;
  --muted: #5e6d64;
  --border: #dce4dc;
  --accent: #174f3b;
  --mint: #e4efe5;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
h1, h2, h3, p { margin: 0; }
input, textarea, select, button { font: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: default; }
a { color: inherit; }
:focus-visible { outline: 3px solid #3d8e72; outline-offset: 3px; }
.topbar {
  min-height: 73px;
  padding: 0 max(28px, calc((100% - 1360px) / 2));
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fcfdfb;
  border-bottom: 1px solid var(--border);
}
.brand, .account { display: inline-flex; align-items: center; gap: 12px; }
.brand { text-decoration: none; font-size: 21px; letter-spacing: -.04em; font-weight: 750; }
.brand-icon {
  display: inline-grid;
  place-items: center;
  width: 35px;
  height: 35px;
  color: #ecf9d8;
  background: #194d3a;
  border-radius: 11px;
  font-size: 23px;
}
.account { font-size: 13px; }
.account-name { max-width: 170px; overflow: hidden; text-overflow: ellipsis; }
.quiet {
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 6px 9px;
  color: var(--muted);
  background: transparent;
}
.quiet:hover { border-color: var(--border); background: #f5f7f4; }
.workspace {
  max-width: 1416px;
  padding: 30px 28px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(310px, 372px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
.panel {
  min-width: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 3px 12px #15312506;
}
.controls, .gallery, .projects { padding: 24px; }
.results { min-width: 0; display: grid; gap: 18px; }
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
h1, h2 { font-size: 22px; font-weight: 750; letter-spacing: -.045em; }
.model {
  padding: 5px 8px;
  color: #285641;
  background: #e8f0e7;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.mode {
  margin: 22px 0 20px;
  padding: 4px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  background: #eef2ed;
  border-radius: 10px;
}
.mode button {
  min-height: 39px;
  padding: 5px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}
.mode button[aria-pressed="true"] {
  color: #153f2e;
  background: #fff;
  border-color: #e4ebe2;
  box-shadow: 0 1px 3px #213e2511;
}
.prompt-tool {
  margin-bottom: 16px;
  background: #f7faf6;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.prompt-tool summary {
  padding: 10px 12px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.prompt-tool-body { padding: 0 10px 12px; }
.habit-tool summary .count { margin-left: 5px; font-size: 12px; font-weight: 500; }
.habit-tool .notice { margin: 0; }
.habit-tool section + section { margin-top: 12px; }
.habit-tool h3 { font-size: 13px; margin-bottom: 6px; }
.habit-listing { margin: 0; padding: 0; list-style: none; }
.habit-listing li { padding: 8px 0; border-top: 1px solid var(--border); font-size: 13px; overflow-wrap: anywhere; }
.habit-listing p { white-space: pre-wrap; }
.habit-listing small { color: var(--muted); }
.habit-actions { display: flex; gap: 5px; margin-top: 4px; }
.habit-actions button { font-size: 12px; padding: 4px 8px; }
.prompt-tool:has(#prompt-image:focus-visible) .upload { outline: 2px solid #3d8e72; outline-offset: 2px; }
#prompt-image-name { overflow-wrap: anywhere; }
#analyze-image, #copy-prompt { margin-top: 8px; }
#analyze-image:disabled { opacity: .55; }
.reverse-result { margin-top: 12px; }
.reverse-result textarea { min-height: 120px; }
.field-label { display: block; font-size: 14px; font-weight: 650; margin-bottom: 8px; }
textarea, select, .login-card input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fcfdfb;
  color: inherit;
  padding: 10px 12px;
  font-size: 14px;
}
textarea { min-height: 140px; padding: 12px; resize: vertical; line-height: 1.65; }
textarea::placeholder { color: #6c796e; }
select, .login-card input { min-height: 42px; }
.field-row { margin: 15px 0 19px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.submit {
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 10px;
  color: #fff;
  background: var(--accent);
  font-size: 15px;
  font-weight: 700;
}
.submit:hover:enabled { background: #0b3d2c; }
.submit:disabled { opacity: .63; }
.notice { color: var(--muted); font-size: 13px; line-height: 1.6; }
.notice:not(:empty) { margin-top: 12px; }
.notice.error, .job-error, .login-error { color: #a12723; }
.upload {
  min-height: 70px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px dashed #96ad9e;
  border-radius: 10px;
  background: #f7faf6;
  font-size: 13px;
  cursor: pointer;
}
.upload:hover { background: #edf5ed; }
#references:focus-within .upload { border-color: var(--accent); }
.folder-button {
  display: inline-block;
  margin-top: 8px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}
.folder-button:hover { background: #edf5ed; }
#references:has(#folder-upload:focus-visible) .folder-button {
  outline: 3px solid #3d8e72;
  outline-offset: 3px;
}
.guidance-field { margin: 15px 0 18px; }
.guidance-help { margin: 0; color: var(--muted); font-size: 12px; }
.guidance-field:has(#guidance-upload:focus-visible) .folder-button {
  outline: 3px solid #3d8e72;
  outline-offset: 3px;
}
.upload:has(+ input:disabled), .folder-button:has(+ input:disabled) {
  opacity: .6;
  cursor: default;
}
.field { display: block; margin-top: 10px; }
.upload small { display: block; margin-top: 4px; color: var(--muted); }
.upload-icon { color: var(--accent); font-size: 20px; flex: 0 0 28px; text-align: center; }
.reference-list { margin-top: 6px; }
.reference-caption { padding: 6px 0 3px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.reference-files { max-height: 148px; overflow: auto; }
.reference { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 12px; }
.reference span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.check { display: flex; align-items: center; gap: 5px; margin: 12px 0 16px; color: var(--muted); font-size: 13px; }
.check input { accent-color: var(--accent); }
.visually-hidden { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
.gallery-title { margin-bottom: 18px; }
.gallery-status { margin: -5px 0 12px; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.more-jobs { display: block; margin: 16px auto 0; }
.count { color: var(--muted); font-size: 13px; }
.projects-empty { margin-top: 12px; color: var(--muted); font-size: 14px; }
.projects-list { display: flex; gap: 8px; overflow-x: auto; padding: 5px 3px 8px; margin-top: 10px; }
.project-choice {
  flex: 0 0 156px;
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fcfdfb;
  color: var(--muted);
  text-align: left;
}
.project-choice[aria-pressed="true"] { background: #e9f2e9; border-color: #9ab7a5; color: var(--accent); }
.project-choice strong, .project-choice small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-choice strong { color: #20392c; font-size: 13px; }
.project-choice small { margin-top: 4px; font-size: 12px; }
.all-projects { flex: 0 0 auto; font-size: 13px; font-weight: 650; }
.project-detail { border: 1px solid var(--border); background: #f7faf6; border-radius: 12px; margin-top: 8px; padding: 14px; }
.project-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.project-heading h3 { font-size: 15px; overflow-wrap: anywhere; }
.project-heading span { font-size: 12px; color: var(--accent); flex-shrink: 0; }
.project-bars { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 175px), 1fr)); gap: 12px 20px; margin-top: 12px; }
.project-progress { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
.project-progress progress { display: block; width: 100%; height: 8px; border: 0; border-radius: 8px; background: #e1e9e0; color: var(--accent); }
.project-progress progress::-webkit-progress-bar { background: #e1e9e0; border-radius: 8px; }
.project-progress progress::-webkit-progress-value { background: #368365; border-radius: 8px; }
.project-progress progress::-moz-progress-bar { background: #368365; border-radius: 8px; }
.project-summary, .project-activity, .project-issues { margin-top: 9px; color: var(--muted); font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; }
.project-issues summary { color: #a12723; cursor: pointer; }
.project-issues ul { max-height: 130px; overflow: auto; margin: 6px 0 0; padding-left: 20px; }
.project-controls { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 12px; }
.quiet.danger { color: #9c342e; font-size: 13px; }
.quiet.danger:hover { background: #fbefee; border-color: #edd4d1; }
.selection-bar {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap;
  gap: 8px; margin-bottom: 14px; padding: 8px 12px;
  border: 1px solid var(--border); border-radius: 10px; background: #f7faf6;
  color: var(--muted); font-size: 13px;
}
.selection-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.selection-actions button:disabled { opacity: .55; }
.empty {
  min-height: 383px;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 24px;
  border: 1px solid #e3ebe1;
  border-radius: 14px;
  background: radial-gradient(ellipse at 50% 38%, #e8f0e5 0, #f4f7f1 54%, #f8faf6 100%);
  text-align: center;
}
.empty h3 { margin-top: 20px; font-size: 17px; }
.empty p { margin-top: 8px; color: var(--muted); font-size: 14px; }
.image-mark { width: 123px; height: 100px; position: relative; }
.image-mark::before, .art-card {
  position: absolute;
  inset: 12px 14px;
  border-radius: 13px;
  border: 1px solid #9cb49e;
}
.image-mark::before { content: ""; background: #dce9d9; transform: rotate(-13deg); }
.art-card { overflow: hidden; background: #f8fbf4; transform: rotate(8deg); box-shadow: 0 8px 18px #244b2e14; }
.art-card i, .art-card b { display: block; position: absolute; }
.art-card i { left: 19px; top: 17px; width: 13px; height: 13px; border-radius: 100%; background: #b6cd8c; }
.art-card b {
  inset: 28px 0 0;
  background: linear-gradient(130deg, #669678, #a9c793);
  clip-path: polygon(0 100%, 0 71%, 36% 27%, 51% 54%, 75% 10%, 100% 57%, 100% 100%);
}
.image-mark > span {
  position: absolute;
  right: 5px;
  top: 3px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 11px;
  background: #21503a;
  color: #f6fce9;
}
.history {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 214px), 1fr));
  gap: 14px;
}
.job { min-width: 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.cover, .job-state { display: block; width: 100%; aspect-ratio: 1 / 1; border: 0; background: #edf2eb; padding: 0; }
.cover:focus-visible { outline-offset: -3px; }
.cover img { display: block; width: 100%; height: 100%; object-fit: contain; }
.job-state { display: grid; place-content: center; font-size: 15px; color: var(--accent); }
.job-state.failed { background: #fbf0ef; color: #a12723; }
.job-state.paused { background: #f5f1e4; color: #73551a; }
.job-state.cancelled { background: #f3f4f2; color: var(--muted); }
.job-details { padding: 12px; }
.job-title { font-weight: 650; font-size: 14px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.full-prompt { border-top: 1px solid var(--border); margin-top: 12px; padding-top: 8px; min-width: 0; }
.prompt-actions, .prompt-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.prompt-actions { justify-content: space-between; }
.prompt-actions strong { font-size: 12px; }
.prompt-buttons button { font-size: 12px; padding: 4px 7px; }
.prompt-text { margin-top: 6px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.6; }
#prompt-feedback {
  position: fixed; bottom: 20px; right: 20px; z-index: 5; max-width: min(390px, calc(100% - 40px));
  padding: 10px 14px; border-radius: 9px; color: #fff; background: var(--accent);
  font-size: 13px; box-shadow: 0 3px 12px #1a282133; pointer-events: none;
}
#prompt-feedback:empty { opacity: 0; }
.job-info, .job-error { margin-top: 5px; font-size: 12px; line-height: 1.5; }
.job-info { color: var(--muted); }
.job-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.task-actions { margin-top: 8px; gap: 5px; }
.choose-image { display: flex; align-items: center; gap: 6px; margin-top: 9px; color: var(--muted); font-size: 12px; cursor: pointer; }
.choose-image input { accent-color: var(--accent); margin: 0; }
.revision-picker { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.revision-picker select { font-size: 12px; min-height: 30px; width: auto; max-width: 100%; padding: 4px 6px; }
.action-link {
  display: inline-block;
  padding: 6px 9px;
  background: #f7faf6;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
  font-weight: 650;
}
.action-link:hover { background: #e5f1e7; }
dialog {
  color: inherit;
  width: min(720px, calc(100% - 36px));
  padding: 18px;
  border-radius: 16px;
  border: 1px solid var(--border);
}
dialog::backdrop { background: #0b211ac2; }
.preview-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
#preview-image { display: block; width: 100%; max-height: 70vh; object-fit: contain; background: #f4f6f2; border-radius: 8px; }
.preview-actions { margin-top: 12px; }
.editor { width: min(1160px, calc(100% - 36px)); max-height: calc(100% - 36px); padding: 22px; }
.editor #editor-filename { margin-top: 4px; overflow-wrap: anywhere; }
.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(232px, 292px); gap: 18px; align-items: start; }
.editor-tools {
  display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
  margin-bottom: 8px; padding: 6px; border: 1px solid var(--border); border-radius: 9px;
}
.editor-tools button:disabled { opacity: .55; }
.editor-tools [aria-pressed="true"] { color: white; background: var(--accent); border-color: var(--accent); }
.editor-width { display: flex; gap: 5px; align-items: center; color: var(--muted); font-size: 12px; }
.editor-width input { width: 85px; accent-color: var(--accent); }
.editor-board {
  display: flex; align-items: center; justify-content: center; min-height: 160px;
  border: 1px solid var(--border); border-radius: 12px; background: #eef2ed; overflow: hidden;
  color: var(--muted); font-size: 13px;
}
.editor-image { display: inline-block; max-width: 100%; position: relative; line-height: 0; }
.editor-image img { display: block; width: auto; height: auto; max-width: 100%; max-height: 64vh; user-select: none; }
.editor-image canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; touch-action: none; }
.editor-form { border: 1px solid var(--border); border-radius: 10px; padding: 14px; }
.editor-help { font-size: 12px; line-height: 1.55; color: var(--muted); margin: 8px 0 12px; }
.login-body {
  min-height: 100vh;
  padding: 22px;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse at center, #e6f0e3, #f4f5f1 70%);
}
.login-card { width: min(100%, 390px); padding: 30px; }
.login-card h1 { margin-top: 16px; font-size: 29px; }
.login-card p { margin-top: 7px; font-size: 14px; color: var(--muted); }
.login-card p.login-error { color: #a12723; }
.login-card form { margin-top: 22px; }
.login-card input { margin-bottom: 15px; }
.login-card .submit { margin-top: 5px; }
@media (max-width: 750px) {
  .topbar { min-height: 62px; padding: 0 16px; }
  .workspace { grid-template-columns: 1fr; gap: 14px; padding: 14px; }
  .controls, .gallery, .projects { padding: 18px; }
  .empty { min-height: 270px; }
  .editor { padding: 14px; }
  .editor-layout { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .editor-image img { max-height: 48vh; }
}
