:root {
  --bg: #070a12;
  --panel: rgba(15, 20, 34, 0.82);
  --panel-strong: #111827;
  --line: rgba(255,255,255,0.09);
  --muted: #8d98ae;
  --text: #f7f8fc;
  --accent: #8b5cf6;
  --accent-2: #ff4e8a;
  --success: #34d399;
  --danger: #fb7185;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; }
input:disabled, select:disabled { opacity: .45; cursor: not-allowed; }
button { color: inherit; }
.ambient { position: fixed; width: 38vw; height: 38vw; border-radius: 50%; filter: blur(110px); opacity: .16; pointer-events: none; }
.ambient-a { background: #7c3aed; top: -15vw; right: -8vw; }
.ambient-b { background: #db2777; bottom: -22vw; left: -10vw; }
.app-shell { width: min(1480px, calc(100% - 40px)); margin: 0 auto; padding: 42px 0 64px; position: relative; }
.topbar { display: flex; justify-content: center; align-items: center; margin-bottom: 30px; text-align: center; }
.brand-center { display: grid; justify-items: center; gap: 8px; }
.brand-links { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 10px; }
.brand-links a { min-width: 154px; padding: 11px 18px; border: 1px solid rgba(216,180,254,.46); border-radius: 12px; color: #fff; background: linear-gradient(135deg,#6d28d9,#8b5cf6 52%,#a855f7); box-shadow: 0 9px 24px rgba(109,40,217,.28),inset 0 1px 0 rgba(255,255,255,.16); text-decoration: none; font: 800 16px/1.25 "Microsoft YaHei UI",sans-serif; letter-spacing: .01em; transition: transform .18s,box-shadow .18s,filter .18s; }
.brand-links a:hover { color: #fff; filter: brightness(1.12); transform: translateY(-2px); box-shadow: 0 13px 28px rgba(139,92,246,.38),inset 0 1px 0 rgba(255,255,255,.2); }
.brand-links a:focus-visible { outline: 3px solid #d8b4fe; outline-offset: 3px; }
.eyebrow { display: block; color: #a78bfa; font: 700 11px/1.4 ui-monospace, monospace; letter-spacing: .18em; }
h1 { margin: 8px 0 4px; font-size: clamp(26px, 3.5vw, 46px); letter-spacing: -.04em; }
.topbar p { margin: 0; color: var(--muted); }
.workflow-strip { display: flex; align-items: center; gap: 10px; margin: -10px 0 26px; padding: 11px 14px; width: fit-content; max-width: 100%; border: 1px solid var(--line); border-radius: 14px; background: rgba(15,20,34,.62); color: #9aa5ba; font-size: 11px; overflow-x: auto; }
.workflow-strip span { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.workflow-strip b { display: inline-grid; place-items: center; width: 21px; height: 21px; border-radius: 7px; color: #fff; background: linear-gradient(135deg,#7c3aed,#db2777); font: 700 10px ui-monospace,monospace; }
.workflow-strip i { color: #475569; font-style: normal; }
.workspace { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(380px, .8fr); gap: 24px; align-items: start; }
.controls-panel { display: grid; gap: 18px; }
.control-card, .preview-sticky { border: 1px solid var(--line); background: var(--panel); backdrop-filter: blur(20px); border-radius: 22px; box-shadow: 0 24px 70px rgba(0,0,0,.22); }
.control-card { padding: 22px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 15px; }
.section-heading > div { display: flex; align-items: center; gap: 11px; }
h2 { font-size: 18px; margin: 0; letter-spacing: -.01em; }
.step { display: inline-grid; place-items: center; min-width: 30px; height: 24px; border-radius: 8px; color: #c4b5fd; background: rgba(139,92,246,.14); font: 700 11px ui-monospace, monospace; }
.hint { color: var(--muted); font-size: 12px; margin: -5px 0 14px; line-height: 1.6; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
.inline-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; color: #cbd5e1; font-size: 12px; }
.source-panel { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.text-hint { margin: 10px 0 0; }
.choice-grid { display: grid; gap: 9px; }
.source-choice-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.animation-choice-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
.background-choice-grid { grid-template-columns: repeat(3,minmax(0,1fr)); margin-bottom: 17px; }
.font-choice-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
.direction-choice-grid, .fps-choice-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
.compact-choice-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.shimmer-color-choices { grid-template-columns: repeat(3,minmax(0,1fr)); }
.choice-button { position: relative; min-width: 0; border: 1px solid var(--line); border-radius: 12px; color: #aeb8ca; background: rgba(4,7,15,.42); padding: 10px 11px; cursor: pointer; text-align: left; transition: border-color .18s, background .18s, transform .18s, color .18s; }
.choice-button:hover { border-color: rgba(139,92,246,.6); background: rgba(139,92,246,.08); transform: translateY(-1px); }
.choice-button.active, .choice-button[aria-pressed="true"] { color: #fff; border-color: rgba(167,139,250,.85); background: linear-gradient(135deg,rgba(124,58,237,.22),rgba(219,39,119,.12)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.025),0 8px 22px rgba(76,29,149,.12); }
.choice-button.active::after, .choice-button[aria-pressed="true"]::after { content: "✓"; position: absolute; top: 7px; right: 8px; display: grid; place-items: center; width: 17px; height: 17px; border-radius: 999px; color: #fff; background: #7c3aed; font-size: 10px; }
.choice-button:disabled { opacity: .38; cursor: not-allowed; transform: none; }
.choice-button strong, .choice-button small { display: block; padding-right: 17px; }
.choice-button strong { font-size: 12px; line-height: 1.35; }
.choice-button small { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.motion-number { display: block; margin-bottom: 7px; color: #8b5cf6; font: 900 16px/1 ui-monospace,monospace; }
.choice-button.active .motion-number, .choice-button[aria-pressed="true"] .motion-number { color: #ddd6fe; }
.animation-hint { display: block; margin: 10px 1px 0; }
.setting-panel { margin-top: 14px; padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: rgba(4,7,15,.27); }
.setting-title { display: block; margin-bottom: 8px; color: #cbd5e1; font-size: 11px; }
.animation-settings:not(:empty) { margin-top: 15px; }
.background-settings { margin-top: 2px; }
.ghost-button { border: 1px solid var(--line); background: transparent; padding: 8px 11px; border-radius: 10px; cursor: pointer; font-size: 12px; }
.ghost-button:hover { border-color: #8b5cf6; background: rgba(139,92,246,.08); }
.text-list { display: grid; gap: 10px; }
.source-mode-grid { margin-bottom: 14px; }
.image-source-panel { display: grid; grid-template-columns: 1fr 112px; gap: 14px; align-items: center; }
.image-source-panel[hidden] { display: none; }
.image-source-panel .field, .image-source-panel .hint { min-width: 0; }
.image-source-panel .image-safe-margin-field { grid-column: 1 / -1; }
.image-source-panel .hint { grid-column: 1 / -1; margin: 0; }
.image-source-preview { width: 100px; height: 100px; border-radius: 16px; overflow: hidden; border: 1px solid rgba(255,255,255,.16); position: relative; display: grid; place-items: center; }
.image-source-preview img { width: 100%; height: 100%; object-fit: contain; image-rendering: auto; }
.image-source-preview span { padding: 8px; color: #4b5563; font: 700 10px ui-monospace, monospace; text-align: center; }
.image-upload-row { min-width: 0; }
.text-row { display: grid; grid-template-columns: 34px 1fr 34px; gap: 9px; align-items: center; }
.text-row .index { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: #c4b5fd; background: #171c2d; font: 700 12px ui-monospace, monospace; }
.text-row textarea, .field input[type="text"], textarea, select { width: 100%; border: 1px solid var(--line); background: rgba(4,7,15,.54); color: var(--text); border-radius: 11px; outline: none; }
.text-row textarea { min-height: 60px; padding: 9px 12px; resize: vertical; line-height: 1.45; }
.field input[type="text"], select { height: 40px; padding: 0 12px; }
.text-row textarea:focus, .field input:focus, textarea:focus, select:focus { border-color: rgba(139,92,246,.8); box-shadow: 0 0 0 3px rgba(139,92,246,.1); }
.remove-text { width: 34px; height: 34px; border: 0; background: transparent; color: #68748b; cursor: pointer; border-radius: 9px; }
.remove-text:hover { color: var(--danger); background: rgba(251,113,133,.08); }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.field { display: grid; gap: 8px; color: #c6ccda; font-size: 12px; }
.field output { float: right; color: #a78bfa; }
.field-note { color: var(--muted); font-size: 10px; line-height: 1.5; }
.span-2 { grid-column: span 2; }
.gradient-color-editor { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 14px; }
.color-list { display: flex; flex-wrap: wrap; gap: 10px; }
.color-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.mini-button { border: 1px solid var(--line); color: #c6ccda; background: rgba(4,7,15,.44); padding: 8px 10px; border-radius: 9px; cursor: pointer; font-size: 11px; }
.mini-button:hover { border-color: rgba(139,92,246,.75); background: rgba(139,92,246,.1); }
.preset-button { border-color: rgba(244,179,41,.42); color: #fde68a; background: linear-gradient(110deg,rgba(222,0,143,.13),rgba(118,13,244,.13)); }
input[type="color"] { appearance: none; border: 0; padding: 0; width: 44px; height: 38px; border-radius: 11px; background: transparent; cursor: pointer; }
input[type="color"]::-webkit-color-swatch-wrapper { padding: 2px; }
input[type="color"]::-webkit-color-swatch { border: 1px solid rgba(255,255,255,.18); border-radius: 9px; }
.color-field { grid-template-columns: 1fr auto; align-items: center; }
input[type="range"] { width: 100%; accent-color: var(--accent); }
.toggle-field { align-self: end; display: flex; align-items: center; gap: 9px; color: #c6ccda; font-size: 12px; min-height: 38px; }
.toggle-field input { display: none; }
.toggle-field span { width: 38px; height: 21px; border-radius: 999px; background: #31384a; position: relative; transition: .2s; }
.toggle-field span::after { content:""; position: absolute; width: 15px; height: 15px; border-radius: 50%; background: white; top: 3px; left: 3px; transition: .2s; }
.toggle-field input:checked + span { background: var(--accent); }
.toggle-field input:checked + span::after { transform: translateX(17px); }
.upload-row { min-height: 45px; display: flex; align-items: center; gap: 12px; border: 1px dashed rgba(255,255,255,.13); border-radius: 12px; padding: 8px 11px; }
.upload-row input { width: 150px; font-size: 11px; }
.upload-row span { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inline-advanced { margin-top: 17px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 14px; background: rgba(4,7,15,.25); }
.inline-advanced summary { color: #cbd5e1; font-size: 12px; }
.inline-advanced .advanced-grid { margin-top: 16px; }
.duration-notice { margin-top: 14px; padding: 10px 12px; color: #a9b1c2; background: rgba(4,7,15,.38); border-radius: 10px; font-size: 12px; }
.duration-notice.warn { color: #fda4af; background: rgba(244,63,94,.08); }
details summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; }
details summary::-webkit-details-marker { display: none; }
details summary > span { display: flex; align-items: center; gap: 11px; }
details summary small { color: var(--muted); }
details[open] summary { margin-bottom: 19px; }
textarea { resize: vertical; min-height: 92px; padding: 12px; line-height: 1.6; }
.secondary-button { margin-top: 12px; width: 100%; border: 1px solid #6d4cca; background: rgba(139,92,246,.12); border-radius: 12px; padding: 12px; cursor: pointer; }
.mosaic-generate { border-color: rgba(52,211,153,.45); background: linear-gradient(110deg,rgba(16,185,129,.16),rgba(59,130,246,.13)); }
.preview-panel { min-width: 0; position: sticky; top: 16px; align-self: start; }
.preview-sticky { position: relative; padding: 24px; max-height: calc(100vh - 32px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(139,92,246,.5) transparent; }
.preview-sticky::-webkit-scrollbar { width: 7px; }
.preview-sticky::-webkit-scrollbar-thumb { border-radius: 999px; background: rgba(139,92,246,.42); }
.preview-header { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 18px; }
.preview-header h2 { margin-top: 5px; font-size: 22px; }
.active-animation-label { display: inline-flex; margin-top: 8px; padding: 5px 8px; border-radius: 8px; color: #ddd6fe; background: rgba(139,92,246,.13); font-size: 10px; }
.preview-tools { display: grid; justify-items: end; gap: 8px; }
.mode-switch { display: flex; padding: 3px; border: 1px solid var(--line); background: rgba(4,7,15,.52); border-radius: 10px; }
.mode-switch button { border: 0; color: var(--muted); background: transparent; padding: 6px 9px; border-radius: 7px; cursor: pointer; font-size: 11px; }
.mode-switch button.active { color: white; background: rgba(139,92,246,.72); }
.size-badge { font: 700 11px ui-monospace, monospace; color: #9ca3b8; border: 1px solid var(--line); padding: 7px 9px; border-radius: 9px; }
.preview-stage { aspect-ratio: 1; display: grid; place-items: center; border-radius: 19px; overflow: hidden; border: 1px solid rgba(255,255,255,.1); position: relative; }
.preview-stage.mosaic-preview { max-height: 560px; }
.checkerboard { background-color: #d8d8dc; background-image: linear-gradient(45deg,#b8bac1 25%,transparent 25%),linear-gradient(-45deg,#b8bac1 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#b8bac1 75%),linear-gradient(-45deg,transparent 75%,#b8bac1 75%); background-size: 32px 32px; background-position: 0 0,0 16px,16px -16px,-16px 0; }
#previewCanvas { width: 100%; height: 100%; display: block; }
.primary-button { width: 100%; display: flex; align-items: center; justify-content: space-between; margin-top: 14px; border: 0; border-radius: 14px; padding: 15px 16px; cursor: pointer; font-weight: 700; background: linear-gradient(110deg, #7c3aed, #db2777); box-shadow: 0 13px 30px rgba(124,58,237,.28); }
.primary-button.mosaic-mode { background: linear-gradient(110deg,#059669,#2563eb); box-shadow: 0 13px 30px rgba(5,150,105,.24); }
.primary-button:hover { filter: brightness(1.08); transform: translateY(-1px); }
.primary-button:disabled, .secondary-button:disabled { opacity: .55; cursor: wait; transform: none; }
.primary-button kbd { font: 700 9px ui-monospace, monospace; padding: 5px 7px; border: 1px solid rgba(255,255,255,.24); border-radius: 7px; background: rgba(0,0,0,.14); }
.gif-button { width: 100%; display: flex; align-items: center; justify-content: space-between; margin-top: 10px; border: 1px solid rgba(192,132,252,.45); border-radius: 14px; padding: 14px 16px; color: #f5f3ff; background: linear-gradient(110deg,rgba(91,33,182,.48),rgba(126,34,206,.30)); cursor: pointer; font-weight: 700; box-shadow: inset 0 1px 0 rgba(255,255,255,.06); }
.gif-button:hover { border-color: rgba(216,180,254,.78); background: linear-gradient(110deg,rgba(109,40,217,.62),rgba(147,51,234,.40)); transform: translateY(-1px); }
.gif-button:disabled { opacity: .55; cursor: wait; transform: none; }
.gif-button kbd { font: 700 9px ui-monospace,monospace; padding: 5px 7px; color: #e9d5ff; border: 1px solid rgba(216,180,254,.28); border-radius: 7px; background: rgba(0,0,0,.14); }
.message { margin-top: 13px; padding: 12px; border-radius: 11px; font-size: 12px; line-height: 1.6; white-space: pre-line; }
.message.error { background: rgba(244,63,94,.1); color: #fda4af; border: 1px solid rgba(244,63,94,.2); }
.message.loading { background: rgba(139,92,246,.1); color: #c4b5fd; border: 1px solid rgba(139,92,246,.2); }
.results { display: grid; gap: 9px; margin-top: 12px; }
.result-item { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 12px; border: 1px solid rgba(52,211,153,.18); background: rgba(52,211,153,.06); border-radius: 11px; }
.result-item strong { display: block; font-size: 12px; word-break: break-all; }
.result-item small { color: #8aa69e; font-size: 10px; }
.result-item .export-time { display: block; margin-top: 4px; color: #94a3b8; font: 500 9px/1.4 ui-monospace,monospace; }
.result-item a { text-decoration: none; color: #d1fae5; background: rgba(52,211,153,.14); padding: 8px 10px; border-radius: 8px; font-size: 11px; }
.mosaic-result details { margin-top: 8px; }
.mosaic-result details summary { display: inline-flex; color: #a7f3d0; font-size: 10px; cursor: pointer; }
.mosaic-result details[open] summary { margin-bottom: 7px; }
.tile-links { display: flex; flex-wrap: wrap; gap: 5px; }
.tile-links a { padding: 5px 7px; font-size: 9px; }
@media (max-width: 1160px) { .animation-choice-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } .font-choice-grid { grid-template-columns: repeat(3,minmax(0,1fr)); } }
@media (max-width: 980px) { .workspace { grid-template-columns: 1fr; } .preview-panel { grid-row: 1; position: relative; top: 0; } .preview-sticky { max-width: 560px; max-height: none; margin: auto; overflow: visible; } .animation-choice-grid { grid-template-columns: repeat(3,minmax(0,1fr)); } }
@media (max-width: 620px) { .app-shell { width: min(100% - 22px, 1480px); padding-top: 24px; } .brand-links { width: 100%; gap: 8px; } .brand-links a { flex: 1 1 145px; min-width: 0; padding: 10px 12px; font-size: 14px; } .workflow-strip { width: 100%; } .field-grid { grid-template-columns: 1fr; } .span-2 { grid-column: span 1; } .image-source-panel { grid-template-columns: 1fr; } .image-source-preview { justify-self: center; } .control-card, .preview-sticky { border-radius: 17px; padding: 17px; } .animation-choice-grid, .font-choice-grid, .direction-choice-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } .background-choice-grid { grid-template-columns: 1fr; } }

