:root {
  --bg: #f6f7fb;
  --panel: #ffffff;
  --line: #e7ebf4;
  --line-dark: #cfd6e6;
  --text: #1f2430;
  --muted: #70788e;
  --soft: #f0f3fa;
  --blue: #5257f8;
  --blue-soft: #eef0ff;
  --green: #22a763;
  --green-soft: #e8f8ef;
  --red: #e44942;
  --red-soft: #fff0ef;
  --yellow: #e1a51d;
  --purple: #8065da;
  --dark: #202631;
  --shadow: 0 12px 28px rgba(28, 36, 56, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  outline: none;
}

input,
select {
  height: 38px;
  padding: 0 12px;
}

textarea {
  min-height: 120px;
  padding: 12px;
  resize: vertical;
  line-height: 1.65;
}

textarea[readonly] {
  background: #f8f9fd;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  background:
    linear-gradient(135deg, rgba(82, 87, 248, 0.08), rgba(34, 167, 99, 0.08)),
    var(--bg);
}

.login-panel {
  width: min(420px, 100%);
  display: grid;
  gap: 16px;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.login-brand {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--dark);
  font-weight: 900;
}

.login-panel h1 {
  max-width: none;
  white-space: normal;
  font-size: 24px;
}

.login-panel p {
  color: var(--muted);
  font-weight: 700;
}

.login-panel label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.login-panel input {
  height: 44px;
}

.login-panel button {
  height: 44px;
}

.login-error {
  min-height: 20px;
  color: var(--red);
  font-size: 13px;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  max-width: 560px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 20px;
  line-height: 1.2;
}

h2 {
  font-size: 16px;
}

h3 {
  font-size: 14px;
}

.topbar {
  height: 64px;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(520px, 1fr);
  align-items: center;
  gap: 18px;
  padding: 0 20px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(14px);
}

.title-wrap {
  grid-column: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.title-wrap p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.back-btn {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: transparent;
  color: var(--dark);
  font-size: 30px;
}

.stepper {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  gap: 10px;
}

.step {
  min-width: 146px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
}

.step.active {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
  box-shadow: 0 8px 18px rgba(82, 87, 248, 0.22);
}

.step.done {
  color: var(--blue);
  background: var(--blue-soft);
  border-color: #c9ccff;
}

.hidden {
  display: none !important;
}

.user-tools {
  grid-column: 2;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.top-generate-actions {
  display: none;
  align-items: center;
  gap: 8px;
}

.top-generate-actions.show {
  display: flex;
}

.deferred-feature {
  display: none !important;
}

.top-generate-actions label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.top-generate-actions select {
  width: 128px;
}

.operator {
  display: flex;
  align-items: center;
  gap: 8px;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #5461ff, #6bd099);
  color: #fff;
  font-weight: 900;
}

.operator input {
  width: 84px;
  border: 0;
  background: transparent;
  font-weight: 800;
}

.operator input[readonly] {
  color: var(--text);
  cursor: default;
}

.logout-button {
  min-width: 68px;
  padding: 0 12px;
}

.left-actions,
.right-actions,
.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.left-actions label,
.right-actions label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.left-actions select,
.right-actions select {
  width: 128px;
}

.primary,
.secondary,
.success,
.danger {
  min-height: 38px;
  padding: 0 16px;
  border-radius: 8px;
  font-weight: 900;
}

.primary {
  color: #fff;
  background: var(--blue);
}

.secondary {
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line-dark);
}

.success {
  color: #fff;
  background: var(--green);
}

.danger {
  color: #fff;
  background: var(--red);
}

.upload-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.upload-btn input {
  display: none;
}

.home-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  background: #f7f8fc;
}

.home-rail {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 28px 16px;
  border-right: 1px solid var(--line);
  background: #fff;
}

.home-brand {
  color: var(--text);
  font-size: 20px;
  font-weight: 900;
}

.team-select,
.home-nav,
.home-credit {
  height: 36px;
  display: flex;
  align-items: center;
  border-radius: 8px;
  padding: 0 12px;
  background: #f8f9fd;
  color: var(--text);
  font-weight: 800;
}

.team-select {
  border: 1px solid var(--line);
  justify-content: space-between;
}

.home-nav-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.home-nav-group > span {
  padding: 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.home-nav {
  width: 100%;
  border: 0;
  background: transparent;
}

.home-nav.active {
  color: var(--blue);
  background: var(--blue-soft);
}

.home-credit {
  margin-top: auto;
  justify-content: space-between;
  border: 1px solid var(--line);
  color: var(--blue);
}

.home-credit span {
  color: var(--muted);
}

.project-list-board {
  min-width: 0;
  padding: 42px 44px;
}

.project-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 28px;
}

.project-list-head h2 {
  font-size: 20px;
}

.project-tools {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 110px 112px;
  align-items: center;
  gap: 10px;
  min-width: min(760px, 70%);
}

.project-tools button {
  height: 38px;
}

.project-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 24px 18px;
}

.project-card {
  min-width: 0;
  cursor: pointer;
}

.project-cover {
  height: 150px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.9), transparent 28%),
    linear-gradient(135deg, #dff7ef, #86b8ff 54%, #51d8de);
  color: #fff;
  font-size: 34px;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.project-cover.scene {
  background:
    linear-gradient(rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.18)),
    linear-gradient(90deg, rgba(146, 132, 98, 0.58), rgba(234, 220, 179, 0.4) 45%, rgba(124, 147, 159, 0.54)),
    repeating-linear-gradient(90deg, #c9b886 0 18px, #725f3b 18px 22px);
}

.project-card:hover .project-cover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(28, 36, 56, 0.14);
}

.project-card-meta {
  position: relative;
  min-height: 76px;
  padding-top: 12px;
  padding-right: 96px;
}

.project-card-meta strong {
  font-size: 15px;
}

.project-card-meta em {
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.project-card-meta small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.project-card-actions {
  position: absolute;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 1;
}

.project-card-actions button {
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid var(--line-dark);
  border-radius: 7px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.project-card-actions button[data-project-action="delete"] {
  color: var(--red);
}

.project-card-actions button:hover {
  border-color: #c8ceff;
  color: var(--blue);
}

.project-card-actions button[data-project-action="delete"]:hover {
  border-color: #f1bbb8;
  color: var(--red);
  background: var(--red-soft);
}

.project-pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-top: 42px;
  color: var(--muted);
  font-size: 12px;
}

.asset-library-board {
  min-width: 0;
  padding: 36px 44px;
}

.asset-scope-tabs,
.asset-library-tabs,
.asset-subtabs {
  display: flex;
  align-items: center;
  gap: 28px;
}

.asset-scope-tabs {
  margin-bottom: 34px;
}

.asset-library-tabs {
  margin-bottom: 24px;
}

.asset-scope-tabs button,
.asset-library-tabs button,
.asset-subtabs button {
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.asset-scope-tabs button {
  font-size: 17px;
}

.asset-library-tabs button {
  font-size: 15px;
}

.asset-subtabs button {
  min-height: 36px;
  padding: 0 2px;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  font-size: 13px;
}

.asset-scope-tabs button.active,
.asset-library-tabs button.active,
.asset-subtabs button.active {
  color: var(--text);
}

.asset-subtabs button.active {
  border-color: var(--blue);
}

.asset-library-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 420px) auto auto;
  justify-content: end;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.asset-library-toolbar input {
  height: 40px;
}

.asset-library-toolbar button {
  height: 40px;
}

.asset-subtabs {
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.asset-folder-grid,
.asset-material-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 420px);
  align-items: start;
  gap: 34px 28px;
  min-height: 160px;
}

.asset-folder-card {
  min-height: 92px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.asset-folder-card:hover,
.asset-material-card:hover {
  border-color: #cbd1ff;
  box-shadow: 0 12px 28px rgba(28, 36, 56, 0.08);
}

.folder-icon {
  width: 48px;
  height: 38px;
  position: relative;
  border-radius: 7px;
  background: linear-gradient(135deg, #dfe5f2, #f5f7fb);
  box-shadow: inset 0 0 0 1px #cfd6e6;
}

.folder-icon::before {
  content: "";
  position: absolute;
  left: 6px;
  top: -7px;
  width: 22px;
  height: 12px;
  border-radius: 6px 6px 0 0;
  background: #dfe5f2;
  box-shadow: inset 0 0 0 1px #cfd6e6;
}

.asset-folder-card strong,
.asset-material-meta strong {
  display: block;
  font-size: 14px;
}

.asset-folder-card span,
.asset-material-meta span,
.asset-material-meta small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.asset-material-card {
  position: relative;
  width: 420px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.asset-material-preview {
  width: 420px;
  height: 236px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(246, 247, 251, 0.92)),
    linear-gradient(135deg, #eef1f7, #d6dce8);
  color: var(--muted);
  font-size: 28px;
  font-weight: 900;
}

.image-preview-trigger {
  padding: 0;
  appearance: none;
  cursor: zoom-in;
  font: inherit;
  text-align: inherit;
}

.asset-uploaded-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.asset-material-preview.characters {
  background:
    radial-gradient(circle at 30% 25%, #151a23 0 22px, transparent 23px),
    linear-gradient(180deg, transparent 0 48%, #151a23 49% 100%),
    linear-gradient(135deg, #fff, #e9edf5);
}

.asset-material-preview.scenes {
  background:
    linear-gradient(rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.2)),
    linear-gradient(90deg, rgba(146, 132, 98, 0.58), rgba(234, 220, 179, 0.4) 45%, rgba(124, 147, 159, 0.54)),
    repeating-linear-gradient(90deg, #c9b886 0 18px, #725f3b 18px 22px);
}

.asset-material-meta {
  min-width: 0;
  margin-top: 12px;
}

.asset-material-meta strong,
.asset-material-meta span,
.asset-material-meta small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-search-panel {
  margin-top: 34px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

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

.asset-search-head h3 {
  font-size: 16px;
}

.asset-empty {
  min-height: 132px;
  display: grid;
  place-items: center;
  grid-column: 1 / -1;
  border: 1px dashed var(--line-dark);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.5);
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.setup-shell {
  min-height: calc(100vh - 64px);
  padding: 26px 36px 96px;
}

.setup-tabs {
  display: flex;
  align-items: center;
  gap: 34px;
  margin-bottom: 38px;
}

.setup-tabs button {
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  font-weight: 900;
}

.setup-tabs button.active {
  color: var(--text);
}

.setup-board {
  display: flex;
  flex-direction: column;
  gap: 42px;
}

.setup-section {
  scroll-margin-top: 90px;
}

.setup-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.setup-section-head h2 {
  display: inline-block;
  margin-right: 14px;
  font-size: 16px;
}

.setup-stats {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  vertical-align: middle;
}

.setup-stats span {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.setup-stats strong {
  color: var(--text);
}

.setup-actions {
  display: flex;
  align-items: center;
  gap: 24px;
}

.text-action {
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.setup-card-grid {
  display: grid;
  gap: 18px;
}

.character-setup-grid {
  grid-template-columns: repeat(auto-fill, 420px);
}

.scene-setup-grid {
  grid-template-columns: repeat(auto-fill, 420px);
}

.prop-setup-grid {
  grid-template-columns: repeat(auto-fill, 420px);
}

.style-prompt-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 18px;
}

.setup-asset-card {
  min-width: 0;
}

.manageable-card {
  position: relative;
}

.setup-card-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 6px;
  opacity: 0;
  pointer-events: auto;
  transition: opacity 0.16s ease;
  z-index: 2;
}

.manageable-card:hover .setup-card-actions {
  opacity: 1;
}

.setup-card-actions button {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
  box-shadow: 0 6px 16px rgba(28, 36, 56, 0.12);
  font-size: 16px;
  font-weight: 900;
}

.setup-card-actions button[data-setup-action="delete"] {
  color: var(--red);
}

.setup-character-preview,
.setup-scene-preview,
.setup-prop-preview {
  width: 420px;
  height: 236px;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.setup-character-preview {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(246, 247, 251, 0.94)),
    radial-gradient(circle at 32% 20%, #e8dfd7, transparent 30%),
    linear-gradient(135deg, #f8f8fb, #e9edf5);
}

.setup-uploaded-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.setup-character-preview .setup-uploaded-image {
  align-self: stretch;
  justify-self: stretch;
  object-fit: cover;
  background: #fff;
}

.setup-image-placeholder {
  min-width: 98px;
  min-height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-weight: 900;
}

.setup-scene-preview {
  overflow: hidden;
  background:
    linear-gradient(rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.18)),
    linear-gradient(90deg, rgba(146, 132, 98, 0.58), rgba(234, 220, 179, 0.4) 45%, rgba(124, 147, 159, 0.54)),
    repeating-linear-gradient(90deg, #c9b886 0 18px, #725f3b 18px 22px);
}

.setup-prop-preview {
  overflow: hidden;
  background: linear-gradient(135deg, #eef0f7, #d8deea);
  color: var(--muted);
  font-size: 36px;
  font-weight: 900;
}

.setup-asset-meta {
  padding-top: 10px;
}

.setup-asset-meta strong {
  display: block;
  font-size: 14px;
}

.setup-asset-meta span {
  display: inline-block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.setup-asset-meta button {
  height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
}

.setup-asset-meta i {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--soft);
  font-style: normal;
  font-size: 9px;
}

.style-prompt-card {
  position: relative;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

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

.style-prompt-head strong {
  font-size: 15px;
}

.style-prompt-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.style-block-field {
  margin-bottom: 12px;
}

.style-block-field textarea {
  min-height: 150px;
}

.setup-empty {
  min-height: 190px;
  display: grid;
  place-items: center;
  gap: 8px;
  border: 1px dashed var(--line-dark);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.48);
  font-size: 13px;
  font-weight: 900;
}

.setup-empty strong {
  color: #c8cfdd;
  font-size: 32px;
}

.setup-next {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  height: 48px;
  padding: 0 28px;
  border-radius: 999px;
  background: #02050b;
  color: #fff;
  box-shadow: 0 12px 26px rgba(2, 5, 11, 0.28);
  font-weight: 900;
  z-index: 20;
}

.modal-layer {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(18, 23, 34, 0.38);
  z-index: 80;
}

.modal-card {
  width: min(560px, 100%);
  padding: 22px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(14, 20, 35, 0.24);
}

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

.modal-head h2 {
  font-size: 18px;
}

.modal-close {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--soft);
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
}

.mention-panel {
  position: fixed;
  z-index: 1200;
  max-height: min(420px, calc(100vh - 120px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #cfd7eb;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 22px 56px rgba(16, 24, 40, 0.22);
}

.mention-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 12px 8px;
  border-bottom: 1px solid var(--line);
}

.mention-head strong {
  color: var(--text);
  font-size: 14px;
}

.mention-head span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.mention-tabs {
  display: flex;
  gap: 6px;
  padding: 8px 10px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  background: #fbfcff;
}

.mention-tabs button {
  min-height: 28px;
  flex: 0 0 auto;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.mention-tabs button.active {
  border-color: #c8ceff;
  background: var(--blue-soft);
  color: var(--blue);
}

.mention-list {
  min-height: 82px;
  overflow-y: auto;
  padding: 8px;
}

.mention-item {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  text-align: left;
}

.mention-item:hover,
.mention-item.active {
  border-color: #c8ceff;
  background: #f4f7ff;
}

.mention-thumb {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8f9fd;
  color: var(--blue);
  font-weight: 900;
}

.mention-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mention-audio-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--blue-soft);
}

.mention-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mention-info strong,
.mention-info small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mention-info strong {
  color: var(--text);
  font-size: 13px;
}

.mention-info small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.mention-play {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--soft);
  color: var(--blue);
  font-weight: 900;
}

.mention-empty {
  padding: 20px 12px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
  font-weight: 800;
}

.modal-upload-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.modal-single-upload {
  margin-bottom: 16px;
}

.upload-tile {
  position: relative;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  border: 1px dashed var(--line-dark);
  border-radius: 9px;
  background: #f8f9fd;
  cursor: pointer;
  text-align: center;
}

.upload-preview {
  width: min(100%, 220px);
  height: 96px;
  display: block;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.upload-preview.hidden {
  display: none;
}

.upload-tile input {
  display: none;
}

.upload-tile strong {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #fff;
  color: var(--blue);
  font-size: 24px;
  box-shadow: 0 4px 12px rgba(28, 36, 56, 0.08);
}

.upload-tile span {
  color: var(--text);
  font-weight: 900;
}

.upload-tile em {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.modal-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.modal-field textarea {
  min-height: 110px;
}

.manual-shot-modal-card {
  max-width: 560px;
}

.manual-shot-modal-card .modal-field textarea {
  min-height: 94px;
}

.episode-range-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.episode-range-inputs {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
}

.episode-range-inputs.disabled {
  opacity: 0.48;
}

.episode-range-inputs input {
  width: 74px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 900;
  text-align: center;
}

.episode-range-inputs input:disabled {
  cursor: not-allowed;
}

.all-episodes-check {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.all-episodes-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--blue);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.modal-actions button {
  min-width: 104px;
}

.style-modal-card {
  width: min(680px, 100%);
}

.batch-modal-card {
  width: min(820px, calc(100vw - 32px));
  padding: 34px 38px;
  border-radius: 34px;
}

.asset-picker-card {
  width: min(560px, calc(100vw - 32px));
}

.asset-picker-list {
  display: grid;
  gap: 10px;
  max-height: min(440px, 62vh);
  overflow: auto;
}

.asset-picker-item {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 70px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  text-align: left;
}

.asset-picker-item.selected {
  opacity: 0.58;
}

.asset-picker-thumb {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background: var(--soft);
  color: var(--muted);
  font-weight: 900;
}

.asset-picker-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.asset-picker-item strong,
.asset-picker-item small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-picker-item small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.asset-picker-empty {
  padding: 22px;
  border: 1px dashed var(--line-dark);
  border-radius: 8px;
  color: var(--muted);
  font-weight: 900;
  text-align: center;
}

.asset-picker-extra {
  margin-top: 14px;
}

.import-preview-card {
  width: min(640px, calc(100vw - 32px));
}

.import-preview-body {
  display: grid;
  gap: 14px;
}

.import-preview-summary {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  border-top: 1px solid var(--line);
}

.import-preview-summary span,
.import-preview-summary strong {
  min-height: 36px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.import-preview-summary span {
  color: var(--muted);
  font-weight: 900;
}

.import-preview-summary strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.import-warning {
  display: grid;
  gap: 6px;
  padding: 12px;
  border-radius: 8px;
  background: #fff7de;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.import-warning strong {
  color: var(--yellow);
}

.import-preview-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.7;
}

.batch-modal-head {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 18px;
  margin-bottom: 38px;
}

.batch-icon {
  width: 70px;
  height: 70px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  color: #3e4454;
  font-size: 28px;
  font-weight: 900;
  box-shadow: 0 8px 20px rgba(28, 36, 56, 0.05);
}

.batch-modal-head h2 {
  font-size: 24px;
}

.batch-shot-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  min-height: 88px;
  margin-bottom: 34px;
}

.batch-shot-card {
  min-height: 86px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}

.batch-shot-card.disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.batch-shot-card input {
  width: 24px;
  height: 24px;
  margin: 0;
  border-radius: 6px;
}

.batch-shot-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 16px;
}

.batch-shot-card span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.4;
}

.batch-empty {
  min-height: 120px;
  display: grid;
  place-items: center;
  grid-column: 1 / -1;
  border: 1px dashed var(--line-dark);
  border-radius: 12px;
  color: var(--muted);
  font-weight: 900;
}

.batch-modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.batch-all,
.batch-cancel,
.batch-confirm {
  min-width: 112px;
  height: 54px;
  border-radius: 10px;
  font-size: 18px;
}

.batch-all:disabled,
.batch-confirm:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.batch-action-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.batch-confirm {
  min-width: 112px;
}

.shell {
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr);
  min-height: calc(100vh - 132px);
}

.episode-rail {
  padding: 16px 12px;
  background: #fbfcff;
  border-right: 1px solid var(--line);
}

.rail-title {
  margin-bottom: 14px;
  color: var(--text);
  font-weight: 900;
}

.episode-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.episode-card {
  height: 20px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

.episode-card.active {
  background: linear-gradient(90deg, #eef4ff, #fff);
  border-color: #c8ceff;
  box-shadow: inset 3px 0 0 var(--blue);
}

.episode-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  min-width: 0;
}

.episode-head strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--blue);
  font-size: 12px;
  line-height: 18px;
}

.episode-card small {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 10px;
  line-height: 18px;
  white-space: nowrap;
}

.episode-head > span {
  flex: 0 0 auto;
  color: var(--text);
  font-size: 12px;
  line-height: 18px;
}

.episode-details {
  display: none;
  margin-top: 10px;
}

.episode-card.expanded .episode-details {
  display: block;
}

.episode-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 2;
}

.dot {
  width: 9px;
  height: 9px;
  display: inline-block;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--blue);
}

.dot.yellow {
  background: var(--yellow);
}

.dot.purple {
  background: var(--purple);
}

.dot.red {
  background: var(--red);
}

.dot.green {
  background: var(--green);
}

.stats-button {
  width: 100%;
  height: 40px;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-weight: 900;
}

.upload-08a-button {
  height: auto;
  min-height: 46px;
  margin: 0 0 8px;
  padding: 0 12px;
  line-height: 1.25;
}

.manual-episode-button {
  height: 32px;
  margin: 0 0 14px;
  border-style: dashed;
  border-color: #aeb7d0;
  color: var(--blue);
  font-size: 12px;
}

.main-board {
  min-width: 0;
  padding: 14px 16px 18px;
}

.crumb-row {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.crumb {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  min-width: 0;
}

.crumb em {
  padding: 4px 8px;
  border-radius: 6px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.mode-switch-top {
  margin-left: 6px;
  flex: 0 0 auto;
}

.mode-switch-top button {
  min-width: 112px;
}

.episode-shot-strip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  max-width: 520px;
  overflow-x: auto;
  padding: 2px 4px 6px;
}

.episode-shot-strip.sorting {
  cursor: grabbing;
  scroll-behavior: auto;
}

.shot-add-button {
  width: 64px;
  height: 30px;
  flex: 0 0 auto;
  margin-top: 2px;
  border: 2px dashed #aeb7d0;
  border-radius: 4px;
  background: #fff;
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.shot-add-button:hover,
.manual-episode-button:hover {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.shot-mini-card {
  width: auto;
  min-width: 0;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  text-align: center;
  cursor: grab;
  touch-action: manipulation;
  transition: opacity 140ms ease, transform 180ms cubic-bezier(0.2, 0, 0, 1);
  user-select: none;
}

.shot-mini-card:active {
  cursor: grabbing;
}

.shot-sortable-chosen {
  transform: translateY(-2px);
}

.shot-sortable-chosen .shot-mini-video,
.shot-sortable-drag .shot-mini-video,
.shot-sortable-fallback .shot-mini-video {
  border-color: var(--blue);
  box-shadow: 0 10px 26px rgba(55, 66, 255, 0.2);
}

.shot-sortable-ghost {
  opacity: 0.28;
}

.shot-sortable-ghost .shot-mini-video {
  border-style: dashed;
  background: var(--blue-soft);
}

.shot-sortable-fallback {
  opacity: 0.96;
  transform: rotate(0.001deg);
}

.shot-mini-video {
  width: 51px;
  height: 30px;
  display: block;
  margin: 0 auto;
  border: 2px solid var(--line-dark);
  border-radius: 4px;
  background: #fff;
}

.shot-mini-card.generated .shot-mini-video {
  background: linear-gradient(135deg, #202631, #687080);
  border-color: #8d95ff;
}

.shot-mini-card.active .shot-mini-video {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}

.shot-mini-label {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #ee4b4b;
  font-size: 12px;
  font-weight: 900;
}

.shot-mini-origin {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.production-grid {
  display: grid;
  grid-template-columns: minmax(720px, 1fr) 405px;
  gap: 12px;
  min-height: calc(100vh - 204px);
}

.production-grid.first-tail-active {
  grid-template-columns: minmax(520px, 1fr) 405px;
}

.production-grid.first-tail-active .shot-card {
  display: none;
}

.maker-card {
  padding: 0;
  overflow: hidden;
}

.maker-mode-row {
  padding: 14px 18px 0;
}

.maker-card-grid {
  display: grid;
  grid-template-columns: minmax(320px, 380px) minmax(420px, 1fr);
  min-height: 100%;
}

.shot-card,
.prompt-card {
  min-width: 0;
  padding: 18px;
}

.shot-card {
  max-width: 380px;
}

.prompt-card {
  border-left: 1px solid var(--line);
}

.production-grid.first-tail-active .maker-card-grid {
  grid-template-columns: 1fr;
}

.production-grid.first-tail-active .prompt-card {
  border-left: 0;
}

.card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.card-head,
.mini-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.badge.blue {
  color: var(--blue);
  background: var(--blue-soft);
}

.badge.gray {
  color: var(--muted);
  background: var(--soft);
}

.badge.green {
  color: var(--green);
  background: var(--green-soft);
}

.badge.red {
  color: var(--red);
  background: var(--red-soft);
}

.badge.yellow {
  color: var(--yellow);
  background: #fff7de;
}

.info-table {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 0;
  margin-bottom: 18px;
  border-top: 1px solid var(--line);
}

.info-table span,
.info-table strong {
  min-height: 38px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.info-table span {
  color: var(--muted);
}

.info-table strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.block-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.block-field textarea,
.block-field input,
.prompt-rich-editor {
  font-weight: 500;
}

.block-field.compact textarea {
  min-height: 190px;
}

#scriptText {
  min-height: 190px;
}

.block-field.grow textarea {
  min-height: 360px;
}

.prompt-rich-editor {
  width: 100%;
  min-height: 360px;
  max-height: 520px;
  padding: 12px;
  overflow: auto;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  outline: none;
  resize: vertical;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.prompt-rich-editor:focus {
  border-color: #aeb6ff;
  box-shadow: 0 0 0 3px rgba(82, 87, 248, 0.1);
}

.prompt-mention {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: min(220px, 100%);
  height: 1.55em;
  padding: 0 6px 0 4px;
  margin: 0 2px;
  vertical-align: middle;
  position: relative;
  top: -1px;
  border-radius: 6px;
  background: #dfe9ff;
  color: #3157d9;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.prompt-mention-thumb {
  width: 1.15em;
  height: 1.15em;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  flex: 0 0 auto;
  border-radius: 4px;
  background: #fff;
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
}

.prompt-mention-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.prompt-mention-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
  font-weight: 900;
}

.block-field.note textarea {
  min-height: 90px;
}

.block-field.inline {
  margin-bottom: 12px;
}

.asset-block {
  margin-top: 16px;
}

.tiny-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--soft);
  color: var(--muted);
  font-weight: 900;
}

.asset-list,
.scene-assets {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.asset-row {
  display: grid;
  align-items: center;
  gap: 10px;
}

.character-row {
  grid-template-columns: 50px minmax(82px, 1fr) minmax(78px, 96px) 34px;
  gap: 7px;
  padding: 0;
  border: 0;
  background: transparent;
}

.character-thumb {
  height: 50px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: end;
  gap: 2px;
  padding: 4px 3px;
  overflow: hidden;
  border-radius: 4px;
  background: linear-gradient(180deg, #fff, #f3f5fb);
  box-shadow: inset 0 0 0 1px #edf0f7;
}

.character-thumb span {
  height: 42px;
  border-radius: 999px 999px 4px 4px;
  background:
    radial-gradient(circle at 50% 8px, #242a36 0 5px, transparent 6px),
    linear-gradient(180deg, #161b25 18%, #3f4858 18% 100%);
}

.character-thumb span:nth-child(2),
.character-thumb span:nth-child(4) {
  height: 45px;
  background:
    radial-gradient(circle at 50% 8px, #32251f 0 5px, transparent 6px),
    linear-gradient(180deg, #1b1210 18%, #161922 18% 100%);
}

.character-thumb-image {
  grid-column: 1 / -1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
}

.character-select,
.character-tone {
  height: 38px;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-weight: 800;
}

.character-select {
  display: flex;
  align-items: center;
  padding: 0 9px;
  text-align: left;
}

.character-select:disabled {
  opacity: 1;
  cursor: default;
}

.character-select span,
.character-tone span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.character-select strong {
  color: var(--muted);
  font-size: 14px;
}

.character-tone {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 8px;
}

.character-tone i {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--soft);
  color: var(--text);
  font-style: normal;
  font-size: 10px;
}

.character-more {
  width: 34px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding-bottom: 2px;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.character-menu {
  position: relative;
}

.character-menu summary {
  list-style: none;
}

.character-menu summary::-webkit-details-marker {
  display: none;
}

.character-menu div {
  position: absolute;
  top: 42px;
  right: 0;
  z-index: 5;
  min-width: 110px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 30px rgba(28, 36, 56, 0.16);
}

.character-menu div button {
  width: 100%;
  height: 32px;
  padding: 0 8px;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  text-align: left;
  font-size: 12px;
  font-weight: 900;
}

.character-menu div button:hover {
  background: var(--soft);
}

.asset-thumb,
.scene-thumb {
  width: 42px;
  height: 42px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #293140, #758197);
  font-size: 12px;
  font-weight: 900;
}

.asset-row:not(.character-row) strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.asset-row:not(.character-row) span {
  color: var(--muted);
  font-size: 11px;
}

.asset-row:not(.character-row) button {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--soft);
  color: var(--muted);
}

.scene-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}

.scene-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--red);
  font-weight: 900;
}

.scene-preview {
  height: 110px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #fff;
  background:
    linear-gradient(rgba(20, 26, 34, 0.2), rgba(20, 26, 34, 0.35)),
    linear-gradient(135deg, #bfbaa7, #596677);
  font-weight: 900;
}

.scene-shot-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scene-card .scene-label {
  padding: 10px;
  font-size: 13px;
  font-weight: 900;
}

.chips {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  gap: 8px;
}

.shot-prop-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}

.shot-prop-tile {
  position: relative;
  min-width: 0;
  margin: 0;
}

.shot-prop-tile > button {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 2;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.shot-prop-tile > div {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  color: var(--muted);
  font-size: 20px;
  font-weight: 900;
}

.shot-prop-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shot-prop-tile figcaption {
  margin-top: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}

.shot-audio-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

.chip {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 0 9px;
  border-radius: 7px;
  background: var(--soft);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.asset-chip button {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.segmented {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--soft);
}

.segmented button {
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.segmented .active {
  background: #fff;
  color: var(--blue);
  box-shadow: 0 2px 8px rgba(28, 36, 56, 0.08);
}

.mode-panel.hidden {
  display: none;
}

.ref-hint {
  margin-bottom: 12px;
  padding: 12px;
  border-radius: 8px;
  background: var(--soft);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.generate-options {
  display: grid;
  grid-template-columns: minmax(108px, 1fr) 58px 52px minmax(112px, 1fr) 82px;
  gap: 6px;
  margin-bottom: 14px;
}

.generate-options label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.generate-inline {
  grid-column: auto;
  align-self: end;
  height: 38px;
  padding: 0 10px;
  white-space: nowrap;
}

.video-spec-button {
  min-width: 0;
  height: 42px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  grid-column: auto;
  padding: 0 8px;
  border: 1px solid var(--line-dark);
  border-radius: 12px;
  background: #f8faff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.video-spec-button span,
.video-spec-button small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}

.video-spec-button strong {
  min-width: 0;
  overflow: hidden;
  color: #1d2433;
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-spec-button small {
  text-align: right;
  white-space: nowrap;
}

.first-tail-editor {
  min-height: 640px;
  display: flex;
  flex-direction: column;
  position: relative;
  border: 1px solid var(--line-dark);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}

.frame-upload-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 26px 28px 10px;
  color: #a3a9bb;
}

.frame-upload-row p {
  flex: 1;
  min-width: 0;
  color: #a3a9bb;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.45;
}

.frame-upload {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  gap: 2px;
  border: 1px dashed #d5d9ea;
  border-radius: 14px;
  background: #f8f9ff;
  color: #687087;
  font-weight: 900;
}

.frame-upload strong {
  font-size: 24px;
  line-height: 1;
}

.frame-upload span {
  font-size: 13px;
}

.frame-arrow {
  color: #b4b9c9;
  font-size: 22px;
  font-weight: 900;
}

#firstTailPrompt {
  min-height: 420px;
  flex: 1;
  border: 0;
  padding: 20px 32px 96px;
  color: var(--text);
  font-size: 18px;
  line-height: 1.7;
  resize: none;
}

#firstTailPrompt::placeholder {
  color: #a8adbd;
}

.first-tail-toolbar {
  position: absolute;
  left: 28px;
  right: 28px;
  bottom: 28px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px 58px minmax(138px, 0.8fr) 44px 104px 92px;
  gap: 10px;
  align-items: center;
}

.first-tail-toolbar select,
.mention-btn,
.first-tail-generate,
.credit-pill {
  height: 44px;
  border: 1px solid var(--line-dark);
  border-radius: 12px;
  background: #fff;
  color: #41485b;
  font-size: 14px;
  font-weight: 900;
}

.first-tail-toolbar .video-spec-button {
  grid-column: auto;
  height: 44px;
}

.first-tail-toolbar .video-spec-button span {
  display: none;
}

.first-tail-toolbar .video-spec-button strong,
.first-tail-toolbar .video-spec-button small {
  font-size: 12px;
}

.mention-btn {
  display: grid;
  place-items: center;
}

.first-tail-generate {
  padding: 0 12px;
  border: 0;
  color: #fff;
  background: var(--blue);
  white-space: nowrap;
}

.credit-pill {
  display: grid;
  place-items: center;
  border-color: #aeb4ff;
  background: #aeb4ff;
  color: #fff;
}

.video-box {
  position: relative;
  height: 360px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 9px;
  background:
    linear-gradient(rgba(25, 31, 42, 0.78), rgba(25, 31, 42, 0.78)),
    linear-gradient(135deg, #202631, #687080);
  color: #fff;
  text-align: center;
}

.video-box strong {
  display: block;
  margin-bottom: 12px;
  font-size: 20px;
}

.video-box span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}

.generated-video-player {
  width: 100%;
  height: 100%;
  display: block;
  background: #111722;
  object-fit: contain;
}

.video-load-status {
  position: absolute;
  left: 12px;
  bottom: 14px;
  max-width: min(58%, 320px);
  padding: 7px 10px;
  border-radius: 7px;
  background: rgba(17, 23, 34, 0.78);
  color: rgba(255, 255, 255, 0.86);
  font-size: 12px;
  font-weight: 800;
  text-align: left;
  backdrop-filter: blur(8px);
}

.video-result-actions {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(17, 23, 34, 0.78);
  backdrop-filter: blur(8px);
}

.video-result-actions strong {
  margin: 0;
  font-size: 13px;
}

.video-result-actions a {
  color: #cdd8ff;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.thumbnail-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin: 10px 0 16px;
}

.thumbnail-strip.hidden {
  display: none;
}

.thumb {
  position: relative;
  height: 48px;
  border: 2px solid transparent;
  border-radius: 7px;
  background: linear-gradient(135deg, #202631, #687080);
  color: #fff;
  overflow: hidden;
}

.thumb.active {
  border-color: var(--blue);
}

.thumb.generated {
  cursor: pointer;
}

.thumb small {
  position: absolute;
  left: 6px;
  bottom: 5px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 10px;
  font-weight: 900;
}

.thumb em {
  position: absolute;
  left: 6px;
  top: 5px;
  color: #b9c6ff;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.thumb-check {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.thumb-check:hover {
  background: rgba(255, 255, 255, 0.32);
}

.thumb.approved .thumb-check {
  border-color: var(--green);
  background: var(--green);
}

.download-selected {
  min-height: 34px;
  padding: 0 12px;
  white-space: nowrap;
}

.download-selected:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.generation-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.record-table {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 8px 12px;
  padding: 12px;
  border-radius: 8px;
  background: var(--soft);
  font-size: 12px;
}

.record-table span {
  color: var(--muted);
}

.history {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 168px;
  overflow: auto;
}

.history-item {
  padding: 10px;
  border-radius: 8px;
  background: var(--soft);
  font-size: 12px;
  line-height: 1.5;
}

.review-buttons {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.inline-review-panel {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.video-settings-card {
  width: min(620px, calc(100vw - 28px));
  padding: 24px;
}

.video-settings-section {
  margin-top: 18px;
}

.video-settings-section h3 {
  margin: 0 0 12px;
  color: #30384b;
  font-size: 18px;
  font-weight: 950;
}

.video-option-grid {
  display: grid;
  gap: 12px;
}

.resolution-options {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ratio-options {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.video-option-grid button {
  height: 64px;
  border: 2px solid #e2e6ef;
  border-radius: 14px;
  background: #f8f9fc;
  color: #485266;
  font-size: 24px;
  font-weight: 850;
  cursor: pointer;
  box-shadow: none;
}

.video-option-grid button.active {
  border-color: #cfd6e4;
  background: #fff;
  color: #141c2c;
  box-shadow: 0 5px 12px rgba(32, 43, 65, 0.16);
}

.video-output-row {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 24px;
  padding: 0 22px;
  border-radius: 14px;
  background: #eef5ff;
}

.video-output-row span {
  color: #354158;
  font-size: 20px;
  font-weight: 950;
}

.video-output-row strong {
  color: #185cff;
  font-size: 28px;
  font-weight: 950;
}

.video-settings-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 24px;
}

.video-settings-actions button {
  height: 56px;
  border-radius: 14px;
  font-size: 20px;
}

.image-preview-card {
  width: min(1120px, calc(100vw - 40px));
  padding: 18px;
  background: #111827;
  color: #fff;
}

.image-preview-card .modal-head {
  margin-bottom: 14px;
}

.image-preview-card h2 {
  color: #fff;
}

.image-preview-card .modal-close {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.image-preview-stage {
  max-height: calc(100vh - 150px);
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background: #0b1020;
}

.image-preview-stage img {
  max-width: 100%;
  max-height: calc(100vh - 170px);
  display: block;
  object-fit: contain;
}

#toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 50;
  max-width: 360px;
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--dark);
  color: #fff;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(18px);
  pointer-events: none;
  transition: 0.2s ease;
}

#toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1080px) {
  .topbar {
    grid-template-columns: 1fr;
    height: auto;
    padding: 14px 18px;
  }

  .stepper {
    justify-content: flex-start;
  }

  .shell {
    grid-template-columns: 1fr;
  }

  .episode-rail {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .episode-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .production-grid {
    grid-template-columns: 1fr;
  }

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

  .generate-inline {
    grid-column: auto;
  }

  .generate-options .video-spec-button {
    grid-column: 1 / -1;
  }

  .first-tail-toolbar {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0 28px 28px;
  }

  #firstTailPrompt {
    padding-bottom: 24px;
  }

  .video-settings-card {
    max-height: calc(100vh - 48px);
    overflow: auto;
  }

  .asset-material-grid,
  .character-setup-grid,
  .scene-setup-grid,
  .prop-setup-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .asset-material-card,
  .asset-material-preview,
  .setup-character-preview,
  .setup-scene-preview,
  .setup-prop-preview {
    width: min(100%, 420px);
  }

  .asset-material-preview {
    height: auto;
    aspect-ratio: 16 / 9;
  }

  .setup-character-preview,
  .setup-scene-preview,
  .setup-prop-preview {
    height: auto;
    aspect-ratio: 16 / 9;
  }
}
