:root {
  --canvas: #aeb0ac;
  --panel: #dcddd6;
  --ink: #242621;
  --muted: #68705f;
  --amber: #ffbd48;
  --radius: 36px;
  --sans: Inter, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--canvas); color: var(--ink); font: 14px var(--sans); -webkit-font-smoothing: antialiased; }
button { font: inherit; cursor: pointer; touch-action: manipulation; transition: background .2s, transform .2s; }
button:active { transform: translateY(1px); }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 3px solid #ab730c; outline-offset: 4px; }
a { color: inherit; text-decoration: none; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.skip-link { position: fixed; top: 12px; left: 20px; z-index: 20; padding: 12px 18px; border-radius: 12px; background: #fff; transform: translateY(-150%); }
.skip-link:focus { transform: none; }

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  width: calc(100% - 80px);
  max-width: 1560px;
  height: 600px;
  margin: 32px auto;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
  box-shadow: 0 28px 42px -26px rgba(15, 21, 18, .5);
}

.scene-panel { position: relative; isolation: isolate; overflow: hidden; border-radius: var(--radius); min-width: 0; padding: 28px 34px; background: #27332e; color: #fff; }
.scene-image { position: absolute; inset: 0; z-index: -3; width: 100%; height: 100%; object-fit: cover; object-position: 50% 41%; }
.scene-shade { position: absolute; inset: 0; z-index: -2; background: linear-gradient(180deg, rgba(11, 23, 17, .46), transparent 30%, transparent 55%, rgba(10, 20, 15, .78)); }
.wordmark { display: inline-flex; flex-direction: column; gap: 5px; }
.brand-name { display: inline-flex; align-items: baseline; gap: 5px; font-size: 28px; font-weight: 550; letter-spacing: -.9px; }
.brand-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--amber); }
.brand-subtitle { font-size: 11px; letter-spacing: 2px; opacity: .86; }
.scene-title { position: absolute; left: 34px; bottom: 32px; margin: 0; font-size: 38px; font-weight: 450; line-height: 1.24; letter-spacing: -1.5px; text-shadow: 0 2px 16px rgba(0, 0, 0, .15); }
.scene-title > span { color: var(--amber); }
.concept-label { position: absolute; right: 28px; bottom: 31px; padding: 7px 10px; border: 1px solid rgba(255, 255, 255, .18); border-radius: 20px; background: rgba(255, 255, 255, .11); backdrop-filter: blur(10px); font-size: 9px; color: #fff; }

.prompt-panel { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 27px 30px 28px; gap: 17px; }
.prompt-meta { display: flex; align-items: center; gap: 11px; flex-shrink: 0; }
.duration-pill { display: inline-flex; align-items: center; gap: 5px; padding: 8px 11px; border-radius: 20px; background: var(--amber); color: #312913; font-size: 12px; white-space: nowrap; }
.duration-pill svg { width: 15px; height: 15px; }
.prompt-tags { display: flex; gap: 10px; color: #5a6350; font-size: 11px; }
.prompt-index { margin-left: auto; white-space: nowrap; font-size: 9px; letter-spacing: 1px; color: #717968; }
.prompt-index b { color: #343e2b; font-size: 13px; font-weight: 500; }
.reference-section { flex-shrink: 0; }
.reference-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.reference-heading h2 { margin: 0; font-size: 12px; font-weight: 500; }
.reference-heading > span { color: #737d67; font-size: 9px; }
.reference-images { display: flex; gap: 8px; flex-wrap: wrap; }
.reference-empty { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 49px; padding: 10px 14px; border: 1px dashed #b4bda7; border-radius: 16px; color: #738063; background: rgba(255, 255, 255, .14); font-size: 11px; }
.reference-empty svg { width: 21px; height: 21px; stroke-width: 1.4; }
.reference-image-button { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; border: 0; padding: 0; background: transparent; text-align: left; color: var(--ink); }
.reference-image-button img { display: block; width: auto; height: auto; max-width: 140px; max-height: 86px; border-radius: 10px; }
.reference-image-button span { font-size: 10px; line-height: 1.4; }
.reference-image-button:hover img { outline: 2px solid #b5862c; outline-offset: 2px; }

.prompt-card { display: flex; flex-direction: column; flex: 1; min-height: 0; margin: 0; padding: 15px 20px 18px; border-radius: 25px; background: #fff; overflow: hidden; }
.prompt-card-header { display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; margin-bottom: 9px; }
.prompt-card-header h2 { margin: 0; font-size: 14px; font-weight: 500; }
.download-button { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: #f1f3ec; color: #616e50; }
.download-button:hover { background: #e3e8d7; }
.download-button svg { width: 16px; height: 16px; }
.prompt-content { min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #cbd2bd transparent; padding-right: 7px; color: #414b35; font-size: 13px; line-height: 1.8; overscroll-behavior: contain; }
.prompt-content::-webkit-scrollbar { width: 4px; }
.prompt-content::-webkit-scrollbar-thumb { background: #cbd2bd; border-radius: 4px; }
.prompt-content p { margin: 0; }
.prompt-content .prompt-intro { margin: 0 0 13px; padding-bottom: 10px; border-bottom: 1px solid #edf0e5; color: #6f7a5f; font-size: 11px; }
.prompt-content section { margin: 0 0 13px; }
.prompt-content section:last-child { margin-bottom: 0; }
.prompt-content h3 { margin: 0 0 5px; color: #2d3921; font-size: 11px; font-weight: 600; line-height: 1.5; }
.copy-button { display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; gap: 12px; width: 100%; height: 52px; padding: 0 21px; border: 0; border-radius: 27px; background: var(--amber); color: #312913; font-size: 13px; font-weight: 550; }
.copy-button > span { display: flex; align-items: center; gap: 10px; }
.copy-button svg { width: 18px; height: 18px; }
.copy-button:hover { background: #ffcb6b; }
.copy-button[data-copied="true"] { background: #e5efce; }
.copy-button:disabled { cursor: wait; }

.reference-dialog { max-width: min(1000px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); margin: auto; padding: 15px 18px 20px; border: 0; border-radius: 24px; background: #f3f4ee; box-shadow: 0 25px 80px rgba(0, 0, 0, .35); }
.reference-dialog::backdrop { background: rgba(18, 29, 18, .65); backdrop-filter: blur(10px); }
.reference-dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 12px; }
.reference-dialog-header p { margin: 0; font-size: 13px; }
.reference-dialog-header button { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: #e2e7d7; color: #343f2b; }
.reference-dialog-header svg { width: 18px; height: 18px; }
.reference-dialog > img { display: block; width: auto; max-width: 100%; max-height: calc(100dvh - 140px); margin: auto; border-radius: 12px; object-fit: contain; }
.toast { position: fixed; bottom: 22px; left: 50%; z-index: 30; max-width: calc(100vw - 32px); padding: 12px 19px; border-radius: 22px; background: #2b3522; color: #fff; font-size: 12px; text-align: center; opacity: 0; transform: translate(-50%, 14px); pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 1600px) {
  .workspace { width: calc(100% - 140px); margin-top: 42px; }
  .prompt-panel { padding: 28px 35px; }
  .scene-panel { padding: 31px 38px; }
  .scene-title { left: 38px; bottom: 33px; font-size: 42px; }
  .prompt-content { font-size: 14px; }
}
@media (max-width: 1100px) {
  .workspace { width: calc(100% - 40px); margin: 20px auto; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); --radius: 30px; }
  .scene-panel { padding: 26px; }
  .scene-title { left: 26px; font-size: 33px; }
  .prompt-panel { padding: 25px 23px; gap: 15px; }
  .prompt-card { padding: 13px 17px 16px; }
  .prompt-tags { gap: 8px; font-size: 10px; }
}
@media (max-width: 700px) {
  body { background: #d1d4cb; }
  .workspace { display: flex; flex-direction: column; width: calc(100% - 24px); height: auto; margin: 12px auto; --radius: 25px; }
  .scene-panel { flex-shrink: 0; height: 240px; padding: 20px 22px; }
  .scene-image { object-position: 50% 33%; }
  .scene-shade { background: linear-gradient(180deg, rgba(10, 22, 15, .45), transparent 40%, rgba(10, 20, 14, .64)); }
  .brand-name { font-size: 23px; }
  .brand-subtitle { font-size: 10px; letter-spacing: 1.5px; }
  .wordmark { gap: 4px; }
  .scene-title { left: 22px; bottom: 21px; font-size: 25px; line-height: 1.23; letter-spacing: -.8px; }
  .concept-label { right: 19px; bottom: 21px; font-size: 8px; padding: 5px 8px; }
  .prompt-panel { height: 580px; padding: 23px 20px 22px; gap: 15px; }
  .prompt-meta { gap: 9px; }
  .duration-pill { font-size: 11px; padding: 7px 10px; }
  .prompt-tags { gap: 8px; font-size: 9px; }
  .prompt-index { font-size: 8px; }
  .prompt-index b { font-size: 12px; }
  .reference-heading h2 { font-size: 11px; }
  .reference-heading > span { font-size: 8px; }
  .reference-empty { min-height: 45px; font-size: 10px; border-radius: 14px; }
  .prompt-card { padding: 13px 17px 16px; border-radius: 22px; }
  .prompt-content { font-size: 13px; line-height: 1.85; }
  .copy-button { height: 50px; font-size: 12px; }
}
@media (max-width: 350px) {
  .scene-panel { padding: 18px; }
  .scene-title { left: 18px; font-size: 23px; }
  .prompt-panel { padding: 20px 15px; }
  .prompt-meta { gap: 7px; }
  .prompt-tags { gap: 6px; font-size: 8px; }
  .prompt-card { padding: 11px 14px 15px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

.prompt-collection { padding: 1px 0 12px; }
.character-workspace .scene-panel { background: #20252d; }
.character-workspace .scene-shade { background: linear-gradient(180deg, rgba(10, 18, 24, .2), transparent 30%, transparent 60%, rgba(10, 18, 24, .9)); }
.scene-characters { position: absolute; inset: 82px 18px 94px; z-index: -1; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.scene-characters figure { position: relative; min-width: 0; margin: 0; overflow: hidden; border-radius: 20px; background: #161c23; }
.scene-characters img { width: 100%; height: 100%; object-fit: contain; display: block; }
.scene-characters figcaption { position: absolute; left: 12px; top: 12px; padding: 5px 8px; border-radius: 20px; background: rgba(14, 22, 25, .6); color: #fff; backdrop-filter: blur(10px); font-size: 10px; }
.reference-item { display: flex; min-width: 0; flex: 0 0 auto; align-items: flex-end; gap: 7px; margin-right: 8px; }
.reference-item .reference-image-button span { font-size: 9px; }
.reference-download { display: grid; place-items: center; flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .7); color: #5b6948; margin-bottom: 2px; }
.reference-download svg { width: 14px; height: 14px; }
.reference-download:hover { background: rgba(255, 255, 255, .45); }
.character-image { object-fit: contain; object-position: center; background: #aaa598; }
.package-workspace .scene-panel { background: #232d29; }
.package-art { position: absolute; inset: 110px 40px 125px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 24px; color: var(--amber); }
.package-art svg { width: 140px; height: 140px; stroke-width: 1; }
.package-art span { font-size: 14px; letter-spacing: 5px; }
.package-card { display: flex; flex: 1; flex-direction: column; justify-content: center; align-items: center; gap: 16px; min-height: 0; padding: 25px; border-radius: 25px; background: white; text-align: center; }
.package-card > svg { width: 44px; height: 44px; color: #839273; stroke-width: 1.3; }
.package-card h2 { margin: 4px 0 0; max-width: 100%; overflow-wrap: anywhere; font-size: 21px; font-weight: 500; }
.package-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.8; }
.package-card .package-instruction { margin-top: 10px; }
.package-download:hover { background: #ffcb6b; }
@media (max-width: 700px) {
  .character-workspace .scene-panel { height: 300px; }
  .character-workspace .scene-title { font-size: 23px; }
  .scene-characters { inset: 59px 14px 49px; gap: 8px; }
  .scene-characters figure { border-radius: 13px; }
  .scene-characters figcaption { left: 7px; top: 7px; padding: 4px 6px; font-size: 8px; }
  .single-character-workspace .scene-panel { height: 300px; }
  .package-art { inset: 48px 30px 30px; flex-direction: row; gap: 20px; opacity: .75; }
  .package-art svg { width: 72px; height: 72px; }
  .package-workspace .prompt-panel { height: 300px; }
  .package-card { gap: 9px; padding: 18px; }
  .package-card > svg { width: 30px; height: 30px; }
  .package-card h2 { font-size: 18px; }
  .package-card .package-instruction { margin-top: 0; }
}
