﻿:root {
  color-scheme: dark;
  --bg: #070815;
  --card: rgba(18, 22, 45, .78);
  --card-strong: rgba(27, 33, 67, .9);
  --line: rgba(255,255,255,.12);
  --text: #f7f8ff;
  --muted: #aab0d4;
  --brand: #8f7cff;
  --brand-2: #21e2ff;
  --danger: #ff6b9b;
  --ok: #5df5b5;
  --shadow: 0 24px 80px rgba(0,0,0,.42);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif; background: radial-gradient(circle at top, #172150 0, #070815 44%, #03040b 100%); color: var(--text); overflow-x: hidden; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; border: 0; color: var(--text); }
input, textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.07); color: var(--text); padding: 14px 16px; outline: none; transition: .2s; }
textarea { resize: vertical; min-height: 160px; }
select option { background: #151935; color: var(--text); }
input:focus, textarea:focus, select:focus { border-color: rgba(143,124,255,.9); box-shadow: 0 0 0 4px rgba(143,124,255,.15); }
.aurora { position: fixed; width: 420px; height: 420px; border-radius: 50%; filter: blur(70px); opacity: .42; pointer-events: none; z-index: -1; }
.aurora-a { background: #7c4dff; top: -120px; left: -90px; }
.aurora-b { background: #00d5ff; right: -100px; top: 220px; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: center; gap: 18px; padding: 14px clamp(18px, 4vw, 56px); background: rgba(7,8,21,.72); backdrop-filter: blur(18px); border-bottom: 1px solid var(--line); }
.brand { position: absolute; left: clamp(18px, 4vw, 56px); display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 900; letter-spacing: .08em; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 14px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: 0 12px 40px rgba(33,226,255,.25); }
nav { display: flex; gap: 8px; padding: 6px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.05); }
.nav-btn, .ghost, .chip { background: transparent; border-radius: 999px; padding: 10px 16px; color: var(--muted); }
.nav-btn.active, .chip.active { color: var(--text); background: rgba(255,255,255,.14); }
.user-pill { position: absolute; right: clamp(124px, 12vw, 168px); color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 10px 14px; white-space: nowrap; }
.topbar #logoutBtn { position: absolute; right: clamp(18px, 4vw, 56px); padding: 10px 14px; }
.shell { width: min(1880px, calc(100% - 32px)); margin: 24px auto 56px; }
.eyebrow { color: var(--brand-2); font-weight: 800; letter-spacing: .18em; font-size: 12px; margin: 0 0 10px; }
h2 { margin: 0 0 10px; font-size: 26px; }
.muted { color: var(--muted); line-height: 1.8; }
.card { border: 1px solid var(--line); background: linear-gradient(145deg, rgba(255,255,255,.1), rgba(255,255,255,.045)); box-shadow: var(--shadow); border-radius: 30px; padding: clamp(20px, 3vw, 30px); backdrop-filter: blur(18px); }
.auth-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 24px; align-items: center; margin-bottom: 24px; }
.form { display: grid; gap: 14px; }
.row, .section-title { display: flex; gap: 12px; align-items: center; justify-content: space-between; min-width: 0; }
button, .primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); border-radius: 18px; padding: 14px 18px; font-weight: 850; box-shadow: 0 16px 34px rgba(80,100,255,.22); }
.ghost { border: 1px solid var(--line); box-shadow: none; background: rgba(255,255,255,.06); }
.view { margin-top: 0; }
.workspace-layout { display: grid; grid-template-columns: minmax(460px, 560px) minmax(760px, 1fr); gap: 22px; align-items: start; }
.workspace-layout.templates-hidden { grid-template-columns: minmax(0, 1fr); }
.workspace-layout.templates-hidden .template-rail { display: none; }
.creator-stage { display: grid; grid-template-columns: minmax(360px, .92fr) minmax(480px, 1.08fr); gap: 26px; align-items: stretch; }
.generator, .preview-card { display: grid; align-content: start; gap: 18px; min-height: 720px; }
.preview-card { grid-template-rows: auto minmax(0, 1fr); }
.generate-row { display: block; }
.generate-row .primary { width: 100%; display: flex; align-items: center; justify-content: center; gap: 12px; position: relative; }
.cost-badge { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); border: 1px solid rgba(255,255,255,.32); color: #eaffff; background: rgba(8,16,32,.22); border-radius: 999px; padding: 5px 9px; white-space: nowrap; font-size: 12px; line-height: 1; }
.upload-box { display: grid; gap: 7px; padding: 18px; border: 1px dashed rgba(255,255,255,.22); border-radius: 22px; background: rgba(255,255,255,.05); }
.upload-box input { display: none; }
.upload-box small, small { color: var(--muted); }
.reference-preview { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ref-thumb { position: relative; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: rgba(255,255,255,.06); cursor: grab; }
.ref-thumb.dragging { opacity: .5; }
.ref-thumb img { width: 100%; aspect-ratio: 1/1; object-fit: cover; display: block; }
.ref-remove { position: absolute; right: 6px; top: 6px; width: 26px; height: 26px; border-radius: 50%; padding: 0; display: grid; place-items: center; background: rgba(0,0,0,.62); box-shadow: none; }
.option-group { display: grid; gap: 10px; }
.ratio-list { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.ratio { border: 1px solid var(--line); background: rgba(255,255,255,.06); padding: 12px 8px; border-radius: 18px; display: grid; justify-items: center; gap: 8px; box-shadow: none; }
.ratio.active { border-color: var(--brand-2); background: rgba(33,226,255,.12); }
.ratio-icon { display: block; border: 2px solid currentColor; border-radius: 6px; color: var(--brand-2); }
.segmented { display: flex; gap: 10px; }
.preview { position: relative; height: 100%; min-height: 0; display: grid; place-items: center; border-radius: 24px; background: radial-gradient(circle, rgba(143,124,255,.18), rgba(255,255,255,.045)); overflow: hidden; text-align: center; color: var(--muted); }
.preview span { font-size: 64px; color: var(--brand-2); }
.preview img { width: 100%; height: 100%; object-fit: contain; display: block; }
.prompt-highlight { margin-top: -8px; border: 1px solid rgba(33,226,255,.24); border-radius: 18px; padding: 12px 14px; color: var(--muted); background: rgba(33,226,255,.06); line-height: 1.7; white-space: normal; }
.prompt-highlight::before { content: '可替换内容预览'; display: block; margin-bottom: 6px; color: var(--brand-2); font-size: 12px; font-weight: 850; letter-spacing: .12em; }
.prompt-highlight mark { border: 1px solid rgba(255,221,99,.4); border-radius: 999px; padding: 1px 7px; color: #fff3b8; background: rgba(255,221,99,.18); }
.template-rail { position: sticky; top: 86px; height: calc(100vh - 110px); border: 1px solid var(--line); border-radius: 24px; background: rgba(14,17,36,.72); box-shadow: var(--shadow); overflow: hidden; }
.rail-head { display: flex; align-items: center; justify-content: space-between; padding: 14px; font-weight: 850; border-bottom: 1px solid var(--line); }
.rail-close { display: none; width: 30px; height: 30px; padding: 0; border-radius: 50%; background: rgba(255,255,255,.1); box-shadow: none; }
.template-body { height: calc(100% - 50px); display: grid; grid-template-columns: 116px minmax(0, 1fr); min-height: 0; }
.template-categories { border-right: 1px solid var(--line); padding: 10px 8px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; scrollbar-width: thin; }
.category-btn { width: 100%; padding: 9px 10px; border-radius: 12px; background: rgba(255,255,255,.06); box-shadow: none; color: var(--muted); text-align: left; font-size: 12px; line-height: 1.25; }
.category-btn.active { color: #fff; background: linear-gradient(135deg, rgba(143,124,255,.85), rgba(33,226,255,.72)); }
.template-waterfall { height: 100%; overflow-y: auto; overflow-x: hidden; padding: 12px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 12px; scrollbar-width: thin; overscroll-behavior: contain; }
.template-column { display: grid; gap: 12px; align-content: start; min-width: 0; }
.template-card { position: relative; display: block; width: 100%; min-width: 0; margin: 0; padding: 0; overflow: hidden; border: 0; border-radius: 14px; background: rgba(255,255,255,.06); box-shadow: 0 8px 22px rgba(0,0,0,.24); text-align: left; }
.template-card img { width: 100%; height: auto; display: block; object-fit: contain; background: rgba(255,255,255,.04); }
.template-more-hint { grid-column: 1 / -1; padding: 10px 8px 18px; color: var(--muted); font-size: 12px; text-align: center; }
.template-card div { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 7px; background: linear-gradient(180deg, transparent, rgba(0,0,0,.72)); opacity: 1; transform: none; transition: .18s ease; }
.template-card:hover div { opacity: 1; transform: translateY(0); }
.template-card strong { display: block; color: #fff; font-size: 11px; line-height: 1.25; text-shadow: 0 1px 6px rgba(0,0,0,.6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.template-card small { display: none; }
.template-badges { position: absolute; top: 8px; left: 8px; right: 8px; z-index: 2; display: flex; flex-wrap: wrap; gap: 5px; pointer-events: none; }
.template-badges span { max-width: 100%; border: 1px solid rgba(255,255,255,.35); border-radius: 999px; padding: 3px 7px; color: #fff; background: linear-gradient(135deg, rgba(255,107,155,.9), rgba(143,124,255,.82)); box-shadow: 0 8px 20px rgba(0,0,0,.28); font-size: 10px; line-height: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.template-card.image-error { min-height: 130px; display: grid; place-items: end stretch; background: linear-gradient(135deg, rgba(143,124,255,.18), rgba(33,226,255,.12)); }
.template-card.image-error::before { content: '图片加载失败'; position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.mobile-rail-tab { display: none; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.work { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: rgba(255,255,255,.06); transition: .2s; text-align: left; padding: 0; box-shadow: none; }
.work:hover, .template-card:hover { transform: translateY(-3px); border-color: rgba(33,226,255,.45); }
.work-open { display: block; width: 100%; padding: 0; border-radius: 0; background: transparent; box-shadow: none; }
.work img { width: 100%; aspect-ratio: 1/1; object-fit: cover; display: block; background: rgba(255,255,255,.05); }
.work div { padding: 12px; color: var(--muted); font-size: 13px; }
.work-prompt { margin: 0 0 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.45; min-height: 2.9em; }
.work small { color: var(--muted); font-weight: 800; }
.image-download { display: grid; place-items: center; border: 1px solid rgba(255,255,255,.25); border-radius: 999px; color: #fff; background: rgba(8,16,32,.56); backdrop-filter: blur(10px); text-decoration: none; font-weight: 850; box-shadow: 0 10px 28px rgba(0,0,0,.25); }
.preview-download { position: absolute; top: 14px; right: 14px; z-index: 2; padding: 10px 14px; font-size: 13px; }
.work-download { position: absolute; top: 10px; right: 10px; z-index: 2; padding: 7px 10px; font-size: 12px; opacity: 0; transition: .18s ease; }
.work:hover .work-download { opacity: 1; }
.ref-box { display: grid; grid-template-columns: 180px 1fr; gap: 18px; align-items: center; }
.ref-box img { width: 180px; height: 180px; border-radius: 22px; background: white; padding: 10px; }
.account-actions { margin-top: 16px; display: flex; justify-content: flex-end; }
.inline-form { grid-template-columns: 1fr auto; }
.admin-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 22px; align-items: start; }
.admin-tabs { position: sticky; top: 86px; display: grid; gap: 10px; border: 1px solid var(--line); border-radius: 24px; padding: 12px; background: rgba(14,17,36,.72); box-shadow: var(--shadow); }
.admin-tab { width: 100%; border: 1px solid transparent; border-radius: 16px; padding: 13px 14px; color: var(--muted); background: rgba(255,255,255,.06); box-shadow: none; text-align: left; }
.admin-tab.active { color: #fff; border-color: rgba(33,226,255,.35); background: linear-gradient(135deg, rgba(143,124,255,.78), rgba(33,226,255,.52)); }
.admin-panels { min-width: 0; }
.admin-panel { display: none; gap: 22px; }
.admin-panel.active { display: grid; grid-template-columns: minmax(320px, 420px) minmax(0, 1fr); align-items: start; }
.admin-panel[data-admin-panel="settings"].active,
.admin-panel[data-admin-panel="codes"].active,
.admin-panel[data-admin-panel="categories"].active { grid-template-columns: minmax(320px, 420px) minmax(0, 1fr); }
.bulk-tools { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.2fr) auto auto auto; gap: 10px; align-items: center; margin: 14px 0; }
.bulk-tools button { padding: 12px 14px; border-radius: 14px; white-space: nowrap; }
.admin-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-bottom: 24px; }
.card label { display: grid; gap: 8px; color: var(--muted); margin: 12px 0; }
.check-row { display: flex !important; align-items: center; gap: 8px !important; }
.check-row input { width: auto; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 12px 0 20px; }
.stat { border: 1px solid var(--line); border-radius: 18px; padding: 16px; background: rgba(255,255,255,.06); }
.stat b { display: block; font-size: 28px; }
.code-list, .template-admin-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; max-height: 620px; overflow: auto; }
.code, .template-admin-item { border: 1px solid var(--line); border-radius: 16px; padding: 12px; background: rgba(255,255,255,.05); }
.code { font-family: ui-monospace, monospace; }
.user-admin-list { display: grid; gap: 12px; max-height: 620px; overflow: auto; }
.user-admin-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 16px; padding: 14px; background: rgba(255,255,255,.05); }
.user-admin-item strong, .user-admin-item small { display: block; }
.user-admin-item small { margin-top: 4px; color: var(--muted); line-height: 1.5; }
.user-admin-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.user-admin-actions button { padding: 8px 12px; border-radius: 12px; box-shadow: none; }
.template-admin-item { display: grid; gap: 8px; min-width: 0; }
.template-select { margin: 0 !important; color: var(--muted); font-size: 12px; }
.template-admin-item img { width: 100%; height: auto; max-height: 220px; object-fit: contain; border-radius: 10px; background: rgba(255,255,255,.04); }
.template-admin-item strong { line-height: 1.35; }
.template-admin-item small { display: block; line-height: 1.45; }
.template-admin-item p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tag-list { display: flex; flex-wrap: wrap; gap: 5px; min-height: 22px; }
.tag-list span, .tag-list em { border-radius: 999px; padding: 4px 8px; background: rgba(33,226,255,.12); color: #dffbff; font-size: 11px; font-style: normal; }
.tag-list em { color: var(--muted); background: rgba(255,255,255,.06); }
.template-admin-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.template-admin-actions button { padding: 8px 10px; border-radius: 12px; box-shadow: none; }
.category-admin-list { display: grid; gap: 10px; max-height: 620px; overflow: auto; }
.category-admin-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; background: rgba(255,255,255,.05); }
.category-admin-item strong, .category-admin-item small { display: block; }
.category-admin-item small { margin-top: 4px; color: var(--muted); }
.category-admin-item button { padding: 8px 12px; border-radius: 12px; }
.category-admin-item button:disabled { opacity: .45; cursor: not-allowed; }
.admin-subtitle { margin-top: 24px; }
.toast { position: fixed; right: 22px; bottom: 22px; max-width: 360px; border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; background: var(--card-strong); box-shadow: var(--shadow); z-index: 20; }
.album-modal { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 24px; }
.album-backdrop { position: absolute; inset: 0; background: rgba(2,4,14,.82); backdrop-filter: blur(16px); }
.album-panel { position: relative; width: min(1120px, 100%); height: min(86vh, 820px); display: block; }
.album-stage { margin: 0; width: 100%; height: 100%; min-width: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; border: 1px solid var(--line); border-radius: 28px; background: rgba(12,15,32,.88); box-shadow: var(--shadow); overflow: hidden; }
.album-stage img { width: 100%; height: 100%; min-height: 0; object-fit: contain; background: radial-gradient(circle, rgba(143,124,255,.12), rgba(0,0,0,.28)); transition: opacity .16s ease; }
.album-stage figcaption { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 18px; border-top: 1px solid var(--line); }
.album-stage p { margin: 5px 0 0; color: var(--muted); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.album-close, .album-arrow, .download-btn { display: grid; place-items: center; border: 1px solid var(--line); background: rgba(255,255,255,.1); box-shadow: var(--shadow); text-decoration: none; color: var(--text); }
.album-close { position: absolute; top: 16px; right: 16px; width: 42px; height: 42px; padding: 0; border-radius: 50%; font-size: 28px; line-height: 1; z-index: 4; background: rgba(20,23,45,.78); box-shadow: 0 10px 28px rgba(0,0,0,.3); }
.album-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 50px; height: 50px; padding: 0; border-radius: 50%; font-size: 38px; line-height: 1; z-index: 4; background: rgba(255,255,255,.16); backdrop-filter: blur(8px); box-shadow: 0 10px 28px rgba(0,0,0,.3); }
.album-prev { left: 18px; }
.album-next { right: 18px; }
.album-arrow:disabled { opacity: .35; cursor: not-allowed; }
.download-btn { min-width: 118px; border-radius: 999px; padding: 12px 16px; font-weight: 850; background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.hidden { display: none !important; }
@media (max-width: 1600px) { .workspace-layout { grid-template-columns: minmax(420px, 520px) minmax(600px, 1fr); } }
@media (max-width: 1440px) { .creator-stage .section-title { align-items: flex-start; flex-direction: column; } }
@media (max-width: 1280px) { .workspace-layout { grid-template-columns: minmax(360px, 440px) minmax(560px, 1fr); } .creator-stage { grid-template-columns: 1fr; } .generator, .preview-card { min-height: auto; } .preview { min-height: 420px; } }
@media (max-width: 1020px) { .workspace-layout { grid-template-columns: 1fr; } .template-body { grid-template-columns: 104px minmax(0, 1fr); } .template-waterfall { grid-template-columns: repeat(2, minmax(0, 1fr)); } .template-rail { position: fixed; top: 0; bottom: 0; width: min(82vw, 420px); height: 100vh; z-index: 25; border-radius: 0; transition: transform .28s ease; } .left-rail { left: 0; transform: translateX(-105%); } .right-rail { right: 0; transform: translateX(105%); } .template-rail.open { transform: translateX(0); } .rail-close { display: grid; } .mobile-rail-tab { display: block; position: fixed; top: 50%; z-index: 20; writing-mode: vertical-rl; letter-spacing: .15em; padding: 14px 9px; border-radius: 16px; box-shadow: var(--shadow); } .mobile-left-tab { left: 6px; } .mobile-right-tab { right: 6px; } }
@media (max-width: 1100px) { .admin-layout, .admin-panel.active { grid-template-columns: 1fr; } .admin-tabs { position: static; grid-template-columns: repeat(5, minmax(0, 1fr)); } .admin-tab { text-align: center; } .bulk-tools { grid-template-columns: 1fr 1fr; } }
@media (max-width: 860px) { .topbar { justify-content: flex-start; flex-wrap: wrap; padding: 14px; } .brand, .user-pill, .topbar #logoutBtn { position: static; } nav { order: 3; width: 100%; overflow-x: auto; justify-content: center; } .auth-grid, .admin-grid { grid-template-columns: 1fr; } .ratio-list { grid-template-columns: repeat(3, 1fr); } .ref-box, .inline-form, .user-admin-item { grid-template-columns: 1fr; } .stats { grid-template-columns: 1fr; } .admin-tabs, .bulk-tools { grid-template-columns: 1fr; } .album-modal { padding: 12px; } .album-panel { height: 88vh; } .album-close { top: 12px; right: 12px; } .album-arrow { top: 45%; width: 46px; height: 46px; font-size: 34px; } .album-prev { left: 10px; } .album-next { right: 10px; } .album-stage figcaption { align-items: stretch; flex-direction: column; } .download-btn { width: 100%; } }
