body[data-octap-home-route="film"] .app-shell {
    visibility: hidden;
    pointer-events: none;
}

body[data-octap-home-route="film"] .octap-home-view[data-view="film"] {
    display: flex;
}

body[data-octap-home-route="film"] .octap-home-nav {
    display: none;
}

body[data-octap-home-route="film"] .octap-workspace-nav {
    display: flex;
}

.octap-film-view {
    height: calc(100vh - 60px);
    flex-direction: column;
    min-height: 0;
    padding: 0;
}

.octap-film-view,
.octap-film-board,
.octap-film-view #octapFilmBoard {
    min-width: 0;
}

.octap-film-view #octapFilmBoard {
    flex: 1 1 auto;
    min-height: 0;
}

.octap-film-board {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    color: var(--home-text);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.018), transparent 120px),
        var(--home-bg);
    border-top: 1px solid var(--home-line);
}

.octap-film-board [hidden] {
    display: none !important;
}

.octap-film-board button,
.octap-film-board input,
.octap-film-board select {
    font: inherit;
}

.film-subbar,
.film-bottom-bar,
.film-section-toolbar,
.film-panel-header {
    display: flex;
    align-items: center;
}

.film-subbar {
    height: 44px;
    flex: 0 0 auto;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid var(--home-line);
    background: rgba(255, 255, 255, 0.018);
}

.film-sub-left,
.film-sub-right,
.film-stepper,
.film-toolbar-left,
.film-toolbar-right,
.film-header-actions,
.film-tag-row,
.film-gen-row,
.film-bottom-actions,
.film-art-tabs,
.film-view-toggle {
    display: flex;
    align-items: center;
}

.film-sub-left {
    gap: 8px;
}

.film-sub-right {
    gap: 16px;
}

.film-sub-button,
.film-step-button,
.film-next-step,
.film-bottom-prev,
.film-bottom-actions button,
.film-ghost-button,
.film-soft-select,
.film-tab,
.film-art-tabs button,
.film-view-toggle button,
.film-entry-actions button,
.film-chapter-actions button,
.film-art-card footer button,
.film-clip-card footer button,
.film-select-option,
.film-text-editor-actions button {
    border: 1px solid transparent;
    background: transparent;
    color: var(--home-muted);
    cursor: pointer;
    transition: color .15s ease, border-color .15s ease, background .15s ease, opacity .15s ease;
}

.film-sub-button {
    height: 28px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 8px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 650;
}

.film-sub-button:hover,
.film-bottom-actions button:hover,
.film-bottom-prev:hover {
    color: var(--home-text);
    background: var(--home-surface-soft);
    border-color: var(--home-line);
}

.film-stepper {
    gap: 7px;
}

.film-step-button {
    height: 28px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 6px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
}

.film-step-button span {
    width: 17px;
    height: 17px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    color: var(--home-muted);
    font-size: 10px;
    line-height: 1;
}

.film-step-button.is-active {
    color: var(--home-accent);
}

.film-step-button.is-active span {
    background: var(--home-accent-soft);
    color: var(--home-accent);
    box-shadow: inset 0 0 0 1px var(--home-accent-line);
}

.film-step-arrow {
    color: var(--home-faint);
    font-style: normal;
    font-size: 15px;
}

.film-next-step {
    height: 31px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 13px;
    border-radius: 10px;
    border-color: var(--home-accent-line);
    background: var(--home-accent-soft);
    color: var(--home-accent);
    font-size: 12px;
    font-weight: 780;
}

.film-next-step:hover,
.film-ghost-button:hover,
.film-soft-select:hover,
.film-tab:hover,
.film-art-tabs button:hover,
.film-view-toggle button:hover {
    color: var(--home-accent);
    border-color: var(--home-accent-line);
    background: var(--home-accent-soft);
}

.film-next-step .is-forward {
    transform: rotate(180deg);
}

.film-main {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.film-step-page {
    height: 100%;
    min-height: 0;
    display: none;
}

.film-art-page,
.film-storyboard-page,
.film-final-page {
    flex-direction: column;
}

.octap-film-board[data-film-step="script"] .film-step-page[data-film-page="script"],
.octap-film-board[data-film-step="art"] .film-step-page[data-film-page="art"],
.octap-film-board[data-film-step="storyboard"] .film-step-page[data-film-page="storyboard"],
.octap-film-board[data-film-step="film"] .film-step-page[data-film-page="film"] {
    display: flex;
}

.film-script-page {
    gap: 0;
}

.film-script-panel {
    width: clamp(410px, 24vw, 470px);
    flex: 0 0 clamp(410px, 24vw, 470px);
    min-width: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--home-line);
    background: rgba(255, 255, 255, 0.015);
}

.film-chapter-panel {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.film-panel-header {
    min-height: 62px;
    padding: 12px 18px;
    justify-content: space-between;
    gap: 14px;
    border-bottom: 1px solid var(--home-line);
}

.film-panel-header strong {
    display: block;
    color: var(--home-text);
    font-size: 15px;
    font-weight: 760;
}

.film-panel-header > div:first-child > span {
    display: block;
    margin-top: 4px;
    color: var(--home-faint);
    font-size: 11px;
    font-weight: 640;
}

.film-header-actions {
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.film-chapter-toolbar-actions {
    flex: 0 1 auto;
    flex-wrap: nowrap;
    min-width: 0;
}

.film-chapter-toolbar-actions .film-select-wrap,
.film-chapter-toolbar-actions .film-soft-select,
.film-chapter-toolbar-actions .film-ghost-button,
.film-chapter-toolbar-actions .film-view-toggle {
    flex: 0 0 auto;
}

.film-chapter-toolbar-actions .film-select-wrap:first-child .film-soft-select {
    max-width: 150px;
}

.film-chapter-stat {
    height: 30px;
    display: inline-flex;
    align-items: center;
    padding: 0 10px;
    border: 1px solid var(--home-line);
    border-radius: 9px;
    background: var(--home-surface-soft);
    color: var(--home-muted);
    font-size: 12px;
    font-weight: 720;
    white-space: nowrap;
}

.film-info-line {
    margin: 12px 18px 0;
    padding: 10px 12px;
    display: flex;
    align-items: baseline;
    gap: 8px;
    border: 1px solid var(--home-line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.022);
    color: var(--home-muted);
    font-size: 12px;
    line-height: 1.5;
}

.film-info-line strong {
    color: var(--home-accent);
    font-weight: 780;
    white-space: nowrap;
}

.film-script-list,
.film-chapter-list,
.film-art-grid,
.film-storyboard-content,
.film-final-grid {
    min-height: 0;
    overflow: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}

.film-script-list {
    flex: 1;
    padding: 14px 18px 20px;
}

.film-script-entry {
    border: 1px solid var(--home-line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.025);
    overflow: hidden;
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.film-entry-head {
    min-height: 39px;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 9px 11px;
    border-bottom: 1px solid var(--home-line);
}

.film-entry-number,
.film-shot-num {
    color: var(--home-accent);
    font-weight: 800;
    font-size: 12px;
}

.film-entry-time {
    margin-left: auto;
    color: var(--home-faint);
    font-size: 11px;
}

.film-entry-actions {
    gap: 4px;
    display: flex;
}

.film-entry-actions button,
.film-chapter-actions button,
.film-art-card footer button,
.film-clip-card footer button {
    height: 25px;
    padding: 0 8px;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 680;
}

.film-entry-actions button:hover,
.film-chapter-actions button:hover,
.film-art-card footer button:hover,
.film-clip-card footer button:hover {
    color: var(--home-text);
    background: var(--home-surface-soft);
    border-color: var(--home-line);
}

.film-script-entry h3 {
    margin: 14px 14px 8px;
    color: var(--home-text);
    font-size: 15px;
    font-weight: 760;
}

.film-script-entry p {
    margin: 0 14px;
    color: var(--home-muted);
    font-size: 13px;
    line-height: 1.72;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.film-tag-row {
    flex-wrap: wrap;
    gap: 6px;
}

.film-script-entry .film-tag-row {
    padding: 13px 14px 0;
}

.film-gen-row {
    gap: 8px;
    padding: 14px;
}

.film-soft-select,
.film-ghost-button,
.film-tab,
.film-art-tabs button {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 11px;
    border-radius: 8px;
    border-color: var(--home-line);
    background: var(--home-surface-soft);
    font-size: 12px;
    font-weight: 650;
    white-space: nowrap;
}

.film-soft-select span {
    margin: 0;
    color: var(--home-faint);
    font-size: 12px;
}

.film-select-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-width: 0;
    flex: 0 0 auto;
}

.film-select-wrap .film-soft-select {
    width: 100%;
}

.film-soft-select [data-film-select-label] {
    min-width: 0;
    overflow: hidden;
    color: inherit;
    text-overflow: ellipsis;
}

.film-soft-select .film-select-caret {
    flex: 0 0 auto;
    transition: transform .16s ease, color .16s ease;
}

.film-soft-select.is-open {
    border-color: var(--home-accent-line);
    background: var(--home-accent-soft);
    color: var(--home-accent);
}

.film-soft-select.is-open .film-select-caret {
    transform: rotate(180deg);
    color: var(--home-accent);
}

.film-select-menu {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 160;
    min-width: 180px;
    max-width: min(260px, calc(100vw - 32px));
    max-height: min(360px, calc(100vh - 180px));
    overflow: auto;
    padding: 6px;
    border: 1px solid var(--home-line-strong);
    border-radius: 8px;
    background: rgba(18, 22, 29, 0.98);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.34) transparent;
}

.film-select-menu[hidden] {
    display: none;
}

.film-select-menu.is-wide {
    min-width: 220px;
}

.film-select-group-label {
    padding: 7px 8px 5px;
    color: var(--home-faint);
    font-size: 10.5px;
    font-weight: 680;
}

.film-select-option {
    width: 100%;
    min-height: 29px;
    display: flex;
    align-items: center;
    padding: 0 9px;
    border: 1px solid transparent;
    border-radius: 7px;
    color: var(--home-text);
    font-size: 12px;
    font-weight: 620;
    text-align: left;
    white-space: nowrap;
}

.film-select-option:hover,
.film-select-option:focus-visible,
.film-select-option.is-selected {
    border-color: var(--home-accent-line);
    background: var(--home-accent-soft);
    color: var(--home-accent);
    outline: none;
}

.film-number-input {
    width: 58px;
    height: 30px;
    padding: 0 9px;
    border: 1px solid var(--home-line);
    border-radius: 8px;
    background: var(--home-surface-soft);
    color: var(--home-text);
    outline: none;
}

.film-chapter-list {
    flex: 1;
    padding: 16px 24px 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    grid-auto-rows: 192px;
    align-content: start;
    align-items: stretch;
    gap: 10px;
}

.film-chapter-list[data-chapter-view="list"] {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
}

.film-chapter-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    padding: 14px 14px 12px;
    border: 1px solid var(--home-line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.024);
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.film-chapter-list[data-chapter-view="list"] .film-chapter-card {
    height: auto;
    min-height: 50px;
    overflow: visible;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
}

.film-chapter-num {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    border: 1px solid var(--home-line);
    background: var(--home-surface-soft);
    color: var(--home-accent);
    font-weight: 800;
    font-size: 12px;
}

.film-chapter-body {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.film-chapter-list[data-chapter-view="list"] .film-chapter-body {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    overflow: visible;
}

.film-chapter-card h3 {
    margin: 0;
    color: var(--home-text);
    font-size: 14px;
    font-weight: 760;
}

.film-chapter-card p {
    margin: 7px 0 10px;
    color: var(--home-muted);
    font-size: 12px;
    line-height: 1.55;
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.film-chapter-list[data-chapter-view="list"] .film-chapter-card p {
    display: none;
}

.film-chapter-list[data-chapter-view="grid"] .film-tag-row {
    max-height: 48px;
    overflow: hidden;
}

.film-chapter-list[data-chapter-view="list"] .film-chapter-card h3 {
    flex: 0 0 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.film-chapter-list[data-chapter-view="list"] .film-tag-row {
    flex: 0 0 auto;
    margin: 0;
}

.film-script-entry.is-active,
.film-chapter-card.is-active,
.film-art-card.is-active,
.film-final-card.is-active {
    border-color: var(--home-accent-line);
    background: rgba(255, 168, 79, 0.055);
    box-shadow: inset 0 0 0 1px rgba(255, 168, 79, 0.08);
}

.film-chapter-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    align-self: end;
    margin-top: auto;
}

.film-chapter-list[data-chapter-view="list"] .film-chapter-actions {
    flex: 0 0 auto;
    align-self: center;
    margin-top: 0;
}

.film-view-toggle {
    height: 30px;
    flex: 0 0 auto;
    align-self: center;
    gap: 2px;
    padding: 2px;
    border: 1px solid var(--home-line);
    border-radius: 9px;
    background: var(--home-surface-soft);
    white-space: nowrap;
}

.film-view-toggle button {
    width: 28px;
    height: 24px;
    flex: 0 0 28px;
    display: grid;
    place-items: center;
    border-radius: 7px;
    padding: 0;
}

.film-view-toggle button.is-active {
    color: var(--home-accent);
    background: var(--home-accent-soft);
}

.film-section-toolbar {
    width: 100%;
    min-height: 50px;
    flex: 0 0 auto;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 18px;
    border-bottom: 1px solid var(--home-line);
    background: rgba(255, 255, 255, 0.018);
}

.film-toolbar-left,
.film-toolbar-right {
    gap: 8px;
    min-width: 0;
}

.film-toolbar-left {
    flex: 1;
    overflow-x: auto;
    scrollbar-width: none;
}

.film-toolbar-left::-webkit-scrollbar {
    display: none;
}

.film-section-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--home-text);
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}

.film-mini-meta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--home-faint);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.film-tab.is-active,
.film-art-tabs button.is-active,
.film-clips-button.is-active {
    color: var(--home-accent);
    border-color: var(--home-accent-line);
    background: var(--home-accent-soft);
}

.film-grid-size-button {
    min-width: 58px;
    justify-content: center;
}

.film-grid-size-button svg {
    opacity: .9;
}

.film-art-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    grid-auto-rows: minmax(306px, auto);
    align-content: start;
    align-items: stretch;
    gap: 14px;
    padding: 18px;
}

.film-art-grid[data-grid-size="medium"] {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    grid-auto-rows: minmax(338px, auto);
}

.film-art-grid[data-grid-size="large"] {
    grid-template-columns: repeat(auto-fill, minmax(430px, 1fr));
    grid-auto-rows: minmax(390px, auto);
}

.film-art-card {
    width: 100%;
    height: auto;
    min-height: 0;
    align-self: start;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--home-line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.024);
    overflow: hidden;
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.film-art-card:hover {
    border-color: rgba(255, 168, 79, 0.32);
    background: rgba(255, 255, 255, 0.036);
}

.film-art-card.is-selected {
    border-color: rgba(126, 117, 255, 0.78);
    box-shadow: 0 0 0 1px rgba(126, 117, 255, 0.22), 0 12px 32px rgba(12, 16, 24, 0.18);
}

.film-art-card.is-dragging {
    opacity: .66;
}

.film-art-card.is-drop-before,
.film-art-card.is-drop-after {
    border-color: rgba(255, 168, 79, 0.72);
}

.film-art-card.is-drop-before {
    box-shadow: inset 0 3px 0 rgba(255, 168, 79, 0.82);
}

.film-art-card.is-drop-after {
    box-shadow: inset 0 -3px 0 rgba(255, 168, 79, 0.82);
}

.film-asset-card {
    position: relative;
    height: 100%;
    min-height: 0;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--home-line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.024);
    overflow: hidden;
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s ease;
}

.film-asset-card:hover {
    border-color: rgba(255, 168, 79, 0.32);
    background: rgba(255, 255, 255, 0.036);
}

.film-asset-card.is-active,
.film-asset-card.is-selected,
.film-shot-card.is-selected {
    border-color: rgba(126, 117, 255, 0.78);
    background: rgba(255, 255, 255, 0.024);
    box-shadow: 0 0 0 1px rgba(126, 117, 255, 0.22), 0 12px 32px rgba(12, 16, 24, 0.18);
}

.film-asset-cover {
    position: relative;
    flex: 0 0 160px;
    min-height: 160px;
    display: grid;
    place-items: center;
    border-bottom: 1px solid var(--home-line);
    overflow: hidden;
}

.film-asset-info {
    min-width: 0;
    padding: 11px 12px 8px;
    flex: 0 0 auto;
    overflow: hidden;
}

.film-asset-info h3 {
    margin: 0;
    color: var(--home-text);
    font-size: 13px;
    font-weight: 780;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.film-asset-info h3[data-film-quick-edit-title] {
    cursor: text;
}

.film-asset-info h3[data-film-quick-edit-title]:hover {
    color: var(--home-accent);
}

.film-asset-info p {
    width: 100%;
    margin: 7px 0 0;
    color: var(--home-muted);
    font-size: 12px;
    line-height: 1.5;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.film-asset-reference-strip,
.film-short-video-reference-row {
    min-height: 36px;
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 2px 0 0;
    padding: 2px 12px 8px;
    overflow: hidden;
}

.film-asset-reference-thumb,
.film-asset-reference-more,
.film-asset-reference-add {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    box-sizing: border-box;
    display: inline-grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--home-line);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.045);
    color: var(--home-muted);
    font-size: 10px;
    font-weight: 840;
}

.film-asset-reference-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.film-asset-reference-add {
    border-style: dashed;
    background: rgba(255, 255, 255, 0.018);
    cursor: pointer;
}

.film-asset-reference-add:hover,
.film-asset-reference-add:focus-visible {
    border-color: rgba(255, 168, 79, 0.55);
    background: rgba(255, 168, 79, 0.12);
    color: var(--home-accent);
}

.film-asset-reference-empty {
    min-width: 0;
    color: var(--home-faint);
    font-size: 11px;
    font-weight: 720;
    line-height: 28px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.film-asset-footer {
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
    padding: 0 12px 12px;
}

.film-cover-upload-button {
    position: absolute;
    right: 10px;
    bottom: 10px;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border: 1px solid var(--home-line-strong);
    border-radius: 50%;
    background: rgba(9, 12, 17, 0.68);
    color: var(--home-muted);
    cursor: pointer;
}

.film-cover-upload-button:hover,
.film-cover-upload-button:focus-visible {
    border-color: rgba(255, 168, 79, 0.45);
    color: var(--home-text);
    background: rgba(255, 168, 79, 0.12);
}

.film-art-thumb {
    position: relative;
    height: 160px;
    flex: 0 0 160px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #20262f, #11151c);
    border-bottom: 1px solid var(--home-line);
}

.film-art-thumb.is-generated {
    background: linear-gradient(135deg, #1e2630, #11151c);
}

.film-art-thumb.has-reference {
    background: linear-gradient(135deg, #20262f, #11151c);
}

.film-art-grid[data-grid-size="medium"] .film-art-thumb {
    height: 188px;
    flex-basis: 188px;
}

.film-art-grid[data-grid-size="large"] .film-art-thumb {
    height: 238px;
    flex-basis: 238px;
}

.film-art-placeholder {
    font-size: 38px;
    opacity: .9;
}

.film-art-preview {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.film-art-reference-button {
    position: absolute;
    right: 10px;
    bottom: 10px;
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border: 1px solid var(--home-line-strong);
    border-radius: 50%;
    background: rgba(9, 12, 17, 0.68);
    color: var(--home-muted);
}

.film-art-reference-button:hover {
    border-color: rgba(255, 168, 79, 0.45);
    color: var(--home-text);
    background: rgba(255, 168, 79, 0.12);
}

.film-art-ref-badge {
    position: absolute;
    left: 10px;
    bottom: 10px;
    min-width: 34px;
    height: 22px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(82, 154, 255, 0.38);
    border-radius: 999px;
    background: rgba(82, 154, 255, 0.14);
    color: #9fc3ff;
    font-size: 11px;
    font-weight: 800;
}

.film-art-body {
    padding: 11px 12px 8px;
    flex: 0 0 auto;
    min-height: 0;
    overflow: hidden;
}

.film-art-body h3,
.film-final-card h3,
.film-clip-card h3 {
    margin: 0;
    color: var(--home-text);
    font-size: 13px;
    font-weight: 780;
}

.film-art-body p,
.film-clip-card p {
    margin: 7px 0 0;
    color: var(--home-muted);
    font-size: 12px;
    line-height: 1.5;
}

.film-art-body p {
    width: 100%;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.film-art-card footer,
.film-clip-card footer {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 12px 12px;
}

.film-art-card-footer {
    justify-content: space-between;
}

.film-art-meta-chips {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
}

.film-art-card-footer .film-chip {
    max-width: 92px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.film-art-card-footer .film-card-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}

.film-art-generate-button,
.film-shot-generate-button {
    height: 28px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid rgba(255, 168, 79, 0.34);
    border-radius: 7px;
    background: rgba(255, 168, 79, 0.14);
    color: var(--home-accent);
    font-size: 12px;
    font-weight: 820;
    cursor: pointer;
}

.film-art-generate-button:hover,
.film-shot-generate-button:hover {
    border-color: rgba(255, 168, 79, 0.62);
    background: rgba(255, 168, 79, 0.22);
    color: var(--home-text);
}

.film-art-context-menu {
    position: fixed;
    z-index: 90;
    width: 178px;
    padding: 6px;
    border: 1px solid var(--home-line-strong);
    border-radius: 8px;
    background: rgba(17, 21, 28, 0.98);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.36);
}

.film-art-context-item {
    width: 100%;
    height: 32px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 9px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--home-text);
    font-size: 12px;
    font-weight: 720;
    text-align: left;
    cursor: pointer;
}

.film-art-context-item:hover {
    background: rgba(255, 255, 255, 0.07);
}

.film-art-context-item.is-danger {
    color: #ff8a8a;
}

.film-art-context-divider {
    display: block;
    height: 1px;
    margin: 5px 3px;
    background: var(--home-line);
}

.film-storyboard-content {
    flex: 1;
    background: rgba(255, 255, 255, 0.01);
}

.film-table-wrap {
    height: 100%;
    overflow: auto;
}

.film-shot-table {
    min-width: 1760px;
    width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
    color: var(--home-muted);
    font-size: 11.5px;
}

.film-shot-table th,
.film-shot-table td {
    vertical-align: top;
    border-right: 1px solid var(--home-line);
    border-bottom: 1px solid var(--home-line);
}

.film-shot-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    height: 42px;
    padding: 0 10px;
    background: #171b22;
    color: var(--home-accent);
    font-size: 11px;
    font-weight: 800;
    text-align: left;
    white-space: nowrap;
}

body[data-theme="light"] .film-shot-table th {
    background: #eef2f7;
}

.film-shot-table td {
    padding: 10px;
    line-height: 1.58;
    background: rgba(255, 255, 255, 0.012);
    overflow-wrap: anywhere;
}

.film-shot-table td:nth-child(1),
.film-shot-table td:nth-child(2),
.film-shot-table td:nth-child(3) {
    white-space: nowrap;
}

.film-shot-table th:nth-child(1) { width: 40px; }
.film-shot-table th:nth-child(2) { width: 46px; }
.film-shot-table th:nth-child(3) { width: 66px; }
.film-shot-table th:nth-child(4) { width: 170px; }
.film-shot-table th:nth-child(5) { width: 80px; }
.film-shot-table th:nth-child(6) { width: 90px; }
.film-shot-table th:nth-child(7) { width: 155px; }
.film-shot-table th:nth-child(8) { width: 80px; }
.film-shot-table th:nth-child(9) { width: 82px; }
.film-shot-table th:nth-child(10) { width: 115px; }
.film-shot-table th:nth-child(11) { width: 170px; }
.film-shot-table th:nth-child(12) { width: 110px; }
.film-shot-table th:nth-child(13) { width: 140px; }
.film-shot-table th:nth-child(14) { width: 115px; }
.film-shot-table th:nth-child(15) { width: 170px; }
.film-shot-table th:nth-child(16) { width: 170px; }

.film-shot-row {
    cursor: default;
}

.film-shot-row:hover td {
    background: rgba(255, 255, 255, 0.026);
}

.film-shot-row.is-selected td {
    background: rgba(255, 168, 79, 0.085);
}

.film-shot-card.is-selected {
    border-color: rgba(126, 117, 255, 0.78);
    background: rgba(255, 255, 255, 0.024);
    box-shadow: 0 0 0 1px rgba(126, 117, 255, 0.22), 0 12px 32px rgba(12, 16, 24, 0.18);
}

.film-shot-card.is-selected::after {
    content: "✓";
    position: absolute;
    top: 10px;
    right: 8px;
    z-index: 3;
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--home-accent);
    color: #0a0d12;
    font-size: 12px;
    font-weight: 850;
}

.film-duration {
    color: #5d9bff;
    font-weight: 800;
}

.film-clip-pill {
    min-width: 40px;
    height: 21px;
    border: 1px solid var(--home-accent-line);
    border-radius: 6px;
    background: var(--home-accent-soft);
    color: var(--home-accent);
    font-size: 11px;
    font-weight: 820;
}

.film-dialogue {
    padding: 8px 9px;
    border-left: 2px solid var(--home-accent);
    border-radius: 0 7px 7px 0;
    background: rgba(255, 255, 255, 0.035);
    color: var(--home-text);
}

.film-long-text {
    max-width: 430px;
}

.film-long-text.is-collapsed span {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.film-long-text.is-expanded span {
    display: block;
}

.film-long-toggle {
    margin-top: 6px;
    height: 22px;
    padding: 0 8px;
    border: 1px solid var(--home-line);
    border-radius: 6px;
    background: var(--home-surface-soft);
    color: var(--home-accent);
    font-size: 11px;
    font-weight: 760;
}

.film-shot-card-grid {
    min-height: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    grid-auto-rows: 306px;
    align-content: start;
    align-items: stretch;
    gap: 14px;
    padding: 18px;
}

.film-shot-card-grid[data-grid-size="medium"] {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    grid-auto-rows: 338px;
}

.film-shot-card-grid[data-grid-size="large"] {
    grid-template-columns: repeat(auto-fill, minmax(430px, 1fr));
    grid-auto-rows: 390px;
}

.film-shot-card {
    position: relative;
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--home-line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.024);
    overflow: hidden;
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s ease;
}

.film-shot-card.is-dragging {
    opacity: .66;
}

.film-shot-card.is-drop-before,
.film-shot-card.is-drop-after {
    border-color: rgba(255, 168, 79, 0.72);
}

.film-shot-card.is-drop-before {
    box-shadow: inset 0 3px 0 rgba(255, 168, 79, 0.82);
}

.film-shot-card.is-drop-after {
    box-shadow: inset 0 -3px 0 rgba(255, 168, 79, 0.82);
}

.film-shot-card-thumb {
    position: relative;
    min-height: 160px;
    flex: 0 0 160px;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, #252a33, #11151c);
    border-bottom: 1px solid var(--home-line);
}

.film-shot-card-thumb.is-generated {
    background: linear-gradient(145deg, #26302d, #11151c);
}

.film-shot-card-grid[data-grid-size="medium"] .film-shot-card-thumb {
    min-height: 188px;
    flex-basis: 188px;
}

.film-shot-card-grid[data-grid-size="large"] .film-shot-card-thumb {
    min-height: 238px;
    flex-basis: 238px;
}

.film-shot-placeholder {
    color: rgba(255, 255, 255, 0.22);
}

.film-shot-preview {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.film-shot-card-badges {
    position: absolute;
    left: 10px;
    bottom: 38px;
    display: flex;
    align-items: center;
    gap: 5px;
    max-width: calc(100% - 20px);
}

.film-shot-card-badges .film-chip {
    max-width: 96px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.film-shot-card-duration,
.film-shot-card-type {
    position: absolute;
    top: 8px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    border-radius: 5px;
    font-size: 10.5px;
    font-weight: 820;
}

.film-shot-card-duration {
    left: 10px;
    padding: 0 7px;
    background: rgba(4, 6, 9, 0.72);
    color: var(--home-text);
}

.film-shot-card-type {
    right: 10px;
    max-width: 48%;
    padding: 0 8px;
    overflow: hidden;
    border: 1px solid rgba(81, 139, 255, 0.28);
    background: rgba(81, 139, 255, 0.18);
    color: #9fc0ff;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.film-shot-card-body {
    padding: 12px;
    flex: 0 0 auto;
    min-height: 0;
    overflow: hidden;
}

.film-shot-card-body strong {
    display: block;
    color: var(--home-text);
    font-size: 13px;
    line-height: 1.45;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.film-shot-card-body span {
    display: block;
    margin-top: 5px;
    color: var(--home-faint);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.55;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.film-shot-card-grid[data-grid-size="large"] .film-shot-card-body span {
    -webkit-line-clamp: 4;
}

.film-shot-dialogue {
    margin: 11px 0 0;
    color: var(--home-muted);
    font-size: 12px;
    line-height: 1.55;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.film-shot-dialogue strong {
    display: inline;
    color: var(--home-accent);
    font-size: inherit;
}

.film-shot-dialogue.is-muted {
    color: var(--home-faint);
    font-style: italic;
}

.film-shot-card-footer {
    position: static;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 12px 12px;
    margin-top: 0;
    pointer-events: auto;
}

.film-shot-card-id {
    min-width: 30px;
    height: 22px;
    display: inline-grid;
    place-items: center;
    border-radius: 5px;
    background: rgba(63, 55, 148, 0.72);
    color: #b7adff;
    font-size: 10px;
    font-weight: 840;
    box-shadow: inset 0 0 0 1px rgba(183, 173, 255, 0.14);
}

.film-shot-card-meta {
    min-width: 0;
    color: var(--home-faint);
    font-size: 11px;
    font-weight: 720;
}

.film-card-actions {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    pointer-events: auto;
}

.film-shot-generate-button {
    width: 24px;
    height: 24px;
    box-sizing: border-box;
    margin-left: 0;
    padding: 0;
    display: inline-grid;
    place-items: center;
    gap: 0;
    font-size: 0;
}

.film-card-icon-button {
    width: 24px;
    height: 24px;
    box-sizing: border-box;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--home-muted);
    line-height: 1;
}

.film-card-icon-button[data-film-action="generate-art"],
.film-card-icon-button[data-film-action="generate-clip"],
.film-card-icon-button[data-film-action="generate-shot"],
.film-card-icon-button[data-film-action="generate-short-video"] {
    border-color: rgba(255, 168, 79, 0.42);
    background: rgba(255, 168, 79, 0.08);
    color: var(--home-accent);
}

.film-card-icon-button svg,
.film-shot-generate-button svg {
    width: 12px;
    height: 12px;
    display: block;
}

.film-shot-card .film-card-icon-button svg,
.film-shot-card .film-shot-generate-button svg {
    width: 12px;
    height: 12px;
}

.film-card-icon-button:hover {
    border-color: var(--home-line-strong);
    background: var(--home-surface-soft);
    color: var(--home-text);
}

.film-card-icon-button[data-film-action="generate-art"]:hover,
.film-card-icon-button[data-film-action="generate-clip"]:hover,
.film-card-icon-button[data-film-action="generate-shot"]:hover,
.film-card-icon-button[data-film-action="generate-short-video"]:hover {
    border-color: rgba(255, 168, 79, 0.68);
    background: rgba(255, 168, 79, 0.16);
    color: var(--home-text);
}

.film-card-icon-button.is-edit:hover {
    border-color: var(--home-accent-line);
    background: var(--home-accent-soft);
    color: var(--home-accent);
}

.film-card-icon-button.is-danger:hover {
    border-color: rgba(248, 113, 113, 0.28);
    background: rgba(248, 113, 113, 0.1);
    color: #fca5a5;
}

.film-card-icon-button.is-ready {
    color: var(--home-accent);
    background: var(--home-accent-soft);
}

.film-clips-view {
    height: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
}

.film-clips-view.is-empty {
    grid-template-columns: minmax(0, 1fr);
}

.film-empty-clips {
    min-height: 100%;
    display: grid;
    place-content: center;
    gap: 8px;
    padding: 40px;
    color: var(--home-muted);
    text-align: center;
}

.film-empty-clips strong {
    color: var(--home-text);
    font-size: 15px;
    font-weight: 780;
}

.film-empty-clips span {
    max-width: 360px;
    font-size: 12px;
    line-height: 1.65;
}

.film-clips-grid {
    min-height: 0;
    overflow: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    grid-auto-rows: minmax(306px, auto);
    align-content: start;
    align-items: stretch;
    gap: 14px;
    padding: 18px;
}

.film-clip-card {
    height: 100%;
    min-height: 0;
}

.film-clip-card.is-active {
    border-color: rgba(126, 117, 255, 0.78);
    box-shadow: 0 0 0 1px rgba(126, 117, 255, 0.22), 0 12px 32px rgba(12, 16, 24, 0.18);
}

.film-clip-thumb {
    position: relative;
    background: linear-gradient(145deg, #242932, #11151c);
}

.film-clip-thumb span {
    color: var(--home-accent);
    font-size: 24px;
    font-weight: 840;
}

.film-clip-thumb i {
    position: absolute;
    right: 10px;
    bottom: 9px;
    color: var(--home-muted);
    font-style: normal;
    font-size: 11px;
    font-weight: 760;
}

.film-clip-card-body {
    padding: 11px 12px 8px;
    flex: 0 0 auto;
    min-height: 0;
    overflow: hidden;
}

.film-clip-card .film-asset-info h3 {
    display: block;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.film-short-video-reference-row .film-asset-reference-thumb,
.film-short-video-reference-row .film-asset-reference-more,
.film-short-video-reference-row .film-asset-reference-add {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
}

.film-clip-card footer button {
    display: inline-grid;
    place-items: center;
    gap: 0;
}

.film-final-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    grid-auto-rows: minmax(306px, auto);
    align-content: start;
    gap: 16px;
    padding: 18px;
}

.film-final-card {
    min-height: 276px;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--home-line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.024);
    overflow: hidden;
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.film-final-thumb {
    position: relative;
    height: 164px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #2a1510, #11151c 68%);
    border-bottom: 1px solid var(--home-line);
}

.film-final-thumb > span {
    color: rgba(255, 255, 255, 0.2);
}

.film-final-thumb button {
    position: absolute;
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    background: rgba(8, 10, 14, 0.58);
    color: var(--home-text);
}

.film-final-card > div:not(.film-final-thumb):not(.film-asset-info):not(.film-short-video-reference-row) {
    padding: 13px 14px 0;
}

.film-final-card p {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 7px 0 0;
    color: var(--home-faint);
    font-size: 12px;
    font-weight: 680;
}

.film-final-card footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
    padding: 12px 14px 14px;
}

.film-short-video-card {
    min-height: 306px;
}

.film-short-video-card.is-dragging {
    opacity: .66;
}

.film-short-video-card.is-drop-before,
.film-short-video-card.is-drop-after {
    border-color: rgba(255, 168, 79, 0.72);
}

.film-short-video-card.is-drop-before {
    box-shadow: inset 0 3px 0 rgba(255, 168, 79, 0.82);
}

.film-short-video-card.is-drop-after {
    box-shadow: inset 0 -3px 0 rgba(255, 168, 79, 0.82);
}

.film-short-video-thumb.has-output {
    background-size: cover;
    background-position: center;
}

.film-short-video-thumb.has-output button {
    border-color: rgba(248, 250, 252, 0.3);
    background: rgba(2, 6, 23, 0.5);
    box-shadow: 0 12px 34px rgba(2, 6, 23, 0.36);
}

.film-short-video-body {
    min-width: 0;
}

.film-short-video-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.film-short-video-title-row h3 {
    min-width: 0;
    flex: 1;
}

.film-short-video-reference-row {
    min-height: 36px;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 2px;
    padding: 2px 12px 8px;
}

.film-short-video-ref-empty {
    color: var(--home-faint);
    font-size: 11px;
    font-weight: 700;
}

.film-short-video-actions {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.film-short-preview-panel {
    width: min(960px, calc(100vw - 48px));
}

.film-short-preview-stage {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border: 1px solid var(--home-line);
    border-radius: 8px;
    background: #020617;
}

.film-short-preview-video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    background: #020617;
}

.film-short-preview-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.film-short-preview-meta span {
    min-height: 22px;
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--home-line);
    border-radius: 999px;
    padding: 0 9px;
    background: rgba(255, 255, 255, 0.035);
    color: var(--home-muted);
    font-size: 11px;
    font-weight: 780;
}

.film-short-preview-prompt {
    margin: 12px 0 0;
    padding: 10px 12px;
    border: 1px solid var(--home-line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.026);
    color: var(--home-faint);
    font-size: 12px;
    line-height: 1.55;
}

.film-detail-overlay {
    position: fixed;
    inset: 0;
    z-index: 12020;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    background: rgba(0, 0, 0, 0.58);
    backdrop-filter: blur(4px);
    overflow: auto;
}

.film-detail-overlay[hidden] {
    display: none;
}

body.is-film-detail-open .octap-home-topbar {
    pointer-events: none;
}

.film-detail-panel {
    width: min(720px, calc(100vw - 48px));
    max-height: calc(100vh - 56px);
    overflow: auto;
    overscroll-behavior: contain;
    padding: 16px 20px;
    border: 1px solid var(--home-line-strong);
    border-radius: 12px;
    background: rgba(17, 21, 28, 0.98);
    box-shadow: 0 24px 72px rgba(0, 0, 0, 0.38);
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.34) transparent;
}

.film-detail-panel.is-reference-layout {
    width: min(1080px, calc(100vw - 40px));
}

.film-detail-panel.is-reference-layout.is-clip-detail {
    max-height: min(78vh, 720px);
}

.film-detail-panel.is-clip-detail .film-detail-prompts pre {
    max-height: 168px;
}

@media (min-width: 761px) {
    .film-detail-panel.is-reference-layout:has(.film-detail-actions .film-detail-select-menu:not([hidden])) {
        overflow: visible;
    }
}

.film-detail-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.film-detail-head h3 {
    min-width: 0;
    flex: 1;
    margin: 0;
    color: var(--home-text);
    font-size: 16px;
    font-weight: 820;
    line-height: 1.35;
}

.film-detail-id,
.film-detail-status {
    min-height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 840;
    white-space: nowrap;
}

.film-detail-id {
    min-width: 30px;
    padding: 0 7px;
    background: rgba(106, 91, 255, 0.18);
    color: #b7adff;
}

.film-detail-status {
    padding: 0 8px;
    background: rgba(95, 191, 143, 0.12);
    color: #7bdc9f;
}

.film-detail-head-action {
    height: 26px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    border: 1px solid rgba(255, 153, 31, 0.36);
    border-radius: 7px;
    background: rgba(255, 153, 31, 0.1);
    color: var(--home-accent);
    font-size: 11px;
    font-weight: 820;
    white-space: nowrap;
}

.film-detail-head-action:hover,
.film-detail-head-action:focus-visible {
    border-color: var(--home-accent-line);
    background: var(--home-accent-soft);
    color: var(--home-accent-strong);
    outline: none;
}

.film-detail-close {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    padding: 0;
    border: 1px solid var(--home-line);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    color: var(--home-muted);
}

.film-detail-close:hover,
.film-detail-close:focus-visible {
    border-color: var(--home-line-strong);
    background: rgba(255, 255, 255, 0.08);
    color: var(--home-text);
    outline: none;
}

.film-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}

.film-detail-reference-layout {
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(236px, 286px) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.film-detail-main {
    min-width: 0;
    display: grid;
    gap: 8px;
}

.film-detail-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.film-detail-main .film-detail-grid,
.film-detail-main .film-detail-block,
.film-detail-main .film-detail-prompts,
.film-detail-main .film-detail-advanced,
.film-detail-main > .film-detail-field {
    margin-bottom: 0;
}

.film-detail-grid > div,
.film-detail-grid .film-detail-field,
.film-detail-panel > .film-detail-field,
.film-detail-main > .film-detail-field,
.film-detail-block,
.film-detail-prompts {
    border: 1px solid var(--home-line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.028);
}

.film-detail-grid > div,
.film-detail-grid .film-detail-field {
    min-width: 0;
    padding: 7px 10px;
}

.film-detail-field {
    display: block;
    min-width: 0;
}

.film-detail-panel > .film-detail-field,
.film-detail-main > .film-detail-field {
    margin-bottom: 8px;
    padding: 9px 11px;
}

.film-detail-main > .film-detail-field {
    margin-bottom: 0;
}

.film-detail-field:focus-within,
.film-detail-prompts:focus-within {
    border-color: var(--home-accent-line);
    background: rgba(255, 153, 31, 0.055);
}

.film-detail-grid strong {
    display: block;
    margin-top: 4px;
    color: var(--home-text);
    font-size: 13px;
    font-weight: 760;
    line-height: 1.45;
}

.film-detail-block {
    margin-bottom: 8px;
    padding: 9px 11px;
    color: var(--home-muted);
    font-size: 12px;
    line-height: 1.65;
}

.film-detail-meta-grid .film-detail-block {
    margin-bottom: 0;
}

.film-detail-reference-strip {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 7px;
}

.film-detail-reference-library {
    height: 34px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    border: 1px solid var(--home-line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.035);
    color: var(--home-muted);
    font-size: 11px;
    font-weight: 780;
}

.film-detail-reference-library:hover {
    border-color: var(--home-accent-line);
    background: var(--home-accent-soft);
    color: var(--home-accent);
}

.film-detail-reference-chips {
    min-width: 0;
    flex: 1;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 1px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.34) transparent;
}

.film-detail-reference-chip {
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--home-line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.045);
    color: var(--home-muted);
}

.film-detail-reference-chip img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.film-detail-reference-icon {
    display: inline-grid;
    place-items: center;
}

.film-detail-reference-count {
    flex: 0 0 auto;
    color: var(--home-accent);
    font-size: 11px;
    font-weight: 840;
}

.film-detail-reference-empty {
    color: var(--home-faint);
    font-size: 11px;
    font-weight: 720;
    white-space: nowrap;
}

.film-detail-reference-pane {
    min-width: 0;
    display: grid;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--home-line);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.024);
}

.film-reference-pane-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.film-reference-pane-head strong {
    display: block;
    color: var(--home-text);
    font-size: 13px;
    font-weight: 820;
}

.film-reference-pane-head em {
    min-width: 34px;
    min-height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(255, 153, 31, 0.12);
    color: var(--home-accent);
    font-size: 11px;
    font-style: normal;
    font-weight: 840;
}

.film-reference-groups {
    min-height: 0;
    display: grid;
    gap: 13px;
}

.film-reference-group {
    min-width: 0;
    display: grid;
    gap: 8px;
}

.film-reference-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.film-reference-group-head strong {
    color: var(--home-text);
    font-size: 12px;
    font-weight: 820;
}

.film-reference-group-body {
    min-width: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.film-reference-add-button {
    min-height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: fit-content;
    max-width: 100%;
    padding: 0 10px;
    border: 1px dashed rgba(126, 117, 255, 0.7);
    border-radius: 999px;
    background: rgba(106, 91, 255, 0.08);
    color: #bdb6ff;
    font-size: 11px;
    font-weight: 820;
}

.film-reference-add-button svg {
    width: 11px;
    height: 11px;
}

.octap-film-board .film-detail-reference-pane .film-reference-add-button {
    font-size: 11px;
}

.film-reference-add-button small {
    color: var(--home-faint);
    font-size: 10px;
    font-weight: 760;
}

.film-reference-add-button:hover {
    border-color: var(--home-accent-line);
    background: var(--home-accent-soft);
    color: var(--home-accent);
}

.film-detail-reference-pane .film-detail-reference-chips {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding-right: 2px;
}

.film-detail-reference-pane .film-detail-reference-chip {
    position: relative;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    overflow: visible;
    border-radius: 10px;
    text-align: left;
}

.film-reference-token {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--home-line-strong);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.045);
    color: var(--home-faint);
}

.film-detail-reference-pane .film-detail-reference-chip:hover .film-reference-token,
.film-detail-reference-pane .film-detail-reference-chip.is-active .film-reference-token {
    border-color: rgba(126, 117, 255, 0.7);
    background: rgba(106, 91, 255, 0.13);
    color: var(--home-text);
}

.film-detail-reference-pane .film-detail-reference-chip img,
.film-detail-reference-pane .film-detail-reference-icon {
    width: 100%;
    height: 100%;
    flex: 0 0 auto;
    border-radius: 9px;
}

.film-detail-reference-pane .film-detail-reference-chip img {
    object-fit: cover;
}

.film-detail-reference-pane .film-detail-reference-icon {
    display: inline-grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.05);
}

.film-detail-reference-pane .film-detail-reference-chip.is-placeholder .film-reference-token {
    border-style: dashed;
    background: rgba(106, 91, 255, 0.055);
    color: rgba(255, 255, 255, 0.44);
}

.film-detail-reference-pane .film-detail-reference-chip.is-placeholder:hover .film-reference-token,
.film-detail-reference-pane .film-detail-reference-chip.is-placeholder .film-reference-token:focus-visible {
    border-color: rgba(126, 117, 255, 0.86);
    background: rgba(106, 91, 255, 0.14);
    color: #d8d3ff;
    outline: none;
}

.film-reference-remove-button {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 17px;
    height: 17px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    background: rgba(10, 12, 16, 0.86);
    color: rgba(255, 255, 255, 0.78);
    opacity: 0;
    transform: scale(0.9);
    z-index: 2;
    transition: opacity .14s ease, transform .14s ease, border-color .14s ease, color .14s ease;
}

.film-detail-reference-chip:hover .film-reference-remove-button,
.film-reference-remove-button:focus-visible {
    opacity: 1;
    transform: scale(1);
}

.film-reference-remove-button:hover {
    border-color: rgba(248, 113, 113, 0.5);
    color: #fca5a5;
}

.film-reference-chip-label {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
}

.film-reference-chip-body {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.film-reference-chip-body small {
    min-width: 0;
    overflow: hidden;
    color: var(--home-faint);
    font-size: 10px;
    font-weight: 720;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.film-reference-matches {
    display: grid;
    gap: 6px;
    padding-top: 2px;
}

.film-reference-matches p {
    margin: 0;
    color: var(--home-faint);
    font-size: 11px;
    line-height: 1.5;
}

.film-reference-match,
.film-reference-match-more {
    min-width: 0;
    display: block;
    padding: 7px 9px;
    border: 1px solid var(--home-line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.026);
}

.film-reference-match strong,
.film-reference-match small {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.film-reference-match strong {
    color: var(--home-text);
    font-size: 11.5px;
    font-weight: 800;
}

.film-reference-match small {
    margin-top: 2px;
    color: var(--home-faint);
    font-size: 10.5px;
    font-weight: 700;
}

.film-reference-match-more {
    color: var(--home-muted);
    font-size: 11px;
    font-weight: 760;
}

.film-detail-label {
    display: block;
    margin-bottom: 3px;
    color: var(--home-faint);
    font-size: 9.5px;
    font-weight: 760;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.film-detail-input,
.film-detail-prompt-input {
    width: 100%;
    display: block;
    border: 0;
    background: transparent;
    color: var(--home-text);
    outline: none;
    resize: vertical;
    font: inherit;
    font-size: 12.5px;
    font-weight: 650;
    line-height: 1.62;
}

.film-detail-input::placeholder,
.film-detail-prompt-input::placeholder {
    color: var(--home-faint);
}

.film-detail-select-field {
    position: relative;
}

.film-detail-select-button {
    width: 100%;
    min-height: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--home-text);
    font-size: 12px;
    font-weight: 760;
    text-align: left;
    cursor: pointer;
}

.film-detail-select-button span:first-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.film-detail-select-menu {
    position: absolute;
    z-index: 12;
    left: 6px;
    right: 6px;
    top: calc(100% - 2px);
    padding: 4px;
    border: 1px solid var(--home-line-strong);
    border-radius: 8px;
    background: rgba(17, 21, 28, 0.98);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.32);
}

.film-detail-select-option {
    width: 100%;
    height: 26px;
    padding: 0 8px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--home-muted);
    font-size: 11.5px;
    font-weight: 720;
    text-align: left;
    cursor: pointer;
}

.film-detail-select-option:hover,
.film-detail-select-option.is-active {
    background: rgba(255, 168, 79, 0.13);
    color: var(--home-accent);
}

.film-detail-generation-settings {
    margin-bottom: 8px;
    padding: 9px 11px;
    border: 1px solid var(--home-line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.028);
}

.film-detail-generation-grid {
    display: grid;
    grid-template-columns: minmax(150px, 1.1fr) minmax(120px, .9fr) minmax(74px, auto);
    gap: 7px;
    align-items: end;
}

.film-detail-generation-select > span {
    display: block;
    margin-bottom: 3px;
    color: var(--home-faint);
    font-size: 9.5px;
    font-weight: 760;
}

.film-detail-select-field.is-compact {
    padding: 0;
    border: 1px solid var(--home-line);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.026);
}

.film-detail-select-field.is-compact .film-detail-select-button {
    min-height: 28px;
    padding: 0 9px;
    font-size: 11.5px;
}

.film-detail-select-field.is-compact .film-detail-select-menu {
    left: -1px;
    right: -1px;
    top: calc(100% + 4px);
}

.film-detail-actions.has-generation-settings .film-detail-select-field.is-compact .film-detail-select-menu {
    top: auto;
    bottom: calc(100% + 4px);
    z-index: 40;
    max-height: min(220px, calc(100vh - 180px));
    overflow-y: auto;
}

.film-detail-generation-ref strong {
    min-height: 30px;
    display: flex;
    align-items: center;
    padding: 0 9px;
    border: 1px solid var(--home-line);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.026);
    color: var(--home-text);
    font-size: 11.5px;
    font-weight: 760;
}

.film-detail-prompt-input {
    min-height: 132px;
    padding: 12px;
    border-top: 1px solid var(--home-line);
    color: var(--home-muted);
    font-size: 11.5px;
    resize: none;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.34) transparent;
}

.film-detail-edit-prompt.is-short-video-prompt .film-detail-prompt-input {
    min-height: 206px;
}

.film-short-video-status-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.film-short-video-chapter-select {
    min-width: 0;
}

.film-short-video-chapter-select .film-detail-select-field.is-compact {
    width: 100%;
}

.film-short-video-status-strip span,
.film-short-video-status-action {
    min-height: 25px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 8px;
    border: 1px solid var(--home-line);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.032);
    color: var(--home-muted);
    font-size: 11px;
    font-weight: 720;
}

.film-short-video-status-action {
    cursor: pointer;
    font-family: inherit;
}

.film-short-video-status-action:hover,
.film-short-video-status-action:focus-visible {
    border-color: rgba(245, 158, 11, 0.58);
    background: rgba(245, 158, 11, 0.095);
    color: var(--home-text);
    outline: none;
}

.film-short-video-status-strip em {
    color: var(--home-faint);
    font-style: normal;
    font-weight: 760;
}

.film-short-video-status-strip strong {
    color: var(--home-text);
    font-weight: 820;
}

.film-short-video-chapter-select .film-detail-select-menu {
    max-height: 188px;
    overflow-y: auto;
}

.film-detail-shot-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.film-detail-shot-list span {
    min-width: 32px;
    height: 22px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--home-line);
    border-radius: 7px;
    color: var(--home-muted);
    font-size: 11px;
    font-weight: 780;
}

.film-detail-prompts {
    margin-bottom: 8px;
    overflow: hidden;
}

.film-detail-advanced {
    margin-bottom: 8px;
    border: 1px solid var(--home-line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.024);
    overflow: hidden;
}

.film-detail-advanced summary {
    min-height: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 12px;
    color: var(--home-muted);
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.film-detail-advanced summary span {
    color: var(--home-faint);
    font-size: 10.5px;
    font-weight: 740;
}

.film-detail-advanced-grid {
    max-height: 224px;
    overflow: auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
    border-top: 1px solid var(--home-line);
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.34) transparent;
}

.film-detail-advanced-grid .film-detail-field {
    padding: 8px 10px;
    border: 1px solid var(--home-line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.026);
}

.film-detail-prompts summary {
    min-height: 36px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    color: var(--home-accent);
    font-size: 12px;
    font-weight: 820;
    cursor: pointer;
    list-style-position: inside;
}

.film-detail-copy {
    height: 24px;
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0 8px;
    border: 1px solid var(--home-line);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.035);
    color: var(--home-muted);
    font-size: 11px;
    font-weight: 740;
}

.film-detail-copy:hover {
    border-color: var(--home-accent-line);
    background: var(--home-accent-soft);
    color: var(--home-accent);
}

.film-detail-prompts pre {
    max-height: 260px;
    overflow: auto;
    margin: 0;
    padding: 12px;
    border-top: 1px solid var(--home-line);
    color: var(--home-muted);
    font-family: inherit;
    font-size: 11.5px;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.34) transparent;
}

.film-text-editor-panel {
    width: min(780px, calc(100vw - 48px));
    height: min(80vh, 720px);
    max-height: min(88vh, 760px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
}

.film-text-editor-toolbar {
    flex: 0 0 auto;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 16px;
    border-bottom: 1px solid var(--home-line);
    background: rgba(255, 255, 255, 0.012);
}

.film-editor-tool {
    width: 28px;
    height: 28px;
    display: inline-grid;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: var(--home-muted);
    font-size: 12px;
    font-weight: 820;
}

.film-editor-tool span { display: inline-flex; align-items: center; }
.film-editor-tool sub { font-size: 0.62em; }
.film-editor-tool svg { width: 14px; height: 14px; }

.film-editor-tool.is-bold {
    font-weight: 900;
}

.film-editor-tool.is-italic {
    font-style: italic;
}

.film-editor-tool:hover,
.film-editor-tool:focus-visible {
    border-color: var(--home-line-strong);
    background: rgba(255, 255, 255, 0.06);
    color: var(--home-text);
    outline: none;
}

.film-editor-divider {
    width: 1px;
    height: 18px;
    margin: 0 2px;
    background: var(--home-line);
}

.film-text-editor-head {
    flex: 0 0 auto;
    min-height: 64px;
    margin: 0;
    padding: 14px 18px;
    border-bottom: 1px solid var(--home-line);
}

.film-text-editor-head > div {
    min-width: 0;
    flex: 1;
}

/* 剧本编辑器：与库编辑器一致的布局（头部工具栏居中 + 导入导出 + 左侧大纲） */
.film-text-editor-panel.is-script-editor {
    width: min(940px, calc(100vw - 48px));
    height: min(720px, calc(100vh - 96px));
    max-height: min(720px, calc(100vh - 96px));
}
.film-text-editor-head.is-row { display: flex; align-items: center; gap: 12px; }
.film-text-editor-head.is-row .film-text-editor-headline { flex: 1 1 0; min-width: 0; }
.film-text-editor-head.is-row .film-text-editor-toolbar { flex: 0 0 auto; min-height: 0; padding: 0; border-bottom: 0; background: transparent; }
.film-text-editor-head-right { flex: 1 1 0; display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.film-editor-io {
    display: inline-flex; align-items: center; gap: 6px;
    height: 32px; padding: 0 12px;
    border: 1px solid var(--home-line); border-radius: 9px;
    background: transparent; color: var(--home-muted); font-size: 12.5px;
}
.film-editor-io:hover { color: var(--home-text); border-color: var(--home-line-strong); }
.film-editor-io svg { width: 15px; height: 15px; color: var(--home-accent); }
.film-text-editor-main { flex: 1; min-height: 0; display: flex; }
.film-editor-outline {
    flex: 0 0 200px; min-width: 0;
    display: flex; flex-direction: column; gap: 8px;
    padding: 16px 14px; border-right: 1px solid var(--home-line);
    overflow-y: auto;
}
.film-editor-outline-label { padding: 2px 4px; color: var(--home-faint); font-size: 11.5px; }
.film-editor-outline-list { display: flex; flex-direction: column; gap: 2px; }
.film-outline-item {
    display: block; width: 100%; text-align: left;
    padding: 6px 8px; border: 0; border-radius: 7px;
    background: transparent; color: var(--home-muted); font-size: 13px; cursor: pointer;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.film-outline-item:hover { background: rgba(255, 255, 255, 0.06); color: var(--home-text); }
.film-outline-item.is-h2 { padding-left: 18px; }
.film-outline-item.is-h3 { padding-left: 30px; font-size: 12.5px; }
.film-outline-empty { padding: 4px; color: var(--home-faint); font-size: 12px; line-height: 1.6; }
.film-text-editor-main .film-text-editor-body { flex: 1 1 auto; min-width: 0; }
.film-text-editor-main .film-rich-surface { min-height: 0; }
.film-export-menu {
    position: absolute; z-index: 60;
    min-width: 180px; padding: 5px;
    border: 1px solid var(--home-line-strong); border-radius: 10px;
    background: var(--home-surface); box-shadow: var(--home-shadow);
    display: flex; flex-direction: column; gap: 2px;
}
.film-export-menu button {
    height: 34px; padding: 0 12px; border: 0; border-radius: 7px;
    background: transparent; color: var(--home-muted); font-size: 13px; text-align: left; cursor: pointer;
}
.film-export-menu button:hover { background: rgba(255, 255, 255, 0.06); color: var(--home-text); }

.film-text-editor-eyebrow {
    display: block;
    margin-bottom: 7px;
    color: var(--home-faint);
    font-size: 11px;
    font-weight: 760;
}

.film-text-editor-body {
    flex: 1;
    min-height: 0;
}

.film-rich-editor {
    height: 100%;
    min-height: 100%;
}

.film-rich-surface {
    width: 100%;
    height: 100%;
    min-height: 520px;
    overflow: auto;
    padding: 24px 26px;
    background: rgba(255, 255, 255, 0.018);
    color: var(--home-text);
    outline: none;
    font-size: 13px;
    line-height: 1.72;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.34) transparent;
}

.film-rich-surface:empty::before {
    color: var(--home-faint);
}

.film-rich-surface h1,
.film-rich-surface h2,
.film-rich-surface h3 {
    color: var(--home-text);
}

.film-rich-surface hr {
    border-top-color: var(--home-line);
}

.film-text-editor-textarea {
    width: 100%;
    height: 100%;
    min-height: 520px;
    display: block;
    padding: 18px 22px;
    border: 0;
    background: rgba(255, 255, 255, 0.018);
    color: var(--home-text);
    outline: none;
    resize: none;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 12px;
    line-height: 1.65;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.34) transparent;
}

.film-detail-actions,
.film-text-editor-actions {
    flex: 0 0 auto;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 9px 14px;
    border-top: 1px solid var(--home-line);
    background: rgba(255, 255, 255, 0.018);
}

.film-detail-actions {
    margin: 4px -2px -4px;
}

.film-detail-actions.has-generation-settings {
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    min-height: 58px;
    padding-top: 6px;
    padding-bottom: 6px;
}

.film-detail-actions.has-generation-settings .film-detail-generation-settings {
    flex: 1 1 auto;
    max-width: 620px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
}

.film-detail-actions.has-generation-settings .film-detail-generation-settings.is-short-video-generation {
    max-width: 496px;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    min-width: 0;
}

.film-short-video-generation-group {
    flex: 0 1 416px;
    min-width: 0;
}

.film-short-video-generation-label {
    display: block;
    margin-bottom: 3px;
    color: var(--home-faint);
    font-size: 9.5px;
    font-weight: 760;
}

.film-short-video-parameter-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.film-short-video-model-toggle,
.film-short-video-config-toggle {
    position: relative;
    min-width: 0;
}

.film-short-video-model-toggle {
    flex: 0 0 158px;
}

.film-short-video-config-toggle {
    flex: 0 1 252px;
}

.film-short-video-model-toggle .film-detail-generation-select > span {
    display: none;
}

.film-short-video-model-toggle .film-detail-select-field.is-compact {
    background: rgba(255, 255, 255, 0.034);
}

.film-short-video-model-toggle .film-detail-select-field.is-compact .film-detail-select-button {
    padding: 0 8px;
}

.film-short-video-config-trigger {
    width: 100%;
    min-height: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 9px;
    border: 1px solid var(--home-line);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.034);
    color: var(--home-text);
    font-size: 11.5px;
    font-weight: 760;
    cursor: pointer;
}

.film-short-video-config-trigger:hover,
.film-short-video-config-trigger:focus-visible,
.film-short-video-config-toggle.is-open .film-short-video-config-trigger {
    border-color: var(--home-accent-line);
    background: rgba(251, 146, 60, 0.1);
    color: var(--home-text);
    outline: none;
}

.film-short-video-config-summary {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
}

.film-short-video-audio-state,
.film-short-video-config-caret {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--home-muted);
}

.film-short-video-audio-state svg,
.film-short-video-config-caret svg {
    width: 14px;
    height: 14px;
}

.film-short-video-config-panel {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    z-index: 80;
    width: 254px;
    padding: 10px;
    border: 1px solid var(--home-line-strong);
    border-radius: 11px;
    background: rgba(17, 21, 28, 0.98);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
    transform: translateX(-50%);
}

.film-short-video-param-section + .film-short-video-param-section {
    margin-top: 8px;
}

.film-short-video-param-title {
    margin-bottom: 6px;
    color: var(--home-faint);
    font-size: 10.5px;
    font-weight: 650;
}

.film-short-video-param-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.film-short-video-mode-row.video-workflow-config-options,
.film-short-video-audio-row.video-workflow-config-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.film-short-video-resolution-row.video-workflow-config-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.film-short-video-duration-row.video-workflow-config-options {
    width: 100%;
    height: 31px;
    display: flex;
    flex-wrap: nowrap;
    gap: 0;
    overflow-x: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
    cursor: grab;
    touch-action: pan-x;
    user-select: none;
    padding: 2px;
    border: 1px solid var(--home-line);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.045);
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%);
}

.film-short-video-duration-row::-webkit-scrollbar {
    display: none;
}

.film-short-video-duration-row.is-dragging {
    cursor: grabbing;
}

.film-short-video-duration-row:not(.can-scroll-left) {
    -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 18px), transparent 100%);
    mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 18px), transparent 100%);
}

.film-short-video-duration-row:not(.can-scroll-right) {
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 100%);
}

.film-short-video-duration-row:not(.can-scroll-left):not(.can-scroll-right) {
    -webkit-mask-image: none;
    mask-image: none;
}

.film-short-video-duration-row .film-short-video-param-option {
    flex: 0 0 41px;
    min-width: 41px;
    min-height: 25px;
    height: 25px;
    padding: 0 6px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: rgba(243, 245, 250, 0.58);
}

.film-short-video-duration-row .film-short-video-param-option:hover,
.film-short-video-duration-row .film-short-video-param-option.is-active {
    background: rgba(255, 255, 255, 0.13);
    color: #fff;
}

.film-short-video-param-option {
    min-height: 27px;
    padding: 0 10px;
    border: 1px solid var(--home-line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--home-muted);
    font-size: 11.5px;
    font-weight: 740;
    cursor: pointer;
}

.film-short-video-param-option:hover,
.film-short-video-param-option.is-active {
    border-color: var(--home-accent-line);
    background: rgba(251, 146, 60, 0.18);
    color: var(--home-text);
}

.film-short-video-ratio-grid .film-short-video-param-option {
    min-width: 48px;
    padding: 0 8px;
}

.film-detail-action-buttons {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.film-detail-actions button,
.film-text-editor-actions button {
    min-height: 30px;
    padding: 0 12px;
    border-color: var(--home-line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.028);
    font-size: 12px;
    font-weight: 760;
}

.film-detail-actions button:hover,
.film-detail-actions button:focus-visible,
.film-text-editor-actions button:hover,
.film-text-editor-actions button:focus-visible {
    border-color: var(--home-line-strong);
    background: rgba(255, 255, 255, 0.06);
    color: var(--home-text);
    outline: none;
}

.film-detail-actions .film-text-editor-save,
.film-text-editor-actions .film-text-editor-save {
    border-color: var(--home-accent-line);
    background: var(--home-accent-soft);
    color: var(--home-accent);
}

.film-detail-generation-grid .film-detail-generation-run,
.film-detail-generation-settings.is-short-video-generation .film-detail-generation-run,
.film-detail-actions .film-detail-canvas-send {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}

.film-detail-generation-grid .film-detail-generation-run,
.film-detail-generation-settings.is-short-video-generation .film-detail-generation-run {
    min-width: 74px;
    min-height: 30px;
    border-color: rgba(251, 146, 60, 0.42);
    background: rgba(251, 146, 60, 0.12);
    color: var(--home-accent);
}

.film-detail-actions .film-detail-canvas-send {
    border-color: rgba(129, 140, 248, 0.42);
    background: rgba(129, 140, 248, 0.12);
    color: #c4b5fd;
}

.film-bottom-bar {
    height: 42px;
    flex: 0 0 auto;
    justify-content: flex-start;
    gap: 16px;
    padding: 0 20px;
    border-top: 1px solid var(--home-line);
    background: rgba(255, 255, 255, 0.018);
}

.film-bottom-prev,
.film-bottom-actions button {
    height: 28px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 9px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
}

.film-bottom-hint {
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--home-muted);
    font-size: 12px;
    line-height: 1.35;
}

.film-bottom-hint svg,
.film-bottom-hint strong {
    color: var(--home-accent);
}

.film-bottom-actions {
    gap: 7px;
}

body[data-octap-home-route="film"] .chat-float {
    right: 18px;
    bottom: 24px;
    left: auto;
    top: auto;
    z-index: 540;
    visibility: visible;
    pointer-events: auto;
}

body[data-octap-home-route="film"] .ai-assistant-v4 {
    z-index: 560;
}

.film-chip {
    min-height: 20px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 7px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.052);
    color: var(--home-muted);
    font-size: 11px;
    font-weight: 760;
    line-height: 1.2;
    vertical-align: top;
}

.film-chip + .film-chip {
    margin-left: 4px;
}

.film-chip.is-warm {
    color: var(--home-accent);
    background: var(--home-accent-soft);
}

.film-chip.is-purple {
    color: #b28cff;
    background: rgba(151, 105, 255, 0.12);
}

.film-chip.is-blue {
    color: #67a7ff;
    background: rgba(83, 145, 255, 0.13);
}

.film-chip.is-cyan {
    color: #6ad7ff;
    background: rgba(44, 177, 217, 0.13);
}

.film-chip.is-green {
    color: #7bdc9f;
    background: rgba(95, 191, 143, 0.12);
}

.film-chip.is-danger {
    color: #fca5a5;
    background: rgba(248, 113, 113, 0.14);
}

.film-chip.is-muted {
    color: var(--home-faint);
    background: rgba(255, 255, 255, 0.035);
}

.film-empty {
    color: var(--home-faint);
}

.count-pill {
    min-width: 20px;
    height: 18px;
    display: inline-grid;
    place-items: center;
    padding: 0 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
    color: inherit;
    font-size: 10px;
    line-height: 1;
}

.film-merge-button.is-disabled {
    opacity: .55;
}

body[data-theme="light"] .octap-film-board {
    background:
        linear-gradient(180deg, rgba(255, 168, 79, 0.035), transparent 130px),
        var(--home-bg);
}

body[data-theme="light"] .film-art-thumb,
body[data-theme="light"] .film-shot-card-thumb,
body[data-theme="light"] .film-clip-thumb,
body[data-theme="light"] .film-final-thumb {
    background: linear-gradient(145deg, #edf1f7, #dfe5ed);
}

body[data-theme="light"] .film-shot-table td,
body[data-theme="light"] .film-script-entry,
body[data-theme="light"] .film-chapter-card,
body[data-theme="light"] .film-art-card,
body[data-theme="light"] .film-clip-card,
body[data-theme="light"] .film-final-card {
    background: rgba(255, 255, 255, 0.58);
}

body[data-theme="light"] .film-detail-overlay {
    background: rgba(15, 23, 42, 0.28);
}

body[data-theme="light"] .film-detail-panel {
    background: rgba(248, 250, 252, 0.98);
}

body[data-theme="light"] .film-select-menu {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.16);
}

body[data-theme="light"] .film-detail-grid > div,
body[data-theme="light"] .film-detail-grid .film-detail-field,
body[data-theme="light"] .film-detail-panel > .film-detail-field,
body[data-theme="light"] .film-detail-block,
body[data-theme="light"] .film-detail-prompts,
body[data-theme="light"] .film-detail-advanced,
body[data-theme="light"] .film-detail-advanced-grid .film-detail-field {
    background: rgba(255, 255, 255, 0.66);
}

body[data-theme="light"] .film-detail-input,
body[data-theme="light"] .film-detail-prompt-input {
    color: #111827;
}

body[data-theme="light"] .film-detail-select-button {
    color: #111827;
}

body[data-theme="light"] .film-detail-select-menu,
body[data-theme="light"] .film-art-context-menu {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.16);
}

body[data-theme="light"] .film-detail-generation-settings,
body[data-theme="light"] .film-detail-select-field.is-compact {
    background: rgba(248, 250, 252, 0.88);
    color: #111827;
}

body[data-theme="light"] .film-text-editor-panel {
    background: rgba(248, 250, 252, 0.98);
}

body[data-theme="light"] .film-text-editor-toolbar,
body[data-theme="light"] .film-text-editor-actions,
body[data-theme="light"] .film-detail-actions {
    background: rgba(255, 255, 255, 0.62);
}

body[data-theme="light"] .film-rich-surface {
    background: rgba(255, 255, 255, 0.72);
    color: #111827;
}

body[data-theme="light"] .film-rich-surface h1,
body[data-theme="light"] .film-rich-surface h2,
body[data-theme="light"] .film-rich-surface h3 {
    color: #111827;
}

body[data-theme="light"] .film-text-editor-textarea {
    background: rgba(255, 255, 255, 0.72);
    color: #111827;
}

body[data-theme="light"] .film-art-placeholder {
    color: #1f2937;
    opacity: .82;
    text-shadow: none;
}

body[data-theme="light"] .film-shot-placeholder,
body[data-theme="light"] .film-final-thumb > span {
    color: rgba(51, 65, 85, 0.28);
}

body[data-theme="light"] .film-shot-card-thumb.is-generated {
    background: linear-gradient(145deg, #ecfdf5, #dde7ee);
}

body[data-theme="light"] .film-art-thumb button,
body[data-theme="light"] .film-cover-upload-button,
body[data-theme="light"] .film-final-thumb button {
    border-color: rgba(100, 116, 139, 0.24);
    background: rgba(255, 255, 255, 0.78);
    color: #475569;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

body[data-theme="light"] .film-art-generate-button,
body[data-theme="light"] .film-shot-generate-button {
    background: rgba(255, 247, 237, 0.9);
    color: #b45309;
}

body[data-theme="light"] .film-art-thumb button:hover,
body[data-theme="light"] .film-cover-upload-button:hover,
body[data-theme="light"] .film-final-thumb button:hover {
    border-color: var(--home-accent-line);
    background: rgba(255, 247, 237, 0.9);
    color: var(--home-accent);
}

body[data-theme="light"] .film-asset-reference-thumb,
body[data-theme="light"] .film-asset-reference-more,
body[data-theme="light"] .film-asset-reference-add {
    border-color: rgba(100, 116, 139, 0.2);
    background: rgba(255, 255, 255, 0.74);
    color: #64748b;
}

body[data-theme="light"] .film-asset-reference-add:hover,
body[data-theme="light"] .film-asset-reference-add:focus-visible {
    border-color: var(--home-accent-line);
    background: rgba(255, 247, 237, 0.9);
    color: var(--home-accent);
}

body[data-theme="light"] .film-short-video-thumb.has-output button {
    border-color: rgba(15, 23, 42, 0.18);
    background: rgba(255, 255, 255, 0.68);
}

body[data-theme="light"] .film-short-preview-stage,
body[data-theme="light"] .film-short-preview-prompt,
body[data-theme="light"] .film-short-preview-meta span {
    background: rgba(255, 255, 255, 0.62);
}

body[data-theme="light"] .film-card-icon-button {
    color: #64748b;
}

body[data-theme="light"] .film-card-icon-button:hover {
    background: rgba(15, 23, 42, 0.04);
    color: #1f2937;
}

body[data-theme="light"] .film-shot-card-duration {
    background: rgba(15, 23, 42, 0.82);
    color: #ffffff;
}

body[data-theme="light"] .film-shot-card-type {
    border-color: rgba(59, 130, 246, 0.24);
    background: rgba(59, 130, 246, 0.11);
    color: #3b82f6;
}

body[data-theme="light"] .film-chip.is-muted {
    background: rgba(15, 23, 42, 0.05);
    color: #64748b;
}

@media (max-width: 1160px) {
    .film-detail-panel.is-reference-layout {
        width: calc(100vw - 32px);
    }

    .film-detail-reference-layout {
        grid-template-columns: minmax(224px, 260px) minmax(0, 1fr);
        gap: 12px;
    }

    .film-script-page {
        flex-direction: column;
        overflow: auto;
    }

    .film-script-panel {
        width: auto;
        flex: 0 0 auto;
        min-width: 0;
        max-height: 52vh;
        border-right: 0;
        border-bottom: 1px solid var(--home-line);
    }

    .film-chapter-panel {
        min-height: 520px;
    }

    .film-chapter-list {
        grid-template-columns: 1fr;
    }

    .film-clips-view {
        grid-template-columns: 1fr;
    }

}

@media (max-width: 760px) {
    .octap-film-view {
        height: auto;
        min-height: calc(100vh - 60px);
    }

    .octap-film-board {
        min-height: calc(100vh - 60px);
    }

    .film-subbar,
    .film-section-toolbar,
    .film-panel-header,
    .film-bottom-bar {
        align-items: flex-start;
        flex-direction: column;
        height: auto;
        padding: 10px 14px;
    }

    .film-sub-right,
    .film-toolbar-right,
    .film-header-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .film-stepper {
        flex-wrap: wrap;
    }

    .film-main {
        overflow: visible;
    }

    .film-step-page {
        min-height: 720px;
    }

    .film-script-list,
    .film-chapter-list,
    .film-art-grid,
    .film-storyboard-content,
    .film-final-grid {
        overflow: visible;
    }

    .film-toolbar-left,
    .film-toolbar-right {
        flex-wrap: wrap;
    }

    .film-shot-card-grid,
    .film-art-grid,
    .film-final-grid,
    .film-clips-grid {
        grid-template-columns: 1fr;
        padding: 14px;
    }

    .film-bottom-hint {
        align-items: flex-start;
    }

    .film-detail-overlay {
        align-items: flex-start;
        padding: 16px;
    }

    .film-detail-panel {
        width: calc(100vw - 32px);
        max-height: calc(100vh - 32px);
        padding: 16px;
    }

    .film-text-editor-panel {
        height: calc(100vh - 32px);
        padding: 0;
    }

    .film-rich-surface,
    .film-text-editor-textarea {
        min-height: 360px;
    }

    .film-text-editor-toolbar {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .film-detail-head {
        align-items: flex-start;
    }

    .film-detail-reference-layout {
        grid-template-columns: 1fr;
    }

    .film-detail-reference-pane .film-detail-reference-chips {
        max-height: none;
    }

    .film-detail-grid {
        grid-template-columns: 1fr;
    }

    .film-detail-meta-grid {
        grid-template-columns: 1fr;
    }

    .film-detail-advanced-grid {
        grid-template-columns: 1fr;
    }

    .film-detail-generation-grid {
        grid-template-columns: 1fr 1fr;
    }

    .film-detail-actions.has-generation-settings {
        align-items: stretch;
        flex-direction: column;
    }

    .film-detail-actions.has-generation-settings .film-detail-generation-settings.is-short-video-generation {
        align-items: stretch;
        max-width: none;
    }

    .film-short-video-parameter-bar {
        flex-wrap: wrap;
    }

    .film-short-video-model-toggle,
    .film-short-video-config-toggle {
        flex: 1 1 220px;
    }

    .film-short-video-config-panel {
        left: 0;
        width: min(254px, calc(100vw - 40px));
        transform: none;
    }

    .film-detail-actions.has-generation-settings .film-detail-generation-settings {
        max-width: none;
    }
}
