refactor: 使用 Naive UI 重构后台布局与黑白双主题

This commit is contained in:
GouJ
2026-09-01 16:31:21 +08:00
parent 55516537bf
commit db8c176b55
51 changed files with 3277 additions and 2442 deletions
+574
View File
@@ -0,0 +1,574 @@
/* 管理后台视口边界:document 不滚动,各个工作区和面板独立滚动。 */
:root {
--app-ink: #202020;
--app-muted: #737373;
--app-surface: #ffffff;
--app-subtle: #f5f5f5;
--app-border: #e5e5e5;
--app-inverse: #ffffff;
--app-shadow: #00000018;
--app-danger: #b42318;
--app-success: #447454;
}
:root[data-theme='dark'] {
--app-ink: #ededed;
--app-muted: #a3a3a3;
--app-surface: #1c1c1c;
--app-subtle: #252525;
--app-border: #363636;
--app-inverse: #171717;
--app-shadow: #00000055;
--app-danger: #ee8b83;
--app-success: #91ba9b;
}
html,
body,
#app,
.app-provider {
height: 100%;
min-height: 0;
overflow: hidden;
}
html {
background: var(--app-surface);
}
body {
margin: 0;
}
.admin-layout {
height: 100dvh;
overflow: hidden;
}
.admin-main {
min-width: 0;
height: 100%;
}
.admin-main > .n-layout-scroll-container {
height: 100%;
display: flex;
flex-direction: column;
overflow: hidden;
}
.admin-sider {
height: 100%;
}
.admin-brand {
display: flex;
align-items: center;
gap: 12px;
height: 74px;
padding: 0 20px;
color: var(--app-ink);
white-space: nowrap;
}
.admin-brand > svg {
flex-shrink: 0;
}
.admin-brand span {
font-size: 15px;
font-weight: 600;
}
.admin-brand small {
display: block;
font-size: 8px;
letter-spacing: 1px;
font-weight: 400;
color: var(--app-muted);
margin-top: 3px;
}
.admin-topbar {
display: flex;
align-items: center;
justify-content: space-between;
flex-shrink: 0;
height: 56px;
padding: 0 20px;
gap: 12px;
}
.theme-select {
width: 120px;
}
.admin-content {
flex: 1;
min-height: 0;
min-width: 0;
overflow: hidden;
outline: none;
}
.project-frame {
display: flex;
flex-direction: column;
height: 100%;
min-height: 0;
overflow: hidden;
}
.project-header {
flex-shrink: 0;
padding: 14px 24px 0;
background: var(--app-surface);
border-bottom: 1px solid var(--app-border);
}
.project-header .n-page-header__main,
.project-header .n-page-header__title {
min-width: 0;
}
.project-title {
max-width: min(58vw, 980px);
font-size: 16px;
font-weight: 600;
}
.project-tabs {
margin-top: 8px;
}
.project-tabs .n-tabs-nav {
border: 0;
}
.project-notices {
flex-shrink: 0;
max-height: 100px;
overflow: auto;
padding: 8px 24px;
display: grid;
gap: 5px;
}
.project-notices .n-alert {
padding: 7px 12px;
font-size: 12px;
}
.project-view {
flex: 1;
min-height: 0;
overflow: hidden;
}
.workspace-page {
height: 100%;
display: flex;
flex-direction: column;
min-height: 0;
overflow: hidden;
}
.workspace-heading {
flex-shrink: 0;
padding: 16px 24px 12px;
max-height: 35%;
overflow: auto;
overscroll-behavior: contain;
}
.workspace-heading h2 {
font-size: 16px;
}
.workspace-heading .text-sm {
font-size: 12px;
}
.workspace-heading .production-controls {
gap: 12px;
}
.workspace-heading .n-input-number {
width: 100%;
}
.workspace-scroll {
flex: 1;
min-height: 0;
}
.workspace-scroll-content {
padding: 4px 24px 24px;
}
.workspace-scroll > .n-scrollbar-container {
overscroll-behavior: contain;
}
.workspace-split {
display: flex;
flex-direction: column;
flex: 1;
min-height: 0;
overflow: hidden;
padding: 4px 24px 20px;
gap: 12px;
}
.workspace-split > .my-6 {
margin: 0;
flex-shrink: 0;
}
.workspace-overview {
flex-shrink: 0;
max-height: 42%;
overflow: auto;
padding: 10px 14px;
background: var(--app-surface);
border: 1px solid var(--app-border);
border-radius: 6px;
}
.workspace-feedback {
flex-shrink: 0;
max-height: 24%;
overflow: auto;
}
.workspace-feedback .n-alert + .n-alert {
margin-top: 8px;
}
.workspace-split > .n-alert {
flex-shrink: 0;
max-height: 24%;
overflow: auto;
}
.script-section {
flex: 1;
display: flex;
flex-direction: column;
min-height: 0;
}
.script-section > :first-child {
flex-shrink: 0;
}
.script-section > :first-child .n-tabs {
flex: 1;
min-width: 220px;
width: auto;
}
.script-section .content-with-history {
flex: 1;
height: auto;
min-height: 0;
}
.script-workspace-page .workspace-split > :not(.script-section) {
flex-shrink: 0;
}
.storyboard-workspace-page .storyboard-workspace {
flex: 1;
height: auto;
min-height: 0;
overflow: hidden;
}
.storyboard-coverage {
flex-shrink: 0;
}
.overview-content {
padding-bottom: 8px;
}
.workspace-loading {
display: grid;
place-content: center;
height: 100%;
}
.production-workspace,
.identity-workspace {
flex: 1;
min-height: 0;
align-items: stretch;
overflow: hidden;
}
.production-shot-list {
max-height: none;
overflow: auto;
min-height: 0;
}
.production-workspace > article {
overflow: auto;
min-height: 0;
overscroll-behavior: contain;
}
.identity-workspace > aside {
display: flex;
flex-direction: column;
min-height: 0;
overflow: hidden;
}
.identity-workspace {
grid-template-columns: 220px minmax(0, 1fr);
}
.identity-workspace > div {
min-height: 0;
overflow: auto;
overscroll-behavior: contain;
}
.identity-subject-list {
max-height: none;
min-height: 0;
flex: 1;
}
.storyboard-workspace {
height: clamp(360px, 65dvh, 850px);
min-height: 0;
}
.storyboard-workspace > article,
.storyboard-workspace .shot-list {
overflow: auto;
min-height: 0;
height: 100%;
max-height: none;
}
.content-with-history {
height: clamp(360px, 66dvh, 850px);
min-height: 0;
grid-template-columns: minmax(0, 1fr) 207px;
}
.content-with-history > main,
.content-with-history > aside,
.script-page {
min-height: 0;
overflow: auto;
overscroll-behavior: contain;
}
.script-workspace {
min-height: 0;
}
.episode-list {
max-height: none;
min-height: 0;
}
.project-table-area {
flex: 1;
min-height: 0;
}
.project-data-table {
height: 100%;
}
.project-data-table .n-data-table-base-table {
flex: 1;
min-height: 0;
}
.project-index-heading {
margin: 0;
}
.project-index-heading h1 {
font-size: 22px;
font-weight: 600;
}
.project-index-toolbar {
display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
gap: 12px;
margin-bottom: 4px;
}
.project-search {
width: 240px;
}
.project-name-cell {
display: block;
min-width: 0;
}
.project-name-cell strong,
.project-name-cell small {
display: block;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.project-name-cell small {
color: var(--app-muted);
margin-top: 4px;
font-size: 11px;
}
.app-dialog {
max-width: calc(100vw - 32px);
max-height: calc(100dvh - 32px);
}
.app-dialog .n-card-header {
flex-shrink: 0;
}
.dialog-body-scroll {
max-height: calc(100dvh - 154px);
}
.app-dialog .n-card__content {
min-height: 0;
}
.dialog-footer {
display: flex;
justify-content: flex-end;
gap: 8px;
padding-top: 16px;
}
.asset-image .n-image {
width: 100%;
height: 100%;
min-height: 0;
display: flex;
justify-content: center;
}
.asset-image .n-image img {
width: 100%;
height: 100%;
object-fit: contain;
}
.n-button__content {
gap: 6px;
}
.n-button:disabled {
opacity: 1;
}
.n-button.episode-link,
.n-button.shot-link,
.n-button.production-shot-link,
.n-button.identity-subject-item,
.n-button.casting-item,
.n-button.image-history-item {
height: auto;
white-space: normal;
}
.n-button.episode-link .n-button__content,
.n-button.shot-link .n-button__content {
width: 100%;
justify-content: flex-start;
text-align: left;
}
.n-button.production-shot-link .n-button__content,
.n-button.identity-subject-item .n-button__content,
.n-button.image-history-item .n-button__content {
display: block;
width: 100%;
text-align: left;
overflow: hidden;
}
.n-button.casting-item .n-button__content {
width: 100%;
justify-content: space-between;
}
.n-button.episode-link .n-button__border,
.n-button.shot-link .n-button__border,
.n-button.production-shot-link .n-button__border,
.n-button.identity-subject-item .n-button__border {
display: none;
}
.search-field {
padding: 0;
border: 0;
background: transparent;
min-width: 180px;
}
.search-field input {
width: 100%;
font-size: inherit;
}
.select-control {
min-width: 130px;
}
.n-checkbox {
align-items: flex-start;
}
.n-checkbox .n-checkbox__label {
white-space: normal;
}
.n-alert {
line-height: 1.8;
}
.n-collapse.panel {
padding: 16px;
}
.n-table.project-table th {
background: var(--app-subtle);
}
.empty-state {
min-height: 200px;
padding: 40px 20px;
}
.production-video {
background: #080808;
}
.button-primary {
color: var(--app-inverse);
}
.skip-link:focus {
z-index: 3000;
}
@media (max-width: 1000px) {
.project-title {
max-width: 44vw;
}
.production-controls {
grid-template-columns: minmax(130px, 1fr) 90px;
}
.content-with-history {
grid-template-columns: minmax(0, 1fr) 180px;
}
}
@media (max-width: 760px) {
.admin-topbar {
padding: 0 10px;
}
.admin-sider:not(.n-layout-sider--collapsed) {
position: absolute;
top: 56px;
bottom: 0;
z-index: 20;
box-shadow: 6px 0 24px var(--app-shadow);
}
.project-header {
padding: 10px 12px 0;
}
.project-title {
max-width: 37vw;
font-size: 14px;
}
.project-header .n-page-header__extra {
margin-left: 6px;
}
.project-header .n-tag {
display: none;
}
.workspace-heading {
padding: 12px;
}
.workspace-scroll-content,
.workspace-split {
padding: 0 12px 12px;
}
.workspace-heading .production-controls {
grid-template-columns: minmax(100px, 1fr) 80px;
}
.production-workspace {
grid-template-columns: minmax(0, 1fr);
grid-template-rows: 110px minmax(0, 1fr);
}
.production-shot-list {
display: flex;
overflow-x: auto;
height: 110px;
}
.production-shot-link {
flex-shrink: 0;
}
.identity-workspace {
grid-template-columns: minmax(0, 1fr);
grid-template-rows: 180px minmax(0, 1fr);
gap: 10px;
}
.storyboard-workspace {
grid-template-columns: 120px minmax(0, 1fr);
}
.storyboard-controls {
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.content-with-history {
grid-template-columns: minmax(0, 1fr);
grid-template-rows: minmax(0, 1fr) 130px;
}
.history-panel {
overflow: auto;
min-height: 0;
}
.script-workspace {
grid-template-columns: 105px minmax(0, 1fr);
}
.episode-list {
display: block;
padding: 0;
border-right: 1px solid var(--app-border);
}
.episode-link {
width: 100%;
}
.script-page {
padding: 18px;
}
.project-search {
width: 100%;
}
.project-index-toolbar .n-radio-group {
width: 100%;
}
.production-pipeline {
grid-template-columns: 1fr;
}
}