﻿:root {
  --ink: #1e2430;
  --muted: #727a88;
  --subtle: #a7aebb;
  --line: #e9e6e0;
  --paper: #fffdf9;
  --warm: #f7f3ed;
  --accent: #e56c4c;
  --accent-dark: #b84e37;
  --accent-soft: #fff0ea;
  --shadow: 0 24px 70px rgba(55, 45, 34, .11);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: #f5f1eb; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 5% 0%, rgba(248, 212, 187, .45), transparent 28rem),
    radial-gradient(circle at 100% 30%, rgba(215, 225, 217, .55), transparent 30rem),
    #f5f1eb;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.app-shell { width: min(1440px, 100%); margin: 0 auto; padding: 28px 34px 22px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.brand { display: flex; gap: 14px; align-items: center; }
.brand-mark { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; color: white; background: var(--ink); font-size: 22px; box-shadow: 0 8px 18px rgba(30, 36, 48, .18); }
.brand h1 { margin: 0; font-size: 20px; letter-spacing: -.03em; }
.brand p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.topbar-note { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #65b18a; box-shadow: 0 0 0 4px rgba(101,177,138,.12); }
.workspace { display: grid; grid-template-columns: minmax(420px, 460px) minmax(0, 1fr); gap: 22px; align-items: stretch; }
.panel { border: 1px solid rgba(224, 218, 208, .8); border-radius: 22px; background: rgba(255, 253, 249, .86); box-shadow: var(--shadow); backdrop-filter: blur(16px); }
.control-panel { padding: 26px; }
.result-panel { min-height: 700px; padding: 26px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.eyebrow { margin: 0 0 7px; color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .16em; }
h2 { margin: 0; font-size: 25px; letter-spacing: -.05em; }
.ghost-button { border: 0; padding: 6px 0; color: var(--muted); background: transparent; font-size: 13px; }
.ghost-button:hover { color: var(--accent-dark); }
.mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 5px; margin-bottom: 22px; border-radius: 13px; background: #f0ede7; }
.mode-button { border: 0; padding: 11px 8px; border-radius: 9px; color: var(--muted); background: transparent; font-size: 13px; font-weight: 650; transition: all .2s ease; }
.mode-button span { margin-right: 3px; }
.mode-button:hover { color: var(--ink); }
.mode-button.active { color: var(--ink); background: var(--paper); box-shadow: 0 3px 10px rgba(61, 50, 38, .08); }
.field-group { margin-bottom: 17px; }
.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
label { display: block; margin-bottom: 8px; font-size: 12px; font-weight: 750; }
.field-hint { display: block; color: var(--subtle); font-size: 11px; line-height: 1.5; }
.label-row .field-hint { white-space: nowrap; }
textarea, select, input[type="text"], input[type="url"], input[type="password"] { width: 100%; border: 1px solid var(--line); border-radius: 12px; outline: none; color: var(--ink); background: rgba(255,255,255,.8); transition: border-color .2s, box-shadow .2s; }
textarea { min-height: 150px; resize: vertical; padding: 14px; line-height: 1.65; }
select, input[type="text"], input[type="url"], input[type="password"] { height: 43px; padding: 0 12px; font-size: 13px; }
textarea:focus, select:focus, input:focus { border-color: rgba(229,108,76,.7); box-shadow: 0 0 0 4px rgba(229,108,76,.11); }
.prompt-tips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.tip-chip { border: 1px solid #e8ddd4; border-radius: 99px; padding: 5px 9px; color: #986957; background: #fff8f3; font-size: 11px; }
.tip-chip:hover { border-color: var(--accent); color: var(--accent-dark); }
.settings-grid, .advanced-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.settings-grid .field-group { margin-bottom: 13px; }
.reference-section { padding-top: 1px; }
.drop-zone { display: flex; min-height: 135px; flex-direction: column; align-items: center; justify-content: center; gap: 7px; border: 1px dashed #d8c9bf; border-radius: 14px; color: var(--muted); background: #fffaf5; text-align: center; cursor: pointer; transition: all .2s; }
.drop-zone:hover, .drop-zone.dragging { border-color: var(--accent); background: var(--accent-soft); }
.drop-zone input { display: none; }
.upload-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; color: var(--accent); background: #ffe2d6; font-size: 20px; }
.drop-zone strong { color: var(--ink); font-size: 12px; }
.drop-zone > span:last-child { font-size: 11px; }
.reference-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-top: 10px; }
.reference-card { position: relative; aspect-ratio: 1; overflow: hidden; border-radius: 10px; background: #eee; }
.reference-card img { width: 100%; height: 100%; object-fit: cover; }
.remove-reference { position: absolute; top: 4px; right: 4px; display: grid; place-items: center; width: 22px; height: 22px; border: 0; border-radius: 50%; color: white; background: rgba(20, 24, 31, .67); font-size: 15px; line-height: 1; }
.advanced-settings { margin: 4px 0 20px; border-top: 1px solid var(--line); padding-top: 13px; }
.advanced-settings summary { color: var(--muted); font-size: 12px; font-weight: 700; cursor: pointer; }
.advanced-grid { margin-top: 15px; }
.full-width { grid-column: 1 / -1; }
.key-option { display: flex; align-items: center; flex-direction: column; justify-content: center; align-items: flex-start; padding-top: 17px; }
.checkbox-label { display: flex; gap: 7px; align-items: center; margin: 0 0 4px; font-weight: 600; cursor: pointer; }
.checkbox-label input { accent-color: var(--accent); }
.primary-button { display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%; height: 50px; border: 0; border-radius: 13px; color: white; background: var(--ink); font-size: 14px; font-weight: 750; box-shadow: 0 10px 20px rgba(30,36,48,.16); transition: transform .2s, background .2s; }
.primary-button:hover:not(:disabled) { transform: translateY(-1px); background: #30394a; }
.primary-button:disabled { cursor: wait; opacity: .72; }
.button-icon { color: #ffc7b0; }
.spinner { width: 15px; height: 15px; border: 2px solid rgba(255,255,255,.4); border-top-color: white; border-radius: 50%; animation: spin .7s linear infinite; }
.error-message { margin: 12px 0 0; border-radius: 10px; padding: 10px 12px; color: #9d3e2d; background: #fff0ec; font-size: 12px; line-height: 1.55; }
.result-count { color: var(--muted); font-size: 12px; }
.empty-state { display: flex; min-height: 555px; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.empty-orbit { display: grid; place-items: center; width: 88px; height: 88px; margin-bottom: 18px; border: 1px solid #eaded5; border-radius: 50%; color: var(--accent); background: radial-gradient(circle, #fff4ed 0 38%, transparent 39%); font-size: 32px; box-shadow: 0 0 0 17px rgba(255,245,237,.65), 0 0 0 34px rgba(255,248,243,.6); }
.empty-state h3 { margin: 0 0 7px; font-size: 16px; }
.empty-state p { margin: 0; color: var(--muted); font-size: 13px; }
.result-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.result-card { overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: white; box-shadow: 0 8px 20px rgba(50,40,30,.06); }
.result-image-wrap { position: relative; min-height: 180px; background: #f0eeea; }
.result-image { display: block; width: 100%; height: auto; max-height: 520px; object-fit: contain; }
.result-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; }
.result-index { color: var(--muted); font-size: 11px; }
.download-button { border: 0; border-radius: 8px; padding: 6px 8px; color: var(--accent-dark); background: var(--accent-soft); font-size: 11px; font-weight: 700; text-decoration: none; }
.download-button:hover { background: #ffe1d5; }
.hidden { display: none !important; }
.footer { display: flex; justify-content: space-between; gap: 20px; padding: 16px 3px 0; color: var(--subtle); font-size: 11px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 980px) { .app-shell { padding: 20px; } .workspace { grid-template-columns: 1fr; } .result-panel { min-height: 480px; } .empty-state { min-height: 360px; } }
@media (max-width: 560px) { .app-shell { padding: 14px; } .topbar-note { display: none; } .control-panel, .result-panel { padding: 18px; border-radius: 17px; } h2 { font-size: 22px; } .settings-grid, .advanced-grid { grid-template-columns: 1fr; } .full-width { grid-column: auto; } .key-option { padding-top: 0; margin-top: -4px; } .footer { flex-direction: column; gap: 4px; } }

/* Simplified controls */
.topbar { margin-bottom: 22px; }
.brand h1 { font-size: 24px; }
.brand p { font-size: 13px; }
.panel-heading { align-items: center; }
.mode-button { font-size: 14px; }
.prompt-library { margin: -2px 0 18px; }
.library-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.library-head label { margin: 0; }
.library-head select { width: 150px; height: 36px; }
.prompt-templates { display: grid; gap: 7px; }
.template-button { width: 100%; border: 1px solid #ece7e1; border-radius: 10px; padding: 9px 10px; color: #5d6572; background: #fffdfa; font-size: 11px; line-height: 1.45; text-align: left; transition: all .2s ease; }
.template-button:hover { border-color: #e5a28f; color: #9d4938; background: #fff5ef; }
.api-settings { margin: 4px 0 19px; border-top: 1px solid var(--line); padding-top: 14px; }
.readonly-row { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; align-items: center; margin-bottom: 8px; color: var(--muted); font-size: 11px; }
.readonly-row code { min-width: 0; overflow: hidden; border-radius: 7px; padding: 7px 8px; color: #68717d; background: #f4f1ec; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.api-key-group { margin: 14px 0 0; }
.key-input-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 7px; }
.clear-key-button { border: 1px solid var(--line); border-radius: 10px; padding: 0 11px; color: var(--muted); background: white; font-size: 12px; }
.clear-key-button:hover { border-color: #e5a28f; color: var(--accent-dark); }
.drop-zone { min-height: 100px; }
.drop-zone strong { font-size: 12px; }
.empty-state { min-height: 555px; }
.empty-state h3 { font-weight: 700; }
.empty-state p { margin-top: 0; }
.footer { display: none; }
@media (max-width: 560px) {
  .library-head { align-items: flex-start; flex-direction: column; gap: 7px; }
  .library-head select { width: 100%; }
  .readonly-row { grid-template-columns: 54px minmax(0, 1fr); }
}
