:root {
  color-scheme: dark;
  --bg: #070b14;
  --bg-deep: #05070c;
  --surface: rgba(17, 22, 31, 0.78);
  --surface-strong: rgba(13, 18, 27, 0.94);
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(0, 242, 254, 0.48);
  --text: #f4f7fb;
  --muted: #9aa5b5;
  --cyan: #00e8f2;
  --blue: #4facfe;
  --coral: #ff7464;
  --green: #70d694;
  --warning: #f6c75d;
  --danger: #ff6b79;
  --shadow: 0 18px 55px rgba(0, 0, 0, 0.34);
  font-family: Inter, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { min-height: 100vh; margin: 0; color: var(--text); background: linear-gradient(145deg, #070b14, #141425); letter-spacing: 0; }
button, input, textarea, select { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
.hidden { display: none !important; }

.glass-panel {
  background: rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.auth-shell { position: fixed; inset: 0; display: grid; align-items: center; padding: clamp(22px, 4vw, 70px); overflow: auto; background: #060910 url('/assets/auth-background.png') center/cover no-repeat; }
.auth-overlay { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(3, 6, 11, .78), rgba(3, 7, 12, .32) 55%, rgba(3, 7, 12, .14)); }
.auth-brand { position: absolute; z-index: 1; top: clamp(22px, 4vw, 52px); left: clamp(22px, 4vw, 64px); display: flex; align-items: center; gap: 12px; }
.auth-brand h1 { font-size: 22px; }
.auth-brand p { margin-top: 3px; color: var(--muted); font-size: 11px; text-transform: uppercase; }
.brand-mark { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; background: #e8fbfc; color: #071017; border: 1px solid rgba(255,255,255,.76); border-radius: 6px; box-shadow: 0 0 25px rgba(0,232,242,.28); }
.brand-mark svg { width: 21px; height: 21px; }
.auth-panel { position: relative; z-index: 1; width: min(430px, 100%); margin-left: max(0px, 5vw); padding: 30px; border-radius: 8px; background: rgba(6, 10, 17, .76); }
.auth-heading { margin-bottom: 22px; }
.auth-heading h2 { margin-top: 8px; font-size: 28px; }
.eyebrow { color: var(--cyan); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.segmented { display: grid; padding: 3px; background: rgba(255,255,255,.055); border: 1px solid var(--line); border-radius: 6px; }
.segmented button { min-height: 36px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); cursor: pointer; }
.segmented button.active { background: rgba(255,255,255,.1); color: var(--text); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.auth-tabs { grid-template-columns: 1fr 1fr; margin-bottom: 20px; }
.auth-form { display: grid; gap: 14px; }
label, .field-label { display: grid; gap: 7px; color: #cbd3df; font-size: 12px; font-weight: 600; }
input, textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 5px; background: rgba(4, 8, 14, .74); color: var(--text); padding: 11px 12px; transition: border-color .2s, background .2s; }
textarea { resize: vertical; line-height: 1.55; }
input:hover, textarea:hover, select:hover { border-color: rgba(255,255,255,.2); }
input:focus, textarea:focus, select:focus { border-color: var(--cyan); background: rgba(3, 10, 16, .9); outline: 0; }
input::placeholder, textarea::placeholder { color: #697687; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #8d99aa 50%), linear-gradient(135deg, #8d99aa 50%, transparent 50%); background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
.field-pair, .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.inline-field { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.inline-field input { min-width: 0; }
.code-button { width: 112px; }

button.primary, button.secondary, .text-button { min-height: 38px; border-radius: 5px; cursor: pointer; transition: transform .16s, border-color .16s, background .16s, opacity .16s; }
button.primary, button.secondary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 14px; }
button.primary { border: 1px solid rgba(255,255,255,.35); color: #041014; font-weight: 700; background: linear-gradient(120deg, var(--cyan), var(--blue)); box-shadow: 0 8px 25px rgba(0, 190, 230, .2); }
button.secondary { border: 1px solid var(--line); background: rgba(255,255,255,.055); color: var(--text); }
button.primary:hover, button.secondary:hover { transform: translateY(-1px); }
button.secondary:hover { border-color: rgba(255,255,255,.24); background: rgba(255,255,255,.09); }
button:disabled { cursor: not-allowed; opacity: .45; transform: none !important; }
button svg { width: 16px; height: 16px; flex: 0 0 16px; }
.wide { width: 100%; }

.app-shell { min-height: 100vh; position: relative; padding: 76px 18px 24px; }
.app-backdrop { position: fixed; inset: 0; z-index: -2; background: #070b14 url('/assets/app-background.png') center/cover no-repeat; }
.app-backdrop::after { content: ''; position: absolute; inset: 0; background: rgba(5, 8, 14, .78); }
.topbar { position: fixed; z-index: 30; top: 12px; left: 18px; right: 18px; height: 52px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 18px; padding: 0 10px 0 8px; border-radius: 7px; background: rgba(8, 12, 19, .76); }
.brand { display: flex; align-items: center; gap: 9px; }
.brand.compact .brand-mark { width: 34px; height: 34px; flex-basis: 34px; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 14px; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 9px; text-transform: uppercase; }
.announcement { min-width: 0; display: flex; justify-self: center; align-items: center; gap: 8px; color: #bdc6d3; font-size: 11px; overflow: hidden; }
.announcement svg { width: 14px; color: var(--coral); }
.announcement span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-strip { display: flex; align-items: center; gap: 7px; }
.credit-pill, .user-button, .icon-button { border: 1px solid var(--line); background: rgba(255,255,255,.045); cursor: pointer; }
.credit-pill { height: 34px; display: flex; align-items: center; gap: 6px; padding: 0 10px; border-radius: 5px; color: #e7fbff; }
.credit-pill svg { color: var(--cyan); }
.user-button { height: 34px; display: flex; align-items: center; gap: 7px; padding: 0 9px 0 4px; border-radius: 5px; font-size: 11px; }
.avatar { width: 26px; height: 26px; display: inline-grid; place-items: center; border-radius: 50%; background: #f2f5f8; color: #111823; font-size: 11px; font-weight: 700; }
.avatar.large { width: 52px; height: 52px; font-size: 18px; }
.icon-button { width: 34px; height: 34px; display: inline-grid; place-items: center; padding: 0; border-radius: 5px; }
.icon-button:hover { border-color: rgba(255,255,255,.25); background: rgba(255,255,255,.09); }

.tool-nav { position: fixed; z-index: 20; left: 18px; top: 76px; bottom: 24px; width: 72px; padding: 8px; display: flex; flex-direction: column; gap: 5px; border-radius: 7px; background: rgba(8,12,19,.7); }
.tool-nav button { width: 54px; min-height: 58px; display: grid; place-items: center; align-content: center; gap: 5px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: #8e99a9; font-size: 9px; cursor: pointer; }
.tool-nav button svg { width: 18px; height: 18px; }
.tool-nav button:hover { color: #dce3ec; background: rgba(255,255,255,.05); }
.tool-nav button.active { color: var(--text); border-color: rgba(0,232,242,.3); background: rgba(0,232,242,.09); box-shadow: inset 3px 0 0 var(--cyan); }
.workspace { margin-left: 84px; min-height: calc(100vh - 100px); }
.view { display: none; animation: fade-in .24s ease; }
.view.active { display: block; }
@keyframes fade-in { from { opacity: 0; transform: translateY(3px); } }

.creator-layout { min-height: calc(100vh - 100px); display: grid; grid-template-columns: minmax(270px, 340px) minmax(360px, 1fr) minmax(230px, 280px); gap: 12px; }
.control-panel, .canvas-panel, .model-panel { min-width: 0; border-radius: 7px; padding: 18px; background: rgba(8, 12, 19, .72); }
.control-panel { display: flex; flex-direction: column; gap: 14px; }
.panel-title, .section-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.panel-title h2, .section-heading h2 { margin-top: 5px; font-size: 16px; }
.panel-title > svg, .section-heading > svg { width: 20px; color: var(--cyan); }
.optimize-button { width: 100%; color: #dffeff !important; border-color: rgba(0,232,242,.22) !important; }
.resolution-control { margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 6px; }
.resolution-control legend { padding: 0 5px; color: #cbd3df; font-size: 11px; font-weight: 600; }
.resolution-control legend span { margin-left: 5px; color: var(--cyan); font-weight: 500; }
.size-presets { grid-template-columns: repeat(3, 1fr); }
.dimension-fields { margin-top: 10px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 8px; }
.dimension-fields label { font-size: 10px; color: var(--muted); }
.dimension-fields input { padding: 8px; }
.dimension-fields > span { padding-bottom: 9px; color: var(--muted); }
.generate-button { width: 100%; min-height: 46px !important; margin-top: auto; }
.generate-button strong { margin-left: auto; padding-left: 9px; border-left: 1px solid rgba(3,12,16,.2); font-size: 10px; }
.pricing-formula { margin: -2px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; text-align: center; }

.canvas-panel { display: grid; grid-template-rows: auto minmax(360px, 1fr) auto; gap: 14px; }
.result-stage { position: relative; min-height: 360px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: #05080d; }
.result-stage > img { width: 100%; height: 100%; position: absolute; inset: 0; object-fit: contain; }
.result-stage.initial > img, .result-stage:not(.has-result) > img { object-fit: cover; opacity: .44; }
.result-stage::after { content: ''; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 80px rgba(0,0,0,.28); }
.empty-copy { position: relative; z-index: 2; display: grid; gap: 5px; justify-items: center; padding: 18px; background: rgba(3, 7, 12, .65); border: 1px solid var(--line); border-radius: 6px; }
.empty-copy span { font-weight: 600; }
.empty-copy small { color: var(--muted); }
.result-thumbnails { min-height: 58px; display: flex; gap: 8px; overflow-x: auto; }
.result-thumbnails button { width: 58px; height: 58px; flex: 0 0 58px; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 4px; background: #05080d; cursor: pointer; }
.result-thumbnails button.active { border-color: var(--cyan); box-shadow: 0 0 14px rgba(0,232,242,.2); }
.result-thumbnails img { width: 100%; height: 100%; object-fit: cover; }

.model-panel { display: flex; flex-direction: column; }
.model-grid { margin-top: 15px; display: grid; gap: 8px; }
.model-card { width: 100%; min-height: 78px; display: grid; grid-template-columns: 56px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 8px; text-align: left; border: 1px solid var(--line); border-radius: 6px; background: rgba(255,255,255,.035); cursor: pointer; overflow: hidden; }
.model-card:hover { border-color: rgba(255,255,255,.22); }
.model-card.selected { border-color: var(--cyan); background: rgba(0,232,242,.09); box-shadow: 0 0 18px rgba(0,232,242,.12); }
.model-card.locked { opacity: .55; }
.model-art { width: 56px; height: 56px; border-radius: 4px; background-image: url('/assets/model-icon-atlas.png'); background-size: 300% 300%; background-repeat: no-repeat; }
.model-card:nth-child(1) .model-art { background-position: 0 0; }
.model-card:nth-child(2) .model-art { background-position: 50% 0; }
.model-card:nth-child(3) .model-art { background-position: 100% 0; }
.model-copy { min-width: 0; }
.model-copy strong, .model-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-copy strong { font-size: 11px; }
.model-copy span { margin-top: 5px; color: var(--muted); font-size: 9px; }
.model-meta { display: grid; justify-items: end; gap: 5px; color: var(--warning); font-size: 9px; }
.mini-history { margin-top: 20px; padding-top: 15px; border-top: 1px solid var(--line); }
.compact-heading h3 { font-size: 12px; }
.text-button { min-height: auto; padding: 0; border: 0; background: transparent; color: var(--cyan); font-size: 10px; }
.mini-history-list { margin-top: 10px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.mini-history-item { aspect-ratio: 1; overflow: hidden; border-radius: 4px; border: 1px solid var(--line); background: #05080d; }
.mini-history-item img { width: 100%; height: 100%; object-fit: cover; }
.mini-empty { grid-column: 1/-1; padding: 12px 0; color: var(--muted); font-size: 10px; }

.page-heading { min-height: 58px; display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 12px; padding: 0 5px; }
.page-heading h2 { margin-top: 5px; font-size: 22px; }
.batch-summary { color: var(--cyan); font-size: 12px; }
.batch-toolbar { min-height: 56px; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px; border-radius: 7px; }
.batch-toolbar select { width: 230px; }
.toolbar-actions { display: flex; gap: 7px; }
.drop-zone { min-height: 190px; margin-top: 12px; display: grid; place-items: center; align-content: center; gap: 9px; text-align: center; border: 1px dashed rgba(0,232,242,.34); border-radius: 7px; background: rgba(5,12,18,.68); transition: border-color .2s, background .2s, box-shadow .2s; }
.drop-zone.dragover { border-color: var(--cyan); background: rgba(0,232,242,.08); box-shadow: inset 0 0 35px rgba(0,232,242,.08), 0 0 22px rgba(0,232,242,.12); }
.drop-zone > svg { width: 32px; height: 32px; color: var(--cyan); }
.drop-zone strong { font-size: 14px; }
.drop-zone > span { color: var(--muted); font-size: 10px; }
.drop-zone > div { display: flex; gap: 8px; }
.batch-grid { margin-top: 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.batch-card { position: relative; padding: 8px; border: 1px solid var(--line); border-radius: 6px; background: rgba(8,12,19,.82); cursor: grab; }
.batch-card.dragging { opacity: .45; }
.batch-card.invalid { border-color: var(--danger); }
.batch-card img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px; background: #05080d; }
.batch-card-head { position: absolute; top: 13px; left: 13px; right: 13px; display: flex; justify-content: space-between; }
.batch-card-head input { width: 18px; height: 18px; accent-color: var(--cyan); }
.batch-remove { width: 28px; height: 28px; border: 1px solid rgba(255,255,255,.18); border-radius: 50%; background: rgba(4,7,11,.82); font-size: 17px; cursor: pointer; }
.batch-file { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; margin: 8px 1px; font-size: 9px; color: var(--muted); }
.batch-file span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #d9e0e9; }
.batch-card textarea { min-height: 72px; font-size: 11px; }
.batch-submit-bar { position: sticky; z-index: 5; bottom: 12px; min-height: 62px; margin-top: 14px; padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-radius: 7px; background: rgba(8,12,19,.92); }
.batch-submit-bar > span { color: var(--muted); font-size: 11px; }
.batch-results { margin-top: 24px; }

.masonry-grid { columns: 4 260px; column-gap: 10px; }
.gallery-item { position: relative; margin-bottom: 10px; break-inside: avoid; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: rgba(8,12,19,.82); }
.gallery-item img { width: 100%; min-height: 180px; object-fit: cover; background: #05080d; }
.gallery-caption { padding: 10px; display: grid; gap: 5px; }
.gallery-caption strong { font-size: 11px; }
.gallery-caption p { color: var(--muted); font-size: 10px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gallery-meta { display: flex; justify-content: space-between; color: #7f8b9b; font-size: 9px; }
.gallery-grid { margin-top: 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }

.history-filters { display: flex; gap: 8px; }
.history-filters select { width: 160px; }
.history-list { overflow: hidden; border-radius: 7px; background: rgba(8,12,19,.75); }
.history-row { display: grid; grid-template-columns: 76px minmax(180px,1fr) 130px 100px auto; align-items: center; gap: 14px; padding: 10px; border-bottom: 1px solid var(--line); }
.history-row:last-child { border-bottom: 0; }
.history-thumb { width: 76px; height: 62px; object-fit: cover; border-radius: 4px; background: #05080d; }
.history-copy { min-width: 0; }
.history-copy strong { font-size: 11px; }
.history-copy p { margin-top: 5px; color: var(--muted); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status { display: inline-flex; align-items: center; width: fit-content; padding: 4px 7px; border-radius: 4px; font-size: 9px; border: 1px solid var(--line); }
.status.success { color: var(--green); border-color: rgba(112,214,148,.25); }
.status.failed { color: var(--danger); border-color: rgba(255,107,121,.25); }
.history-actions { display: flex; justify-content: end; gap: 6px; }

.prompt-library-visual { min-height: 260px; display: grid; grid-template-columns: minmax(260px, .8fr) minmax(320px, 1.2fr); align-items: center; gap: 28px; overflow: hidden; border-bottom: 1px solid var(--line); background: rgba(6,10,17,.56); }
.prompt-library-visual img { width: 100%; height: 260px; object-fit: cover; }
.prompt-library-visual h2 { margin: 7px 0 18px; font-size: 28px; }
.search-field { width: min(420px, 92%); display: flex; align-items: center; gap: 8px; padding: 0 11px; border: 1px solid var(--line); border-radius: 5px; background: rgba(4,8,14,.76); }
.search-field svg { width: 16px; color: var(--muted); }
.search-field input { border: 0; background: transparent; }
.prompt-grid { padding-top: 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px,1fr)); gap: 9px; }
.prompt-item { min-height: 140px; display: flex; flex-direction: column; align-items: start; padding: 15px; border: 1px solid var(--line); border-radius: 6px; background: rgba(8,12,19,.74); }
.prompt-item h3 { font-size: 13px; }
.prompt-item p { margin: 9px 0 14px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.prompt-item button { margin-top: auto; }

.account-layout { display: grid; grid-template-columns: 1.1fr .9fr .8fr; gap: 12px; }
.profile-section, .recharge-section, .password-section { padding: 18px; border-radius: 7px; background: rgba(8,12,19,.76); }
.profile-identity { display: flex; align-items: center; gap: 12px; padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.profile-identity h3 { font-size: 15px; }
.profile-identity p { margin-top: 4px; color: var(--muted); font-size: 10px; }
.profile-section form, .password-section form { margin-top: 14px; display: grid; gap: 11px; }
.invite-box { margin-top: 14px; display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 9px; padding: 9px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); font-size: 10px; }
.invite-box strong { color: var(--text); font-size: 12px; }
.amount-presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 17px 0; }
.amount-presets button { min-height: 36px; border: 1px solid var(--line); border-radius: 4px; background: rgba(255,255,255,.04); color: #cbd3df; cursor: pointer; }
.amount-presets button.active { color: #061014; background: var(--cyan); border-color: var(--cyan); font-weight: 700; }
.money-input { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 5px; background: rgba(4,8,14,.74); }
.money-input span { padding-left: 12px; color: var(--muted); }
.money-input input { border: 0; background: transparent; }
.conversion { display: flex; justify-content: space-between; margin: 15px 0; color: var(--muted); font-size: 11px; }
.conversion strong { color: var(--cyan); }
.credit-log-section { margin-top: 24px; }
.credit-log-section > .section-heading { margin-bottom: 10px; }
.table-wrap { overflow-x: auto; border-radius: 7px; background: rgba(8,12,19,.76); }
table { width: 100%; border-collapse: collapse; font-size: 11px; }
th, td { padding: 11px 13px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: #8f9aab; font-size: 9px; text-transform: uppercase; }
td { color: #d9e0e8; }
.positive { color: var(--green); }
.negative { color: var(--danger); }

.progress-dialog { width: min(680px, calc(100vw - 28px)); padding: 0; overflow: hidden; border: 1px solid rgba(0,232,242,.24); border-radius: 8px; color: var(--text); background: #070b12; box-shadow: 0 35px 100px rgba(0,0,0,.7); }
.progress-dialog::backdrop { background: rgba(2,4,8,.82); backdrop-filter: blur(8px); }
.progress-art { width: 100%; aspect-ratio: 1.52; background: #05080d url('/assets/generation-progress-strip.png') 0 0/300% 200% no-repeat; border-bottom: 1px solid var(--line); }
.progress-content { position: relative; padding: 21px; }
.progress-content h2 { margin-top: 6px; font-size: 20px; }
.progress-content p { margin-top: 8px; color: var(--muted); font-size: 11px; }
.progress-track { height: 5px; margin-top: 18px; overflow: hidden; border-radius: 3px; background: rgba(255,255,255,.08); }
.progress-track span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--blue), var(--coral)); transition: width .3s ease; }
.progress-content > strong { position: absolute; right: 21px; top: 25px; color: var(--cyan); font-size: 18px; }
.toast-stack { position: fixed; z-index: 100; right: 18px; bottom: 18px; width: min(350px, calc(100vw - 36px)); display: grid; gap: 8px; }
.toast { padding: 12px 13px; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 6px; background: rgba(9,14,22,.96); box-shadow: var(--shadow); font-size: 11px; animation: toast-in .2s ease; }
.toast::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.toast.error::before { background: var(--danger); box-shadow: 0 0 10px var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }
.empty-state { padding: 38px 18px; color: var(--muted); text-align: center; font-size: 11px; }
.payment-page { min-height: 100vh; display: grid; place-items: center; padding: 18px; background: #070b14 url('/assets/auth-background.png') center/cover no-repeat; }
.payment-page::before { content: ''; position: fixed; inset: 0; background: rgba(3,6,11,.72); }
.payment-result { position: relative; width: min(520px,100%); padding: 30px; text-align: center; border-radius: 8px; background: rgba(7,11,17,.88); }
.payment-icon { width: 58px; height: 58px; margin: 0 auto 18px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--cyan); }
.payment-icon svg { width: 27px; height: 27px; }.payment-icon.pending svg { animation: spin 1.4s linear infinite; }.payment-icon.success { color: var(--green); border-color: rgba(112,214,148,.35); }
@keyframes spin { to { transform: rotate(360deg); } }
.payment-result h1 { margin: 7px 0 9px; font-size: 24px; }.payment-result > p { color: var(--muted); font-size: 11px; }
.payment-details { margin: 22px 0; border: 1px solid var(--line); border-radius: 6px; }.payment-details div { min-height: 43px; padding: 0 12px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }.payment-details div:last-child { border-bottom: 0; }.payment-details dt { color: var(--muted); font-size: 10px; }.payment-details dd { margin: 0; font-size: 11px; font-weight: 600; }
.payment-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }.primary-link { min-height: 38px; display: flex; justify-content: center; align-items: center; gap: 8px; border: 1px solid rgba(255,255,255,.3); border-radius: 5px; background: linear-gradient(120deg,var(--cyan),var(--blue)); color: #041014; font-size: 11px; font-weight: 700; }.primary-link svg { width: 15px; }

/* 模型生成的材质皮肤，以低对比叠加保持组件文字与状态清晰。 */
.glass-panel, .batch-card, .gallery-item, .history-list, .prompt-item, .profile-section, .recharge-section, .password-section, .metric-card, .admin-panel {
  background-color: rgba(8, 12, 19, .84);
  background-image: linear-gradient(rgba(8,12,19,.72), rgba(8,12,19,.72)), url('/assets/panel-surface.png');
  background-size: auto, cover;
  background-blend-mode: normal, soft-light;
}
input, textarea, select, .search-field, .money-input {
  background-color: rgba(4, 8, 14, .9);
  background-image: linear-gradient(rgba(3,8,14,.78), rgba(3,8,14,.78)), url('/assets/control-surface.png');
  background-size: auto, 100% 420%;
  background-blend-mode: normal, soft-light;
}
button.secondary, .icon-button, .credit-pill, .user-button, .model-card, .amount-presets button, .segmented button.active {
  background-color: rgba(17, 23, 33, .9);
  background-image: linear-gradient(rgba(8,13,20,.72), rgba(8,13,20,.72)), url('/assets/control-surface.png');
  background-size: auto, 100% 420%;
  background-position: center, center 48%;
  background-blend-mode: normal, soft-light;
}
button.primary, .primary-link {
  background-image: linear-gradient(120deg, rgba(0,232,242,.92), rgba(79,172,254,.9)), url('/assets/control-surface.png');
  background-size: auto, cover;
  background-blend-mode: normal, soft-light;
}

@media (max-width: 1200px) {
  .creator-layout { grid-template-columns: 310px minmax(340px,1fr); }
  .model-panel { grid-column: 1/-1; display: grid; grid-template-columns: auto minmax(0,1fr); gap: 18px; align-items: start; }
  .model-panel .panel-title { align-self: center; }
  .model-grid { margin-top: 0; grid-template-columns: repeat(3,1fr); }
  .mini-history { display: none; }
  .account-layout { grid-template-columns: 1fr 1fr; }
  .password-section { grid-column: 1/-1; }
}

@media (max-width: 900px) {
  .app-shell { padding-left: 12px; padding-right: 12px; padding-bottom: 88px; }
  .topbar { left: 12px; right: 12px; }
  .announcement { display: none; }
  .topbar { grid-template-columns: 1fr auto; }
  .tool-nav { top: auto; left: 12px; right: 12px; bottom: 10px; width: auto; height: 64px; flex-direction: row; justify-content: space-around; padding: 4px; }
  .tool-nav button { width: auto; min-width: 50px; flex: 1; min-height: 54px; }
  .tool-nav button.active { box-shadow: inset 0 -3px 0 var(--cyan); }
  .workspace { margin-left: 0; }
  .creator-layout { grid-template-columns: minmax(260px, .85fr) minmax(340px, 1.15fr); }
  .model-panel { grid-template-columns: 1fr; }
  .model-panel .panel-title { display: none; }
  .history-row { grid-template-columns: 64px minmax(140px,1fr) 100px auto; }
  .history-row > :nth-child(4) { display: none; }
}

@media (max-width: 720px) {
  .auth-shell { align-items: end; padding: 88px 12px 12px; background-position: 65% center; }
  .auth-overlay { background: linear-gradient(0deg, rgba(3,6,11,.96), rgba(3,6,11,.42)); }
  .auth-brand { left: 18px; top: 20px; }
  .auth-panel { margin: 0; padding: 20px; background: rgba(6,10,17,.88); }
  .field-pair, .form-row { grid-template-columns: 1fr; }
  .creator-layout { display: flex; flex-direction: column; min-height: auto; }
  .canvas-panel { order: -1; grid-template-rows: auto minmax(300px, 52vh) auto; }
  .result-stage { min-height: 300px; }
  .model-grid { grid-template-columns: 1fr; }
  .topbar .brand small, .user-button > span:last-child { display: none; }
  .account-strip { gap: 4px; }
  .tool-nav button span { display: none; }
  .tool-nav button { min-width: 38px; }
  .batch-toolbar { align-items: stretch; flex-direction: column; }
  .batch-toolbar select { width: 100%; }
  .toolbar-actions { display: grid; grid-template-columns: repeat(3,1fr); }
  .toolbar-actions button span { display: none; }
  .batch-submit-bar { align-items: stretch; flex-direction: column; }
  .batch-submit-bar button { width: 100%; }
  .history-filters { width: 100%; }
  .page-heading { align-items: start; flex-direction: column; }
  .page-heading > button { align-self: stretch; }
  .history-row { grid-template-columns: 58px minmax(0,1fr) auto; gap: 9px; }
  .history-row > :nth-child(3), .history-row > :nth-child(4) { display: none; }
  .history-thumb { width: 58px; height: 58px; }
  .prompt-library-visual { grid-template-columns: 1fr; }
  .prompt-library-visual img { height: 210px; opacity: .75; }
  .prompt-library-visual > div { padding: 0 18px 20px; }
  .search-field { width: 100%; }
  .account-layout { grid-template-columns: 1fr; }
  .password-section { grid-column: auto; }
  .progress-art { aspect-ratio: 1.52; }
}

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