:root {
  color-scheme: dark;
  font-family: "Microsoft YaHei", system-ui, sans-serif;
  background: #111;
  color: #fff;
}

/* Final override layer for all legacy page-specific declarations. */
body{background:radial-gradient(circle at 50% -10%,rgba(142,49,82,.34),transparent 46%),#160d12;color:#fff1f5}
.topbar{background:linear-gradient(180deg,rgba(31,13,23,.98),rgba(18,10,15,.96));border-bottom-color:rgba(218,116,146,.3)}
.panel,.card,.image-card,.ranking-movie-card,.ranking-preview-card,.modal-card,.auth-panel{background:linear-gradient(180deg,#321a28,#21131b);border-color:rgba(218,116,146,.3);box-shadow:0 16px 42px rgba(20,3,11,.34)}
input,select,textarea{background:#1b1017;border-color:rgba(218,116,146,.38);color:#fff1f5}
input:hover,select:hover,textarea:hover{border-color:#c85b7b}
input:focus,select:focus,textarea:focus{border-color:#e3a8b8;box-shadow:0 0 0 3px rgba(200,91,123,.2)}
button:not(.secondary),.download-link,.download-button{background:linear-gradient(180deg,#b84f70,#7b2949);color:#fff5f7;border-color:#d47b98}
button:not(.secondary):hover,.download-link:hover,.download-button:hover{background:linear-gradient(180deg,#d36a8a,#983857);border-color:#f0a7bb;box-shadow:0 9px 24px rgba(130,35,67,.42);transform:translateY(-1px)}
button.secondary,.tutorial-button.secondary,.close-button,.nine-home-button,.nine-again-button{background:#472235;color:#eec5d0;border-color:rgba(218,116,146,.38)}
button.secondary:hover,.tutorial-button.secondary:hover,.close-button:hover,.nine-home-button:hover,.nine-again-button:hover{background:#71304c;color:#fff4f7;border-color:#dc8ba4;box-shadow:0 8px 20px rgba(104,32,57,.34);transform:translateY(-1px)}
.academy-card{background:linear-gradient(180deg,#321a28,#21131b);border-color:rgba(218,116,146,.3)}
.academy-card:hover{background:linear-gradient(180deg,#4a2135,#2a1522);border-color:#c85b7b;box-shadow:0 16px 38px rgba(111,26,54,.34);transform:translateY(-2px)}
.step-label,.status,.auth-panel-badge,.hint,.brand-footer span{color:#e3a8b8}
.modal-backdrop{background:rgba(18,5,12,.84)}
.image-card,.ranking-movie-card{box-shadow:0 12px 30px rgba(18,4,11,.3)}
@media(max-width:600px){.app-shell{padding-left:12px;padding-right:12px}.panel{padding:14px}button,.download-link{min-height:46px}}

/* Final studio layer: placed after legacy page rules so every shared control is consistent. */
:root {
  --studio-bg: #160d12;
  --studio-surface: #25141d;
  --studio-surface-raised: #321a28;
  --studio-wine: #8e3152;
  --studio-wine-bright: #c85b7b;
  --studio-line: rgba(218, 116, 146, .30);
  --studio-text: #fff1f5;
  --studio-muted: #c2a2af;
}

body {
  background: radial-gradient(circle at 50% -10%, rgba(142, 49, 82, .34), transparent 46%), var(--studio-bg);
  color: var(--studio-text);
}

.app-shell { color: var(--studio-text); }
.panel, .image-card, .ranking-movie-card, .ranking-preview-card {
  background: linear-gradient(180deg, var(--studio-surface-raised), var(--studio-surface));
  border-color: var(--studio-line);
  box-shadow: 0 14px 38px rgba(12, 3, 8, .28), inset 0 1px 0 rgba(255, 220, 230, .035);
}
.topbar { background: rgba(25, 11, 18, .96); border-bottom-color: var(--studio-line); }
.academy-hero, .auth-brand { border-color: var(--studio-line); }
.academy-card { background: linear-gradient(180deg, #321a28, #21131b); border-color: var(--studio-line); }
.academy-card:hover { background: linear-gradient(180deg, #4a2135, #2a1522); border-color: var(--studio-wine-bright); transform: translateY(-2px); }
input, select, textarea { background: #1b1017; color: var(--studio-text); border-color: var(--studio-line); }
input:hover, select:hover, textarea:hover { border-color: rgba(218, 116, 146, .52); }
input:focus, select:focus, textarea:focus { border-color: var(--studio-wine-bright); box-shadow: 0 0 0 3px rgba(200, 91, 123, .18); }
button, .download-link, .download-button { background: linear-gradient(180deg, #b84f70, #7b2949); color: #fff5f7; border-color: #d47b98; }
button:hover, .download-link:hover, .download-button:hover { background: linear-gradient(180deg, #d36a8a, #983857); border-color: #f0a7bb; box-shadow: 0 8px 22px rgba(130, 35, 67, .36); transform: translateY(-1px); }
button.secondary, .tutorial-button.secondary, .close-button, .nine-home-button, .nine-again-button { background: #472235; color: #eec5d0; border-color: var(--studio-line); }
button.secondary:hover, .tutorial-button.secondary:hover, .close-button:hover, .nine-home-button:hover, .nine-again-button:hover { background: #71304c; color: #fff4f7; border-color: #dc8ba4; }
.step-label, .status, .auth-panel-badge, .hint, .ranking-preview-stars, .brand-footer span { color: #e8a9bc; }
.brand-footer { border-top-color: var(--studio-line); color: var(--studio-muted); }
.modal-backdrop { background: rgba(18, 5, 12, .82); }
.wechat-tip { background: rgba(142, 49, 82, .18); border-color: var(--studio-line); color: #f1becb; }
.ranking-preview-panel, .ranking-results-panel { background: linear-gradient(180deg, #321a28, #20131a); }
.ranking-preview-frame, .ranking-poster, .ranking-result, .video-result video { border-color: var(--studio-line); }
.green-screen-stage, .movie-voice-preview, .stills-preview, .ranking-preview-poster { background: #1e1118; border-color: var(--studio-line); }
.auth-user-panel { justify-content: flex-start; margin-bottom: 16px; }

@media (max-width: 600px) {
  .app-shell { padding-left: 12px; padding-right: 12px; }
  .topbar-row { align-items: center; }
  .topbar-actions { justify-content: flex-start; }
  .panel { padding: 14px; }
  button, .download-link { min-height: 46px; }
}

/* Doulami studio theme: shared interface chrome, excluding generated artwork. */
:root {
  --studio-wine: #7d2945;
  --studio-wine-deep: #481c2c;
  --studio-wine-soft: #a94d6b;
  --studio-rose: #e3a8b8;
  --studio-gold: #ffd66f;
}

body {
  background: radial-gradient(circle at 50% 0%, rgba(111, 34, 61, .28), transparent 42%), #120e11;
}

.app-shell {
  position: relative;
}

.topbar,
.auth-brand,
.brand-footer {
  border-color: rgba(194, 83, 116, .24);
}

.topbar {
  background: linear-gradient(180deg, rgba(31, 15, 24, .96), rgba(19, 13, 17, .94));
}

.panel,
.card,
.modal-card,
.auth-panel {
  background: linear-gradient(180deg, #2a1922, #1d141a);
  border-color: rgba(194, 83, 116, .28);
  box-shadow: 0 18px 50px rgba(21, 5, 13, .32), inset 0 1px 0 rgba(255, 208, 220, .03);
}

input,
select,
textarea {
  background: #181117;
  border-color: rgba(178, 76, 105, .46);
  color: #fff4f7;
  accent-color: var(--studio-wine-soft);
}

input:focus,
select:focus,
textarea:focus {
  border-color: #d6879f;
  box-shadow: 0 0 0 3px rgba(178, 76, 105, .18);
}

button,
.tutorial-button,
.download-button,
.nine-home-button,
.nine-again-button {
  border-radius: 8px;
}

button:not(.secondary),
.download-button {
  background: linear-gradient(180deg, #b64d6c, #792943);
  color: #fff4f7;
  border-color: #d17c96;
  box-shadow: 0 8px 22px rgba(102, 26, 52, .26);
}

button:not(.secondary):hover,
.download-button:hover {
  background: linear-gradient(180deg, #d26a88, #913451);
  border-color: #f0a8bb;
  box-shadow: 0 10px 26px rgba(128, 35, 65, .42);
  transform: translateY(-1px);
}

button.secondary,
.tutorial-button.secondary,
.nine-home-button,
.nine-again-button {
  background: rgba(91, 37, 57, .68);
  color: #e8b9c7;
  border-color: rgba(205, 112, 139, .42);
}

button.secondary:hover,
.tutorial-button.secondary:hover,
.nine-home-button:hover,
.nine-again-button:hover {
  background: #71304b;
  color: #fff2f6;
  border-color: #d68aa2;
  box-shadow: 0 8px 20px rgba(104, 32, 57, .32);
  transform: translateY(-1px);
}

.step-label,
.auth-panel-badge,
.status,
.hint,
.brand-footer span {
  color: var(--studio-rose);
}

.auth-brand-name,
.auth-panel h1,
.auth-panel h2,
.academy-hero h1 {
  color: #fff3f6;
}

.academy-card:hover {
  border-color: #c56b88;
  background: linear-gradient(180deg, #3a202c, #24171f);
  box-shadow: 0 16px 38px rgba(111, 26, 54, .3);
}

.academy-card strong {
  color: #ffeef3;
}

.modal-backdrop {
  background: rgba(20, 5, 13, .82);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #111;
}

.app-shell {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 18px 14px 48px;
}

.topbar {
  padding: 12px 2px 18px;
}

.topbar-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

h1, h2, p {
  margin: 0;
}

h1 {
  font-size: 25px;
}

.topbar p {
  margin-top: 8px;
  color: #bdbdbd;
  font-size: 14px;
}

.panel {
  background: #1c1c1c;
  border: 1px solid #303030;
  border-radius: 8px;
  padding: 18px;
}

.panel + .panel {
  margin-top: 16px;
}

.hidden {
  display: none;
}

.step-label {
  color: #ffcf66;
  font-size: 13px;
  margin-bottom: 5px;
}

h2 {
  font-size: 22px;
  margin-bottom: 18px;
}

label {
  display: block;
  margin: 14px 0;
  color: #ddd;
  font-size: 14px;
}

input, select, #rankingManualMeta {
  width: 100%;
  margin-top: 7px;
  min-height: 44px;
  border: 1px solid #444;
  border-radius: 6px;
  background: #101010;
  color: white;
  padding: 9px 11px;
  font-size: 16px;
}

#rankingManualMeta {
  display: block;
  min-height: 100px;
  max-width: 100%;
  resize: vertical;
  font-family: inherit;
  line-height: 1.6;
}

.field-title {
  margin-top: 16px;
  margin-bottom: 9px;
  color: #ddd;
  font-size: 14px;
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.swatch {
  width: 48px;
  height: 40px;
  border-radius: 6px;
  background: var(--color);
  border: 2px solid #555;
}

.swatch.active {
  border-color: #ffd66b;
  box-shadow: 0 0 0 2px rgba(255,214,107,.22);
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}

button {
  min-height: 46px;
  border: 0;
  border-radius: 6px;
  background: #ffd66b;
  color: #171717;
  font-weight: 700;
  font-size: 15px;
}

button.secondary {
  background: #333;
  color: #fff;
}

.tutorial-button {
  width: auto;
  min-height: 38px;
  padding: 0 12px;
  background: #333;
  border-radius: 8px;
  color: #fff;
  white-space: nowrap;
  font-size: 14px;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.topbar-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

button:disabled {
  opacity: .62;
}

.status {
  min-height: 24px;
  margin-top: 14px;
  color: #ffcf66;
}

.brand-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin: 18px auto 2px;
  padding: 10px 0 2px;
  color: rgba(255, 255, 255, .72);
  font-size: 13px;
  font-weight: 700;
}

.brand-footer img {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .16);
}

.auth-shell {
  max-width: 560px;
  padding-top: 34px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 4px 4px 22px;
}

.auth-brand-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  border: 1px solid rgba(255, 214, 107, .35);
  border-radius: 14px;
  background: rgba(255, 214, 107, .08);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .22);
}

.auth-brand-mark img {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  object-fit: cover;
}

.auth-brand-name {
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0;
}

.auth-brand-subtitle {
  margin-top: 4px;
  color: #aaa;
  font-size: 13px;
}

.auth-panel {
  display: grid;
  gap: 12px;
  padding: 24px 26px 22px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .18);
}

.auth-panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.auth-panel-heading h1 {
  margin-top: 4px;
  font-size: 27px;
}

.auth-panel-badge {
  padding: 6px 9px;
  border: 1px solid rgba(255, 214, 107, .28);
  border-radius: 7px;
  color: #ffd66b;
  font-size: 12px;
  white-space: nowrap;
}

.auth-panel-description {
  margin: -2px 0 4px;
  color: #a9a9a9;
  font-size: 13px;
  line-height: 1.6;
}

.auth-panel button {
  width: 100%;
  margin-top: 4px;
}

.auth-panel label {
  margin: 7px 0;
}

.auth-panel input {
  margin-top: 6px;
}

.auth-panel .status {
  margin-top: 2px;
}

.auth-user-panel {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
  color: rgba(255, 255, 255, .82);
  font-size: 14px;
}

.auth-user-name,
.auth-user-phone,
.auth-user-points {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .08);
}

.auth-user-points {
  color: #ffd86f;
  font-weight: 800;
}

.movie-voice-preview-panel {
  margin-top: 16px;
}

.movie-voice-bg-control {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.movie-voice-bg-control input[type=color] {
  width: 42px;
  height: 32px;
  padding: 2px;
  background: #111;
  border: 1px solid #333;
  border-radius: 6px;
}

.movie-voice-bg-control .swatches {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  padding: 1px 0;
  scrollbar-width: none;
}

.movie-voice-bg-control .swatches::-webkit-scrollbar {
  display: none;
}

.movie-voice-bg-control .swatch {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  min-height: 30px;
  border-width: 1px;
}

.movie-voice-config-action,
.movie-voice-generate-row {
  display: grid;
  margin-top: 4px;
}

.movie-voice-config-action button,
.movie-voice-generate-row button {
  width: 100%;
}

.movie-voice-cover-preview {
  display: grid;
  place-content: center;
  gap: 14px;
  width: min(100%, 300px);
  aspect-ratio: 720 / 952;
  margin: 8px auto 16px;
  overflow: hidden;
  color: #fff;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  box-shadow: inset 0 -120px 180px rgba(255, 255, 255, .06);
}

.movie-voice-cover-preview div {
  max-width: 86%;
  margin: 0 auto;
  font-size: clamp(22px, 7vw, 32px);
  font-weight: 900;
  line-height: 1.12;
  text-shadow: 0 3px 0 #000, 0 9px 20px rgba(0, 0, 0, .6);
}

.movie-voice-list {
  display: grid;
  gap: 12px;
}

.movie-voice-card {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  grid-template-areas:
    "poster content"
    "poster actions";
  gap: 12px;
  align-items: start;
  padding: 10px;
  border: 1px solid #333;
  border-radius: 8px;
  background: #151515;
}

.movie-voice-card img {
  grid-area: poster;
  width: 88px;
  aspect-ratio: 3 / 4;
  border-radius: 6px;
  object-fit: cover;
  background: #080808;
}

.movie-voice-card-content {
  grid-area: content;
  min-width: 0;
}

.movie-voice-card strong {
  display: block;
  color: #fff;
  font-size: 16px;
  line-height: 1.35;
}

.movie-voice-card span {
  display: block;
  margin-top: 5px;
  color: #ffd66b;
  font-size: 13px;
}

.movie-voice-card p {
  display: -webkit-box;
  margin-top: 7px;
  overflow: hidden;
  color: #cfcfcf;
  font-size: 13px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.movie-voice-card-actions {
  display: flex;
  grid-area: actions;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.movie-voice-redraw,
.movie-voice-manual {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 13px;
}

.movie-stills-info {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
}

.movie-stills-voice-text {
  min-height: 42px;
  margin: -2px 0 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.055);
  color: #d9d9d9;
  font-size: 13px;
  line-height: 1.55;
}

.movie-stills-config-action {
  display: grid;
  margin-top: 14px;
}

.movie-stills-config-action button {
  width: 100%;
}

.movie-stills-info strong {
  font-size: 22px;
}

.movie-stills-info span,
.movie-stills-info small {
  color: var(--muted);
  line-height: 1.55;
}

.movie-stills-layout {
  display: grid;
  grid-template-columns: minmax(220px, 0.86fr) minmax(0, 1.4fr);
  gap: 18px;
  align-items: start;
}

.movie-stills-cover,
.movie-stills-photo-card {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.24);
}

.movie-stills-cover img {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
}

.movie-stills-photo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.movie-stills-photo-card {
  display: grid;
  gap: 8px;
  padding-bottom: 10px;
}

.movie-stills-photo-card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.movie-stills-photo-card button {
  width: calc(100% - 20px);
  margin: 0 10px;
}

.movie-stills-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

.academy-shell {
  width: min(100%, 920px);
}

.academy-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 2px 22px;
}

.academy-hero img {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  object-fit: cover;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .28);
}

.academy-hero h1 {
  font-size: 30px;
}

.academy-hero p {
  margin-top: 8px;
  color: #cfc6cc;
  font-size: 15px;
}

.academy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.academy-card {
  display: grid;
  gap: 8px;
  min-height: 126px;
  padding: 18px;
  color: #fff;
  text-decoration: none;
  background: #1c1c1c;
  border: 1px solid #303030;
  border-radius: 8px;
  opacity: 0;
  transform: translate3d(0, 18px, 0) scale(.985);
  transform-origin: center bottom;
  animation: academy-card-enter .64s cubic-bezier(.18, .86, .32, 1) both;
  will-change: transform, opacity;
  transition:
    transform .28s cubic-bezier(.2, .8, .2, 1),
    border-color .28s ease,
    box-shadow .28s ease,
    background .28s ease;
}

.academy-card:nth-child(1) {
  animation-delay: 40ms;
}

.academy-card:nth-child(2) {
  animation-delay: 96ms;
}

.academy-card:nth-child(3) {
  animation-delay: 152ms;
}

.academy-card:nth-child(4) {
  animation-delay: 208ms;
}

.academy-card:nth-child(5) {
  animation-delay: 264ms;
}

.academy-card:nth-child(6) {
  animation-delay: 320ms;
}

.academy-card:nth-child(7) {
  animation-delay: 376ms;
}

.academy-card:nth-child(8) {
  animation-delay: 432ms;
}

.academy-card:nth-child(9) {
  animation-delay: 488ms;
}

.academy-card:hover {
  background: #202020;
  border-color: rgba(255, 214, 107, .72);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .28), 0 0 0 2px rgba(255, 214, 107, .12);
  transform: translate3d(0, -4px, 0);
}

.academy-card strong {
  font-size: 21px;
}

.academy-card span {
  color: #c9c1c7;
  font-size: 14px;
  line-height: 1.55;
}

@keyframes academy-card-enter {
  0% {
    opacity: 0;
    transform: translate3d(0, 18px, 0) scale(.985);
  }
  60% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .academy-card {
    opacity: 1;
    transform: none;
    animation: none;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
    will-change: auto;
  }

  .academy-card:hover {
    transform: none;
  }
}

.result-grid {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.video-panel {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #333;
}

.video-panel h2 {
  margin-bottom: 10px;
}

.video-panel button {
  width: 100%;
  margin-top: 8px;
}

.green-screen-shell {
  width: min(100%, 1120px);
}

.green-screen-editing .topbar {
  display: none;
}

.green-screen-editing .green-screen-shell {
  padding-top: 10px;
}

.green-screen-upload-step {
  max-width: 720px;
  margin: 0 auto;
}

.green-screen-upload-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.green-screen-upload-wide {
  grid-column: 1 / -1;
}

.green-screen-upload-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}

.green-screen-create-link {
  flex: 0 0 auto;
  min-height: 22px;
  padding: 3px 7px;
  border: 1px solid rgba(255, 214, 107, .42);
  border-radius: 6px;
  color: #ffd66b;
  background: rgba(255, 214, 107, .1);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
}

.green-screen-editor-step {
  display: grid;
  gap: 10px;
}

.green-screen-editor-step.hidden {
  display: none;
}

.green-screen-editor-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.green-screen-editor-head h2 {
  margin-bottom: 0;
}

.green-screen-back-button {
  width: auto;
  min-height: 26px;
  padding: 0 8px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
  color: #d9d9d9;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .14);
}

.green-screen-workbench {
  display: grid;
  grid-template-columns: minmax(320px, .95fr) minmax(320px, .76fr);
  gap: 12px;
  align-items: start;
}

.green-screen-side-panel {
  display: grid;
  gap: 8px;
}

.green-screen-trim {
  padding: 8px 12px 9px;
}

.green-screen-trim-overlay {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  background: rgba(18, 18, 18, .8);
  border: 0;
  border-radius: 8px;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .28);
}

.green-screen-trim-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
  color: #c9c1c7;
  font-size: 11px;
}

.green-screen-trim-summary span {
  min-width: 0;
  padding: 4px 7px;
  border: 1px solid #3a3a3a;
  border-radius: 6px;
  background: #101010;
  font-variant-numeric: tabular-nums;
}

.green-screen-trim-summary b {
  color: #ffd66b;
}

.green-screen-trim-track {
  --trim-start: 0%;
  --trim-end: 100%;
  position: relative;
  height: 56px;
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.green-screen-trim-track::before,
.green-screen-trim-track::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 28px;
  height: 4px;
  border: 0;
  border-radius: 999px;
  transform: translateY(-50%);
}

.green-screen-trim-track::before {
  background: rgba(255, 255, 255, .2);
}

.green-screen-trim-track::after {
  left: var(--trim-start);
  right: calc(100% - var(--trim-end));
  background: linear-gradient(90deg, #ffe58f, #ffbf2f);
  box-shadow: 0 0 12px rgba(255, 214, 107, .24);
}

.green-screen-trim-range {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 56px;
  min-height: 56px;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  outline: none;
  box-shadow: none !important;
  -webkit-tap-highlight-color: transparent;
  pointer-events: none;
  touch-action: none;
}

.green-screen-trim-range:focus,
.green-screen-trim-range:focus-visible {
  outline: none;
  border: 0 !important;
  box-shadow: none !important;
}

.green-screen-trim-range::-webkit-slider-runnable-track {
  height: 4px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.green-screen-trim-range::-moz-range-track {
  height: 4px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.green-screen-trim-range::-moz-range-progress {
  height: 4px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.green-screen-trim-range::-webkit-slider-thumb {
  width: 44px;
  height: 56px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  appearance: none;
  -webkit-appearance: none;
  cursor: grab;
  pointer-events: auto;
}

.green-screen-trim-range::-moz-range-thumb {
  width: 44px;
  height: 56px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  cursor: grab;
  pointer-events: auto;
}

.green-screen-trim-visual-handle {
  position: absolute;
  left: 0;
  top: 28px;
  width: 20px;
  height: 28px;
  z-index: 5;
  cursor: grab;
  pointer-events: auto;
  touch-action: none;
  background: linear-gradient(180deg, #fff4b8 0%, #ffd76a 48%, #f2b42a 100%);
  filter: drop-shadow(0 4px 9px rgba(0, 0, 0, .35));
}

.green-screen-trim-visual-start {
  left: var(--trim-start);
  clip-path: polygon(18% 0, 82% 0, 82% 58%, 50% 100%, 18% 58%);
  transform: translate(-50%, -100%);
}

.green-screen-trim-visual-end {
  left: var(--trim-end);
  clip-path: polygon(50% 0, 82% 42%, 82% 100%, 18% 100%, 18% 42%);
  transform: translate(-50%, 0);
}

.green-screen-trim-start:active ~ .green-screen-trim-visual-start,
.green-screen-trim-end:active ~ .green-screen-trim-visual-end,
.green-screen-trim-visual-handle:active {
  cursor: grabbing;
  filter: drop-shadow(0 5px 12px rgba(0, 0, 0, .42));
}

.green-screen-trim-start {
  z-index: 2;
}

.green-screen-trim-end {
  z-index: 3;
}

.green-screen-preview-panel {
  position: sticky;
  top: 14px;
  padding: 12px;
}

.green-screen-preview-stage {
  position: relative;
  width: min(100%, 360px);
  margin: 0 auto;
}

.green-screen-preview-wrap {
  padding: 8px;
  background: #0b0b0b;
  border: 1px solid #3b3b3b;
  border-radius: 8px;
}

.green-screen-preview {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 9 / 16;
  background: #000;
  border-radius: 4px;
}

.green-screen-source-video {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.green-screen-controls {
  display: grid;
  gap: 7px;
  padding: 10px;
}

.green-screen-controls label {
  margin: 0;
}

.green-screen-transform-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 8px;
}

.green-screen-control-row {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.green-screen-control-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 18px;
  color: #ddd;
  font-size: 12px;
}

.green-screen-control-head b {
  color: #ffd66b;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.green-screen-control-row input[type="range"] {
  min-height: 22px;
  padding: 0;
  accent-color: #ffd66b;
}

.green-screen-check {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 4px;
}

.green-screen-check input {
  width: 18px;
  min-height: 18px;
  margin: 0;
  accent-color: #ffd66b;
}

.green-screen-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}

.green-screen-upload-step .green-screen-actions {
  grid-template-columns: 1fr;
}

.green-screen-actions button {
  width: 100%;
}

.green-screen-tip {
  margin-top: 12px;
  color: #aaa;
  font-size: 13px;
  line-height: 1.55;
}

.video-result {
  display: grid;
  gap: 16px;
}

.video-result video {
  display: block;
  width: 100%;
  background: #000;
  border-radius: 8px;
}

.download-link {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: #ffd66b;
  color: #171717;
  font-weight: 700;
  text-decoration: none;
}

.download-link.secondary {
  background: #333;
  color: #fff;
}

.wechat-tip {
  padding: 12px;
  border: 1px solid #5c4930;
  border-radius: 8px;
  background: rgba(255, 214, 107, .1);
  color: #ffdf8c;
  line-height: 1.55;
}

.image-card {
  background: #101010;
  border: 1px solid #303030;
  border-radius: 8px;
  padding: 10px;
}

.image-card img {
  display: block;
  width: 100%;
  border-radius: 4px;
  user-select: auto;
  -webkit-user-select: auto;
  -webkit-touch-callout: default;
}

.image-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  color: #cfcfcf;
  font-size: 13px;
}

.redraw {
  width: auto;
  min-height: 36px;
  padding: 0 12px;
  font-size: 13px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .74);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(100%, 760px);
  background: #181818;
  border: 1px solid #3a3a3a;
  border-radius: 8px;
  padding: 14px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.modal-head h2 {
  margin: 0;
}

.close-button {
  width: auto;
  min-height: 36px;
  padding: 0 12px;
  background: #333;
  color: #fff;
}

.modal video {
  display: block;
  width: 100%;
  max-height: 72vh;
  background: #000;
  border-radius: 6px;
}

.pandian-batch-password-card {
  width: min(100%, 420px);
}

.pandian-batch-password-body {
  display: grid;
  gap: 10px;
}

.pandian-batch-password-label {
  display: grid;
  gap: 6px;
  margin: 0;
}

.pandian-batch-password-label input {
  min-height: 42px;
}

.pandian-batch-password-actions {
  grid-template-columns: 1fr 1fr;
  margin-top: 4px;
}

.pandian-batch-password-actions .secondary {
  background: #333;
  color: #fff;
}

.nine-shell {
  max-width: 980px;
}

.nine-counts {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.nine-counts label {
  gap: 8px;
}

.nine-again-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 6px;
  background: linear-gradient(135deg, #9a342e, #5f1f2a);
  color: #fff;
  box-shadow: 0 10px 22px rgba(0, 0, 0, .26);
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.nine-again-button::before {
  content: "+";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-right: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .18);
  font-size: 16px;
  line-height: 1;
}

.nine-home-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 6px;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .04), 0 10px 22px rgba(0, 0, 0, .22);
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.nine-home-button::before {
  content: "‹";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-right: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
  font-size: 22px;
  line-height: 1;
}

.hint {
  color: #cfcfcf;
  font-size: 13px;
}

.preview-tip {
  margin-top: -4px;
  margin-bottom: 12px;
}

.hint.error {
  color: #ffb4a8;
}

.nine-preview,
.nine-result {
  width: min(100%, 720px);
  aspect-ratio: 3 / 4;
  margin: 0 auto;
  background: #050505;
}

.nine-preview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 0;
}

.nine-cell {
  position: relative;
  min-height: 0;
  border: 0;
  border-radius: 0;
  padding: 0;
  overflow: hidden;
  background: #111;
  cursor: pointer;
}

.nine-cell img,
.nine-result img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nine-cell span {
  position: absolute;
  left: 6px;
  bottom: 6px;
  width: auto;
  min-height: 0;
  padding: 3px 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, .58);
  color: #fff;
  font-size: 12px;
  line-height: 1;
}

.nine-cell.beauty span {
  background: rgba(133, 46, 41, .78);
}

.small-modal {
  width: min(100%, 360px);
  display: grid;
  gap: 10px;
}

.small-modal h2 {
  margin: 0 0 4px;
}

.download-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 6px;
  background: #852E29;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
}

.mask-button {
  width: auto;
  min-height: 44px;
  padding: 0 18px;
}

.mask-editor,
.movie-copy-panel {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.mask-editor.hidden,
.movie-copy-panel.hidden {
  display: none;
}

.mask-editor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.mask-editor-head h2,
.movie-copy-panel h2 {
  margin: 0;
  font-size: 20px;
}

.mask-editor-head p {
  margin: 6px 0 0;
  color: #cfcfcf;
  font-size: 13px;
  line-height: 1.5;
}

.mask-canvas-wrap {
  width: min(100%, 720px);
  margin: 0 auto;
  background: #050505;
}

#maskCanvas {
  display: block;
  width: 100%;
  height: auto;
  touch-action: none;
  cursor: crosshair;
}

.mask-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
}

.mask-controls label {
  flex: 1 1 180px;
  min-width: 160px;
}

.mask-controls button {
  width: auto;
  min-height: 42px;
  padding: 0 16px;
}

.movie-copy-panel pre {
  margin: 0;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 6px;
  background: rgba(0, 0, 0, .24);
  color: #f5f1ef;
  font: 700 17px/1.8 "Microsoft YaHei", "PingFang SC", sans-serif;
  white-space: pre-wrap;
}

.movie-copy-panel button {
  justify-self: start;
  width: auto;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 6px;
  background: #852E29;
  color: #fff;
  font-weight: 800;
}

.ranking-shell {
  max-width: 980px;
}

.ranking-config-panel,
.ranking-preview-panel {
  margin-bottom: 18px;
}

.ranking-preview-list {
  display: grid;
  gap: 14px;
}

.ranking-preview-card {
  display: grid;
  gap: 8px;
}

.ranking-preview-frame {
  display: grid;
  grid-template-columns: 732fr 292fr;
  position: relative;
  overflow: hidden;
  width: 100%;
  min-height: 0;
  aspect-ratio: 1024 / 230;
  border-radius: 8px;
  background: #050505;
  box-shadow: inset 0 0 0 2px rgba(214, 176, 96, .66);
}

.manju-ranking-shell .ranking-preview-frame {
  grid-template-columns: 676fr 292fr;
  aspect-ratio: 968 / 230;
}

.ranking-preview-poster {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  touch-action: none;
  cursor: ns-resize;
}

.ranking-preview-poster.is-dragging {
  cursor: grabbing;
}

.ranking-preview-poster img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
}

.ranking-preview-left {
  position: absolute;
  inset: 0 auto 0 0;
  width: 250px;
  padding: 20px 24px;
  background: linear-gradient(90deg, rgba(0, 0, 0, .62), rgba(0, 0, 0, .28) 58%, rgba(0, 0, 0, 0));
}

.ranking-preview-keyword {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid rgba(255, 223, 140, .9);
  border-radius: 999px;
  background: rgba(0, 0, 0, .68);
  color: #ffe9ad;
  font-size: 15px;
  font-weight: 900;
}

.ranking-preview-left strong {
  display: block;
  margin-top: 22px;
  color: #ffd467;
  font-size: 72px;
  line-height: .9;
  -webkit-text-stroke: 3px #100b05;
  text-shadow: 0 8px 14px rgba(0, 0, 0, .42);
}

.ranking-preview-info {
  display: grid;
  align-content: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  padding: 18px 24px;
  border-left: 1px solid rgba(232, 198, 118, .5);
  background: rgba(6, 6, 5, .9);
}

.ranking-preview-info strong {
  overflow: hidden;
  color: #ffe3a1;
  font-size: 24px;
  line-height: 1.16;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking-preview-info p {
  color: #f3ecdc;
  font-size: 15px;
  line-height: 1.34;
}

.ranking-preview-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking-preview-info b,
.ranking-preview-stars {
  color: #ffd14f !important;
  font-size: 26px !important;
  font-weight: 900;
}

.ranking-preview-actions {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.ranking-crop-control {
  display: grid;
  grid-template-columns: auto minmax(90px, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin: 0;
  color: #f5ead2;
  font-size: 13px;
  font-weight: 800;
}

.ranking-crop-control input {
  width: 100%;
  min-height: 0;
  padding: 0;
  accent-color: #e8bf5d;
}

.ranking-preview-actions button {
  width: auto;
  min-height: 38px;
  padding: 0 14px;
}

.ranking-movie-card {
  display: grid;
  grid-template-columns: 48px 116px minmax(0, 1fr) 86px;
  gap: 12px;
  align-items: center;
  min-height: 152px;
  padding: 10px;
  border: 1px solid rgba(255, 214, 107, .2);
  border-radius: 8px;
  background: #111;
}

.ranking-rank {
  color: #ffd66b;
  font-size: 42px;
  font-weight: 900;
  text-align: center;
}

.ranking-movie-card img {
  width: 116px;
  height: 132px;
  object-fit: cover;
  border-radius: 6px;
  background: #050505;
}

.ranking-movie-info {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.ranking-movie-info strong {
  overflow: hidden;
  color: #fff1bd;
  font-size: 19px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking-movie-info span,
.ranking-movie-info p {
  overflow: hidden;
  color: #cfcfcf;
  font-size: 13px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking-replace {
  min-height: 38px;
  padding: 0 10px;
  font-size: 13px;
}

.ranking-result {
  width: min(100%, 720px);
  aspect-ratio: 3 / 4;
  margin: 0 auto;
  background: #050505;
}

.ranking-result img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.manju-ranking-result {
  aspect-ratio: auto;
}

.manju-ranking-result img {
  height: auto;
}

.dragon-shell {
  max-width: 1120px;
}

.dragon-layout {
  display: grid;
  grid-template-columns: minmax(0, 390px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.dragon-layout.panel {
  padding: 14px;
}

.dragon-controls {
  min-width: 0;
}

.dragon-line-group {
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid rgba(255, 255, 255, .08);
}

.dragon-line-group > label {
  margin: 8px 0 7px;
}

.dragon-style-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 68px 128px;
  gap: 8px;
  align-items: end;
}

.dragon-style-grid label {
  margin: 0;
  font-size: 12px;
}

.dragon-style-grid input,
.dragon-style-grid select {
  min-height: 36px;
  margin-top: 4px;
  padding: 6px 8px;
  font-size: 14px;
}

.dragon-color-row {
  display: grid !important;
  grid-template-columns: 36px 1fr;
  gap: 7px;
  align-items: center;
  margin-top: 4px;
}

.dragon-style-grid input[type="color"] {
  width: 36px !important;
  height: 36px !important;
  min-height: 36px !important;
  margin: 0 !important;
  padding: 3px !important;
}

.dragon-inline-palette {
  display: grid !important;
  grid-template-columns: repeat(3, 16px);
  gap: 4px;
  align-items: center;
}

.dragon-inline-palette button {
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  min-height: 16px !important;
  max-width: 16px !important;
  max-height: 16px !important;
  padding: 0 !important;
  border: 2px solid rgba(255, 255, 255, .24);
  border-radius: 50%;
  background: var(--color);
  line-height: 1;
}

.dragon-mark-bg-control {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.dragon-mark-bg-control input[type="color"] {
  width: 38px;
  height: 38px;
  min-height: 38px;
  margin: 0;
  padding: 4px;
}

.dragon-mark-bg-control .swatches {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 0;
  scrollbar-width: none;
}

.dragon-mark-bg-control .swatches::-webkit-scrollbar {
  display: none;
}

.dragon-mark-bg-control .swatch {
  flex: 0 0 auto;
  width: 28px !important;
  height: 28px !important;
  min-height: 28px !important;
  max-height: 28px !important;
  border-width: 2px;
  border-radius: 5px;
  padding: 0 !important;
}

#generateDragon {
  width: 100%;
  margin-top: 22px;
}

.dragon-preview-wrap {
  min-width: 0;
}

.dragon-preview-card {
  position: relative;
  width: min(100%, 540px);
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  overflow: hidden;
  background: #000;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .34);
}

.dragon-preview-card--simple {
  display: grid;
  gap: 14px;
  aspect-ratio: auto;
  padding: 18px;
  overflow: visible;
  background: linear-gradient(180deg, #0e0e0e 0%, #171717 100%);
}

.dragon-preview-card--simple .dragon-preview-copy {
  display: grid;
  gap: 4px;
}

.dragon-preview-base {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.dragon-preview-card--simple .dragon-preview-base {
  display: block;
  position: static;
  inset: auto;
  width: 100%;
  height: auto;
  object-fit: contain;
  z-index: auto;
  border-radius: 2px;
}

.dragon-preview-text {
  position: absolute;
  left: 24px;
  right: 24px;
  z-index: 2;
  color: #fff;
  font-weight: 800;
  line-height: 1.05;
  text-align: center;
  text-shadow: 3px 3px 0 #000, 0 0 4px #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dragon-preview-card--simple .dragon-preview-text {
  position: static;
  left: auto;
  right: auto;
  z-index: auto;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dragon-preview-text.title {
  top: 11.3%;
}

.dragon-preview-text.category {
  top: 25.2%;
}

.dragon-preview-text.intro {
  top: 80%;
}

.dragon-preview-card--simple .dragon-preview-text.title {
  top: auto;
}

.dragon-preview-card--simple .dragon-preview-text.category {
  top: auto;
}

.dragon-preview-card--simple .dragon-preview-text.intro {
  top: auto;
}

#dragonSimpleGenerate {
  width: 100%;
  margin-top: 22px;
}

.dragon-mark-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: 33.9%;
  height: 42%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #006B1C;
}

.dragon-mark-panel img {
  display: block;
  width: auto;
  height: 88%;
  user-select: none;
  pointer-events: none;
}

.dragon-result {
  display: grid;
  gap: 12px;
  width: min(100%, 540px);
  margin: 18px auto 0;
}

.dragon-result.hidden {
  display: none;
}

.dragon-result img {
  display: block;
  width: 100%;
  border-radius: 6px;
}

.dragon-result .download-button {
  width: 100%;
}

.dragon-result-shell {
  max-width: 760px;
}

.dragon-video-shell {
  max-width: 760px;
}

.dragon-video-source-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.dragon-video-source-image {
  display: block;
  width: min(100%, 420px);
  margin: 0 auto;
  background: #050505;
}

.dragon-video-result-shell {
  max-width: 760px;
}

.dragon-video-result-panel {
  margin-top: 18px;
}

.dragon-result-panel,
.dragon-video-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.dragon-result-image-wrap {
  width: min(100%, 560px);
  margin: 0 auto;
  background: #050505;
}

.dragon-result-image-wrap img {
  display: block;
  width: 100%;
  user-select: auto;
  -webkit-user-select: auto;
  -webkit-touch-callout: default;
}

.dragon-video-panel h2 {
  margin-bottom: 4px;
}

.radio-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 36px;
  margin: 4px 0;
}

.radio-row input {
  width: auto;
  min-height: 0;
  margin: 0;
}

.dragon-dynamic-options {
  display: grid;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
}

.dragon-dynamic-options.hidden {
  display: none;
}

.dragon-dynamic-options input[type="color"] {
  width: 48px;
  min-height: 36px;
  padding: 2px;
}

.dragon-video-panel button,
.dragon-video-panel .download-link,
.dragon-result-panel .download-button {
  width: 100%;
}

.dragon-result-panel .download-button {
  background: #ffd66b;
  color: #171717;
}

.dragon-video-panel video {
  display: block;
  width: 100%;
  background: #000;
  border-radius: 6px;
}

.pandian-shell {
  max-width: 840px;
}

.pandian-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.pandian-panel h2 {
  margin: 0;
}

.pandian-panel label {
  display: grid;
  gap: 6px;
  margin: 0;
}

.pandian-panel input,
.pandian-panel select {
  min-height: 40px;
  padding: 8px 10px;
}

.pandian-template-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.pandian-template-card {
  display: grid;
  gap: 8px;
  padding: 9px;
  color: #f7f2f6;
  text-align: left;
  background: #141015;
  border: 2px solid rgba(255, 255, 255, .14);
  border-radius: 8px;
}

.pandian-template-card.active {
  border-color: #ff5f93;
  box-shadow: 0 0 0 2px rgba(255, 95, 147, .18);
}

.pandian-template-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1458 / 852;
  object-fit: cover;
  border-radius: 6px;
  background: #050505;
}

.pandian-template-card span {
  font-size: 13px;
  font-weight: 700;
}

.pandian-template-case {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  color: rgba(255, 255, 255, .72);
  background: rgba(20, 16, 21, .7);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
}

.pandian-template-case.hidden {
  display: none;
}

.pandian-template-case span {
  min-width: 0;
  font-size: 12px;
  line-height: 1.35;
}

.pandian-template-case button {
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 7px;
}

.pandian-ending-options {
  display: grid;
  gap: 10px;
}

.pandian-ending-options.hidden {
  display: none;
}

.pandian-ending-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.pandian-ending-card {
  display: grid;
  gap: 4px;
  min-height: 70px;
  padding: 9px;
  color: #f8edf3;
  text-align: left;
  background: rgba(20, 16, 21, .92);
  border: 2px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
}

.pandian-ending-card.active {
  border-color: #ffd46b;
  box-shadow: 0 0 0 2px rgba(255, 212, 107, .18);
}

.pandian-ending-card strong {
  font-size: 13px;
  line-height: 1.2;
}

.pandian-ending-card span {
  color: rgba(255, 255, 255, .66);
  font-size: 11px;
  line-height: 1.35;
}

.pandian-panel .field-title {
  margin-top: 2px;
}

.pandian-panel .actions {
  grid-template-columns: 1fr;
  margin-top: 0;
}

.pandian-panel #generatePandianVideo {
  width: 100%;
}

.pandian-panel .status {
  margin-top: -2px;
}

.pandian-batch-panel {
  gap: 12px;
}

.pandian-batch-url-label {
  display: grid;
  gap: 6px;
  margin: 0;
}

.pandian-batch-url-list {
  width: 100%;
  min-height: 148px;
  padding: 12px;
  color: #f8f8f8;
  background: #101010;
  border: 1px solid #3b3b3b;
  border-radius: 8px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  line-height: 1.45;
}

.pandian-batch-copy-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.pandian-batch-copy-row .status {
  margin-top: 0;
}

.pandian-batch-results-panel {
  gap: 12px;
}

.pandian-batch-grid {
  display: grid;
  gap: 12px;
}

.pandian-batch-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: #161116;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
}

.pandian-batch-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pandian-batch-card-head strong {
  font-size: 15px;
}

.pandian-batch-status {
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .1);
  color: #f3e7b4;
}

.pandian-batch-status.done {
  background: rgba(56, 166, 92, .18);
  color: #9ff0b1;
}

.pandian-batch-status.failed {
  background: rgba(194, 63, 63, .2);
  color: #ffabab;
}

.pandian-batch-status.running,
.pandian-batch-status.queued {
  background: rgba(255, 214, 107, .12);
}

.pandian-batch-card-url {
  margin: 0;
  padding: 10px 12px;
  color: #dedede;
  background: #0f0f0f;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 8px;
  word-break: break-all;
  line-height: 1.45;
}

.pandian-batch-video {
  width: 100%;
  min-height: 240px;
  background: #000;
  border-radius: 8px;
}

.pandian-batch-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pandian-batch-card-actions .download-link {
  min-height: 42px;
}

.pandian-batch-card-actions .hidden {
  display: none;
}

.pandian-batch-summary-panel {
  gap: 12px;
}

.entertainment-shell {
  max-width: 840px;
}

.entertainment-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.entertainment-panel h2 {
  margin: 0;
}

.entertainment-panel label {
  display: grid;
  gap: 6px;
  margin: 0;
}

.entertainment-panel input,
.entertainment-panel select {
  min-height: 40px;
  padding: 8px 10px;
}

.entertainment-actions {
  grid-template-columns: 1fr;
  margin-top: 4px;
}

.entertainment-actions button {
  width: 100%;
}

.entertainment-summary-panel,
.entertainment-results-panel {
  gap: 12px;
}

.entertainment-url-section {
  display: grid;
  gap: 8px;
}

.entertainment-url-section.hidden {
  display: none;
}

.entertainment-url-label {
  display: grid;
  gap: 6px;
  margin: 0;
}

.entertainment-url-list {
  width: 100%;
  min-height: 148px;
  padding: 12px;
  color: #f8f8f8;
  background: #101010;
  border: 1px solid #3b3b3b;
  border-radius: 8px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  line-height: 1.45;
}

.entertainment-copy-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.entertainment-copy-row .status {
  margin-top: 0;
}

.entertainment-grid {
  display: grid;
  gap: 12px;
}

.entertainment-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: #161116;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
}

.entertainment-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.entertainment-card-head strong {
  font-size: 15px;
}

.entertainment-badge {
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .1);
  color: #f3e7b4;
}

.entertainment-badge.done {
  background: rgba(56, 166, 92, .18);
  color: #9ff0b1;
}

.entertainment-badge.failed {
  background: rgba(194, 63, 63, .2);
  color: #ffabab;
}

.entertainment-badge.running,
.entertainment-badge.queued {
  background: rgba(255, 214, 107, .12);
}

.entertainment-poster {
  width: 100%;
  aspect-ratio: 810 / 1080;
  object-fit: cover;
  background: #000;
  border-radius: 8px;
}

.entertainment-poster-placeholder {
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, .72);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
  border: 1px dashed rgba(255, 255, 255, .18);
}

.entertainment-video {
  width: 100%;
  min-height: 240px;
  background: #000;
  border-radius: 8px;
}

.entertainment-card-body {
  display: grid;
  gap: 8px;
}

.entertainment-card-body p {
  margin: 0;
  color: rgba(255, 255, 255, .84);
  line-height: 1.55;
}

.entertainment-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.entertainment-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  background: rgba(255, 255, 255, .08);
  border-radius: 999px;
  color: #f6eed0;
  font-size: 12px;
}

.entertainment-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.entertainment-card-actions .download-link {
  min-height: 42px;
}

.drama-share-shell {
  max-width: 920px;
}

.drama-share-panel,
.drama-share-result {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.drama-share-panel label {
  display: grid;
  gap: 6px;
}

.drama-share-panel textarea {
  min-height: 112px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: #0f0f0f;
  color: #f3f3f3;
  resize: vertical;
  line-height: 1.55;
}

.drama-share-actions {
  grid-template-columns: 1fr;
}

.drama-share-actions button {
  width: 100%;
}

.drama-share-result.hidden {
  display: none;
}

.drama-share-hero {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.drama-share-cover {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 8px;
  background: #000;
}

.drama-share-cover.hidden {
  display: none;
}

.drama-share-meta {
  display: grid;
  gap: 10px;
}

.drama-share-meta h2 {
  margin: 0;
  font-size: 24px;
}

.drama-share-sentence,
.drama-share-summary {
  margin: 0;
  color: rgba(255, 255, 255, .84);
  line-height: 1.6;
}

.drama-share-summary-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.drama-share-summary-row .drama-share-summary {
  flex: 1;
  min-width: 0;
}

.drama-share-copy-btn {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 214, 107, .18);
  color: #ffd86f;
  font-size: 12px;
  font-weight: 700;
}

.drama-share-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.drama-share-tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  color: #f6eed0;
  font-size: 12px;
}

.drama-share-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: rgba(255, 255, 255, .68);
  font-size: 13px;
}

.drama-share-clips {
  display: grid;
  gap: 12px;
}

.drama-share-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.drama-share-grid {
  display: grid;
  gap: 12px;
}

.drama-share-clip {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: #161116;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
}

.drama-share-clip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.drama-share-clip-body {
  display: grid;
  gap: 8px;
}

.drama-share-clip-body p {
  margin: 0;
  line-height: 1.55;
}

.drama-share-clip-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: rgba(255, 255, 255, .72);
  font-size: 12px;
}

.drama-share-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .1);
  color: #f3e7b4;
  font-size: 12px;
}

.drama-share-badge.highlight {
  background: rgba(255, 214, 107, .16);
  color: #ffd86f;
}

.drama-share-clip-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.drama-share-clip-actions .download-link {
  min-height: 42px;
  width: 100%;
  justify-content: center;
}

@media (max-width: 720px) {
  .auth-shell {
    padding-top: 22px;
  }

  .auth-brand {
    padding-bottom: 18px;
  }

  .auth-brand-name {
    font-size: 19px;
  }

  .auth-panel {
    padding: 20px 16px 18px;
  }

  .auth-panel-heading h1 {
    font-size: 24px;
  }

  .academy-hero {
    align-items: flex-start;
    gap: 12px;
  }

  .academy-hero img {
    width: 52px;
    height: 52px;
    border-radius: 13px;
  }

  .academy-hero h1 {
    font-size: 24px;
  }

  .academy-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .nine-counts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mask-editor-head,
  .mask-controls {
    display: grid;
    grid-template-columns: 1fr;
  }

  .mask-controls button,
  .mask-button {
    width: 100%;
  }

  .dragon-layout {
    grid-template-columns: 1fr;
  }

  .dragon-style-grid {
    grid-template-columns: minmax(0, 1fr) 62px 116px;
    gap: 7px;
  }

  .dragon-layout.panel {
    padding: 12px;
  }

  .pandian-template-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pandian-template-case {
    grid-template-columns: 1fr;
  }

  .pandian-ending-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pandian-batch-card-head,
  .pandian-batch-card-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .pandian-batch-copy-row {
    flex-direction: column;
    align-items: stretch;
  }

  .pandian-batch-copy-row button {
    width: 100%;
  }

  .entertainment-copy-row {
    flex-direction: column;
    align-items: stretch;
  }

  .entertainment-copy-row button {
    width: 100%;
  }

  .drama-share-hero {
    grid-template-columns: 1fr;
  }

  .drama-share-section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .entertainment-card-head,
  .entertainment-card-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .entertainment-video {
    min-height: 200px;
  }

  .pandian-batch-video {
    min-height: 200px;
  }

  .pandian-batch-password-actions {
    grid-template-columns: 1fr;
  }

  .movie-stills-layout,
  .movie-stills-actions {
    grid-template-columns: 1fr;
  }

  .green-screen-upload-grid,
  .green-screen-workbench {
    grid-template-columns: 1fr;
  }

  .green-screen-editor-head {
    align-items: stretch;
  }

  .green-screen-back-button {
    width: auto;
    justify-self: start;
  }

  .green-screen-trim-summary {
    display: flex;
  }

  .green-screen-preview-panel {
    position: static;
  }

  .green-screen-preview-wrap {
    width: 100%;
  }

  .green-screen-preview-stage {
    width: min(100%, 330px);
  }

  .ranking-movie-card {
    grid-template-columns: 36px 88px minmax(0, 1fr);
    gap: 8px;
  }

  .ranking-preview-frame {
    width: 100%;
    min-height: 0;
  }

  .ranking-preview-left {
    width: 92px;
    padding: 5px 6px;
  }

  .ranking-preview-keyword {
    min-height: 15px;
    padding: 0 5px;
    border-width: 1px;
    font-size: 7px;
  }

  .ranking-preview-left strong {
    margin-top: 8px;
    font-size: 27px;
    -webkit-text-stroke-width: 1px;
    text-shadow: 0 3px 6px rgba(0, 0, 0, .42);
  }

  .ranking-preview-info {
    gap: 1px;
    padding: 4px 5px;
  }

  .ranking-preview-info strong {
    font-size: 8px;
    line-height: 1.08;
  }

  .ranking-preview-info p {
    font-size: 6px;
    line-height: 1.08;
  }

  .ranking-preview-info b,
  .ranking-preview-stars {
    font-size: 9px !important;
    line-height: 1 !important;
  }

  .ranking-preview-info p:nth-of-type(3) {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
  }

  .ranking-preview-actions {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .ranking-crop-control {
    grid-column: 1 / -1;
  }

  .ranking-preview-actions button {
    width: 100%;
  }

  .ranking-rank {
    font-size: 32px;
  }

  .ranking-movie-card img {
    width: 88px;
    height: 112px;
  }

  .ranking-movie-info strong {
    font-size: 16px;
  }

  .ranking-movie-card .ranking-replace {
    grid-column: 1 / -1;
    width: 100%;
  }
}

/* Semantic color controls must retain their configured color in every state. */
body button.swatch,body button.swatch:hover,body button.swatch:focus-visible,
body .dragon-inline-palette button,body .dragon-inline-palette button:hover{
  background:var(--color);box-shadow:none;transform:none;border:2px solid #786572;
}
body button.swatch:hover{border-color:#e3b8c7}
body button.swatch.active{border-color:#ffd66f;box-shadow:0 0 0 2px #ffd66f55}
body button.swatch:focus-visible{outline:2px solid #fff1f5;outline-offset:3px}
body .app-shell>.topbar{background:transparent;box-shadow:none}

/* Final visual layer */
body{background:radial-gradient(circle at 50% -10%,rgba(142,49,82,.34),transparent 46%),#160d12;color:#fff1f5}
.topbar{background:linear-gradient(180deg,rgba(31,13,23,.98),rgba(18,10,15,.96));border-bottom-color:rgba(218,116,146,.3)}
.panel,.card,.image-card,.ranking-movie-card,.ranking-preview-card,.modal-card,.auth-panel{background:linear-gradient(180deg,#321a28,#21131b);border-color:rgba(218,116,146,.3);box-shadow:0 16px 42px rgba(20,3,11,.34)}
input,select,textarea{background:#1b1017;border-color:rgba(218,116,146,.38);color:#fff1f5}input:hover,select:hover,textarea:hover{border-color:#c85b7b}input:focus,select:focus,textarea:focus{border-color:#e3a8b8;box-shadow:0 0 0 3px rgba(200,91,123,.2)}
button:not(.secondary),.download-link,.download-button{background:linear-gradient(180deg,#b84f70,#7b2949);color:#fff5f7;border-color:#d47b98}button:not(.secondary):hover,.download-link:hover,.download-button:hover{background:linear-gradient(180deg,#d36a8a,#983857);border-color:#f0a7bb;box-shadow:0 9px 24px rgba(130,35,67,.42);transform:translateY(-1px)}
button.secondary,.tutorial-button.secondary,.close-button,.nine-home-button,.nine-again-button{background:#472235;color:#eec5d0;border-color:rgba(218,116,146,.38)}button.secondary:hover,.tutorial-button.secondary:hover,.close-button:hover,.nine-home-button:hover,.nine-again-button:hover{background:#71304c;color:#fff4f7;border-color:#dc8ba4;box-shadow:0 8px 20px rgba(104,32,57,.34);transform:translateY(-1px)}
.academy-card{background:linear-gradient(180deg,#321a28,#21131b);border-color:rgba(218,116,146,.3)}.academy-card:hover{background:linear-gradient(180deg,#4a2135,#2a1522);border-color:#c85b7b;box-shadow:0 16px 38px rgba(111,26,54,.34);transform:translateY(-2px)}.step-label,.status,.auth-panel-badge,.hint,.brand-footer span{color:#e3a8b8}.modal-backdrop{background:rgba(18,5,12,.84)}
