:root {
  --navy: #111d35;
  --navy-2: #1b2945;
  --blue: #2864dc;
  --blue-dark: #1d4fb6;
  --blue-soft: #edf4ff;
  --ink: #182033;
  --muted: #687187;
  --line: #e2e6ef;
  --line-strong: #d3d9e6;
  --surface: #ffffff;
  --background: #f5f7fb;
  --success: #138a5b;
  --danger: #c93f46;
  --shadow-sm: 0 1px 2px rgba(17, 29, 53, 0.05), 0 6px 18px rgba(17, 29, 53, 0.04);
  --shadow-md: 0 16px 50px rgba(17, 29, 53, 0.12);
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--background);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; overflow-x: hidden; background: var(--background); }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, label[for] { -webkit-tap-highlight-color: transparent; }
svg { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

.auth-screen { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1.05fr) minmax(460px, 0.95fr); background: #fff; }
.auth-visual { position: relative; display: flex; min-height: 720px; overflow: hidden; color: #fff; background: linear-gradient(145deg, rgba(11, 24, 49, 0.95), rgba(23, 51, 96, 0.82)), url("first.png") center / cover; }
.auth-visual::before { content: ""; position: absolute; inset: 0; opacity: 0.32; background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px); background-size: 54px 54px; mask-image: linear-gradient(to bottom, black, transparent 75%); }
.auth-visual::after { content: ""; position: absolute; width: 420px; height: 420px; right: -140px; top: -130px; border: 1px solid rgba(255,255,255,.14); border-radius: 50%; box-shadow: 0 0 0 68px rgba(255,255,255,.025), 0 0 0 138px rgba(255,255,255,.025); }
.auth-visual__content { position: relative; z-index: 1; width: 100%; display: flex; flex-direction: column; padding: 54px clamp(42px, 6vw, 96px) 64px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 750; font-size: 17px; letter-spacing: -0.2px; color: var(--navy); }
.brand--home { padding: 0; border: 0; background: transparent; text-align: left; cursor: pointer; }
.brand--home:focus-visible { outline: 3px solid rgba(40, 100, 220, .22); outline-offset: 4px; border-radius: 10px; }
.brand--home { min-height: 44px; }
.brand--light { color: #fff; }
.brand__mark { width: 36px; height: 36px; display: grid; place-items: center; color: #fff; background: var(--blue); border-radius: 10px; }
.brand__mark svg { width: 22px; height: 22px; }
.auth-copy { margin: auto 0 80px; max-width: 600px; }
.eyebrow { margin: 0 0 14px; font-size: 11px; line-height: 1; letter-spacing: 2px; font-weight: 800; text-transform: uppercase; color: rgba(255,255,255,.62); }
.eyebrow--blue { color: var(--blue); }
.auth-copy h1 { margin: 0; font-size: clamp(44px, 5.2vw, 72px); line-height: 1.13; letter-spacing: -3.3px; font-weight: 720; }
.auth-copy > p:last-child { margin: 28px 0 0; max-width: 480px; font-size: 17px; line-height: 1.8; color: rgba(255,255,255,.68); }
.auth-proof { display: flex; gap: 54px; padding-top: 28px; border-top: 1px solid rgba(255,255,255,.18); }
.auth-proof div { display: flex; flex-direction: column; gap: 5px; }
.auth-proof strong { font-size: 21px; font-weight: 720; }
.auth-proof span { font-size: 12px; color: rgba(255,255,255,.55); }
.auth-panel { display: grid; place-items: center; padding: 48px; background: #fff; }
.auth-card { width: min(100%, 420px); }
.auth-card__header h2 { margin: 0 0 10px; font-size: 34px; letter-spacing: -1px; }
.auth-card__header > p:last-child { margin: 0; color: var(--muted); font-size: 14px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; margin: 36px 0 24px; border-bottom: 1px solid var(--line); }
.auth-tab { position: relative; padding: 13px; border: 0; background: transparent; color: var(--muted); font-weight: 650; cursor: pointer; }
.auth-tab::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: transparent; }
.auth-tab.is-active { color: var(--blue); }
.auth-tab.is-active::after { background: var(--blue); }
.auth-form { display: grid; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field > span { color: #333c50; font-size: 13px; font-weight: 650; }
.field em { color: var(--blue); font-size: 11px; font-style: normal; margin-left: 4px; }
.field > span small { color: #969daf; font-weight: 450; }
.field input, .field select, .field textarea, .global-feedback input { width: 100%; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: #fff; color: var(--ink); outline: none; transition: border-color .18s, box-shadow .18s; }
.field input, .field select { height: 46px; padding: 0 13px; }
.field textarea { padding: 12px 13px; line-height: 1.55; resize: vertical; }
.field input::placeholder, .field textarea::placeholder, .global-feedback input::placeholder { color: #a5acbb; }
.field input:focus, .field select:focus, .field textarea:focus, .global-feedback input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(40, 100, 220, .1); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 42px; padding: 0 18px; border: 1px solid transparent; border-radius: var(--radius-sm); font-size: 13px; font-weight: 700; cursor: pointer; transition: transform .15s, background .15s, box-shadow .15s, border-color .15s; }
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button:disabled { opacity: .58; cursor: wait; transform: none; }
.button--primary { color: #fff; background: var(--blue); box-shadow: 0 7px 18px rgba(40, 100, 220, .2); }
.button--primary:hover { background: var(--blue-dark); box-shadow: 0 9px 22px rgba(40, 100, 220, .26); }
.button--secondary { color: #303a50; background: #fff; border-color: var(--line-strong); }
.button--secondary:hover { border-color: #a9b1c2; }
.button--dark { background: var(--navy); color: #fff; }
.button--wide { width: 100%; }
.button--large { min-height: 50px; padding: 0 24px; font-size: 14px; }
.auth-form .button { margin-top: 4px; height: 48px; }

.app-shell { min-height: 100vh; }
.topbar { position: sticky; z-index: 20; top: 0; height: 68px; display: flex; align-items: center; justify-content: space-between; padding: 0 26px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(15px); }
.topbar__actions { position: relative; display: flex; align-items: center; gap: 18px; }
.mock-badge { display: flex; align-items: center; gap: 7px; padding: 6px 10px; border: 1px solid #bce5d5; border-radius: 99px; color: #147151; background: #effbf6; font-size: 10px; font-weight: 750; letter-spacing: .3px; }
.mock-badge > span { width: 6px; height: 6px; border-radius: 50%; background: #1aa471; box-shadow: 0 0 0 3px rgba(26,164,113,.12); }
.user-menu { display: flex; align-items: center; gap: 9px; padding: 4px 6px 4px 4px; border: 0; background: transparent; cursor: pointer; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; color: #fff; background: linear-gradient(135deg, #315eaf, #162a50); font-size: 12px; font-weight: 750; }
.user-menu__copy { display: flex; flex-direction: column; gap: 1px; text-align: left; }
.user-menu__copy strong { font-size: 12px; }
.user-menu__copy small { color: var(--muted); font-size: 10px; }
.user-menu > svg { width: 14px; color: #929aab; }
.user-popover { position: absolute; z-index: 30; top: 50px; right: 0; width: 160px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: var(--shadow-md); }
.user-popover button { display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px 10px; border: 0; border-radius: 7px; color: #4d566a; background: transparent; font-size: 12px; cursor: pointer; }
.user-popover button:hover { color: var(--blue); background: var(--blue-soft); }
.user-popover #logout-button:hover { color: var(--danger); background: #fff2f3; }
.password-dialog { width: min(440px, calc(100vw - 32px)); max-width: none; padding: 0; border: 0; border-radius: var(--radius); background: transparent; box-shadow: var(--shadow-md); }
.password-dialog::backdrop { background: rgba(17, 29, 53, .5); backdrop-filter: blur(3px); }
.password-dialog__card { padding: 26px; border-radius: var(--radius); background: #fff; }
.password-dialog__heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.password-dialog__heading h2 { margin: 0 0 7px; font-size: 23px; }
.password-dialog__heading p:last-child { margin: 0; color: var(--muted); font-size: 11px; }
.dialog-close { display: grid; place-items: center; flex: 0 0 auto; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px; color: var(--muted); background: transparent; cursor: pointer; }
.dialog-close:hover { color: var(--ink); background: var(--background); }
.password-dialog__fields { display: grid; gap: 16px; margin-top: 24px; }
.password-dialog__actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.workspace { display: grid; grid-template-columns: 242px minmax(0, 1fr); min-height: calc(100vh - 68px); }
.sidebar { position: sticky; top: 68px; height: calc(100vh - 68px); display: flex; flex-direction: column; padding: 20px 16px 18px; border-right: 1px solid var(--line); background: #fff; }
.new-project-button { justify-content: flex-start; min-height: 44px; padding-left: 16px; }
.new-project-button svg { width: 17px; }
.sidebar__section { min-height: 0; display: flex; flex: 1; flex-direction: column; margin-top: 20px; }
.sidebar__heading { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 9px; color: #9299a8; font-size: 10px; font-weight: 750; letter-spacing: .8px; text-transform: uppercase; }
.sidebar__heading span:last-child { display: grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 99px; color: #6e7688; background: #eef0f5; font-size: 9px; }
.history-list { min-height: 0; overflow-y: auto; display: grid; align-content: start; gap: 5px; }
.history-item { position: relative; display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 10px; width: 100%; padding: 9px; border: 1px solid transparent; border-radius: 9px; background: transparent; text-align: left; cursor: pointer; }
.history-item:hover { background: #f6f8fc; }
.history-item.is-active { border-color: #d6e2fa; background: var(--blue-soft); }
.history-item.is-failed { border-color: #f2c8cc; background: #fff7f8; }
.history-item.is-cancelled { border-color: #d6dbe5; background: #f5f6f8; }
.history-item__thumb { width: 38px; height: 38px; object-fit: cover; border-radius: 6px; background: #e9edf4; }
.history-item__copy { min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 3px; }
.history-item__copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.history-item__copy small { color: #8a92a2; font-size: 9px; }
.history-item.is-failed .history-item__copy small { color: var(--danger); }
.history-item.is-cancelled .history-item__copy small { color: #626b7b; }
.history-empty { margin: auto 0; padding: 24px 10px; text-align: center; color: #a2a9b7; }
.history-empty svg { width: 27px; height: 27px; }
.history-empty p { margin: 10px 0 5px; color: #717a8d; font-size: 11px; font-weight: 650; }
.history-empty span { font-size: 9px; line-height: 1.5; }
.main-content { min-width: 0; padding: 30px clamp(24px, 3.2vw, 48px) 60px; }
.view { width: min(100%, 1120px); margin: 0 auto; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.page-heading h1 { margin: 0; font-size: 27px; line-height: 1.2; letter-spacing: -1px; }
.page-heading > div > p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.steps { display: flex; align-items: center; gap: 7px; padding-bottom: 3px; }
.step { display: flex; align-items: center; gap: 6px; color: #9aa1b0; font-size: 10px; font-weight: 650; white-space: nowrap; }
.step b { display: grid; place-items: center; width: 21px; height: 21px; border: 1px solid var(--line-strong); border-radius: 50%; background: #fff; font-size: 9px; }
.step.is-active { color: var(--blue); }
.step.is-active b { border-color: var(--blue); color: #fff; background: var(--blue); }
.steps i { width: 22px; height: 1px; background: var(--line-strong); }
.generation-form { display: grid; gap: 12px; }
.form-card { padding: 20px 22px 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.form-card__heading { display: flex; align-items: flex-start; gap: 11px; margin-bottom: 17px; }
.section-number { display: grid; place-items: center; flex: 0 0 auto; width: 29px; height: 29px; border-radius: 8px; color: var(--blue); background: var(--blue-soft); font-size: 10px; font-weight: 800; }
.form-card__heading h2 { margin: 0 0 5px; font-size: 15px; }
.form-card__heading p { margin: 0; color: var(--muted); font-size: 11px; }
.optional-badge { margin-left: auto; padding: 4px 7px; border-radius: 5px; color: #8d94a4; background: #f2f3f6; font-size: 9px; }
.required-badge { margin-left: auto; padding: 5px 8px; border-radius: 5px; color: #a6333b; background: #fff0f1; font-size: 9px; font-weight: 750; white-space: nowrap; }
.form-grid { display: grid; gap: 19px 16px; }
.form-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.scene-people-count { margin-top: 18px; }
.form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.field--span-2 { grid-column: span 2; }
.field--block { position: relative; margin-top: 16px; }
.field-hint { position: absolute; right: 9px; bottom: 8px; color: #a1a8b5; font-size: 9px; }
.room-fieldset { min-width: 0; margin: 20px 0 0; padding: 0; border: 0; }
.room-fieldset legend { padding: 0; color: #333c50; font-size: 13px; font-weight: 650; }
.room-fieldset legend em { margin-left: 4px; color: var(--blue); font-size: 10px; font-style: normal; }
.room-fieldset > p { margin: 5px 0 11px; color: var(--muted); font-size: 10px; }
.room-presets { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.room-preset { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: #fff; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.room-preset:hover { transform: translateY(-1px); border-color: #b9c8e5; box-shadow: var(--shadow-sm); }
.room-preset:has(input:checked) { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(40,100,220,.11); }
.room-preset input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.room-preset > img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #e8ebf1; }
.room-preset > span { display: flex; flex-direction: column; gap: 3px; padding: 10px 9px 11px; }
.room-preset strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.room-preset small { color: var(--muted); font-size: 10px; }
.room-preset > i { position: absolute; top: 6px; right: 6px; display: none; place-items: center; width: 20px; height: 20px; border: 2px solid #fff; border-radius: 50%; color: #fff; background: var(--blue); box-shadow: 0 2px 8px rgba(17,29,53,.22); }
.room-preset:has(input:checked) > i { display: grid; }
.room-preset > i svg { width: 12px; stroke-width: 2.5; }
.room-reference { margin-top: 14px; padding: 15px; border: 1px solid #dce3ef; border-radius: 10px; background: #f8faff; }
.room-reference__heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 11px; }
.room-reference__heading > span:first-child { display: flex; flex-direction: column; gap: 3px; }
.room-reference__heading strong { font-size: 13px; }
.room-reference__heading small { color: var(--muted); font-size: 11px; }
.room-reference__heading > span:last-child { padding: 4px 7px; border-radius: 5px; color: var(--blue); background: #e7efff; font-size: 10px; font-weight: 700; }
.room-gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.room-gallery figure { position: relative; overflow: hidden; margin: 0; border-radius: 7px; background: #e5e9f0; }
.room-gallery img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.room-gallery figcaption { position: absolute; right: 5px; bottom: 5px; padding: 3px 5px; border-radius: 4px; color: #fff; background: rgba(17,29,53,.62); font-size: 7px; backdrop-filter: blur(4px); }
.resource-choice-gallery { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.resource-choice { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }
.resource-choice:has(input:checked) { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(40,100,220,.14); }
.resource-choice input { position: absolute; z-index: 1; top: 6px; right: 6px; width: 16px; height: 16px; accent-color: var(--blue); }
.resource-choice img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; background: #e5e9f0; }
.resource-choice span { display: block; padding: 7px 8px; color: var(--muted); font-size: 10px; }
.scene-resource-groups { display: grid; gap: 12px; margin-top: 14px; }
.scene-resource-group { padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.scene-resource-group > div:first-child { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.scene-resource-group strong { font-size: 14px; }
.scene-resource-group small { color: var(--muted); font-size: 11px; }
.upload-zone { min-height: 98px; display: flex; align-items: center; justify-content: center; gap: 13px; padding: 17px; border: 1px dashed #bec7d8; border-radius: 10px; color: #4c576c; background: #fafbfe; cursor: pointer; transition: border-color .15s, background .15s; }
.upload-zone:hover, .upload-zone.is-dragging { border-color: var(--blue); background: var(--blue-soft); }
.upload-zone.is-complete { border-color: #8bcdb4; background: #f3fbf7; }
.upload-zone__icon { display: grid; place-items: center; flex: 0 0 auto; width: 42px; height: 42px; border-radius: 10px; color: var(--blue); background: #e5efff; }
.upload-zone__icon svg { width: 20px; }
.upload-zone > span:last-of-type { display: flex; flex-direction: column; gap: 5px; }
.upload-zone strong { font-size: 12px; }
.upload-zone small { color: #8c94a4; font-size: 10px; }
.upload-zone > b { margin-left: 12px; padding: 7px 10px; border-radius: 7px; color: #6e7789; background: #edf0f5; font-size: 10px; white-space: nowrap; }
.upload-zone.is-complete > b { color: #08704c; background: #dff5ea; }
.upload-preview { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.upload-preview--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.upload-card { position: relative; overflow: hidden; aspect-ratio: 4 / 3; border: 1px solid var(--line); border-radius: 8px; background: #eef1f6; }
.upload-card img { width: 100%; height: 100%; object-fit: cover; }
.upload-card button { position: absolute; top: 5px; right: 5px; display: grid; place-items: center; width: 23px; height: 23px; padding: 0; border: 0; border-radius: 50%; color: #fff; background: rgba(17,29,53,.78); cursor: pointer; }
.upload-card button svg { width: 12px; }
.upload-card span { position: absolute; left: 0; right: 0; bottom: 0; overflow: hidden; padding: 12px 6px 5px; text-overflow: ellipsis; white-space: nowrap; color: #fff; background: linear-gradient(transparent, rgba(17,29,53,.78)); font-size: 8px; }
.form-actions { display: flex; align-items: center; justify-content: space-between; padding: 14px 3px 0; }
.form-actions__note { display: flex; align-items: center; gap: 10px; color: #697287; }
.form-actions__note > svg { width: 22px; color: var(--success); }
.form-actions__note > span { display: flex; flex-direction: column; gap: 2px; }
.form-actions__note strong { color: #4c5568; font-size: 10px; }
.form-actions__note small { font-size: 9px; }

.text-button { display: inline-flex; align-items: center; gap: 5px; padding: 0; border: 0; color: var(--blue); background: transparent; font-size: 11px; font-weight: 650; cursor: pointer; }
.text-button svg { width: 15px; }
.results-heading { align-items: flex-start; }
.results-title-row { display: flex; align-items: center; gap: 13px; margin-top: 17px; }
.results-title-row .eyebrow { margin-bottom: 8px; }
.results-title-row p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.success-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: #fff; background: var(--success); }
.success-mark svg { width: 20px; stroke-width: 2.3; }
.result-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: -8px 0 20px; }
.summary-chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px; color: #5f687a; background: #fff; font-size: 9px; }
.summary-chip strong { color: #343d50; }
.global-feedback { display: grid; grid-template-columns: minmax(260px, .8fr) minmax(380px, 1.2fr); align-items: center; gap: 24px; margin-bottom: 22px; padding: 18px 20px; border: 1px solid #d7e3fa; border-radius: 12px; background: linear-gradient(100deg, #f2f7ff, #fbfdff); }
.global-feedback > div:first-child { display: flex; align-items: center; gap: 12px; }
.global-feedback__icon { display: grid; place-items: center; flex: 0 0 auto; width: 38px; height: 38px; border-radius: 9px; color: var(--blue); background: #dfeaff; }
.global-feedback__icon svg { width: 19px; }
.global-feedback > div:first-child > span:last-child { display: flex; flex-direction: column; gap: 4px; }
.global-feedback strong { font-size: 12px; }
.global-feedback small { color: var(--muted); font-size: 9px; line-height: 1.5; }
.global-feedback__action { display: flex; gap: 8px; }
.global-feedback input { min-width: 0; height: 42px; padding: 0 12px; font-size: 11px; }
.global-feedback .button { white-space: nowrap; }
.result-grid { display: grid; gap: 20px; }
.result-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); }
.result-card__header { display: flex; align-items: center; justify-content: space-between; padding: 15px 17px; border-bottom: 1px solid var(--line); }
.result-card__title { display: flex; align-items: center; gap: 10px; }
.camera-index { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; color: #fff; background: var(--navy); font-size: 9px; font-weight: 800; }
.result-card__title h2 { margin: 0 0 3px; font-size: 13px; }
.result-card__title p { margin: 0; color: var(--muted); font-size: 9px; }
.version-badge { padding: 5px 8px; border-radius: 5px; color: #5d687c; background: #f0f2f6; font-size: 9px; font-weight: 700; }
.result-card__body { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .75fr); }
.result-image-wrap { position: relative; min-height: 300px; overflow: hidden; background: #dce1e9; }
.result-image-wrap img { display: block; width: 100%; height: 100%; min-height: 300px; object-fit: cover; aspect-ratio: 4 / 3; }
.result-image-wrap::after { content: "AI 生成结果"; position: absolute; left: 12px; bottom: 12px; padding: 5px 8px; border-radius: 5px; color: rgba(255,255,255,.9); background: rgba(17,29,53,.64); backdrop-filter: blur(5px); font-size: 8px; font-weight: 650; letter-spacing: .3px; }
.result-card.is-loading .result-image-wrap::before { content: "正在重新生成…"; position: absolute; z-index: 3; inset: 0; display: grid; place-items: center; color: #fff; background: rgba(17,29,53,.65); backdrop-filter: blur(4px); font-size: 12px; font-weight: 700; }
.result-image-wrap.is-missing::after { content: "生成未完成"; }
.result-image-missing { display: grid; place-content: center; min-height: 300px; padding: 28px; color: #69758a; text-align: center; background: linear-gradient(145deg, #eef1f5, #dce2ea); }
.result-image-missing strong { margin-bottom: 8px; color: #39465b; font-size: 15px; }
.result-image-missing span { max-width: 300px; font-size: 10px; line-height: 1.6; }
.result-controls { display: flex; flex-direction: column; padding: 20px; border-left: 1px solid var(--line); }
.result-controls h3 { margin: 0 0 6px; font-size: 12px; }
.result-controls > p { margin: 0 0 15px; color: var(--muted); font-size: 9px; line-height: 1.6; }
.result-controls textarea { width: 100%; min-height: 96px; padding: 10px; border: 1px solid var(--line-strong); border-radius: 8px; outline: none; resize: vertical; color: var(--ink); font-size: 10px; line-height: 1.55; }
.result-controls textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(40,100,220,.09); }
.result-controls__buttons { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 10px; }
.result-controls__buttons .button { min-height: 38px; padding: 0 12px; font-size: 10px; }
.result-controls__buttons .download-button { width: 40px; padding: 0; }
.consistency-note { display: flex; align-items: flex-start; gap: 7px; margin-top: auto; padding-top: 15px; color: #788195; font-size: 8px; line-height: 1.5; }
.consistency-note svg { flex: 0 0 auto; width: 13px; color: var(--blue); }
.feedback-history { margin-top: 24px; padding: 23px 25px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.feedback-history__heading { display: flex; align-items: center; justify-content: space-between; }
.feedback-history__heading h2 { margin: 0 0 4px; font-size: 14px; }
.feedback-history__heading p { margin: 0; color: var(--muted); font-size: 10px; }
.feedback-log { display: grid; gap: 9px; margin-top: 17px; }
.feedback-entry { display: grid; grid-template-columns: 7px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 10px 12px; border-radius: 8px; background: #f7f8fb; }
.feedback-entry > i { width: 7px; height: 7px; margin-top: 4px; border-radius: 50%; background: var(--blue); }
.feedback-entry strong { display: block; margin-bottom: 3px; font-size: 10px; }
.feedback-entry p { margin: 0; color: #5f687a; font-size: 10px; line-height: 1.5; }
.feedback-entry time { color: #969eac; font-size: 8px; white-space: nowrap; }
.prompt-output { margin-bottom: 22px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); }
.prompt-output__heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.prompt-output__heading .eyebrow { margin-bottom: 8px; }
.prompt-output__heading h2 { margin: 0 0 6px; font-size: 16px; }
.prompt-output__heading p:last-child { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.prompt-output__grid { display: grid; gap: 14px; }
.prompt-output__item { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #fafbfc; }
.prompt-output__item-header { display: flex; align-items: center; justify-content: space-between; padding: 11px 12px; border-bottom: 1px solid var(--line); background: #f5f7fa; }
.prompt-output__item-header > span { display: flex; align-items: center; gap: 8px; }
.prompt-output__item-header b { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; color: #fff; background: var(--navy); font-size: 8px; }
.prompt-output__item-header strong { font-size: 11px; }
.copy-prompt-button { min-height: 32px; padding: 0 11px; font-size: 9px; }
.prompt-output textarea { display: block; width: 100%; min-height: 240px; padding: 15px; border: 0; outline: 0; resize: vertical; color: #3f485a; background: #fff; font: 10px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace; }
.prompt-output textarea:focus { box-shadow: inset 0 0 0 2px rgba(40,100,220,.24); }

.system-config-view .page-heading > div > p:last-child { font-size: 14px; }
.system-config-view .button, .system-config-view .field > span, .system-config-view input { font-size: 13px; }
.config-tabs { display: flex; gap: 6px; margin-bottom: 16px; padding: 5px; border: 1px solid var(--line); border-radius: 11px; background: #f1f4f8; }
.config-tab { flex: 0 1 180px; min-height: 42px; padding: 0 18px; border: 0; border-radius: 8px; color: #687287; background: transparent; font-size: 14px; font-weight: 700; cursor: pointer; }
.config-tab:hover { color: var(--blue); background: rgba(255,255,255,.72); }
.config-tab.is-active { color: var(--blue); background: #fff; box-shadow: var(--shadow-sm); }
.config-tab-panel[hidden] { display: none; }
.config-panel-heading { margin-bottom: 14px; }
.config-panel-heading h2 { margin: 0 0 5px; font-size: 18px; }
.config-panel-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.global-config-badge { display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; border: 1px solid #cbdaf7; border-radius: 8px; color: var(--blue); background: var(--blue-soft); font-size: 12px; font-weight: 700; white-space: nowrap; }
.global-config-badge svg { width: 16px; }
.config-notice { display: flex; align-items: center; gap: 11px; margin-bottom: 14px; padding: 13px 15px; border: 1px solid #d8e3f7; border-radius: 10px; color: var(--blue); background: #f3f7ff; }
.config-notice > svg { flex: 0 0 auto; width: 20px; }
.config-notice > span { display: flex; flex-direction: column; gap: 3px; }
.config-notice strong { color: #34415a; font-size: 14px; }
.config-notice small { color: #6b7690; font-size: 12px; line-height: 1.5; }
.resource-config-section { margin-bottom: 18px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow-sm); }
.resource-config-heading { margin-bottom: 14px; }
.resource-config-heading h2 { margin: 0 0 5px; font-size: 18px; }
.resource-config-heading p:last-child { margin: 0; color: var(--muted); font-size: 12px; }
.resource-config-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.resource-manager { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #fafbfc; }
.resource-manager--rooms { grid-column: 1 / -1; }
.resource-manager__heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.resource-manager__heading h3 { margin: 0 0 5px; font-size: 15px; }
.resource-manager__heading p { margin: 0; color: var(--muted); font-size: 12px; }
.resource-manager__heading > span { color: var(--blue); font-size: 12px; font-weight: 700; }
.resource-upload-form { display: flex; align-items: end; gap: 9px; margin-bottom: 12px; }
.resource-upload-form .field { flex: 1 1 180px; }
.compact-upload { display: flex; align-items: center; min-height: 40px; padding: 0 10px; border: 1px dashed #b8c3d5; border-radius: 8px; color: var(--blue); background: #fff; cursor: pointer; font-size: 12px; }
.compact-upload input { width: min(240px, 100%); font-size: 12px; }
.compact-upload span { display: none; }
.resource-manager__list { display: grid; gap: 9px; }
.resource-room-item { display: grid; grid-template-columns: 1fr auto; gap: 8px 14px; padding: 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.resource-room-item > div:first-child { display: flex; flex-direction: column; gap: 3px; }
.resource-room-item strong { font-size: 13px; }
.resource-room-item small { color: var(--muted); font-size: 12px; }
.resource-room-item .resource-photo-strip { grid-column: 1 / -1; }
.resource-photo-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; min-height: 36px; }
.resource-photo-strip img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 6px; background: #e5e9f0; }
.resource-empty { grid-column: 1 / -1; margin: 0; padding: 10px; border-radius: 6px; color: var(--muted); background: #f1f3f7; font-size: 12px; text-align: center; }
.text-button--danger { color: var(--danger); }
.system-prompt-form { display: grid; gap: 12px; }
.system-prompt-card { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow-sm); }
.system-prompt-card__heading { display: flex; align-items: center; gap: 10px; padding: 13px 15px; border-bottom: 1px solid var(--line); background: #fafbfc; }
.system-prompt-card__heading h2 { margin: 0 0 4px; font-size: 15px; }
.system-prompt-card__heading p { margin: 0; color: var(--muted); font-size: 12px; }
.system-prompt-card textarea { display: block; width: 100%; min-height: 240px; padding: 16px; border: 0; outline: 0; resize: vertical; color: #3f485a; background: #fff; font: 13px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace; }
.system-prompt-card textarea:focus { box-shadow: inset 0 0 0 2px rgba(40,100,220,.24); }
.system-config-actions { position: sticky; bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 2px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.96); box-shadow: 0 10px 30px rgba(17,29,53,.12); backdrop-filter: blur(12px); }
.system-config-actions > span { color: var(--muted); font-size: 12px; }
.system-config-actions > div { display: flex; gap: 8px; }
.generating-overlay { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 24px; background: rgba(8, 18, 36, .74); backdrop-filter: blur(9px); }
.generating-card { width: min(100%, 430px); padding: 34px; text-align: center; border-radius: var(--radius-lg); background: #fff; box-shadow: 0 30px 80px rgba(0,0,0,.25); }
.generation-visual { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; height: 105px; overflow: hidden; margin-bottom: 28px; padding: 8px; border-radius: 10px; background: #e7ebf2; }
.generation-visual > span { border-radius: 6px; background: linear-gradient(145deg, #aab7cc, #e3e8f0); }
.generation-scan { position: absolute; left: 8px; right: 8px; height: 2px; background: var(--blue); box-shadow: 0 0 12px 3px rgba(40,100,220,.6); animation: scan 1.6s ease-in-out infinite alternate; }
@keyframes scan { from { top: 10px; } to { top: 94px; } }
.generating-card h2 { margin: 0 0 9px; font-size: 22px; }
.generating-card > p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 11px; }
.progress-track { height: 5px; overflow: hidden; margin: 24px 0 11px; border-radius: 99px; background: #e9edf3; }
.progress-track span { display: block; width: 12%; height: 100%; border-radius: inherit; background: var(--blue); transition: width .35s ease; }
.generating-card > small { color: #969eac; font-size: 9px; }
.toast-region { position: fixed; z-index: 200; top: 20px; right: 20px; display: grid; gap: 8px; pointer-events: none; }
.toast { max-width: 340px; padding: 12px 15px; border: 1px solid rgba(255,255,255,.1); border-radius: 9px; color: #fff; background: var(--navy); box-shadow: var(--shadow-md); font-size: 11px; animation: toast-in .2s ease; }
.toast.is-error { background: #8f2e35; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-7px); } }

@media (max-width: 1040px) {
  .auth-screen { grid-template-columns: .85fr 1fr; }
  .auth-proof { gap: 28px; }
  .workspace { grid-template-columns: 210px minmax(0, 1fr); }
  .sidebar { padding-inline: 12px; }
  .main-content { padding-inline: 24px; }
  .form-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field--span-2 { grid-column: span 1; }
  .room-presets { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .global-feedback { grid-template-columns: 1fr; }
  .result-card__body { grid-template-columns: 1.35fr .75fr; }
}

@media (max-width: 780px) {
  .auth-screen {
    display: block;
    min-height: 100dvh;
    padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    background: linear-gradient(145deg, var(--navy), #213d70);
  }
  .auth-visual { display: none; }
  .auth-panel { min-height: calc(100dvh - 24px); padding: 24px; border-radius: 18px; }
  .auth-tabs { margin-top: 28px; }
  .auth-tab, .button, .dialog-close, .text-button { min-height: 44px; }
  .workspace { display: block; }
  .sidebar { position: static; width: auto; height: auto; padding: 10px max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left)); border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar__section { display: none; }
  .topbar {
    min-height: 60px;
    height: auto;
    padding: max(8px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left));
  }
  .topbar__actions { gap: 8px; }
  .mock-badge, .user-menu__copy { display: none; }
  .user-menu { min-width: 44px; min-height: 44px; justify-content: center; padding: 4px; }
  .user-popover { top: calc(100% + 8px); width: 190px; padding: 8px; }
  .user-popover button { min-height: 44px; font-size: 13px; }
  .main-content { padding: 22px max(16px, env(safe-area-inset-right)) max(68px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 18px; }
  .page-heading h1 { font-size: 25px; }
  .steps { width: 100%; justify-content: space-between; overflow-x: auto; }
  .form-grid--2, .form-grid--3, .form-grid--4 { grid-template-columns: 1fr; }
  .field--span-2 { grid-column: auto; }
  .field input, .field select, .field textarea, .global-feedback input, .result-controls textarea { font-size: 16px; }
  .form-actions { align-items: stretch; flex-direction: column; gap: 16px; }
  .form-actions .button { width: 100%; }
  .upload-preview { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .room-presets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .room-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .room-reference__heading, .scene-resource-group > div:first-child, .resource-manager__heading { align-items: flex-start; flex-wrap: wrap; }
  .resource-config-grid { grid-template-columns: 1fr; }
  .resource-manager--rooms { grid-column: auto; }
  .resource-upload-form { align-items: stretch; flex-direction: column; }
  .resource-upload-form .button { width: 100%; }
  .compact-upload { min-height: 46px; overflow: hidden; }
  .resource-choice-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .prompt-output { padding: 18px; }
  .system-config-actions { position: static; align-items: stretch; flex-direction: column; }
  .system-config-actions > div { display: grid; grid-template-columns: 1fr 1fr; }
  .config-back { margin-bottom: 5px; }
  .results-heading { align-items: stretch; }
  .results-heading > .button { width: 100%; }
  .global-feedback__action { flex-direction: column; }
  .result-card__body { grid-template-columns: 1fr; }
  .result-image-wrap, .result-image-wrap img { min-height: 0; }
  .result-controls { border-top: 1px solid var(--line); border-left: 0; }
  .password-dialog__card { padding: 22px; }
  .toast-region { top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); left: max(12px, env(safe-area-inset-left)); }
  .toast { width: 100%; max-width: none; }
}

@media (max-width: 500px) {
  .auth-panel { padding: 22px 18px; }
  .auth-card__header h2 { font-size: 29px; }
  .brand { gap: 9px; font-size: 15px; }
  .brand__mark { width: 34px; height: 34px; }
  .form-card { padding: 19px 15px; }
  .form-card__heading { flex-wrap: wrap; }
  .form-card__heading > div { min-width: 0; flex: 1 1 180px; }
  .form-card__heading p { line-height: 1.5; }
  .required-badge, .optional-badge { margin-left: 40px; }
  .upload-zone { align-items: flex-start; flex-wrap: wrap; }
  .upload-zone > span:last-of-type { min-width: 0; flex: 1 1 160px; }
  .upload-zone > b { margin-left: 55px; }
  .upload-preview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .room-presets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .room-preset { display: block; min-width: 0; }
  .room-preset > img { height: auto; aspect-ratio: 16 / 9; }
  .room-gallery { grid-template-columns: 1fr 1fr; }
  .resource-choice-gallery, .resource-photo-strip { grid-template-columns: 1fr 1fr; }
  .upload-preview--three { grid-template-columns: 1fr; }
  .prompt-output__heading { flex-direction: column; }
  .prompt-output textarea { min-height: 300px; font-size: 12px; }
  .config-tabs { overflow: hidden; }
  .config-tab { min-width: 0; padding-inline: 8px; font-size: 13px; }
  .config-notice { align-items: flex-start; }
  .system-config-actions > div { grid-template-columns: 1fr; }
  .results-title-row { align-items: flex-start; }
  .result-summary { display: grid; grid-template-columns: 1fr 1fr; }
  .global-feedback { padding: 16px; }
  .global-feedback > div:first-child { align-items: flex-start; }
  .result-card__header { align-items: flex-start; gap: 8px; }
  .result-controls__buttons { grid-template-columns: 1fr 44px; }
  .feedback-entry { grid-template-columns: 7px minmax(0, 1fr); }
  .feedback-entry time { grid-column: 2; }
  .password-dialog__actions { display: grid; grid-template-columns: 1fr 1fr; }
  .generating-overlay { padding: 16px; }
  .generating-card { padding: 26px 20px; }
}

.task-center { flex: 0 0 auto; }
.active-task-list { display: grid; gap: 7px; }
.active-task {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid #cbdaf8;
  border-radius: 9px;
  background: var(--blue-soft);
}
.active-task__heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.active-task__heading strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.active-task__status { color: var(--blue); font-size: 11px; font-weight: 700; }
.active-task__progress { height: 4px; overflow: hidden; border-radius: 99px; background: #dce5f6; }
.active-task__progress span { display: block; height: 100%; background: var(--blue); }
.active-task__meta { margin: 0; color: var(--muted); font-size: 11px; }
.active-task__actions { display: flex; justify-content: flex-end; }
.active-task__actions button { min-height: 32px; border: 0; color: var(--danger); background: transparent; font-size: 11px; font-weight: 700; cursor: pointer; }
.page-alert {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 auto 16px;
  padding: 12px 14px;
  border: 1px solid #e9b6bb;
  border-radius: 9px;
  color: #70232a;
  background: #fff4f5;
  font-size: 13px;
}
.page-alert[hidden] { display: none; }
.page-alert button { min-width: 44px; min-height: 44px; border: 0; color: inherit; background: transparent; font-weight: 700; cursor: pointer; }
.generating-actions { display: flex; gap: 9px; justify-content: center; margin-top: 20px; }
.button--danger { color: #fff; background: var(--danger); }

@media (max-width: 820px) {
  .sidebar__section.task-center { display: flex; margin-top: 10px; }
  .active-task-list { grid-auto-flow: column; grid-auto-columns: minmax(250px, 82vw); overflow-x: auto; }
}

:where(button, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid rgba(40, 100, 220, .3);
  outline-offset: 2px;
}
.eyebrow,
.field em,
.mock-badge,
.user-menu__copy small,
.password-dialog__heading p:last-child,
.sidebar__heading,
.sidebar__heading span:last-child,
.history-item__copy strong,
.history-item__copy small,
.history-empty p,
.history-empty span,
.step,
.step b,
.section-number,
.form-card__heading p,
.optional-badge,
.required-badge,
.field-hint,
.room-fieldset legend em,
.room-fieldset > p,
.room-preset small,
.room-reference__heading small,
.room-reference__heading > span:last-child,
.room-gallery figcaption,
.resource-choice span,
.scene-resource-group small,
.upload-zone small,
.upload-zone > b,
.upload-card span,
.form-actions__note strong,
.form-actions__note small,
.text-button,
.results-title-row p:last-child,
.summary-chip,
.global-feedback small,
.global-feedback input,
.result-card__title p,
.version-badge,
.result-image-wrap::after,
.result-image-missing span,
.result-controls > p,
.result-controls textarea,
.result-controls__buttons .button,
.consistency-note,
.feedback-history__heading p,
.feedback-entry strong,
.feedback-entry p,
.feedback-entry time,
.prompt-output__heading p:last-child,
.prompt-output__item-header b,
.prompt-output__item-header strong,
.copy-prompt-button,
.prompt-output textarea,
.generating-card > p:not(.eyebrow),
.generating-card > small,
.toast,
.active-task__status,
.active-task__meta,
.active-task__actions button {
  font-size: 12px;
}
.button,
.dialog-close,
.copy-prompt-button,
.result-controls__buttons .button,
.active-task__actions button {
  min-height: 44px;
}
.dialog-close { width: 44px; height: 44px; }

@media (max-width: 820px) {
  .upload-card button { width: 44px; height: 44px; }
  .result-controls__buttons .download-button { width: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
