2026-07-18 23:20:06 +08:00
< script setup lang = "ts" >
import { computed , onBeforeUnmount , onMounted , ref , watch } from "vue"
import { endpoints } from "../../../../shared/api/endpoints"
import { deleteJson , getJson , postJson } from "../../../../shared/api/client"
import type {
AdvancedMaterial ,
AdvancedMaterialDecisionRequest ,
AdvancedMaterialImport ,
AdvancedMaterialUploadRequest ,
AdvancedMaterialUploadResult ,
AdvancedStyleConsensus ,
AdvancedStyleSetUploadRequest ,
AdvancedStyleSource ,
AdvancedStyleValidationCase ,
AdvancedMaterialValidationAttempt ,
} from "../../../../shared/types/advanced-material"
import type { MaterialCategory } from "../../../../shared/types/material"
import type { MediaFetchResult , MediaSignResult } from "../../../../shared/types/storage"
import { materialCategoryLabel } from "../../material-labels"
import ImagePreviewDialog from "../../components/ImagePreviewDialog.vue"
import {
advancedAttemptStatusMeta ,
advancedImportStatusMeta ,
advancedMaterialErrorMessage ,
firstRecord ,
listItems ,
sortAdvancedImports ,
sortAdvancedMaterials ,
sortValidationAttempts ,
type MaterialLibraryView ,
} from "./advanced-material-state"
const MAX _UPLOAD _BYTES = 20 * 1024 * 1024
const MIN _STYLE _IMAGES = 2
const MAX _STYLE _IMAGES = 8
const POLL _INTERVAL _MS = 4500
interface StyleUploadDraft {
id : string
file : File
dataUrl : string
source : AdvancedMaterialUploadRequest [ "upload_source" ]
}
const props = withDefaults ( defineProps < {
mode : Extract < MaterialLibraryView , " advanced " | " advanced -import " >
categories : MaterialCategory [ ]
canManage ? : boolean
} > ( ) , {
canManage : true ,
} )
const emit = defineEmits < {
navigate : [ view : MaterialLibraryView ]
changed : [ ]
} > ( )
const imports = ref < AdvancedMaterialImport [ ] > ( [ ] )
const materials = ref < AdvancedMaterial [ ] > ( [ ] )
const attempts = ref < AdvancedMaterialValidationAttempt [ ] > ( [ ] )
const selectedImportId = ref ( "" )
const selectedImportDetail = ref < AdvancedMaterialImport | null > ( null )
2026-07-20 17:57:02 +08:00
const reviewWorkbenchOpen = ref ( false )
2026-07-18 23:20:06 +08:00
const loading = ref ( false )
const detailLoading = ref ( false )
const actionBusy = ref ( "" )
const deleteConfirmImportId = ref ( "" )
const error = ref ( "" )
const message = ref ( "" )
const signedMediaUrls = ref < Record < string , string > > ( { } )
const pollBusy = ref ( false )
const previewImageSrc = ref ( "" )
const previewImageTitle = ref ( "" )
const fileInput = ref < HTMLInputElement | null > ( null )
const uploadFile = ref < File | null > ( null )
const uploadDataUrl = ref ( "" )
const uploadSource = ref < AdvancedMaterialUploadRequest [ " upload_source " ] > ( "file" )
const styleUploadDrafts = ref < StyleUploadDraft [ ] > ( [ ] )
const uploadDisplayName = ref ( "" )
const uploadCategoryId = ref ( "" )
const adjustmentText = ref ( "" )
const validationInstructionText = ref ( "" )
const decisionNotes = ref ( "" )
const fidelityPercent = ref ( 85 )
const acceptConfirmed = ref ( false )
2026-07-20 17:57:02 +08:00
const validationReferenceEnabled = ref ( false )
const validationReferenceSourceId = ref ( "" )
2026-07-18 23:20:06 +08:00
let pollTimer = 0
const ownedMediaObjectUrls = new Set < string > ( )
const rootCategories = computed ( ( ) =>
props . categories
. filter ( ( category ) => ! category . parent _id && category . category _type !== "accessory_group" )
. sort ( ( left , right ) => left . sort _order - right . sort _order || left . name . localeCompare ( right . name , "zh-CN" ) ) ,
)
const selectedUploadCategory = computed ( ( ) =>
rootCategories . value . find ( ( category ) => category . category _id === uploadCategoryId . value ) ? ? null ,
)
const styleSetUploadEnabled = computed ( ( ) => isStyleCategory ( selectedUploadCategory . value ) )
2026-07-20 17:57:02 +08:00
const isVisibleImport = ( item : AdvancedMaterialImport ) => ! [ "accepted" , "archived" ] . includes ( normalizeStatus ( item . status ) )
const sortedImports = computed ( ( ) => sortAdvancedImports ( imports . value . filter ( isVisibleImport ) ) )
2026-07-18 23:20:06 +08:00
const sortedMaterials = computed ( ( ) => sortAdvancedMaterials ( materials . value ) )
const selectedImport = computed ( ( ) =>
selectedImportDetail . value ? . import _id === selectedImportId . value
? selectedImportDetail . value
: imports . value . find ( ( item ) => item . import _id === selectedImportId . value ) ? ? null ,
)
const sortedAttempts = computed ( ( ) => sortValidationAttempts ( attempts . value ) )
const currentAttempt = computed ( ( ) => {
const currentId = selectedImport . value ? . current _attempt _id
return sortedAttempts . value . find ( ( attempt ) => attempt . attempt _id === currentId ) ? ? sortedAttempts . value [ 0 ] ? ? null
} )
const selectedStyleSet = computed ( ( ) => isStyleSetImport ( selectedImport . value ) )
const styleSources = computed ( ( ) =>
[ ... ( selectedImport . value ? . sources ? ? [ ] ) ] . sort ( ( left , right ) =>
Number ( left . sort _order || 0 ) - Number ( right . sort _order || 0 ) ,
) ,
)
const activeStyleSources = computed ( ( ) => styleSources . value . filter ( ( source ) => ! source . excluded ) )
const recognizedStyleSources = computed ( ( ) =>
activeStyleSources . value . filter ( ( source ) => [ "recognized" , "completed" , "succeeded" ] . includes ( normalizeStatus ( source . status ) ) ) ,
)
2026-07-20 17:57:02 +08:00
const defaultValidationReferenceSourceId = computed ( ( ) => {
const representatives = styleConsensus . value ? . representative _source _ids ? ? [ ]
const activeIds = new Set ( recognizedStyleSources . value . map ( ( source ) => source . source _id ) )
const fromRepresentative = representatives . find ( ( sourceId ) => activeIds . has ( sourceId ) )
if ( fromRepresentative ) return fromRepresentative
const primary = recognizedStyleSources . value . find ( ( source ) => source . is _primary )
return primary ? . source _id || recognizedStyleSources . value [ 0 ] ? . source _id || ""
} )
const effectiveValidationReferenceSourceId = computed ( ( ) => {
if ( ! validationReferenceEnabled . value ) return ""
const selected = validationReferenceSourceId . value
if ( selected && recognizedStyleSources . value . some ( ( source ) => source . source _id === selected ) ) return selected
return defaultValidationReferenceSourceId . value
} )
2026-07-18 23:20:06 +08:00
const styleConsensus = computed ( ( ) => selectedImport . value ? . consensus ? ? null )
const styleValidationCases = computed ( ( ) => {
const cases = currentAttempt . value ? . validation _cases ? . length
? currentAttempt . value . validation _cases
: selectedImport . value ? . validation _cases ? ? [ ]
const rank : Record < string , number > = { portrait : 0 , fullbody : 1 , novel _scene : 2 }
return [ ... cases ] . sort ( ( left , right ) => ( rank [ left . scenario ] ? ? 99 ) - ( rank [ right . scenario ] ? ? 99 ) )
} )
const selectedStatus = computed ( ( ) => advancedImportStatusMeta ( selectedImport . value ? . status ? ? "" ) )
const currentAttemptStatus = computed ( ( ) => advancedAttemptStatusMeta ( currentAttempt . value ? . status ? ? "" ) )
const activeImportCount = computed ( ( ) =>
imports . value . filter ( ( item ) => advancedImportStatusMeta ( item . status ) . busy ) . length ,
)
const reviewImportCount = computed ( ( ) =>
imports . value . filter ( ( item ) =>
[ "pending_review" , "awaiting_review" , "rejected" , "adjustment_required" ] . includes ( normalizeStatus ( item . status ) ) ,
) . length ,
)
const failedImportCount = computed ( ( ) =>
imports . value . filter ( ( item ) =>
[ "failed" , "recognition_failed" , "validation_failed" ] . includes ( normalizeStatus ( item . status ) ) ,
) . length ,
)
const uploadReady = computed ( ( ) =>
Boolean (
props . canManage &&
( styleSetUploadEnabled . value
? styleUploadDrafts . value . length >= MIN _STYLE _IMAGES && styleUploadDrafts . value . length <= MAX _STYLE _IMAGES
: uploadFile . value && uploadDataUrl . value ) &&
uploadDisplayName . value . trim ( ) &&
uploadCategoryId . value &&
! actionBusy . value ,
) ,
)
const canStartValidation = computed ( ( ) => {
const item = selectedImport . value
if ( ! item || ! props . canManage || actionBusy . value ) return false
if ( selectedStyleSet . value ) return false
if ( [
"accepted" ,
"archived" ,
"cancelled" ,
"recognition_queued" ,
"recognizing" ,
"pending_recognition" ,
"validation_queued" ,
"validating" ,
"awaiting_review" ,
] . includes ( normalizeStatus ( item . status ) ) ) {
return false
}
return Boolean ( item . recognition _prompt && ! currentAttemptStatus . value . busy )
} )
const canReviewCurrentAttempt = computed ( ( ) => {
const attempt = currentAttempt . value
if ( ! attempt || ! props . canManage || actionBusy . value ) return false
if ( selectedStyleSet . value ) {
return styleValidationCases . value . length === 3 && styleValidationCases . value . every ( ( item ) =>
[ "succeeded" , "completed" , "pending_review" , "awaiting_review" ] . includes ( normalizeStatus ( item . status ) ) &&
Boolean ( styleValidationCaseImageUrl ( item ) ) ,
)
}
return [ "succeeded" , "completed" , "pending_review" , "awaiting_review" ] . includes ( normalizeStatus ( attempt . status ) ) && Boolean ( attemptImageUrl ( attempt ) )
} )
const uploadPreview = computed ( ( ) => uploadDataUrl . value )
const canRunStyleConsensus = computed ( ( ) => Boolean (
selectedStyleSet . value &&
props . canManage &&
recognizedStyleSources . value . length >= MIN _STYLE _IMAGES &&
! [ "queued" , "running" ] . includes ( normalizeStatus ( styleConsensus . value ? . status ? ? "" ) ) &&
! [
"ready_for_validation" ,
"validating" ,
"validation_partial_failed" ,
"awaiting_review" ,
"accepted" ,
"cancelled" ,
"archived" ,
] . includes ( normalizeStatus ( selectedImport . value ? . status ? ? "" ) ) &&
! actionBusy . value ,
) )
const canEditStyleSources = computed ( ( ) => Boolean (
selectedStyleSet . value &&
( ! styleConsensus . value || [ "failed" , "cancelled" ] . includes ( normalizeStatus ( styleConsensus . value . status ) ) ) ,
) )
watch (
( ) => props . categories ,
( ) => {
if ( ! uploadCategoryId . value && rootCategories . value . length ) {
uploadCategoryId . value = rootCategories . value [ 0 ] . category _id
}
} ,
{ immediate : true } ,
)
watch ( styleSetUploadEnabled , ( enabled , previous ) => {
if ( enabled === previous ) return
if ( enabled && uploadFile . value && uploadDataUrl . value ) {
styleUploadDrafts . value = [ {
id : styleUploadId ( uploadFile . value ) ,
file : uploadFile . value ,
dataUrl : uploadDataUrl . value ,
source : uploadSource . value ,
} ]
uploadFile . value = null
uploadDataUrl . value = ""
return
}
if ( ! enabled && styleUploadDrafts . value . length ) {
const [ first , ... discarded ] = styleUploadDrafts . value
uploadFile . value = first . file
uploadDataUrl . value = first . dataUrl
uploadSource . value = first . source
styleUploadDrafts . value = [ ]
if ( discarded . length ) message . value = "当前分类只支持单图,已保留第一张图片。"
}
} )
watch (
( ) => props . mode ,
( mode ) => {
error . value = ""
message . value = ""
if ( mode === "advanced" && ! selectedImportId . value && sortedImports . value . length ) {
void selectImport ( sortedImports . value [ 0 ] . import _id )
}
} ,
)
watch ( selectedImportId , ( ) => {
closeImagePreview ( )
adjustmentText . value = ""
validationInstructionText . value = ""
decisionNotes . value = ""
fidelityPercent . value = 85
acceptConfirmed . value = false
} )
onMounted ( async ( ) => {
await refreshAll ( )
pollTimer = window . setInterval ( ( ) => {
if (
document . visibilityState === "visible" &&
shouldPoll ( ) &&
! pollBusy . value &&
! loading . value &&
! detailLoading . value &&
! actionBusy . value
) {
void pollActiveState ( )
}
} , POLL _INTERVAL _MS )
} )
onBeforeUnmount ( ( ) => {
if ( pollTimer ) window . clearInterval ( pollTimer )
for ( const url of ownedMediaObjectUrls ) URL . revokeObjectURL ( url )
ownedMediaObjectUrls . clear ( )
} )
async function refreshAll ( silent = false ) {
if ( ! silent ) loading . value = true
if ( ! silent ) error . value = ""
try {
const [ importPayload , materialPayload ] = await Promise . all ( [
props . canManage
? getJson < unknown > ( endpoints . advancedMaterialImports , { page : 1 , page _size : 100 } )
: Promise . resolve ( { items : [ ] } ) ,
getJson < unknown > ( endpoints . advancedMaterials , { page : 1 , page _size : 100 } ) ,
] )
2026-07-20 17:57:02 +08:00
imports . value = listItems < AdvancedMaterialImport > ( importPayload ) . map ( normalizeImport ) . filter ( isVisibleImport )
2026-07-18 23:20:06 +08:00
materials . value = listItems < AdvancedMaterial > ( materialPayload ) . map ( normalizeMaterial )
await resolveRecordMedia ( [ ... imports . value , ... materials . value ] )
if ( selectedImportId . value ) {
const exists = imports . value . some ( ( item ) => item . import _id === selectedImportId . value )
if ( exists ) await loadImportDetail ( selectedImportId . value , true )
2026-07-20 17:57:02 +08:00
else {
selectedImportId . value = ""
selectedImportDetail . value = null
if ( sortedImports . value . length ) await selectImport ( sortedImports . value [ 0 ] . import _id )
}
2026-07-18 23:20:06 +08:00
} else if ( sortedImports . value . length ) {
await selectImport ( sortedImports . value [ 0 ] . import _id )
}
} catch ( err ) {
if ( ! silent ) error . value = errorMessage ( err )
} finally {
if ( ! silent ) loading . value = false
}
}
async function pollActiveState ( ) {
if ( pollBusy . value ) return
pollBusy . value = true
try {
const importId = selectedImportId . value
const selectedWasBusy = selectedStateIsBusy ( )
if ( importId && selectedWasBusy ) {
await loadImportDetail ( importId , true )
const detail = selectedImportDetail . value
if ( detail ) {
imports . value = replaceImportSummary ( imports . value , detail )
}
if ( selectedWasBusy && ! selectedStateIsBusy ( ) ) {
await refreshAll ( true )
}
return
}
await refreshImportSummaries ( )
} catch {
// Poll failures are transient and should not replace the user's current
// page with an error state or trigger a visual reset.
} finally {
pollBusy . value = false
}
}
async function refreshImportSummaries ( ) {
if ( ! props . canManage ) return
const payload = await getJson < unknown > ( endpoints . advancedMaterialImports , { page : 1 , page _size : 100 } )
2026-07-20 17:57:02 +08:00
const nextItems = listItems < AdvancedMaterialImport > ( payload ) . map ( normalizeImport ) . filter ( isVisibleImport )
imports . value = mergeImportSummaries ( imports . value , nextItems ) . filter ( isVisibleImport )
2026-07-18 23:20:06 +08:00
const selectedSummary = imports . value . find ( ( item ) => item . import _id === selectedImportId . value )
if ( selectedImportDetail . value && selectedSummary ) {
selectedImportDetail . value = preserveStableMedia ( selectedImportDetail . value , {
... selectedImportDetail . value ,
... selectedSummary ,
sources : selectedImportDetail . value . sources ,
consensus : selectedImportDetail . value . consensus ,
validation _cases : selectedImportDetail . value . validation _cases ,
} )
2026-07-20 17:57:02 +08:00
} else if ( selectedImportId . value && ! selectedSummary ) {
selectedImportId . value = ""
selectedImportDetail . value = null
if ( sortedImports . value . length ) await selectImport ( sortedImports . value [ 0 ] . import _id )
2026-07-18 23:20:06 +08:00
}
await resolveRecordMedia ( imports . value )
}
async function selectImport ( importId : string ) {
deleteConfirmImportId . value = ""
selectedImportId . value = importId
2026-07-20 17:57:02 +08:00
reviewWorkbenchOpen . value = false
2026-07-18 23:20:06 +08:00
await loadImportDetail ( importId )
}
async function deleteImport ( ) {
const item = selectedImport . value
if ( ! item || actionBusy . value || item . accepted _material _id ) return
if ( deleteConfirmImportId . value !== item . import _id ) {
deleteConfirmImportId . value = item . import _id
message . value = "再次点击“确认删除导入”将取消残留任务,并删除该导入、样本、验证轮次和独立文件。"
error . value = ""
return
}
actionBusy . value = "delete-import"
error . value = ""
message . value = ""
try {
await deleteJson < Record < string , unknown > > ( endpoints . advancedMaterialImportDelete ( item . import _id ) )
const deletedName = item . display _name
selectedImportId . value = ""
selectedImportDetail . value = null
attempts . value = [ ]
deleteConfirmImportId . value = ""
await refreshAll ( true )
message . value = ` 已删除进阶导入“ ${ deletedName } ”。 `
emit ( "changed" )
} catch ( err ) {
error . value = errorMessage ( err )
} finally {
actionBusy . value = ""
}
}
async function loadImportDetail ( importId : string , silent = false ) {
if ( ! silent ) detailLoading . value = true
try {
const [ detailPayload , attemptPayload ] = await Promise . all ( [
getJson < unknown > ( endpoints . advancedMaterialImport ( importId ) ) ,
getJson < unknown > ( endpoints . advancedMaterialValidationAttempts ( importId ) ) ,
] )
const detailRecord = detailPayload && typeof detailPayload === "object"
? detailPayload as Record < string , unknown >
: { }
const importRecord = firstRecord < AdvancedMaterialImport > ( detailPayload , [ "import" , "item" ] )
? ? ( detailPayload as AdvancedMaterialImport )
const nextDetail = normalizeImport ( {
... importRecord ,
sources : Array . isArray ( detailRecord . sources ) ? detailRecord . sources as AdvancedStyleSource [ ] : importRecord . sources ,
consensus : detailRecord . consensus && typeof detailRecord . consensus === "object"
? detailRecord . consensus as AdvancedStyleConsensus
: importRecord . consensus ,
validation _cases : Array . isArray ( detailRecord . validation _cases )
? detailRecord . validation _cases as AdvancedStyleValidationCase [ ]
: importRecord . validation _cases ,
} )
const nextAttempts = listItems < AdvancedMaterialValidationAttempt > ( attemptPayload ) . map ( normalizeAttempt )
selectedImportDetail . value = preserveStableMedia ( selectedImportDetail . value , nextDetail )
attempts . value = mergeAttempts ( attempts . value , nextAttempts )
await resolveRecordMedia ( [
selectedImportDetail . value ,
... ( selectedImportDetail . value . sources ? ? [ ] ) ,
... ( selectedImportDetail . value . validation _cases ? ? [ ] ) ,
... attempts . value ,
... attempts . value . flatMap ( ( attempt ) => attempt . validation _cases ? ? [ ] ) ,
] )
} catch ( err ) {
if ( ! silent ) error . value = errorMessage ( err )
} finally {
if ( ! silent ) detailLoading . value = false
}
}
function openFilePicker ( ) {
if ( props . canManage && ! actionBusy . value ) fileInput . value ? . click ( )
}
async function onFileInput ( event : Event ) {
const files = Array . from ( ( event . target as HTMLInputElement ) . files ? ? [ ] )
if ( files . length ) await prepareUploadFiles ( files , "file" )
; ( event . target as HTMLInputElement ) . value = ""
}
async function onPaste ( event : ClipboardEvent ) {
const files = Array . from ( event . clipboardData ? . items ? ? [ ] )
. filter ( ( item ) => item . kind === "file" && item . type . startsWith ( "image/" ) )
. map ( ( item ) => item . getAsFile ( ) )
. filter ( ( item ) : item is File => Boolean ( item ) )
if ( ! files . length ) return
event . preventDefault ( )
await prepareUploadFiles ( files , "paste" )
}
async function onDrop ( event : DragEvent ) {
const files = Array . from ( event . dataTransfer ? . files ? ? [ ] ) . filter ( ( item ) => item . type . startsWith ( "image/" ) )
if ( files . length ) await prepareUploadFiles ( files , "drop" )
}
async function prepareUploadFiles ( files : File [ ] , source : AdvancedMaterialUploadRequest [ "upload_source" ] ) {
if ( ! styleSetUploadEnabled . value ) {
await prepareUploadFile ( files [ 0 ] , source )
return
}
error . value = ""
message . value = ""
const existing = new Set ( styleUploadDrafts . value . map ( ( item ) => styleUploadId ( item . file ) ) )
const accepted = files . filter ( ( file ) => {
if ( ! file . type . startsWith ( "image/" ) ) return false
if ( file . size > MAX _UPLOAD _BYTES ) return false
const id = styleUploadId ( file )
if ( existing . has ( id ) ) return false
existing . add ( id )
return true
} ) . slice ( 0 , Math . max ( 0 , MAX _STYLE _IMAGES - styleUploadDrafts . value . length ) )
if ( ! accepted . length ) {
error . value = styleUploadDrafts . value . length >= MAX _STYLE _IMAGES
? ` 画风样本最多上传 ${ MAX _STYLE _IMAGES } 张。 `
: "没有可添加的图片;请检查格式、20 MB 大小限制或重复文件。"
return
}
try {
const drafts = await Promise . all ( accepted . map ( async ( file ) => ( {
id : styleUploadId ( file ) ,
file ,
dataUrl : await readFileAsDataUrl ( file ) ,
source ,
} ) ) )
styleUploadDrafts . value = [ ... styleUploadDrafts . value , ... drafts ]
if ( ! uploadDisplayName . value . trim ( ) ) uploadDisplayName . value = ` ${ filenameStem ( drafts [ 0 ] . file . name ) || "未命名" } 画风组 `
if ( accepted . length < files . length ) {
message . value = ` 已添加 ${ accepted . length } 张;重复、格式异常、超限或超过 8 张的图片已跳过。 `
}
} catch ( err ) {
error . value = errorMessage ( err )
}
}
async function prepareUploadFile ( file : File , source : AdvancedMaterialUploadRequest [ "upload_source" ] ) {
error . value = ""
message . value = ""
if ( ! file . type . startsWith ( "image/" ) ) {
error . value = "请选择 PNG、JPEG、WebP 等图片文件。"
return
}
if ( file . size > MAX _UPLOAD _BYTES ) {
error . value = "单张素材不能超过 20 MB。"
return
}
try {
uploadDataUrl . value = await readFileAsDataUrl ( file )
uploadFile . value = file
uploadSource . value = source
if ( ! uploadDisplayName . value . trim ( ) ) uploadDisplayName . value = filenameStem ( file . name ) || "进阶素材"
} catch ( err ) {
error . value = errorMessage ( err )
}
}
function resetUpload ( ) {
uploadFile . value = null
uploadDataUrl . value = ""
styleUploadDrafts . value = [ ]
uploadDisplayName . value = ""
uploadSource . value = "file"
}
function removeStyleUpload ( id : string ) {
if ( actionBusy . value ) return
styleUploadDrafts . value = styleUploadDrafts . value . filter ( ( item ) => item . id !== id )
}
function moveStyleUpload ( id : string , direction : - 1 | 1 ) {
if ( actionBusy . value ) return
const current = styleUploadDrafts . value . findIndex ( ( item ) => item . id === id )
const target = current + direction
if ( current < 0 || target < 0 || target >= styleUploadDrafts . value . length ) return
const next = [ ... styleUploadDrafts . value ]
const [ item ] = next . splice ( current , 1 )
next . splice ( target , 0 , item )
styleUploadDrafts . value = next
}
async function submitUpload ( ) {
if ( ! uploadReady . value ) return
actionBusy . value = "upload"
error . value = ""
message . value = ""
try {
if ( styleSetUploadEnabled . value ) {
const payload : AdvancedStyleSetUploadRequest = {
display _name : uploadDisplayName . value . trim ( ) ,
category _id : uploadCategoryId . value ,
images : styleUploadDrafts . value . map ( ( draft , index ) => ( {
client _source _id : draft . id ,
image _data _url : draft . dataUrl ,
filename : draft . file . name || ` style-source- ${ index + 1 } .png ` ,
... ( draft . file . type . trim ( ) ? { content _type : draft . file . type . trim ( ) } : { } ) ,
size _bytes : draft . file . size ,
upload _source : draft . source ,
sort _order : index ,
is _primary : index === 0 ,
} ) ) ,
metadata : { pipeline : "advanced_style_consensus_validation" , workflow _kind : "style_set" } ,
}
const result = await postJson < AdvancedMaterialUploadResult | AdvancedMaterialImport > (
endpoints . advancedMaterialStyleSetUpload ,
payload ,
)
const created = normalizeImport (
firstRecord < AdvancedMaterialImport > ( result , [ "import" , "item" ] ) ? ? ( result as AdvancedMaterialImport ) ,
)
message . value = ` ${ payload . images . length } 张画风样本已拆分入队,将并行识别并在完成后交叉分析。 `
resetUpload ( )
await refreshAll ( true )
if ( created . import _id ) await selectImport ( created . import _id )
emit ( "changed" )
return
}
if ( ! uploadFile . value ) return
const declaredContentType = uploadFile . value . type . trim ( )
const payload : AdvancedMaterialUploadRequest = {
image _data _url : uploadDataUrl . value ,
display _name : uploadDisplayName . value . trim ( ) ,
category _id : uploadCategoryId . value ,
filename : uploadFile . value . name || "advanced-material.png" ,
... ( declaredContentType ? { content _type : declaredContentType } : { } ) ,
size _bytes : uploadFile . value . size ,
upload _source : uploadSource . value ,
metadata : { pipeline : "advanced_material_fidelity_validation" } ,
}
const result = await postJson < AdvancedMaterialUploadResult | AdvancedMaterialImport > (
endpoints . advancedMaterialImportUpload ,
payload ,
)
const created = normalizeImport (
firstRecord < AdvancedMaterialImport > ( result , [ "import" , "item" ] ) ? ? ( result as AdvancedMaterialImport ) ,
)
message . value = "进阶素材已加入识别与还原度验证队列。完成后可在这里对照源图审核。"
resetUpload ( )
await refreshAll ( true )
if ( created . import _id ) await selectImport ( created . import _id )
emit ( "changed" )
} catch ( err ) {
error . value = errorMessage ( err )
} finally {
actionBusy . value = ""
}
}
async function retryImport ( ) {
const item = selectedImport . value
if ( ! item || actionBusy . value ) return
actionBusy . value = "retry"
error . value = ""
message . value = ""
try {
await postJson < unknown > ( endpoints . advancedMaterialImportRetry ( item . import _id ) , { } )
message . value = "重试任务已加入队列。"
await refreshAll ( true )
emit ( "changed" )
} catch ( err ) {
error . value = errorMessage ( err )
} finally {
actionBusy . value = ""
}
}
async function retryStyleSource ( source : AdvancedStyleSource ) {
const item = selectedImport . value
if ( ! item || actionBusy . value ) return
actionBusy . value = ` source-retry: ${ source . source _id } `
error . value = ""
message . value = ""
try {
await postJson < unknown > ( endpoints . advancedMaterialStyleSourceRetry ( item . import _id , source . source _id ) , { } )
message . value = ` 样本 ${ source . sort _order + 1 } 已重新加入独立识别队列。 `
await loadImportDetail ( item . import _id , true )
} catch ( err ) {
error . value = errorMessage ( err )
} finally {
actionBusy . value = ""
}
}
async function excludeStyleSource ( source : AdvancedStyleSource , excluded = true ) {
const item = selectedImport . value
if ( ! item || actionBusy . value || source . is _primary ) return
actionBusy . value = ` source-exclude: ${ source . source _id } `
error . value = ""
message . value = ""
try {
await postJson < unknown > ( endpoints . advancedMaterialStyleSourceExclude ( item . import _id , source . source _id ) , { excluded } )
message . value = excluded
? ` 样本 ${ source . sort _order + 1 } 已从交叉分析中排除。 `
: ` 样本 ${ source . sort _order + 1 } 已恢复;如识别失败可单独重试。 `
await loadImportDetail ( item . import _id , true )
} catch ( err ) {
error . value = errorMessage ( err )
} finally {
actionBusy . value = ""
}
}
async function createStyleConsensus ( ) {
const item = selectedImport . value
if ( ! item || ! canRunStyleConsensus . value ) return
actionBusy . value = "style-consensus"
error . value = ""
message . value = ""
try {
2026-07-20 17:57:02 +08:00
const referenceSourceId = effectiveValidationReferenceSourceId . value
2026-07-18 23:20:06 +08:00
await postJson < unknown > ( endpoints . advancedMaterialStyleConsensus ( item . import _id ) , {
included _source _ids : recognizedStyleSources . value . map ( ( source ) => source . source _id ) ,
2026-07-20 17:57:02 +08:00
validation _reference _enabled : validationReferenceEnabled . value ,
... ( validationReferenceEnabled . value && referenceSourceId
? { validation _reference _source _id : referenceSourceId }
: { } ) ,
2026-07-18 23:20:06 +08:00
} )
2026-07-20 17:57:02 +08:00
message . value = validationReferenceEnabled . value
? "画风交叉分析已入队;验证轮将附带 1 张风格参考图。"
: "画风交叉分析已入队;验证轮保持纯文本迁移。"
2026-07-18 23:20:06 +08:00
await loadImportDetail ( item . import _id , true )
} catch ( err ) {
error . value = errorMessage ( err )
} finally {
actionBusy . value = ""
}
}
async function retryStyleValidationCase ( validationCase : AdvancedStyleValidationCase ) {
const item = selectedImport . value
if ( ! item || actionBusy . value ) return
actionBusy . value = ` case-retry: ${ validationCase . case _id } `
error . value = ""
message . value = ""
try {
await postJson < unknown > (
endpoints . advancedMaterialStyleValidationCaseRetry ( item . import _id , validationCase . case _id ) ,
{ } ,
)
message . value = ` ${ styleValidationScenarioLabel ( validationCase . scenario ) } 已重新加入独立生图队列。 `
await loadImportDetail ( item . import _id , true )
} catch ( err ) {
error . value = errorMessage ( err )
} finally {
actionBusy . value = ""
}
}
async function createValidationAttempt ( ) {
const item = selectedImport . value
if ( ! item || ! canStartValidation . value ) return
actionBusy . value = "validation"
error . value = ""
message . value = ""
try {
await postJson < unknown > ( endpoints . advancedMaterialValidationAttempts ( item . import _id ) , {
adjustment _text : adjustmentText . value . trim ( ) || undefined ,
} )
message . value = "还原度验证图已加入生成队列。"
adjustmentText . value = ""
await refreshAll ( true )
emit ( "changed" )
} catch ( err ) {
error . value = errorMessage ( err )
} finally {
actionBusy . value = ""
}
}
async function rejectAndRegenerate ( ) {
const item = selectedImport . value
const attempt = currentAttempt . value
const adjustment = adjustmentText . value . trim ( )
const validationInstruction = validationInstructionText . value . trim ( )
if ( ! item || ! attempt || ! canReviewCurrentAttempt . value ) return
if ( ! adjustment && ! validationInstruction ) {
error . value = selectedStyleSet . value
? "请至少填写画风修正或下一轮验证内容。"
: "请先说明验证图与源图的差异,以及下一轮需要怎样调整。"
return
}
actionBusy . value = "reject"
error . value = ""
message . value = ""
try {
2026-07-20 17:57:02 +08:00
const referenceSourceId = effectiveValidationReferenceSourceId . value
2026-07-18 23:20:06 +08:00
const payload : AdvancedMaterialDecisionRequest = {
adjustment _text : selectedStyleSet . value ? undefined : adjustment ,
style _adjustment _text : selectedStyleSet . value ? adjustment || undefined : undefined ,
validation _instruction : selectedStyleSet . value ? validationInstruction || undefined : undefined ,
fidelity _score : fidelityPercent . value / 100 ,
decision _notes : decisionNotes . value . trim ( ) || undefined ,
reuse _validation _scenarios : selectedStyleSet . value && ! validationInstruction || undefined ,
2026-07-20 17:57:02 +08:00
... ( selectedStyleSet . value
? {
validation _reference _enabled : validationReferenceEnabled . value ,
... ( validationReferenceEnabled . value && referenceSourceId
? { validation _reference _source _id : referenceSourceId }
: { } ) ,
}
: { } ) ,
2026-07-18 23:20:06 +08:00
}
await postJson < unknown > ( endpoints . advancedMaterialAttemptReject ( item . import _id , attempt . attempt _id ) , payload )
message . value = "本轮反馈已保存,调整后的下一轮验证图已加入队列。"
adjustmentText . value = ""
validationInstructionText . value = ""
decisionNotes . value = ""
acceptConfirmed . value = false
await refreshAll ( true )
emit ( "changed" )
} catch ( err ) {
error . value = errorMessage ( err )
} finally {
actionBusy . value = ""
}
}
async function acceptAttempt ( ) {
const item = selectedImport . value
const attempt = currentAttempt . value
if ( ! item || ! attempt || ! canReviewCurrentAttempt . value || ! acceptConfirmed . value ) return
actionBusy . value = "accept"
error . value = ""
message . value = ""
try {
const payload : AdvancedMaterialDecisionRequest = {
fidelity _score : fidelityPercent . value / 100 ,
decision _notes : decisionNotes . value . trim ( ) || undefined ,
}
await postJson < unknown > ( endpoints . advancedMaterialAttemptAccept ( item . import _id , attempt . attempt _id ) , payload )
message . value = "验证结果已封存,素材已进入高优先级进阶素材库。"
acceptConfirmed . value = false
await refreshAll ( true )
emit ( "changed" )
} catch ( err ) {
error . value = errorMessage ( err )
} finally {
actionBusy . value = ""
}
}
function shouldPoll ( ) {
return imports . value . some ( ( item ) => advancedImportStatusMeta ( item . status ) . busy ) ||
attempts . value . some ( ( attempt ) => advancedAttemptStatusMeta ( attempt . status ) . busy ) ||
activeStyleSources . value . some ( ( source ) => [ "uploaded" , "recognition_queued" , "recognizing" , "queued" , "running" ] . includes ( normalizeStatus ( source . status ) ) ) ||
[ "queued" , "running" ] . includes ( normalizeStatus ( styleConsensus . value ? . status ? ? "" ) ) ||
styleValidationCases . value . some ( ( item ) => [ "queued" , "running" , "validating" ] . includes ( normalizeStatus ( item . status ) ) )
}
function selectedStateIsBusy ( ) {
return Boolean (
advancedImportStatusMeta ( selectedImport . value ? . status ? ? "" ) . busy ||
attempts . value . some ( ( attempt ) => advancedAttemptStatusMeta ( attempt . status ) . busy ) ||
activeStyleSources . value . some ( ( source ) => [ "uploaded" , "recognition_queued" , "recognizing" , "queued" , "running" ] . includes ( normalizeStatus ( source . status ) ) ) ||
[ "queued" , "running" ] . includes ( normalizeStatus ( styleConsensus . value ? . status ? ? "" ) ) ||
styleValidationCases . value . some ( ( item ) => [ "queued" , "running" , "validating" ] . includes ( normalizeStatus ( item . status ) ) )
)
}
function replaceImportSummary ( items : AdvancedMaterialImport [ ] , detail : AdvancedMaterialImport ) {
const index = items . findIndex ( ( item ) => item . import _id === detail . import _id )
if ( index < 0 ) return [ detail , ... items ]
const next = [ ... items ]
next [ index ] = preserveStableMedia ( items [ index ] , detail )
return next
}
function mergeImportSummaries ( current : AdvancedMaterialImport [ ] , incoming : AdvancedMaterialImport [ ] ) {
const currentById = new Map ( current . map ( ( item ) => [ item . import _id , item ] ) )
return incoming . map ( ( item ) => preserveStableMedia ( currentById . get ( item . import _id ) ? ? null , item ) )
}
function mergeAttempts (
current : AdvancedMaterialValidationAttempt [ ] ,
incoming : AdvancedMaterialValidationAttempt [ ] ,
) {
const currentById = new Map ( current . map ( ( item ) => [ item . attempt _id , item ] ) )
return incoming . map ( ( item ) => preserveStableMedia ( currentById . get ( item . attempt _id ) ? ? null , item ) )
}
function preserveStableMedia < T extends object > ( current : T | null , incoming : T ) : T {
if ( ! current ) return incoming
const currentRecord = current as Record < string , unknown >
const incomingRecord = incoming as Record < string , unknown >
const next = { ... incoming }
for ( const [ key , value ] of Object . entries ( currentRecord ) ) {
if ( ! key . endsWith ( "_url" ) ) continue
const uriKey = key . replace ( /_url$/ , "_uri" )
const currentUri = String ( currentRecord [ uriKey ] || "" )
const incomingUri = String ( incomingRecord [ uriKey ] || "" )
if ( currentUri && currentUri === incomingUri && value ) {
; ( next as Record < string , unknown > ) [ key ] = value
}
}
return next
}
function sourceImageUrl ( item : AdvancedMaterialImport | AdvancedMaterial ) {
return mediaUrl ( item . source _thumbnail _uri , item . source _image _uri , item . source _thumbnail _url , item . source _image _url )
}
function validationImageUrl ( item : AdvancedMaterial ) {
return mediaUrl (
item . validation _thumbnail _uri ,
item . validation _image _uri ,
item . validation _thumbnail _url ,
item . validation _image _url ,
)
}
function attemptImageUrl ( item : AdvancedMaterialValidationAttempt ) {
return mediaUrl (
item . validation _thumbnail _uri ,
item . validation _image _uri ,
item . validation _thumbnail _url ,
item . validation _image _url ,
)
}
function styleSourceImageUrl ( item : AdvancedStyleSource ) {
return mediaUrl (
item . source _thumbnail _uri ,
item . source _image _uri ,
item . thumbnail _uri ,
item . image _uri ,
item . source _thumbnail _url ,
item . source _image _url ,
item . thumbnail _url ,
item . image _url ,
)
}
function styleValidationCaseImageUrl ( item : AdvancedStyleValidationCase ) {
return mediaUrl (
item . validation _thumbnail _uri ,
item . validation _image _uri ,
item . validation _thumbnail _url ,
item . validation _image _url ,
)
}
function sourcePreviewUrl ( item : AdvancedMaterialImport | AdvancedMaterial | AdvancedStyleSource ) {
return mediaUrl (
item . source _image _uri ,
item . source _image _url ,
item . source _thumbnail _uri ,
item . source _thumbnail _url ,
)
}
function validationCasePreviewUrl ( item : AdvancedStyleValidationCase ) {
return mediaUrl (
item . validation _image _uri ,
item . validation _image _url ,
item . validation _thumbnail _uri ,
item . validation _thumbnail _url ,
)
}
function attemptPreviewUrl ( item : AdvancedMaterialValidationAttempt ) {
return mediaUrl (
item . validation _image _uri ,
item . validation _image _url ,
item . validation _thumbnail _uri ,
item . validation _thumbnail _url ,
)
}
function openImagePreview ( src : string , title : string ) {
const resolved = String ( src || "" ) . trim ( )
if ( ! resolved ) return
previewImageSrc . value = resolved
previewImageTitle . value = title
}
function closeImagePreview ( ) {
previewImageSrc . value = ""
previewImageTitle . value = ""
}
function mediaUrl ( ... values : Array < string | null | undefined > ) {
for ( const value of values ) {
const candidate = String ( value || "" ) . trim ( )
if ( ! candidate ) continue
if ( signedMediaUrls . value [ candidate ] ) return signedMediaUrls . value [ candidate ]
if ( /^(?:https?:|data:|blob:|\/)/i . test ( candidate ) ) return candidate
}
return ""
}
async function resolveRecordMedia ( records : unknown [ ] ) {
const uris = new Set < string > ( )
const signedUrls = new Set < string > ( )
for ( const record of records ) {
if ( ! record || typeof record !== "object" ) continue
const mediaRecord = record as Record < string , unknown >
for ( const [ key , value ] of Object . entries ( mediaRecord ) ) {
if ( key . endsWith ( "_uri" ) && typeof value === "string" && value . startsWith ( "storage://" ) ) uris . add ( value )
if ( key . endsWith ( "_url" ) && typeof value === "string" && signedMediaToken ( value ) ) {
const pairedUri = String ( mediaRecord [ key . replace ( /_url$/ , "_uri" ) ] || "" )
if ( ! pairedUri || ! pairedUri . startsWith ( "storage://" ) ) signedUrls . add ( value )
}
}
}
await Promise . allSettled ( [ ... signedUrls ] . map ( ( url ) => resolveSignedMedia ( url ) ) )
const pending = [ ... uris ] . filter ( ( uri ) => ! signedMediaUrls . value [ uri ] )
if ( ! pending . length ) return
const resolved = await Promise . allSettled (
pending . map ( async ( uri ) => ( { uri , result : await getJson < MediaSignResult > ( endpoints . mediaSign , { uri } ) } ) ) ,
)
const additions : Record < string , string > = { }
for ( const result of resolved ) {
if ( result . status !== "fulfilled" || ! result . value . result . url ) continue
const displayUrl = await resolveSignedMedia ( result . value . result . url )
additions [ result . value . uri ] = displayUrl || result . value . result . url
}
if ( Object . keys ( additions ) . length ) signedMediaUrls . value = { ... signedMediaUrls . value , ... additions }
}
async function resolveSignedMedia ( url : string ) : Promise < string > {
if ( signedMediaUrls . value [ url ] ) return signedMediaUrls . value [ url ]
const token = signedMediaToken ( url )
if ( ! token ) return url
try {
const payload = await getJson < MediaFetchResult > ( endpoints . mediaPayload , { token } )
const normalized = String ( payload . body _base64 || "" ) . replace ( /-/g , "+" ) . replace ( /_/g , "/" )
if ( ! normalized ) return url
const padded = normalized . padEnd ( Math . ceil ( normalized . length / 4 ) * 4 , "=" )
const binary = window . atob ( padded )
const bytes = new Uint8Array ( binary . length )
for ( let index = 0 ; index < binary . length ; index += 1 ) bytes [ index ] = binary . charCodeAt ( index )
const objectUrl = URL . createObjectURL ( new Blob ( [ bytes ] , { type : payload . content _type || "application/octet-stream" } ) )
ownedMediaObjectUrls . add ( objectUrl )
signedMediaUrls . value = { ... signedMediaUrls . value , [ url ] : objectUrl }
return objectUrl
} catch {
return url
}
}
function signedMediaToken ( rawUrl : string ) {
try {
const url = new URL ( rawUrl , window . location . origin )
return url . pathname . endsWith ( "/media/fetch" ) ? url . searchParams . get ( "token" ) ? . trim ( ) || "" : ""
} catch {
return ""
}
}
function categoryName ( categoryId ? : string | null ) {
return materialCategoryLabel (
props . categories . find ( ( category ) => category . category _id === categoryId ) ? . name || "未分类" ,
)
}
function importError ( item : AdvancedMaterialImport | null ) {
return advancedMaterialErrorMessage ( item ? . error )
}
function attemptError ( item : AdvancedMaterialValidationAttempt | null ) {
return advancedMaterialErrorMessage ( item ? . error )
}
function formatDate ( value ? : string | null ) {
if ( ! value ) return "-"
const parsed = new Date ( value )
return Number . isNaN ( parsed . getTime ( ) ) ? value : parsed . toLocaleString ( "zh-CN" , { hour12 : false } )
}
function normalizeImport ( value : AdvancedMaterialImport ) : AdvancedMaterialImport {
const record = value && typeof value === "object" ? value : ( { } as AdvancedMaterialImport )
return {
... record ,
import _id : String ( record . import _id || "" ) ,
display _name : String ( record . display _name || "未命名进阶素材" ) ,
status : String ( record . status || "pending_recognition" ) ,
recognition _tags : Array . isArray ( record . recognition _tags ) ? record . recognition _tags . map ( String ) : [ ] ,
recognition _result : record . recognition _result && typeof record . recognition _result === "object" ? record . recognition _result : { } ,
workflow _kind : String ( record . workflow _kind || record . metadata ? . workflow _kind || "single" ) ,
sources : Array . isArray ( record . sources ) ? record . sources . map ( normalizeStyleSource ) : [ ] ,
consensus : record . consensus && typeof record . consensus === "object"
? normalizeStyleConsensus ( record . consensus )
: null ,
validation _cases : Array . isArray ( record . validation _cases )
? record . validation _cases . map ( normalizeStyleValidationCase )
: [ ] ,
error : record . error && typeof record . error === "object" ? record . error : { } ,
metadata : record . metadata && typeof record . metadata === "object" ? record . metadata : { } ,
created _at : String ( record . created _at || "" ) ,
updated _at : String ( record . updated _at || record . created _at || "" ) ,
}
}
function normalizeAttempt ( value : AdvancedMaterialValidationAttempt ) : AdvancedMaterialValidationAttempt {
const record = value && typeof value === "object" ? value : ( { } as AdvancedMaterialValidationAttempt )
return {
... record ,
attempt _id : String ( record . attempt _id || "" ) ,
import _id : String ( record . import _id || "" ) ,
attempt _number : Number ( record . attempt _number || 0 ) ,
status : String ( record . status || "queued" ) ,
usage : record . usage && typeof record . usage === "object" ? record . usage : { } ,
error : record . error && typeof record . error === "object" ? record . error : { } ,
metadata : record . metadata && typeof record . metadata === "object" ? record . metadata : { } ,
validation _cases : Array . isArray ( record . validation _cases )
? record . validation _cases . map ( normalizeStyleValidationCase )
: [ ] ,
created _at : String ( record . created _at || "" ) ,
updated _at : String ( record . updated _at || record . created _at || "" ) ,
}
}
function normalizeStyleSource ( value : AdvancedStyleSource ) : AdvancedStyleSource {
const record = value && typeof value === "object" ? value : ( { } as AdvancedStyleSource )
return {
... record ,
source _id : String ( record . source _id || "" ) ,
sort _order : Number ( record . sort _order || 0 ) ,
is _primary : Boolean ( record . is _primary ) ,
excluded : Boolean ( record . excluded || record . excluded _at || normalizeStatus ( record . status ) === "excluded" ) ,
status : String ( record . status || "uploaded" ) ,
recognition _tags : Array . isArray ( record . recognition _tags ) ? record . recognition _tags . map ( String ) : [ ] ,
recognition _result : record . recognition _result && typeof record . recognition _result === "object" ? record . recognition _result : { } ,
error : record . error && typeof record . error === "object" ? record . error : { } ,
metadata : record . metadata && typeof record . metadata === "object" ? record . metadata : { } ,
}
}
function normalizeStyleConsensus ( value : AdvancedStyleConsensus ) : AdvancedStyleConsensus {
const record = value && typeof value === "object" ? value : ( { } as AdvancedStyleConsensus )
const result = record . result && typeof record . result === "object" ? record . result : { }
return {
... record ,
status : String ( record . status || "queued" ) ,
version _id : record . version _id || record . consensus _id || null ,
version _number : Number ( record . version _number || record . revision || 0 ) ,
consensus _style : record . consensus _style && typeof record . consensus _style === "object"
? record . consensus _style
: result . consensus _style && typeof result . consensus _style === "object" ? result . consensus _style as Record < string , unknown > : [ ] ,
variable _style _features : Array . isArray ( record . variable _style _features )
? record . variable _style _features
: Array . isArray ( result . variable _style _features ) ? result . variable _style _features : [ ] ,
source _content _features : Array . isArray ( record . source _content _features ) || ( record . source _content _features && typeof record . source _content _features === "object" )
? record . source _content _features
: Array . isArray ( result . source _content _features ) || ( result . source _content _features && typeof result . source _content _features === "object" )
? result . source _content _features as AdvancedStyleConsensus [ "source_content_features" ]
: [ ] ,
content _leakage _exclusions : ( Array . isArray ( record . content _leakage _exclusions )
? record . content _leakage _exclusions
: Array . isArray ( result . content _leakage _exclusions ) ? result . content _leakage _exclusions : [ ] ) . map ( String ) ,
outlier _source _ids : ( Array . isArray ( record . outlier _source _ids )
? record . outlier _source _ids
: Array . isArray ( result . outlier _source _ids ) ? result . outlier _source _ids : [ ] ) . map ( String ) ,
representative _source _ids : ( Array . isArray ( record . representative _source _ids )
? record . representative _source _ids
: Array . isArray ( result . representative _source _ids ) ? result . representative _source _ids : [ ] ) . map ( String ) ,
consensus _confidence : Number ( record . consensus _confidence ? ? result . consensus _confidence ? ? 0 ) ,
generation _capsules : record . generation _capsules && typeof record . generation _capsules === "object"
? record . generation _capsules
: result . generation _capsules && typeof result . generation _capsules === "object" ? result . generation _capsules as Record < string , unknown > : { } ,
error : record . error && typeof record . error === "object" ? record . error : { } ,
metadata : record . metadata && typeof record . metadata === "object" ? record . metadata : { } ,
}
}
function normalizeStyleValidationCase ( value : AdvancedStyleValidationCase ) : AdvancedStyleValidationCase {
const record = value && typeof value === "object" ? value : ( { } as AdvancedStyleValidationCase )
return {
... record ,
case _id : String ( record . case _id || "" ) ,
scenario : String ( record . scenario || record . case _key || "novel_scene" ) ,
status : String ( record . status || "queued" ) ,
input _image _count : Number ( record . input _image _count || 0 ) ,
fidelity _score : record . fidelity _score == null ? null : Number ( record . fidelity _score ) ,
style _scores : record . style _scores && typeof record . style _scores === "object"
? record . style _scores
: record . style _review && typeof record . style _review === "object" ? record . style _review : { } ,
content _novelty : record . content _novelty && typeof record . content _novelty === "object" ? record . content _novelty : { } ,
error : record . error && typeof record . error === "object" ? record . error : { } ,
metadata : record . metadata && typeof record . metadata === "object" ? record . metadata : { } ,
}
}
function normalizeMaterial ( value : AdvancedMaterial ) : AdvancedMaterial {
const record = value && typeof value === "object" ? value : ( { } as AdvancedMaterial )
return {
... record ,
material _id : String ( record . material _id || "" ) ,
import _id : String ( record . import _id || "" ) ,
accepted _attempt _id : String ( record . accepted _attempt _id || "" ) ,
display _name : String ( record . display _name || "未命名进阶素材" ) ,
tags : Array . isArray ( record . tags ) ? record . tags . map ( String ) : [ ] ,
priority : Number ( record . priority || 0 ) ,
status : String ( record . status || "active" ) ,
capsule : record . capsule && typeof record . capsule === "object" ? record . capsule : { } ,
metadata : record . metadata && typeof record . metadata === "object" ? record . metadata : { } ,
created _at : String ( record . created _at || "" ) ,
updated _at : String ( record . updated _at || record . created _at || "" ) ,
}
}
function readFileAsDataUrl ( file : File ) {
return new Promise < string > ( ( resolve , reject ) => {
const reader = new FileReader ( )
reader . onload = ( ) => resolve ( String ( reader . result || "" ) )
reader . onerror = ( ) => reject ( reader . error || new Error ( "读取图片失败" ) )
reader . readAsDataURL ( file )
} )
}
function filenameStem ( filename : string ) {
return filename . replace ( /\.[^.]+$/ , "" ) . trim ( )
}
function styleUploadId ( file : File ) {
return ` ${ file . name } : ${ file . size } : ${ file . lastModified } `
}
function isStyleCategory ( category : MaterialCategory | null | undefined ) {
if ( ! category ) return false
const group = String ( category . metadata ? . frontend _group || category . name || "" ) . trim ( ) . toLowerCase ( )
return group === "风格" || group === "style"
}
function isStyleSetImport ( item : AdvancedMaterialImport | null | undefined ) {
const workflowKind = String ( item ? . workflow _kind || item ? . metadata ? . workflow _kind || "" ) . trim ( ) . toLowerCase ( )
return workflowKind === "style_set" || workflowKind === "advanced_style_set" || item ? . metadata ? . style _set === true
}
function styleSourceStatusLabel ( source : AdvancedStyleSource ) {
if ( source . excluded ) return "已排除"
const labels : Record < string , string > = {
uploaded : "等待识别" ,
recognition _queued : "已入队" ,
recognizing : "识别中" ,
recognized : "识别完成" ,
completed : "识别完成" ,
succeeded : "识别完成" ,
failed : "识别失败" ,
cancelled : "已取消" ,
}
return labels [ normalizeStatus ( source . status ) ] || source . status || "未知状态"
}
function styleSourceTone ( source : AdvancedStyleSource ) {
if ( source . excluded ) return "idle"
const status = normalizeStatus ( source . status )
if ( [ "recognized" , "completed" , "succeeded" ] . includes ( status ) ) return "good"
if ( [ "failed" , "cancelled" ] . includes ( status ) ) return "bad"
if ( [ "recognizing" , "running" ] . includes ( status ) ) return "active"
return "idle"
}
function styleValidationScenarioLabel ( scenario : string ) {
const labels : Record < string , string > = {
portrait : "异角色头像" ,
fullbody : "异角色全身" ,
novel _scene : "异场景动态构图" ,
}
return labels [ scenario ] || scenario || "验证场景"
}
function styleValidationStatusLabel ( status : string ) {
const labels : Record < string , string > = {
queued : "已入队" ,
running : "生成中" ,
validating : "生成中" ,
succeeded : "待审核" ,
completed : "待审核" ,
awaiting _review : "待审核" ,
pending _review : "待审核" ,
failed : "生成失败" ,
cancelled : "已取消" ,
accepted : "已采纳" ,
rejected : "未采纳" ,
}
return labels [ normalizeStatus ( status ) ] || status || "未知状态"
}
function styleValidationFidelityPercent ( validationCase : AdvancedStyleValidationCase ) {
const score = Number ( validationCase . fidelity _score ? ? validationCase . style _review ? . fidelity _score )
return Number . isFinite ( score ) ? Math . max ( 0 , Math . min ( 100 , Math . round ( score * 100 ) ) ) : null
}
function styleValidationReviewSummary ( validationCase : AdvancedStyleValidationCase ) {
const review = validationCase . style _review && typeof validationCase . style _review === "object"
? validationCase . style _review
: validationCase . style _scores && typeof validationCase . style _scores === "object" ? validationCase . style _scores : { }
const mismatches = Array . isArray ( review . mismatches ) ? review . mismatches . map ( String ) . filter ( Boolean ) : [ ]
if ( mismatches . length ) return ` 主要偏差: ${ mismatches . slice ( 0 , 2 ) . join ( ";" ) } `
return String ( review . description || "" ) . trim ( )
}
function consensusItems ( value : AdvancedStyleConsensus [ "consensus_style" ] | AdvancedStyleConsensus [ "source_content_features" ] ) {
if ( Array . isArray ( value ) ) return value . map ( consensusItemLabel ) . filter ( Boolean )
if ( ! value || typeof value !== "object" ) return [ ]
return Object . entries ( value ) . flatMap ( ( [ key , item ] ) => {
if ( Array . isArray ( item ) ) return item . map ( consensusItemLabel ) . filter ( Boolean )
const label = consensusItemLabel ( item )
return label ? [ ` ${ key } : ${ label } ` ] : [ ]
} )
}
function consensusItemLabel ( value : unknown ) : string {
if ( typeof value === "string" ) return value . trim ( )
if ( ! value || typeof value !== "object" ) return ""
const record = value as Record < string , unknown >
return String ( record . trait || record . label || record . description || record . value || "" ) . trim ( )
}
function styleSourceLabel ( sourceId : string ) {
const index = styleSources . value . findIndex ( ( source ) => source . source _id === sourceId )
if ( index < 0 ) return sourceId
return styleSources . value [ index ] ? . is _primary ? "主参考图" : ` 样本 ${ index + 1 } `
}
function normalizeStatus ( value : string ) {
return String ( value || "" ) . trim ( ) . toLowerCase ( )
}
function errorMessage ( err : unknown ) {
return err instanceof Error ? err . message || "请求失败" : String ( err || "请求失败" )
}
< / script >
< template >
< section class = "advanced-material-page" >
< div v-if = "error || message" :class="['advanced-material-banner', error ? 'bad' : 'good']" role="status" >
< div >
< strong > { { error ? "操作未完成" : "操作已提交" } } < / strong >
< span > { { error || message } } < / span >
< / div >
< button type = "button" aria -label = " 关闭提示 " @ click = "error = ''; message = ''" > × < / button >
< / div >
< div v-if = "!canManage" class="advanced-material-banner" role="status" >
< div > < strong > 当前账号为只读权限 < / strong > < span > 可以查看已封存进阶素材 , 但导入记录 、 验证轮次和封存操作需要素材管理权限 。 < / span > < / div >
< / div >
< template v-if = "mode === 'advanced'" >
< section class = "advanced-material-metrics" aria -label = " 进阶素材状态 " >
< article > < span > 已封存进阶素材 < / span > < strong > { { sortedMaterials . length } } < / strong > < small > 在自动检索与角色拼装中优先于普通素材 < / small > < / article >
< article > < span > 处理中 < / span > < strong > { { activeImportCount } } < / strong > < small > 识别与验证在独立队列执行 < / small > < / article >
< article > < span > 等待人工审核 < / span > < strong > { { reviewImportCount } } < / strong > < small > 需要比较源图与验证图 < / small > < / article >
< article > < span > 异常任务 < / span > < strong > { { failedImportCount } } < / strong > < small > 保留错误信息 , 可单独重试 < / small > < / article >
< / section >
< section class = "advanced-material-library-layout" >
< article class = "advanced-material-panel advanced-material-library-panel" >
< header class = "advanced-section-header" >
< div >
< span > 高优先级封存库 < / span >
< h3 > { { sortedMaterials . length } } 条进阶素材 < / h3 >
< p > 源图 、 验证图和最终提示词被独立封存 , 不进入普通图库或工作流候选池 。 < / p >
< / div >
< button type = "button" class = "primary" @ click = "emit('navigate', 'advanced-import')" > + 新建进阶导入 < / button >
< / header >
< div v-if = "loading && !sortedMaterials.length" class="advanced-material-skeleton"><span v-for="index in 4" :key="index" / > < / div >
< div v -else -if = " sortedMaterials.length " class = "advanced-material-card-grid" >
< button
v - for = "material in sortedMaterials"
: key = "material.material_id"
type = "button"
class = "advanced-material-card"
@ click = "selectImport(material.import_id)"
>
< span class = "advanced-material-card-images" >
< span > < img v-if = "sourceImageUrl(material)" :src="sourceImageUrl(material)" :alt="`${material.display_name} 源图`" > < i v-else > 源图 < / i > < / span >
< span > < img v-if = "validationImageUrl(material)" :src="validationImageUrl(material)" :alt="`${material.display_name} 验证图`" > < i v-else > 验证图 < / i > < / span >
< / span >
< span class = "advanced-material-card-copy" >
< small > 进阶素材 · { { categoryName ( material . category _id ) } } < / small >
< strong > { { material . display _name } } < / strong >
< em > { { material . prompt || "已封存高优先级生成胶囊" } } < / em >
< / span >
< span class = "advanced-material-card-tags" >
< b > 优先级 { { material . priority } } < / b >
< b v-for ="tag in material.tags.slice(0, 2)" :key ="tag" > {{ tag }} < / b >
< / span >
< / button >
< / div >
< div v -else class = "advanced-material-empty" >
< strong > 还没有封存的进阶素材 < / strong >
< p > 导入一张参考图 , 经过识别 、 验证生图和人工还原度审核后才会进入这里 。 < / p >
< button type = "button" class = "primary" @ click = "emit('navigate', 'advanced-import')" > 开始第一次进阶导入 < / button >
< / div >
< / article >
< aside class = "advanced-material-panel advanced-import-queue" >
< header class = "advanced-section-header compact" >
< div > < span > 验证流水线 < / span > < h3 > 最近导入 < / h3 > < / div >
< button type = "button" :disabled = "loading" @click ="refreshAll()" > {{ loading ? " 刷新中 " : " 刷新 " }} < / button >
< / header >
< div v-if = "sortedImports.length" class="advanced-import-list" >
< button
v - for = "item in sortedImports"
: key = "item.import_id"
type = "button"
: class = "['advanced-import-list-item', { active: selectedImportId === item.import_id }]"
@ click = "selectImport(item.import_id)"
>
< span : class = "['status-dot', advancedImportStatusMeta(item.status).tone]" / >
< span > < strong > { { item . display _name } } < / strong > < small > { { advancedImportStatusMeta ( item . status ) . label } } · { { formatDate ( item . updated _at ) } } < / small > < / span >
< / button >
< / div >
< div v -else class = "advanced-material-empty compact" > < p > 暂无导入记录 。 < / p > < / div >
< / aside >
< / section >
< / template >
< template v-else >
< section class = "advanced-material-import-layout" >
< article class = "advanced-material-panel advanced-upload-panel" >
< header class = "advanced-section-header" >
< div >
< span > 进阶素材导入 < / span >
< h3 > 上传源图并验证还原度 < / h3 >
< p > 视觉模型先提取关键词和提示词 , 再由生图模型生成独立验证图 ; 只有人工确认后才会封存 。 < / p >
< / div >
< button type = "button" @ click = "emit('navigate', 'advanced')" > 返回进阶素材库 < / button >
< / header >
< div class = "advanced-upload-grid" >
< div
class = "advanced-upload-dropzone"
tabindex = "0"
@ click = "openFilePicker"
@ keydown . enter . prevent = "openFilePicker"
@ keydown . space . prevent = "openFilePicker"
@ paste = "onPaste"
@ dragover . prevent
@ drop . prevent = "onDrop"
>
< div v-if = "styleSetUploadEnabled && styleUploadDrafts.length" class="advanced-style-upload-grid" >
< figure v-for = "(draft, index) in styleUploadDrafts" :key="draft.id" >
< img :src = "draft.dataUrl" : alt = "`画风样本 ${index + 1}`" >
< figcaption > < strong > { { index === 0 ? "主参考" : ` 样本 ${ index + 1 } ` } } < / strong > < small > { { draft . file . name } } < / small > < / figcaption >
< div class = "advanced-style-upload-actions" @ click.stop >
< button type = "button" : disabled = "index === 0" : aria -label = " ` 将样本 $ { index + 1 } 前移 ` " title = "前移;移到首位即设为主参考" @ click.stop = " moveStyleUpload ( draft.id , -1 ) " > ← < / button >
< button type = "button" : disabled = "index === styleUploadDrafts.length - 1" : aria -label = " ` 将样本 $ { index + 1 } 后移 ` " title = "后移" @ click.stop = " moveStyleUpload ( draft.id , 1 ) " > → < / button >
< button type = "button" : aria -label = " ` 移除样本 $ { index + 1 } ` " title = "移除" @click.stop ="removeStyleUpload(draft.id)" > × < / button >
< / div >
< / figure >
< span v-if = "styleUploadDrafts.length < MAX_STYLE_IMAGES" class="advanced-style-upload-add" > < b > + < / b > < small > 继续添加 < / small > < / span >
< / div >
< img v -else -if = " ! styleSetUploadEnabled & & uploadPreview " :src = "uploadPreview" alt = "待导入素材预览" >
< span v -else class = "advanced-upload-placeholder" >
< b > { { styleSetUploadEnabled ? "粘贴、拖入或选择 2~ 8 张画风样本" : "粘贴、拖入或选择图片" } } < / b >
< small > PNG / JPEG / WebP , 单张不超过 20 MB { { styleSetUploadEnabled ? ";推荐 3~ 6 张" : "" } } < / small >
< / span >
< em v-if = "!styleSetUploadEnabled && uploadFile" > {{ uploadFile.name }} · {{ ( uploadFile.size / 1024 / 1024 ) .toFixed ( 2 ) }} MB < / em >
< input ref = "fileInput" type = "file" accept = "image/*" :multiple = "styleSetUploadEnabled" hidden @change ="onFileInput" >
< / div >
< form class = "advanced-upload-form" @submit.prevent ="submitUpload" >
< label > < span > 素材名称 < / span > < input v-model = "uploadDisplayName" type="text" maxlength="120" placeholder="例如:银白冬季斗篷" > < / label >
< label >
< span > 素材分类 < / span >
< select v-model = "uploadCategoryId" >
< option value = "" disabled > 选择现有分类 < / option >
< option v-for = "category in rootCategories" :key="category.category_id" :value="category.category_id" > {{ materialCategoryLabel ( category.name ) }} < / option >
< / select >
< small v-if = "styleSetUploadEnabled" class="advanced-style-mode-note" > 风格分类启用多图交叉提取 ; 每张图独立并行识别 , 验证阶段不传任何源图 。 < / small >
< / label >
< dl >
< div > < dt > 处理方式 < / dt > < dd > { { styleSetUploadEnabled ? "并行逐图识别 → 多图交叉分析 → 三场景纯文本验证 → 人工封存" : "视觉识别 → 验证生图 → 人工对照 → 独立封存" } } < / dd > < / div >
< div > < dt > 存储隔离 < / dt > < dd > 源图和验证轮次不会进入普通素材库 、 图库或角色候选池 < / dd > < / div >
< div > < dt > { { styleSetUploadEnabled ? "迁移验证" : "检索优先级" } } < / dt > < dd > { { styleSetUploadEnabled ? "使用完全不同的角色、场景和构图,只用提示词验证画风泛化能力" : "封存后在自动检索中优先于普通素材,显式选择仍以用户选择为准" } } < / dd > < / div >
< / dl >
< div class = "advanced-upload-actions" >
< span v-if = "styleSetUploadEnabled" class="advanced-style-upload-count" > {{ styleUploadDrafts.length }} / {{ MAX_STYLE_IMAGES }} 张 < / span >
< button type = "button" : disabled = "(!uploadFile && !styleUploadDrafts.length) || Boolean(actionBusy)" @click ="resetUpload" > 清空 < / button >
< button type = "submit" class = "primary" :disabled = "!uploadReady" > { { actionBusy === "upload" ? "提交中" : styleSetUploadEnabled ? "并行识别画风样本" : "提交识别与验证" } } < / button >
< / div >
< / form >
< / div >
< / article >
< aside class = "advanced-material-panel advanced-import-queue" >
< header class = "advanced-section-header compact" > < div > < span > 继续处理 < / span > < h3 > 最近导入 < / h3 > < / div > < button type = "button" :disabled = "loading" @click ="refreshAll()" > 刷新 < / button > < / header >
< div v-if = "sortedImports.length" class="advanced-import-list" >
< button v-for = "item in sortedImports" :key="item.import_id" type="button" :class="['advanced-import-list-item', { active: selectedImportId === item.import_id }]" @click="selectImport(item.import_id)" >
< span : class = "['status-dot', advancedImportStatusMeta(item.status).tone]" / >
< span > < strong > { { item . display _name } } < / strong > < small > { { advancedImportStatusMeta ( item . status ) . label } } < / small > < / span >
< / button >
< / div >
< div v -else class = "advanced-material-empty compact" > < p > 提交后的识别和验证任务会显示在这里 。 < / p > < / div >
< / aside >
< / section >
< / template >
< section v-if = "selectedImport" class="advanced-material-panel advanced-review-panel" >
< header class = "advanced-review-header" >
< div >
< span > 还原度验证工作台 < / span >
< h3 > { { selectedImport . display _name } } < / h3 >
< p > { { categoryName ( selectedImport . category _id ) } } · 导入于 { { formatDate ( selectedImport . created _at ) } } < / p >
< / div >
< div class = "advanced-review-header-actions" >
2026-07-20 17:57:02 +08:00
< button type = "button" @ click = "reviewWorkbenchOpen = !reviewWorkbenchOpen" > { { reviewWorkbenchOpen ? "收起工作台" : "展开工作台" } } < / button >
2026-07-18 23:20:06 +08:00
< div : class = "['advanced-status-chip', selectedStatus.tone]" > < i / > < span > < strong > { { selectedStatus . label } } < / strong > < small > { { selectedStatus . detail } } < / small > < / span > < / div >
< button
v - if = "canManage && !selectedImport.accepted_material_id"
type = "button"
class = "danger"
: disabled = "Boolean(actionBusy)"
@ click = "deleteImport"
> { { actionBusy === "delete-import" ? "删除中" : deleteConfirmImportId === selectedImport . import _id ? "确认删除导入" : "删除导入" } } < / button >
< / div >
< / header >
< div v-if = "detailLoading" class="advanced-review-loading" > 正在读取识别结果与验证轮次 … < / div >
2026-07-20 17:57:02 +08:00
< template v -else -if = " reviewWorkbenchOpen " >
2026-07-18 23:20:06 +08:00
< div v-if = "importError(selectedImport) || attemptError(currentAttempt)" class="advanced-inline-error" >
< div > < strong > 任务错误 < / strong > < span > { { attemptError ( currentAttempt ) || importError ( selectedImport ) } } < / span > < / div >
< button
v - if = "['failed', 'recognition_failed', 'validation_failed', 'style_consensus_failed'].includes(normalizeStatus(selectedImport.status))"
type = "button"
: disabled = "Boolean(actionBusy)"
@ click = "retryImport"
> { { actionBusy === "retry" ? "重试中" : "重试当前阶段" } } < / button >
< / div >
< section v-if = "selectedStyleSet" class="advanced-style-workbench" >
< article class = "advanced-style-stage" >
< header class = "advanced-style-stage-header" >
< div > < span > 01 · 并行识别 < / span > < h4 > 画风样本 { { recognizedStyleSources . length } } / { { activeStyleSources . length || styleSources . length } } 已完成 < / h4 > < p > 每张图片拥有独立任务 、 计时器和错误 ; 失败不会中断其他样本 。 < / p > < / div >
< button v-if = "canRunStyleConsensus" type="button" class="primary" @click="createStyleConsensus">{{ actionBusy === "style-consensus" ? "入队中" : "交叉分析有效样本" }} < / button >
< / header >
< div class = "advanced-style-source-grid" >
< article v-for = "(source, index) in styleSources" :key="source.source_id" :class="{ excluded: source.excluded }" >
< div class = "advanced-style-source-image" > < img v-if = "styleSourceImageUrl(source)" :src="styleSourceImageUrl(source)" :alt="`画风样本 ${index + 1}`" role="button" tabindex="0" title="点击查看大图" @click="openImagePreview(sourcePreviewUrl(source), source.is_primary ? '主参考图' : `画风样本 ${index + 1}`)" @keydown.enter.prevent="openImagePreview(sourcePreviewUrl(source), source.is_primary ? '主参考图' : `画风样本 ${index + 1}`)" @keydown.space.prevent="openImagePreview(sourcePreviewUrl(source), source.is_primary ? '主参考图' : `画风样本 ${index + 1}`)" > < span v-else > 源图准备中 < / span > < / div >
< div class = "advanced-style-source-copy" >
< span : class = "['status-dot', styleSourceTone(source)]" / >
< strong > { { source . is _primary ? "主参考图" : ` 样本 ${ index + 1 } ` } } < / strong >
< small > { { styleSourceStatusLabel ( source ) } } < / small >
< p > { { source . recognition _prompt || "等待视觉模型完成独立画风分析。" } } < / p >
< em v-if = "advancedMaterialErrorMessage(source.error)" > {{ advancedMaterialErrorMessage ( source.error ) }} < / em >
< / div >
< div v-if = "canManage && canEditStyleSources" class="advanced-style-source-actions" >
< button v-if = "normalizeStatus(source.status) === 'failed'" type="button" :disabled="Boolean(actionBusy)" @click="retryStyleSource(source)">{{ actionBusy === `source-retry:${source.source_id}` ? "入队中" : "单独重试" }} < / button >
< button v-if = "!source.is_primary && !source.excluded" type="button" :disabled="Boolean(actionBusy)" @click="excludeStyleSource(source)">{{ actionBusy === `source-exclude:${source.source_id}` ? "处理中" : "排除" }} < / button >
< button v-if = "!source.is_primary && source.excluded" type="button" :disabled="Boolean(actionBusy)" @click="excludeStyleSource(source, false)">{{ actionBusy === `source-exclude:${source.source_id}` ? "处理中" : "恢复" }} < / button >
< / div >
< / article >
< / div >
< p v-if = "recognizedStyleSources.length < MIN_STYLE_IMAGES" class="advanced-style-stage-tip" > 至少需要 2 张有效样本才能交叉分析 ; 失败样本可以单独重试或排除 。 < / p >
2026-07-20 17:57:02 +08:00
< div v-if = "canRunStyleConsensus || canManage" class="advanced-style-reference-picker" >
< div class = "advanced-style-reference-head" >
< strong > 验证参考图 < / strong >
< label class = "advanced-style-reference-toggle" >
< input v-model = "validationReferenceEnabled" type="checkbox" :disabled="Boolean(actionBusy)" / >
< span > 第一轮验证附带 1 张源图作风格参考 < / span >
< / label >
< / div >
< p class = "advanced-style-stage-tip" > 参考图只提供线稿 / 配色 / 眼型等风格语法 ; 不会复制人物身份 、 服装 、 姿势或场景 。 头像 / 全身 / 异场景共用同一张 。 < / p >
< div v-if = "validationReferenceEnabled" class="advanced-style-reference-grid" >
< button
v - for = "(source, index) in recognizedStyleSources"
: key = "`ref:${source.source_id}`"
type = "button"
class = "advanced-style-reference-card"
: class = "{ active: effectiveValidationReferenceSourceId === source.source_id }"
: disabled = "Boolean(actionBusy)"
@ click = "validationReferenceSourceId = source.source_id"
>
< img v-if = "styleSourceImageUrl(source)" :src="styleSourceImageUrl(source)" :alt="`参考样本 ${index + 1}`" / >
< span v-else > 样本 {{ index + 1 }} < / span >
< small > { { source . is _primary ? "主参考" : ` 样本 ${ index + 1 } ` } } < / small >
< / button >
< small v-if = "!recognizedStyleSources.length" > 至少完成 2 张识别后可选择参考图 。 < / small >
< / div >
< / div >
2026-07-18 23:20:06 +08:00
< / article >
< article class = "advanced-style-stage" >
< header class = "advanced-style-stage-header" >
< div > < span > 02 · 交叉分析 < / span > < h4 > 统一画风指纹 { { styleConsensus ? . revision ? ` · 第 ${ styleConsensus . revision } 版 ` : "" } } < / h4 > < p > 共同画风进入胶囊 , 可变项降权 , 人物 、 服装和场景进入内容污染排除 。 < / p > < / div >
< b v-if = "styleConsensus?.consensus_confidence != null" class="advanced-style-confidence" > 置信度 {{ Math.round ( Number ( styleConsensus.consensus_confidence ) * 100 ) }} % < / b >
< / header >
< div v-if = "styleConsensus" class="advanced-style-consensus-grid" >
< section > < span > 核心共同画风 < / span > < ul > < li v-for ="item in consensusItems(styleConsensus.consensus_style)" :key ="item" > {{ item }} < / li > < li v-if = "!consensusItems(styleConsensus.consensus_style).length" > 交叉任务完成后显示稳定共同特征 。 < / li > < / ul > < / section >
< section > < span > 可变或弱特征 < / span > < ul > < li v-for ="item in styleConsensus.variable_style_features.map(consensusItemLabel).filter(Boolean)" :key ="item" > {{ item }} < / li > < li v-if = "!styleConsensus.variable_style_features.length" > 暂无可变特征 。 < / li > < / ul > < / section >
< section > < span > 内容污染排除 < / span > < ul > < li v-for ="item in styleConsensus.content_leakage_exclusions" :key ="item" > {{ item }} < / li > < li v-if = "!styleConsensus.content_leakage_exclusions.length" > 等待模型分离人物 、 服装 、 姿势和场景 。 < / li > < / ul > < / section >
< / div >
< div v-if = "styleConsensus" class="advanced-style-source-flags" >
< span > 代表样本 < b v-for = "sourceId in styleConsensus.representative_source_ids" :key="`representative:${sourceId}`">{{ styleSourceLabel(sourceId) }}</b><small v-if="!styleConsensus.representative_source_ids.length" > 自动选择中 < / small > < / span >
< span > 疑似离群 < em v-for = "sourceId in styleConsensus.outlier_source_ids" :key="`outlier:${sourceId}`">{{ styleSourceLabel(sourceId) }}</em><small v-if="!styleConsensus.outlier_source_ids.length" > 无 < / small > < / span >
< / div >
< div v -else class = "advanced-style-stage-empty" > 逐图识别达到至少两张后 , 可启动交叉分析 。 < / div >
< / article >
< article class = "advanced-style-stage" >
< header class = "advanced-style-stage-header" >
< div > < span > 03 · 纯文本迁移验证 < / span > < h4 > 近域 、 中域与跨场景案例 < / h4 > < p > 只发送统一画风提示词 , 不携带源图 ; 默认使用同一新角色逐级改变构图与场景 , 文字调整会直接写入下一轮提示词 。 < / p > < / div >
< b class = "advanced-style-text-only" > 0 张参考图 < / b >
< / header >
< div v-if = "styleValidationCases.length" class="advanced-style-validation-grid" >
< article v-for = "validationCase in styleValidationCases" :key="validationCase.case_id" >
< div class = "advanced-style-validation-image" > < img v-if = "styleValidationCaseImageUrl(validationCase)" :src="styleValidationCaseImageUrl(validationCase)" :alt="styleValidationScenarioLabel(validationCase.scenario)" role="button" tabindex="0" title="点击查看大图" @click="openImagePreview(validationCasePreviewUrl(validationCase), `${selectedImport.display_name} / ${styleValidationScenarioLabel(validationCase.scenario)}`)" @keydown.enter.prevent="openImagePreview(validationCasePreviewUrl(validationCase), `${selectedImport.display_name} / ${styleValidationScenarioLabel(validationCase.scenario)}`)" @keydown.space.prevent="openImagePreview(validationCasePreviewUrl(validationCase), `${selectedImport.display_name} / ${styleValidationScenarioLabel(validationCase.scenario)}`)" > < span v-else > {{ styleValidationStatusLabel ( validationCase.status ) }} < / span > < / div >
< div class = "advanced-style-validation-copy" >
< span > { { styleValidationScenarioLabel ( validationCase . scenario ) } } < / span >
< strong > { { styleValidationStatusLabel ( validationCase . status ) } } < / strong >
< p > { { validationCase . content _prompt || "后端将规划与源样本不同、但便于对照的验证角色与场景。" } } < / p >
< small v-if = "validationCase.metadata?.validation_instruction" class="advanced-applied-adjustment" > 已应用文字调整 : {{ validationCase.metadata.validation_instruction }} < / small >
< small v-if = "styleValidationFidelityPercent(validationCase) != null" class="advanced-style-fidelity" > 自动还原度 : {{ styleValidationFidelityPercent ( validationCase ) }} % < / small >
< small v-if = "styleValidationReviewSummary(validationCase)" class="advanced-style-review-summary" > {{ styleValidationReviewSummary ( validationCase ) }} < / small >
2026-07-20 17:57:02 +08:00
< small > { { Number ( validationCase . input _image _count || validationCase . metadata ? . input _image _count || 0 ) > 0 || validationCase . metadata ? . reference _image _applied ? "风格参考图验证" : "纯文本验证" } } · { { Number ( validationCase . input _image _count || validationCase . metadata ? . input _image _count || 0 ) } } 张参考图 · 种子 { { validationCase . seed || "自动" } } < / small >
2026-07-18 23:20:06 +08:00
< em v-if = "advancedMaterialErrorMessage(validationCase.error)" > {{ advancedMaterialErrorMessage ( validationCase.error ) }} < / em >
< / div >
< button v-if = "normalizeStatus(validationCase.status) === 'failed'" type="button" :disabled="Boolean(actionBusy)" @click="retryStyleValidationCase(validationCase)">{{ actionBusy === `case-retry:${validationCase.case_id}` ? "入队中" : "单独重试" }} < / button >
< / article >
< / div >
< div v -else class = "advanced-style-stage-empty" > 完成交叉分析后会同时生成头像 、 全身和异场景三项验证 。 < / div >
< / article >
< / section >
< div v -else class = "advanced-recognition-summary" >
< article > < span > 识别提示词 < / span > < p > { { selectedImport . recognition _prompt || "视觉模型识别完成后会显示在这里。" } } < / p > < / article >
< article > < span > 负向约束 < / span > < p > { { selectedImport . recognition _negative _prompt || "暂无负向约束。" } } < / p > < / article >
< article > < span > 识别标签 < / span > < div > < b v-for ="tag in selectedImport.recognition_tags" :key ="tag" > {{ tag }} < / b > < small v-if = "!selectedImport.recognition_tags.length" > 等待识别 < / small > < / div > < / article >
< / div >
< div v-if = "!selectedStyleSet" class="advanced-comparison-grid" >
< figure >
< div > < img v-if = "sourceImageUrl(selectedImport)" :src="sourceImageUrl(selectedImport)" :alt="`${selectedImport.display_name} 源图`" role="button" tabindex="0" title="点击查看大图" @click="openImagePreview(sourcePreviewUrl(selectedImport), `${selectedImport.display_name} / 源图`)" @keydown.enter.prevent="openImagePreview(sourcePreviewUrl(selectedImport), `${selectedImport.display_name} / 源图`)" @keydown.space.prevent="openImagePreview(sourcePreviewUrl(selectedImport), `${selectedImport.display_name} / 源图`)" > < span v-else > 源图正在准备 < / span > < / div >
< figcaption > < strong > 源图 < / strong > < small > 独立保存的识别依据 < / small > < / figcaption >
< / figure >
< figure >
< div > < img v-if = "currentAttempt && attemptImageUrl(currentAttempt)" :src="attemptImageUrl(currentAttempt)" :alt="`${selectedImport.display_name} 验证图`" role="button" tabindex="0" title="点击查看大图" @click="openImagePreview(attemptPreviewUrl(currentAttempt), `${selectedImport.display_name} / 第 ${currentAttempt.attempt_number} 轮验证图`)" @keydown.enter.prevent="openImagePreview(attemptPreviewUrl(currentAttempt), `${selectedImport.display_name} / 第 ${currentAttempt.attempt_number} 轮验证图`)" @keydown.space.prevent="openImagePreview(attemptPreviewUrl(currentAttempt), `${selectedImport.display_name} / 第 ${currentAttempt.attempt_number} 轮验证图`)"><span v-else>{{ currentAttemptStatus.busy ? "验证图生成中" : "尚未生成验证图" }} < / span > < / div >
< figcaption > < strong > 验证图 · 第 { { currentAttempt ? . attempt _number || 0 } } 轮 < / strong > < small > { { currentAttempt ? currentAttemptStatus . label : "等待首轮验证" } } < / small > < / figcaption >
< / figure >
< / div >
< div class = "advanced-review-controls" >
< div v-if = "selectedStyleSet" class="advanced-adjustment-grid" >
< label class = "advanced-adjustment-field" >
< span > 画风修正 ( 选填 ) < / span >
< textarea v-model = "adjustmentText" rows="4" maxlength="2000" placeholder="例如:加强干净细线与两阶赛璐璐阴影,降低暖色滤镜;高光更锐利。" / >
< small > { { adjustmentText . length } } / 2000 · 只修改画风共识与胶囊 ; 未填写验证内容时沿用相同场景和种子做 A / B 对比 。 < / small >
< / label >
< label class = "advanced-adjustment-field" >
< span > 下一轮验证内容 ( 选填 ) < / span >
< textarea v-model = "validationInstructionText" rows="4" maxlength="2000" placeholder="例如:女性角色,全身,萌袖卫衣、泡泡袜和运动鞋,白发蓝瞳猫耳;三个案例保持同一角色。" / >
< small > { { validationInstructionText . length } } / 2000 · 会直接写入三个生图提示词 , 并为新内容使用新的随机种子 , 不再复用旧场景 。 < / small >
< / label >
< / div >
< label v -else class = "advanced-adjustment-field" >
< span > { { canReviewCurrentAttempt ? "不还原时,说明下一轮怎样调整" : "验证描述补充(可选)" } } < / span >
< textarea v-model = "adjustmentText" rows="4" maxlength="2000" placeholder="例如:斗篷应更长,领口是银色毛边;保持原图的蓝灰配色,不要改变材质。" / >
< small > { { adjustmentText . length } } / 2000 · 描述会叠加在识别提示词上 , 并保留每一轮历史 。 < / small >
< / label >
< div v-if = "canReviewCurrentAttempt" class="advanced-decision-fields" >
< label > < span > 主观还原度 { { fidelityPercent } } % < / span > < input v -model .number = " fidelityPercent " type = "range" min = "0" max = "100" step = "1" > < / label >
< label > < span > 审核备注 ( 可选 ) < / span > < input v-model = "decisionNotes" type="text" maxlength="500" placeholder="记录接受或拒绝本轮的理由" > < / label >
< label class = "advanced-accept-confirm" > < input v-model = "acceptConfirmed" type="checkbox"><span>{{ selectedStyleSet ? "我已检查近域、中域和跨场景结果,确认画风可以脱离源图迁移并封存。" : "我已并排比较源图与验证图,确认可以封存为进阶素材。" }} < / span > < / label >
< / div >
< div class = "advanced-review-actions" >
< button v-if = "canStartValidation && !canReviewCurrentAttempt" type="button" class="primary" :disabled="Boolean(actionBusy)" @click="createValidationAttempt">{{ actionBusy === "validation" ? "入队中" : currentAttempt ? "重新生成验证图" : "生成首轮验证图" }} < / button >
< template v-if = "canReviewCurrentAttempt" >
< button type = "button" class = "warn" : disabled = "Boolean(actionBusy) || (!adjustmentText.trim() && !validationInstructionText.trim())" @click ="rejectAndRegenerate" > {{ actionBusy = = = " reject " ? " 提交中 " : selectedStyleSet ? " 应用文字调整并生成下一轮 " : " 不够还原 , 按描述重试 " }} < / button >
< button type = "button" class = "primary" : disabled = "Boolean(actionBusy) || !acceptConfirmed" @click ="acceptAttempt" > {{ actionBusy = = = " accept " ? " 封存中 " : selectedStyleSet ? " 确认迁移能力并封存 " : " 确认还原并封存 " }} < / button >
< / template >
< span v-if = "selectedStatus.busy" > 任务已在后台执行 , 离开页面不会中断 ; 本页会自动刷新状态 。 < / span >
< / div >
< / div >
< details v-if = "sortedAttempts.length" class="advanced-attempt-history" open >
< summary > 验证轮次历史 · { { sortedAttempts . length } } 轮 < / summary >
< div >
< article v-for = "attempt in sortedAttempts" :key="attempt.attempt_id" >
< span : class = "['status-dot', advancedAttemptStatusMeta(attempt.status).tone]" / >
< div > < strong > 第 { { attempt . attempt _number } } 轮 · { { advancedAttemptStatusMeta ( attempt . status ) . label } } < / strong > < p > { { attempt . adjustment _text || "使用识别结果生成首轮验证图" } } < / p > < small > { { attempt . provider _id || "自动路由" } } / { { attempt . provider _model || attempt . model _route || "默认生图模型" } } · { { formatDate ( attempt . updated _at ) } } < / small > < em v-if = "attemptError(attempt)" > {{ attemptError ( attempt ) }} < / em > < / div >
< div v-if = "attempt.validation_cases?.length" class="advanced-attempt-history-images" >
< figure v-for = "validationCase in attempt.validation_cases" :key="validationCase.case_id" >
< img v-if = "styleValidationCaseImageUrl(validationCase)" :src="styleValidationCaseImageUrl(validationCase)" :alt="`第 ${attempt.attempt_number} 轮 ${styleValidationScenarioLabel(validationCase.scenario)}`" role="button" tabindex="0" title="点击查看大图" @click="openImagePreview(validationCasePreviewUrl(validationCase), `${selectedImport.display_name} / 第 ${attempt.attempt_number} 轮 / ${styleValidationScenarioLabel(validationCase.scenario)}`)" @keydown.enter.prevent="openImagePreview(validationCasePreviewUrl(validationCase), `${selectedImport.display_name} / 第 ${attempt.attempt_number} 轮 / ${styleValidationScenarioLabel(validationCase.scenario)}`)" @keydown.space.prevent="openImagePreview(validationCasePreviewUrl(validationCase), `${selectedImport.display_name} / 第 ${attempt.attempt_number} 轮 / ${styleValidationScenarioLabel(validationCase.scenario)}`)" >
< span v-else > {{ styleValidationStatusLabel ( validationCase.status ) }} < / span >
< figcaption > { { styleValidationScenarioLabel ( validationCase . scenario ) } } < / figcaption >
< / figure >
< / div >
< img v -else -if = " attemptImageUrl ( attempt ) " :src = "attemptImageUrl(attempt)" : alt = "`第 ${attempt.attempt_number} 轮验证图`" role = "button" tabindex = "0" title = "点击查看大图" @ click = "openImagePreview(attemptPreviewUrl(attempt), `${selectedImport.display_name} / 第 ${attempt.attempt_number} 轮验证图`)" @ keydown.enter.prevent = " openImagePreview ( attemptPreviewUrl ( attempt ) , ` $ { selectedImport.display_name } / 第 $ { attempt.attempt_number } 轮验证图 ` ) " @ keydown.space.prevent = " openImagePreview ( attemptPreviewUrl ( attempt ) , ` $ { selectedImport.display_name } / 第 $ { attempt.attempt_number } 轮验证图 ` ) " >
< / article >
< / div >
< / details >
< / template >
< / section >
< ImagePreviewDialog
: open = "Boolean(previewImageSrc)"
: title = "previewImageTitle"
: src = "previewImageSrc"
@ close = "closeImagePreview"
/ >
< / section >
< / template >
< style scoped >
. advanced - material - page ,
. advanced - material - panel ,
. advanced - section - header > div ,
. advanced - material - card - copy ,
. advanced - import - list - item > span : last - child ,
. advanced - review - header > div : first - child ,
. advanced - status - chip span ,
. advanced - inline - error > div ,
. advanced - upload - form ,
. advanced - review - controls ,
. advanced - adjustment - field ,
. advanced - decision - fields ,
. advanced - attempt - history article > div {
display : grid ;
min - width : 0 ;
}
. advanced - material - page { gap : 14 px ; }
. advanced - material - panel { gap : 14 px ; border : 1 px solid var ( -- border ) ; border - radius : 10 px ; padding : 14 px ; background : var ( -- panel ) ; }
. advanced - material - banner { display : flex ; align - items : flex - start ; justify - content : space - between ; gap : 14 px ; border : 1 px solid var ( -- border ) ; border - radius : 9 px ; padding : 11 px 12 px ; background : var ( -- panel ) ; }
. advanced - material - banner > div { display : grid ; gap : 4 px ; }
. advanced - material - banner strong { color : var ( -- text ) ; }
. advanced - material - banner span { color : var ( -- text - soft ) ; font - size : 13 px ; }
. advanced - material - banner . good { border - color : var ( -- accent - strong ) ; background : color - mix ( in srgb , var ( -- accent ) 9 % , var ( -- panel ) ) ; }
. advanced - material - banner . bad { border - color : var ( -- danger - strong ) ; background : var ( -- danger - soft ) ; }
. advanced - material - banner button { width : 30 px ; height : 30 px ; border - radius : 7 px ; color : var ( -- text ) ; background : var ( -- panel - muted ) ; font - size : 20 px ; }
. advanced - material - metrics { display : grid ; grid - template - columns : repeat ( 4 , minmax ( 0 , 1 fr ) ) ; gap : 10 px ; }
. advanced - material - metrics article { display : grid ; gap : 6 px ; min - width : 0 ; min - height : 110 px ; border : 1 px solid var ( -- border ) ; border - radius : 9 px ; padding : 12 px ; background : var ( -- panel ) ; }
. advanced - material - metrics span , . advanced - material - metrics small { color : var ( -- text - soft ) ; font - size : 12 px ; }
. advanced - material - metrics strong { color : var ( -- text ) ; font - size : 25 px ; line - height : 1 ; }
. advanced - material - metrics small { line - height : 1.4 ; }
. advanced - material - library - layout { display : grid ; grid - template - columns : minmax ( 0 , 1 fr ) minmax ( 260 px , 330 px ) ; gap : 12 px ; align - items : start ; }
. advanced - material - import - layout { display : grid ; grid - template - columns : minmax ( 0 , 1 fr ) minmax ( 260 px , 330 px ) ; gap : 12 px ; align - items : start ; }
. advanced - section - header , . advanced - review - header { display : flex ; align - items : flex - start ; justify - content : space - between ; gap : 14 px ; }
. advanced - section - header > div , . advanced - review - header > div : first - child { gap : 4 px ; }
. advanced - section - header span , . advanced - review - header span { color : var ( -- text - soft ) ; font - size : 12 px ; font - weight : 800 ; }
. advanced - section - header h3 , . advanced - review - header h3 { margin : 0 ; color : var ( -- text ) ; font - size : 20 px ; }
. advanced - section - header p , . advanced - review - header p { max - width : 720 px ; margin : 0 ; color : var ( -- text - soft ) ; font - size : 13 px ; line - height : 1.5 ; }
. advanced - section - header button , . advanced - review - header - actions button , . advanced - review - actions button , . advanced - upload - actions button , . advanced - inline - error button , . advanced - material - empty button { min - height : 36 px ; border : 1 px solid var ( -- border ) ; border - radius : 8 px ; padding : 0 12 px ; color : var ( -- text ) ; background : var ( -- panel - muted ) ; font - weight : 800 ; }
button . primary { color : # fff ; border - color : var ( -- primary ) ; background : var ( -- primary ) ; }
button . warn { color : var ( -- text ) ; border - color : var ( -- warn - strong ) ; background : var ( -- warn - soft ) ; }
button . danger { color : var ( -- danger ) ; border - color : var ( -- danger - strong ) ; background : var ( -- danger - soft ) ; }
button : disabled { cursor : not - allowed ; opacity : .52 ; }
. advanced - material - card - grid { display : grid ; grid - template - columns : repeat ( 2 , minmax ( 0 , 1 fr ) ) ; gap : 10 px ; }
. advanced - material - card { display : grid ; grid - template - columns : 126 px minmax ( 0 , 1 fr ) ; grid - template - rows : minmax ( 0 , 1 fr ) auto ; gap : 10 px ; min - width : 0 ; min - height : 164 px ; border : 1 px solid var ( -- border ) ; border - radius : 9 px ; padding : 10 px ; color : var ( -- text ) ; text - align : left ; background : var ( -- panel ) ; }
. advanced - material - card : hover { border - color : var ( -- primary ) ; background : var ( -- primary - soft ) ; }
. advanced - material - card - images { display : grid ; grid - row : 1 / 3 ; grid - template - columns : 1 fr 1 fr ; gap : 3 px ; overflow : hidden ; border - radius : 7 px ; background : var ( -- panel - muted ) ; }
. advanced - material - card - images > span { display : grid ; place - items : center ; min - width : 0 ; overflow : hidden ; }
. advanced - material - card - images img { width : 100 % ; height : 100 % ; object - fit : cover ; }
. advanced - material - card - images i { color : var ( -- text - soft ) ; font - size : 10 px ; font - style : normal ; writing - mode : vertical - rl ; }
. advanced - material - card - copy { align - content : start ; gap : 6 px ; }
. advanced - material - card - copy small , . advanced - material - card - copy em { overflow : hidden ; color : var ( -- text - soft ) ; font - size : 12 px ; font - style : normal ; text - overflow : ellipsis ; }
. advanced - material - card - copy strong { overflow : hidden ; text - overflow : ellipsis ; white - space : nowrap ; }
. advanced - material - card - copy em { display : - webkit - box ; line - height : 1.4 ; - webkit - box - orient : vertical ; - webkit - line - clamp : 3 ; }
. advanced - material - card - tags { display : flex ; align - items : flex - end ; flex - wrap : wrap ; gap : 5 px ; }
. advanced - material - card - tags b , . advanced - recognition - summary b { border - radius : 999 px ; padding : 4 px 7 px ; color : var ( -- text - soft ) ; background : var ( -- panel - muted ) ; font - size : 10 px ; }
. advanced - import - queue { position : sticky ; top : 86 px ; max - height : 720 px ; overflow : hidden ; }
. advanced - section - header . compact { align - items : center ; }
. advanced - section - header . compact h3 { font - size : 17 px ; }
. advanced - import - list { display : grid ; gap : 6 px ; min - height : 0 ; overflow - y : auto ; }
. advanced - import - list - item { display : grid ; grid - template - columns : 10 px minmax ( 0 , 1 fr ) ; align - items : center ; gap : 9 px ; min - width : 0 ; border : 1 px solid var ( -- border ) ; border - radius : 8 px ; padding : 9 px ; color : var ( -- text ) ; text - align : left ; background : var ( -- panel - muted ) ; }
. advanced - import - list - item : hover , . advanced - import - list - item . active { border - color : var ( -- primary ) ; background : var ( -- primary - soft ) ; }
. advanced - import - list - item > span : last - child { gap : 3 px ; }
. advanced - import - list - item strong , . advanced - import - list - item small { overflow : hidden ; text - overflow : ellipsis ; white - space : nowrap ; }
. advanced - import - list - item small { color : var ( -- text - soft ) ; font - size : 11 px ; }
. status - dot { display : block ; width : 9 px ; height : 9 px ; border - radius : 999 px ; background : var ( -- neutral ) ; }
. status - dot . good { background : var ( -- accent ) ; }
. status - dot . warn { background : var ( -- warn ) ; }
. status - dot . bad { background : var ( -- danger ) ; }
. status - dot . active { background : var ( -- primary ) ; box - shadow : 0 0 0 4 px var ( -- primary - soft ) ; }
. advanced - material - empty { display : grid ; place - items : center ; gap : 8 px ; min - height : 240 px ; border : 1 px dashed var ( -- border ) ; border - radius : 9 px ; padding : 24 px ; text - align : center ; background : var ( -- panel - muted ) ; }
. advanced - material - empty . compact { min - height : 100 px ; padding : 14 px ; }
. advanced - material - empty strong { color : var ( -- text ) ; font - size : 17 px ; }
. advanced - material - empty p { max - width : 520 px ; margin : 0 ; color : var ( -- text - soft ) ; line - height : 1.5 ; }
. advanced - material - skeleton { display : grid ; grid - template - columns : 1 fr 1 fr ; gap : 10 px ; }
. advanced - material - skeleton span { min - height : 164 px ; border - radius : 9 px ; background : linear - gradient ( 100 deg , var ( -- panel - muted ) , var ( -- primary - soft ) , var ( -- panel - muted ) ) ; background - size : 220 % 100 % ; animation : advanced - pulse 1.2 s linear infinite ; }
. advanced - upload - grid { display : grid ; grid - template - columns : minmax ( 260 px , .8 fr ) minmax ( 320 px , 1.2 fr ) ; gap : 14 px ; }
. advanced - upload - dropzone { position : relative ; display : grid ; place - items : center ; min - height : 390 px ; overflow : hidden ; border : 1 px dashed var ( -- primary ) ; border - radius : 10 px ; color : var ( -- text ) ; background : var ( -- panel - muted ) ; cursor : pointer ; outline : none ; }
. advanced - upload - dropzone : focus { box - shadow : 0 0 0 3 px var ( -- primary - soft ) ; }
. advanced - upload - dropzone img { width : 100 % ; height : 100 % ; max - height : 520 px ; object - fit : contain ; }
. advanced - upload - placeholder { display : grid ; gap : 7 px ; text - align : center ; }
. advanced - upload - placeholder b { font - size : 17 px ; }
. advanced - upload - placeholder small , . advanced - upload - dropzone em { color : var ( -- text - soft ) ; font - size : 12 px ; font - style : normal ; }
. advanced - upload - dropzone em { position : absolute ; right : 10 px ; bottom : 10 px ; left : 10 px ; overflow : hidden ; border - radius : 7 px ; padding : 7 px 9 px ; color : # fff ; background : color - mix ( in srgb , # 101827 75 % , transparent ) ; text - overflow : ellipsis ; white - space : nowrap ; }
. advanced - upload - form { align - content : start ; gap : 11 px ; }
. advanced - upload - form label , . advanced - adjustment - field , . advanced - decision - fields label { display : grid ; gap : 6 px ; color : var ( -- text - soft ) ; font - size : 12 px ; font - weight : 800 ; }
. advanced - upload - form input , . advanced - upload - form select , . advanced - review - controls textarea , . advanced - decision - fields input [ type = "text" ] { width : 100 % ; min - width : 0 ; border : 1 px solid var ( -- border ) ; border - radius : 8 px ; padding : 10 px 11 px ; color : var ( -- text ) ; background : var ( -- panel - muted ) ; outline : none ; }
. advanced - upload - form input : focus , . advanced - upload - form select : focus , . advanced - review - controls textarea : focus , . advanced - decision - fields input : focus { border - color : var ( -- primary ) ; box - shadow : 0 0 0 3 px var ( -- primary - soft ) ; }
. advanced - upload - form dl { display : grid ; gap : 7 px ; margin : 0 ; }
. advanced - upload - form dl div { display : grid ; grid - template - columns : 76 px minmax ( 0 , 1 fr ) ; gap : 9 px ; border : 1 px solid var ( -- border ) ; border - radius : 8 px ; padding : 9 px ; background : var ( -- panel - muted ) ; }
. advanced - upload - form dt { color : var ( -- text - soft ) ; font - size : 11 px ; font - weight : 800 ; }
. advanced - upload - form dd { margin : 0 ; color : var ( -- text ) ; font - size : 12 px ; line - height : 1.45 ; }
. advanced - upload - actions { display : flex ; justify - content : flex - end ; gap : 8 px ; }
. advanced - style - mode - note { color : var ( -- primary ) ; font - weight : 700 ; line - height : 1.45 ; }
. advanced - style - upload - count { align - self : center ; margin - right : auto ; color : var ( -- text - soft ) ; font - size : 12 px ; font - weight : 800 ; }
. advanced - style - upload - grid { display : grid ; grid - template - columns : repeat ( 2 , minmax ( 0 , 1 fr ) ) ; gap : 8 px ; width : 100 % ; padding : 10 px ; }
. advanced - style - upload - grid figure { position : relative ; display : grid ; grid - template - rows : 130 px auto ; min - width : 0 ; overflow : hidden ; margin : 0 ; border : 1 px solid var ( -- border ) ; border - radius : 8 px ; background : var ( -- panel ) ; }
. advanced - style - upload - grid figure > img { width : 100 % ; height : 130 px ; object - fit : cover ; }
. advanced - style - upload - grid figcaption { display : grid ; gap : 2 px ; min - width : 0 ; padding : 7 px 8 px ; }
. advanced - style - upload - grid figcaption strong { color : var ( -- text ) ; font - size : 11 px ; }
. advanced - style - upload - grid figcaption small { overflow : hidden ; color : var ( -- text - soft ) ; font - size : 10 px ; text - overflow : ellipsis ; white - space : nowrap ; }
. advanced - style - upload - actions { position : absolute ; top : 6 px ; right : 6 px ; display : flex ; gap : 4 px ; }
. advanced - style - upload - actions button { display : grid ; place - items : center ; width : 27 px ; height : 27 px ; padding : 0 ; border : 1 px solid var ( -- border ) ; border - radius : 7 px ; color : var ( -- text ) ; background : color - mix ( in srgb , var ( -- panel ) 88 % , transparent ) ; font - size : 14 px ; }
. advanced - style - upload - actions button : last - child { font - size : 17 px ; }
. advanced - style - upload - actions button : disabled { opacity : .38 ; cursor : not - allowed ; }
. advanced - style - upload - add { display : grid ; place - items : center ; align - content : center ; gap : 3 px ; min - height : 177 px ; border : 1 px dashed var ( -- border ) ; border - radius : 8 px ; color : var ( -- text - soft ) ; background : var ( -- panel ) ; }
. advanced - style - upload - add b { color : var ( -- primary ) ; font - size : 25 px ; }
. advanced - style - upload - add small { font - size : 11 px ; }
. advanced - review - panel { margin - top : 0 ; }
. advanced - review - header { align - items : center ; }
. advanced - review - header - actions { display : flex ; align - items : center ; gap : 8 px ; }
. advanced - status - chip { display : grid ; grid - template - columns : 10 px minmax ( 0 , 1 fr ) ; align - items : center ; gap : 9 px ; max - width : 360 px ; border : 1 px solid var ( -- border ) ; border - radius : 9 px ; padding : 9 px 11 px ; background : var ( -- panel - muted ) ; }
. advanced - status - chip i { width : 9 px ; height : 9 px ; border - radius : 999 px ; background : var ( -- neutral ) ; }
. advanced - status - chip . good i { background : var ( -- accent ) ; }
. advanced - status - chip . warn i { background : var ( -- warn ) ; }
. advanced - status - chip . bad i { background : var ( -- danger ) ; }
. advanced - status - chip . active i { background : var ( -- primary ) ; box - shadow : 0 0 0 4 px var ( -- primary - soft ) ; }
. advanced - status - chip span { gap : 2 px ; }
. advanced - status - chip strong { color : var ( -- text ) ; font - size : 12 px ; }
. advanced - status - chip small { color : var ( -- text - soft ) ; font - size : 11 px ; font - weight : 500 ; line - height : 1.35 ; }
. advanced - review - loading { min - height : 160 px ; display : grid ; place - items : center ; color : var ( -- text - soft ) ; background : var ( -- panel - muted ) ; border - radius : 9 px ; }
. advanced - inline - error { display : flex ; justify - content : space - between ; gap : 12 px ; border : 1 px solid var ( -- danger - strong ) ; border - radius : 9 px ; padding : 10 px ; background : var ( -- danger - soft ) ; }
. advanced - inline - error > div { gap : 3 px ; }
. advanced - inline - error strong { color : var ( -- danger ) ; }
. advanced - inline - error span { color : var ( -- text ) ; font - size : 12 px ; }
. advanced - recognition - summary { display : grid ; grid - template - columns : 1.3 fr 1 fr 1 fr ; gap : 9 px ; }
. advanced - recognition - summary article { display : grid ; align - content : start ; gap : 7 px ; min - width : 0 ; border : 1 px solid var ( -- border ) ; border - radius : 9 px ; padding : 10 px ; background : var ( -- panel - muted ) ; }
. advanced - recognition - summary article > span { color : var ( -- text - soft ) ; font - size : 11 px ; font - weight : 800 ; }
. advanced - recognition - summary p { max - height : 96 px ; overflow - y : auto ; margin : 0 ; color : var ( -- text ) ; font - size : 12 px ; line - height : 1.5 ; white - space : pre - wrap ; }
. advanced - recognition - summary article > div { display : flex ; flex - wrap : wrap ; gap : 5 px ; }
. advanced - recognition - summary small { color : var ( -- text - soft ) ; }
. advanced - comparison - grid { display : grid ; grid - template - columns : 1 fr 1 fr ; gap : 10 px ; }
. advanced - comparison - grid figure { display : grid ; gap : 0 ; min - width : 0 ; overflow : hidden ; margin : 0 ; border : 1 px solid var ( -- border ) ; border - radius : 9 px ; background : var ( -- panel - muted ) ; }
. advanced - comparison - grid figure > div { display : grid ; place - items : center ; min - height : 390 px ; overflow : hidden ; background : color - mix ( in srgb , var ( -- panel - muted ) 82 % , # 000 18 % ) ; }
. advanced - comparison - grid img { width : 100 % ; height : 100 % ; max - height : 620 px ; object - fit : contain ; }
. advanced - comparison - grid figure > div > span { color : var ( -- text - soft ) ; font - size : 13 px ; }
. advanced - comparison - grid figcaption { display : flex ; align - items : center ; justify - content : space - between ; gap : 8 px ; padding : 10 px 12 px ; }
. advanced - comparison - grid figcaption strong { color : var ( -- text ) ; }
. advanced - comparison - grid figcaption small { color : var ( -- text - soft ) ; }
. advanced - style - workbench { display : grid ; gap : 12 px ; }
. advanced - style - stage { display : grid ; gap : 11 px ; min - width : 0 ; border : 1 px solid var ( -- border ) ; border - radius : 9 px ; padding : 11 px ; background : var ( -- panel - muted ) ; }
. advanced - style - stage - header { display : flex ; align - items : flex - start ; justify - content : space - between ; gap : 12 px ; }
. advanced - style - stage - header > div { display : grid ; gap : 3 px ; min - width : 0 ; }
. advanced - style - stage - header span { color : var ( -- primary ) ; font - size : 11 px ; font - weight : 900 ; letter - spacing : .04 em ; }
. advanced - style - stage - header h4 { margin : 0 ; color : var ( -- text ) ; font - size : 16 px ; }
. advanced - style - stage - header p { margin : 0 ; color : var ( -- text - soft ) ; font - size : 12 px ; line - height : 1.45 ; }
. advanced - style - stage - header button , . advanced - style - source - actions button , . advanced - style - validation - grid article > button { min - height : 32 px ; border : 1 px solid var ( -- border ) ; border - radius : 7 px ; padding : 0 10 px ; color : var ( -- text ) ; background : var ( -- panel ) ; font - size : 11 px ; font - weight : 800 ; }
. advanced - style - confidence , . advanced - style - text - only { flex : 0 0 auto ; border : 1 px solid var ( -- border ) ; border - radius : 999 px ; padding : 6 px 9 px ; color : var ( -- text ) ; background : var ( -- panel ) ; font - size : 11 px ; }
. advanced - style - text - only { color : var ( -- accent - strong ) ; border - color : var ( -- accent - strong ) ; background : color - mix ( in srgb , var ( -- accent ) 8 % , var ( -- panel ) ) ; }
. advanced - style - source - grid { display : grid ; grid - template - columns : repeat ( 2 , minmax ( 0 , 1 fr ) ) ; gap : 8 px ; }
. advanced - style - source - grid > article { display : grid ; grid - template - columns : 92 px minmax ( 0 , 1 fr ) ; grid - template - rows : minmax ( 0 , 1 fr ) auto ; gap : 8 px ; min - width : 0 ; overflow : hidden ; border : 1 px solid var ( -- border ) ; border - radius : 8 px ; padding : 8 px ; background : var ( -- panel ) ; }
. advanced - style - source - grid > article . excluded { opacity : .55 ; }
. advanced - style - source - image { display : grid ; grid - row : 1 / 3 ; place - items : center ; min - height : 110 px ; overflow : hidden ; border - radius : 6 px ; color : var ( -- text - soft ) ; background : var ( -- panel - muted ) ; font - size : 10 px ; }
. advanced - style - source - image img { width : 100 % ; height : 100 % ; object - fit : cover ; }
. advanced - style - source - copy { display : grid ; grid - template - columns : 10 px minmax ( 0 , 1 fr ) ; gap : 3 px 7 px ; min - width : 0 ; }
. advanced - style - source - copy . status - dot { align - self : center ; grid - row : 1 / 3 ; }
. advanced - style - source - copy strong { overflow : hidden ; color : var ( -- text ) ; font - size : 12 px ; text - overflow : ellipsis ; white - space : nowrap ; }
. advanced - style - source - copy small { color : var ( -- text - soft ) ; font - size : 10 px ; }
. advanced - style - source - copy p , . advanced - style - source - copy em { grid - column : 1 / - 1 ; margin : 3 px 0 0 ; font - size : 10 px ; line - height : 1.4 ; }
. advanced - style - source - copy p { display : - webkit - box ; overflow : hidden ; color : var ( -- text - soft ) ; - webkit - box - orient : vertical ; - webkit - line - clamp : 3 ; }
. advanced - style - source - copy em { color : var ( -- danger ) ; font - style : normal ; }
. advanced - style - source - actions { display : flex ; justify - content : flex - end ; gap : 6 px ; }
. advanced - style - stage - tip , . advanced - style - stage - empty { margin : 0 ; border : 1 px dashed var ( -- border ) ; border - radius : 7 px ; padding : 9 px ; color : var ( -- text - soft ) ; background : var ( -- panel ) ; font - size : 11 px ; line - height : 1.45 ; }
. advanced - style - consensus - grid , . advanced - style - validation - grid { display : grid ; grid - template - columns : repeat ( 3 , minmax ( 0 , 1 fr ) ) ; gap : 8 px ; }
. advanced - style - consensus - grid > section { min - width : 0 ; border : 1 px solid var ( -- border ) ; border - radius : 8 px ; padding : 9 px ; background : var ( -- panel ) ; }
. advanced - style - consensus - grid > section > span { color : var ( -- text ) ; font - size : 12 px ; font - weight : 900 ; }
. advanced - style - consensus - grid ul { display : grid ; gap : 5 px ; margin : 8 px 0 0 ; padding - left : 17 px ; color : var ( -- text - soft ) ; font - size : 11 px ; line - height : 1.4 ; }
. advanced - style - source - flags { display : flex ; flex - wrap : wrap ; gap : 8 px 14 px ; margin - top : 8 px ; color : var ( -- text - soft ) ; font - size : 11 px ; }
. advanced - style - source - flags > span { display : inline - flex ; flex - wrap : wrap ; align - items : center ; gap : 5 px ; }
. advanced - style - source - flags b , . advanced - style - source - flags em { border - radius : 999 px ; padding : 3 px 7 px ; font - style : normal ; font - weight : 800 ; }
. advanced - style - source - flags b { color : var ( -- primary ) ; background : var ( -- primary - soft ) ; }
. advanced - style - source - flags em { color : var ( -- danger ) ; background : color - mix ( in srgb , var ( -- danger ) 12 % , transparent ) ; }
. advanced - style - validation - grid > article { display : grid ; gap : 8 px ; min - width : 0 ; overflow : hidden ; border : 1 px solid var ( -- border ) ; border - radius : 8 px ; padding : 8 px ; background : var ( -- panel ) ; }
. advanced - style - validation - image { display : grid ; place - items : center ; min - height : 220 px ; overflow : hidden ; border - radius : 6 px ; color : var ( -- text - soft ) ; background : var ( -- panel - muted ) ; font - size : 11 px ; }
. advanced - style - validation - image img { width : 100 % ; height : 220 px ; object - fit : contain ; }
. advanced - style - validation - copy { display : grid ; gap : 3 px ; min - width : 0 ; }
. advanced - style - validation - copy > span { color : var ( -- primary ) ; font - size : 10 px ; font - weight : 900 ; }
. advanced - style - validation - copy strong { color : var ( -- text ) ; font - size : 12 px ; }
. advanced - style - validation - copy p { display : - webkit - box ; overflow : hidden ; margin : 2 px 0 ; color : var ( -- text - soft ) ; font - size : 10 px ; line - height : 1.4 ; - webkit - box - orient : vertical ; - webkit - line - clamp : 3 ; }
. advanced - style - validation - copy small { color : var ( -- accent - strong ) ; font - size : 10 px ; }
. advanced - style - validation - copy . advanced - applied - adjustment { border - left : 2 px solid var ( -- primary ) ; padding - left : 6 px ; color : var ( -- primary ) ; line - height : 1.4 ; }
. advanced - style - validation - copy . advanced - style - fidelity { color : var ( -- text ) ; font - weight : 900 ; }
. advanced - style - validation - copy . advanced - style - review - summary { border - left : 2 px solid var ( -- warning , # d89b30 ) ; padding - left : 6 px ; color : var ( -- text - soft ) ; line - height : 1.4 ; }
. advanced - style - validation - copy em { color : var ( -- danger ) ; font - size : 10 px ; font - style : normal ; }
. advanced - review - controls { gap : 10 px ; }
. advanced - adjustment - grid { display : grid ; grid - template - columns : repeat ( 2 , minmax ( 0 , 1 fr ) ) ; gap : 10 px ; }
. advanced - adjustment - field { gap : 7 px ; }
. advanced - review - controls textarea { resize : vertical ; line - height : 1.5 ; }
. advanced - adjustment - field small { color : var ( -- text - soft ) ; font - weight : 500 ; }
. advanced - decision - fields { grid - template - columns : 1 fr 1 fr ; gap : 10 px ; border : 1 px solid var ( -- border ) ; border - radius : 9 px ; padding : 10 px ; background : var ( -- panel - muted ) ; }
. advanced - accept - confirm { grid - column : 1 / - 1 ; display : flex ! important ; grid - template - columns : none ! important ; align - items : flex - start ; flex - direction : row ; }
. advanced - accept - confirm input { flex : 0 0 auto ; margin - top : 2 px ; }
. advanced - accept - confirm span { color : var ( -- text ) ; line - height : 1.4 ; }
. advanced - review - actions { display : flex ; align - items : center ; justify - content : flex - end ; flex - wrap : wrap ; gap : 8 px ; }
. advanced - review - actions > span { margin - right : auto ; color : var ( -- text - soft ) ; font - size : 12 px ; }
. advanced - attempt - history { border - top : 1 px solid var ( -- border ) ; padding - top : 10 px ; }
. advanced - attempt - history summary { color : var ( -- text ) ; font - weight : 900 ; cursor : pointer ; }
. advanced - attempt - history > div { display : grid ; gap : 7 px ; margin - top : 10 px ; }
. advanced - attempt - history article { display : grid ; grid - template - columns : 10 px minmax ( 0 , 1 fr ) minmax ( 210 px , 280 px ) ; align - items : center ; gap : 10 px ; min - width : 0 ; border : 1 px solid var ( -- border ) ; border - radius : 8 px ; padding : 9 px ; background : var ( -- panel - muted ) ; }
. advanced - attempt - history article > div { gap : 3 px ; }
. advanced - attempt - history strong { color : var ( -- text ) ; font - size : 12 px ; }
. advanced - attempt - history p { margin : 0 ; color : var ( -- text ) ; font - size : 12 px ; line - height : 1.4 ; }
. advanced - attempt - history small { color : var ( -- text - soft ) ; font - size : 10 px ; }
. advanced - attempt - history em { color : var ( -- danger ) ; font - size : 11 px ; font - style : normal ; }
. advanced - attempt - history img { width : 84 px ; height : 64 px ; border - radius : 6 px ; object - fit : cover ; }
. advanced - attempt - history - images { display : grid ; grid - template - columns : repeat ( 3 , minmax ( 0 , 1 fr ) ) ; gap : 5 px ; min - width : 0 ; }
. advanced - attempt - history - images figure { display : grid ; grid - template - rows : 62 px auto ; min - width : 0 ; overflow : hidden ; margin : 0 ; border : 1 px solid var ( -- border ) ; border - radius : 6 px ; background : var ( -- panel ) ; }
. advanced - attempt - history - images img { width : 100 % ; height : 62 px ; border - radius : 0 ; object - fit : cover ; }
. advanced - attempt - history - images figure > span { display : grid ; place - items : center ; min - height : 62 px ; color : var ( -- text - soft ) ; font - size : 9 px ; }
. advanced - attempt - history - images figcaption { overflow : hidden ; padding : 3 px 4 px ; color : var ( -- text - soft ) ; font - size : 9 px ; text - align : center ; text - overflow : ellipsis ; white - space : nowrap ; }
. advanced - style - source - image img [ role = "button" ] , . advanced - style - validation - image img [ role = "button" ] , . advanced - comparison - grid img [ role = "button" ] , . advanced - attempt - history img [ role = "button" ] { cursor : zoom - in ; }
. advanced - style - source - image img [ role = "button" ] : focus - visible , . advanced - style - validation - image img [ role = "button" ] : focus - visible , . advanced - comparison - grid img [ role = "button" ] : focus - visible , . advanced - attempt - history img [ role = "button" ] : focus - visible { outline : 3 px solid var ( -- primary ) ; outline - offset : - 3 px ; }
@ keyframes advanced - pulse { to { background - position : - 220 % 0 ; } }
@ media ( max - width : 1180 px ) {
. advanced - material - metrics { grid - template - columns : repeat ( 2 , minmax ( 0 , 1 fr ) ) ; }
. advanced - material - library - layout , . advanced - material - import - layout { grid - template - columns : 1 fr ; }
. advanced - import - queue { position : static ; max - height : none ; }
}
@ media ( max - width : 820 px ) {
. advanced - material - metrics , . advanced - material - card - grid , . advanced - upload - grid , . advanced - recognition - summary , . advanced - comparison - grid , . advanced - decision - fields , . advanced - style - consensus - grid , . advanced - style - validation - grid , . advanced - adjustment - grid { grid - template - columns : 1 fr ; }
. advanced - section - header , . advanced - review - header { align - items : stretch ; flex - direction : column ; }
. advanced - status - chip { max - width : none ; }
. advanced - material - card { grid - template - columns : 108 px minmax ( 0 , 1 fr ) ; }
. advanced - comparison - grid figure > div { min - height : 300 px ; }
}
@ media ( max - width : 520 px ) {
. advanced - material - metrics { grid - template - columns : 1 fr ; }
. advanced - material - card { grid - template - columns : 1 fr ; }
. advanced - material - card - images { grid - row : auto ; min - height : 190 px ; }
. advanced - upload - dropzone { min - height : 300 px ; }
. advanced - upload - actions , . advanced - review - actions { align - items : stretch ; flex - direction : column ; }
. advanced - style - upload - count { margin : 0 ; }
. advanced - style - upload - grid , . advanced - style - source - grid { grid - template - columns : 1 fr ; }
. advanced - style - stage - header { align - items : stretch ; flex - direction : column ; }
. advanced - review - actions > span { margin : 0 ; }
. advanced - attempt - history article { grid - template - columns : 10 px minmax ( 0 , 1 fr ) ; }
. advanced - attempt - history > div > article > img , . advanced - attempt - history - images { grid - column : 2 ; width : 100 % ; }
. advanced - attempt - history > div > article > img { height : 120 px ; }
}
2026-07-20 17:57:02 +08:00
. advanced - style - reference - picker { display : grid ; gap : 8 px ; min - width : 0 ; border : 1 px dashed var ( -- border ) ; border - radius : 8 px ; padding : 10 px ; background : var ( -- panel ) ; }
. advanced - style - reference - head { display : flex ; flex - wrap : wrap ; align - items : center ; justify - content : space - between ; gap : 8 px ; }
. advanced - style - reference - head strong { color : var ( -- text ) ; font - size : 12 px ; }
. advanced - style - reference - toggle { display : inline - flex ; align - items : center ; gap : 6 px ; color : var ( -- text - soft ) ; font - size : 11 px ; font - weight : 700 ; }
. advanced - style - reference - grid { display : grid ; grid - template - columns : repeat ( auto - fill , minmax ( 88 px , 1 fr ) ) ; gap : 8 px ; }
. advanced - style - reference - card { display : grid ; gap : 4 px ; min - width : 0 ; border : 1 px solid var ( -- border ) ; border - radius : 8 px ; padding : 6 px ; color : var ( -- text - soft ) ; background : var ( -- panel - muted ) ; text - align : left ; cursor : pointer ; }
. advanced - style - reference - card . active { border - color : var ( -- primary ) ; color : var ( -- text ) ; box - shadow : 0 0 0 1 px color - mix ( in srgb , var ( -- primary ) 35 % , transparent ) ; }
. advanced - style - reference - card img { width : 100 % ; aspect - ratio : 1 ; object - fit : cover ; border - radius : 6 px ; background : # 111 ; }
. advanced - style - reference - card small { font - size : 10 px ; font - weight : 800 ; }
2026-07-18 23:20:06 +08:00
< / style >