/* ===== WickEditor Style Dark Theme ===== */
:root {
    --bg-darkest: #101014;
    --bg-dark: #16181d;
    --bg-panel: #1c1e24;
    --bg-panel-alt: #22252c;
    --bg-input: #2a2d36;
    --bg-hover: #333744;
    --border-color: #2a2d34;
    --border-light: #3a3d46;
    --accent: #00bfa5;
    --accent-hover: #00d4b8;
    --accent-dark: #009688;
    --text-primary: #e8ebf2;
    --text-secondary: #9ea4b3;
    --text-muted: #6b7280;
    --shadow: rgba(0, 0, 0, 0.4);
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --status-success: #22c55e;
    --status-warning: #f59e0b;
    --status-error: #ef4444;
    --status-info: #3b82f6;
}

/* ===== Reset ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body, #app {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Inter', 'PingFang SC', 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 13px;
    color: var(--text-primary);
    background: var(--bg-darkest);
    -webkit-font-smoothing: antialiased;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-hover);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}

/* ===== Button Reset ===== */
button {
    font-family: inherit;
    font-size: inherit;
    border: none;
    background: none;
    cursor: pointer;
    outline: none;
    color: inherit;
}

input, textarea, select {
    font-family: inherit;
    font-size: inherit;
    outline: none;
    border: none;
    background: none;
    color: inherit;
}

a {
    color: inherit;
    text-decoration: none;
}

ul, ol {
    list-style: none;
}

/* ===== Layout ===== */
.app-layout {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    background: var(--bg-darkest);
}

.app-header {
    display: flex;
    align-items: center;
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border-color);
    padding: 20px 40px !important;
    flex-shrink: 0;
    min-height: 56px;
}

.app-header__brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-header__logo {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    border-radius: 10px;
    color: #fff;
}

.app-header__title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.app-header__nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 40px;
}

.app-header__nav-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s ease;
}

.app-header__nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.app-header__nav-item.active,
.app-header__nav-item.router-link-active {
    background: rgba(0, 191, 165, 0.15);
    color: var(--accent);
}

.app-header__actions {
    margin-left: auto;
}

.app-header__user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px;
    border-radius: var(--radius-sm);
}

.app-header__user:hover {
    background: var(--bg-hover);
}

.app-header__avatar {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    border-radius: 50%;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}

.app-header__avatar--admin {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.app-header__username {
    font-size: 13px;
    color: var(--text-primary);
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-header__badge {
    font-size: 10px;
    padding: 2px 6px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #fff;
    border-radius: 10px;
    font-weight: 500;
}

.app-header__user {
    cursor: pointer;
}

/* ===== Login Modal ===== */
.modal--login {
    max-width: 400px;
    width: 90%;
}

.modal--login .modal__body {
    padding: 24px;
}

.login-form .form-group {
    margin-bottom: 16px;
}

.login-form .form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.login-form .form-group input {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
}

.login-form .form-group input:focus {
    border-color: var(--accent);
    outline: none;
}

.login-error {
    padding: 10px 12px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-sm);
    color: var(--status-error);
    font-size: 13px;
    margin-top: 16px;
}

.login-hint {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
}

.login-hint .hint-small {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-input);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-family: monospace;
}

.btn--sm {
    padding: 6px 12px;
    font-size: 12px;
    gap: 4px;
}

.app-main {
    flex: 1;
    overflow: hidden;
    display: flex;
    width: 100%;
}

.app-main > * {
    flex: 1;
    width: 100%;
}

/* ===== Novel List Page - 剧本管理 ===== */
.novel-list {
    display: flex;
    width: 100%;
    height: 100%;
    min-height: 0; /* 关键：允许flex项目缩小以启用子元素滚动 */
}

/* 左侧导航�?*/
.novel-list__sidebar {
    width: 280px;
    flex-shrink: 0;
    background: var(--bg-dark);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 16px;
    overflow-y: auto;
}

.novel-list__sidebar .sidebar-section {
    margin-bottom: 16px;
}

.novel-list__sidebar .sidebar-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.novel-list__sidebar .sidebar-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.novel-list__sidebar .sidebar-filter-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.novel-list__sidebar .sidebar-filter-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.novel-list__sidebar .sidebar-filter-btn.active {
    background: rgba(0, 191, 165, 0.15);
    color: var(--accent);
}

/* 右侧主内容区 */
.novel-list__main {
    flex: 1;
    min-width: 0;
    min-height: 0; /* 关键：允许flex项目缩小以启用子元素滚动 */
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 顶部标题和搜�?*/
.novel-list__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-dark);
}

.novel-list__header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.novel-list__actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.novel-list__actions .search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    min-width: 240px;
}

.novel-list__actions .search-box svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.novel-list__actions .search-box input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
}

.novel-list__actions .search-box input::placeholder {
    color: var(--text-muted);
}

/* Tab筛�?*/
.novel-list__tabs {
    display: flex;
    gap: 0;
    padding: 0 24px;
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border-color);
}

.novel-list__tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.novel-list__tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.novel-list__tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.novel-list__tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--bg-input);
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.novel-list__tab.active .novel-list__tab-count {
    background: var(--accent);
    color: white;
}

/* 内容�?- 滚动容器 */
.novel-list__content {
    flex: 1 1 0;
    min-height: 0; /* 关键：允许flex项目缩小以启用滚�?*/
    max-height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 24px;
    padding-bottom: 80px;
    /* Firefox滚动条样�?*/
    scrollbar-width: thin;
    scrollbar-color: var(--border-light) var(--bg-dark);
}

/* 自定义滚动条样式 - Chrome/Edge/Safari */
.novel-list__content::-webkit-scrollbar {
    width: 10px;
}

.novel-list__content::-webkit-scrollbar-track {
    background: var(--bg-dark);
    border-radius: 5px;
}

.novel-list__content::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 5px;
    min-height: 50px;
}

.novel-list__content::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.novel-list__loading,
.novel-list__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
}

.novel-list__empty svg {
    opacity: 0.3;
    margin-bottom: 16px;
}

.novel-list__empty h3 {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.novel-list__empty p {
    font-size: 13px;
    margin-bottom: 20px;
}

.novel-list__empty-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: var(--accent);
    border-radius: var(--radius-md);
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s ease;
}

.novel-list__empty-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.novel-list__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* 创建剧本卡片 */
.novel-card--create {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    border: 2px dashed var(--border-color);
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.novel-card--create:hover {
    border-color: var(--accent);
    background: rgba(0, 191, 165, 0.05);
}

.novel-card__create-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.novel-card__create-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--bg-panel);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.novel-card--create:hover .novel-card__create-icon {
    background: var(--accent);
    color: #fff;
}

.novel-card__create-text {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
}

.novel-card--create:hover .novel-card__create-text {
    color: var(--accent);
}

/* ===== Novel Card ===== */
.novel-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.novel-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.novel-card:hover .novel-card__actions {
    opacity: 1;
}

.novel-card__cover {
    height: 160px;
    background: linear-gradient(135deg, var(--bg-panel-alt) 0%, var(--bg-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.novel-card__cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.novel-card__cover-placeholder {
    color: var(--text-muted);
    opacity: 0.5;
}

.novel-card__status {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 10px;
    font-weight: 600;
}

.novel-card__status--draft {
    background: rgba(107, 114, 128, 0.2);
    color: var(--text-secondary);
}

.novel-card__status--progress {
    background: rgba(245, 158, 11, 0.2);
    color: var(--status-warning);
}

.novel-card__status--completed {
    background: rgba(34, 197, 94, 0.2);
    color: var(--status-success);
}

.novel-card__info {
    padding: 14px 16px;
}

.novel-card__title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.novel-card__author {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.novel-card__meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.novel-card__genre {
    font-size: 11px;
    padding: 3px 8px;
    background: rgba(0, 191, 165, 0.1);
    color: var(--accent);
    border-radius: var(--radius-sm);
}

.novel-card__chapters {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--text-muted);
}

.novel-card__time {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--text-muted);
}

.novel-card__actions {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.novel-card__actions button {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    border-radius: var(--radius-sm);
    color: #fff;
    transition: all 0.15s ease;
}

.novel-card__actions button:hover {
    background: var(--accent);
}

.novel-card__actions button.delete:hover {
    background: var(--status-error);
}

/* ===== Modal ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 排除已有专用样式定义的模态框，避免覆盖其专用样式 */
.modal:not(.modal--character-fullscreen):not(.modal--scene-character):not(.modal--character-editor):not(.modal--character-create):not(.modal--voice-actor-enhanced):not(.modal--voice-actor-single-narration):not(.modal--scene-editor):not(.modal--scene-library):not(.modal--scene-background-full) {
    width: 480px;
    max-width: 90%;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    z-index: 10000;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
}

.modal--large {
    width: 640px;
}

.modal--export-result {
    width: 600px;
    max-width: 90vw;
}

.export-result-modal__summary {
    text-align: center;
    font-size: 16px;
    padding: 16px;
    background: rgba(var(--accent-rgb), 0.1);
    border-radius: 8px;
    margin-bottom: 20px;
}

.export-result-modal__summary strong {
    color: var(--accent);
    font-size: 18px;
}

.export-result-modal__item {
    margin-bottom: 16px;
}

.export-result-modal__item label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text);
}

.export-result-modal__path {
    display: flex;
    gap: 8px;
    align-items: center;
}

.export-result-modal__path input {
    flex: 1;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 13px;
    font-family: 'Consolas', 'Monaco', monospace;
}

.export-result-modal__path input:focus {
    outline: none;
    border-color: var(--accent);
}

.export-result-modal__preview {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.export-result-modal__preview label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    color: var(--text);
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(20px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal__header h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal__close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
}

.modal__close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal__body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

/* ===== Form ===== */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    transition: border-color 0.15s ease;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--accent);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-row .form-group {
    flex: 1;
}

.form-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
    text-align: right;
}

/* ===== Buttons ===== */
.btn {
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s ease;
}

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

.btn--primary:hover {
    background: var(--accent-hover);
}

.btn--secondary {
    background: var(--bg-input);
    color: var(--text-secondary);
}

.btn--secondary:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn--outline {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
}

.btn--outline:hover {
    background: rgba(0, 191, 165, 0.1);
    border-color: var(--accent-hover);
    color: var(--accent-hover);
}

.btn--danger {
    background: #e74c3c;
    color: white;
}

.btn--danger:hover {
    background: #c0392b;
}

/* ===== Loading Spinner ===== */
.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ===== Novel Detail Page ===== */
.novel-detail {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    background: var(--bg-darkest);
}

.novel-detail__header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px 24px;
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.novel-detail__back {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    transition: all 0.15s ease;
}

.novel-detail__back:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.novel-detail__title-section {
    flex: 1;
}

.novel-detail__title-section h1 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.novel-detail__author {
    font-size: 12px;
    color: var(--text-muted);
}

.novel-detail__actions {
    display: flex;
    gap: 10px;
}

.novel-detail__action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    background: var(--bg-input);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    transition: all 0.15s ease;
}

.novel-detail__action-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.novel-detail__action-btn--primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.novel-detail__action-btn--primary:hover {
    background: var(--accent-hover);
}

.novel-detail__tabs {
    display: flex;
    gap: 4px;
    padding: 0 24px;
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border-color);
}

.novel-detail__tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all 0.15s ease;
}

.novel-detail__tab:hover {
    color: var(--text-primary);
    background: rgba(0, 191, 165, 0.05);
}

.novel-detail__tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.novel-detail__tab-count {
    padding: 2px 8px;
    background: var(--bg-input);
    border-radius: 10px;
    font-size: 11px;
    color: var(--text-muted);
}

.novel-detail__tab.active .novel-detail__tab-count {
    background: rgba(0, 191, 165, 0.2);
    color: var(--accent);
}

.novel-detail__content {
    flex: 1;
    overflow: auto;
    padding: 24px;
}

/* ===== Chapters Panel ===== */
.chapters-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.chapters-panel__header h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.chapters-panel__add-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--accent);
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.15s ease;
}

.chapters-panel__add-btn:hover {
    background: var(--accent-hover);
}

.chapters-panel__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.chapters-panel__empty svg {
    opacity: 0.3;
    margin-bottom: 16px;
}

.chapters-panel__empty h3 {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.chapters-panel__list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ===== Chapter Item ===== */
.chapter-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s ease;
}

.chapter-item:hover {
    border-color: var(--accent);
    background: rgba(0, 191, 165, 0.05);
}

.chapter-item:hover .chapter-item__actions {
    opacity: 1;
}

.chapter-item__number {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
}

.chapter-item__info {
    flex: 1;
    min-width: 0;
}

.chapter-item__title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chapter-item__meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
}

.chapter-item__status {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 11px;
}

.chapter-item__status--pending {
    background: rgba(107, 114, 128, 0.1);
    color: var(--text-muted);
}

.chapter-item__status--analyzing {
    background: rgba(245, 158, 11, 0.15);
    color: var(--status-warning);
}

.chapter-item__status--analyzed {
    background: rgba(59, 130, 246, 0.15);
    color: var(--status-info);
}

.chapter-item__status--edited {
    background: rgba(0, 191, 165, 0.15);
    color: var(--accent);
}

.chapter-item__status--2d {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
}

.chapter-item__actions {
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.chapter-item__btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    transition: all 0.15s ease;
}

.chapter-item__btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.chapter-item__btn--analyze {
    background: rgba(59, 130, 246, 0.15);
    color: var(--status-info);
}

.chapter-item__btn--analyze:hover {
    background: var(--status-info);
    color: #fff;
}

.chapter-item__btn--delete:hover {
    background: var(--status-error);
    color: #fff;
}

.chapter-item__btn--view {
    background: rgba(0, 212, 170, 0.15);
    color: #00d4aa;
}

.chapter-item__btn--view:hover {
    background: #00d4aa;
    color: #fff;
}

/* 章节分析按钮样式 */
.chapter-analyze-btn {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    border: 1px solid transparent;
}

.chapter-analyze-btn--emoji {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(234, 88, 12, 0.15) 100%);
    border-color: rgba(245, 158, 11, 0.4);
    color: #f59e0b;
}

.chapter-analyze-btn--emoji:hover {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.3) 0%, rgba(234, 88, 12, 0.3) 100%);
    border-color: #f59e0b;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
}

.chapter-analyze-btn--2d {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
    border-color: rgba(99, 102, 241, 0.4);
    color: #818cf8;
}

.chapter-analyze-btn--2d:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3) 0%, rgba(139, 92, 246, 0.3) 100%);
    border-color: #818cf8;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

.chapter-item__arrow {
    color: var(--text-muted);
}

/* ===== Chapter Editor ===== */
.chapter-editor {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    background: var(--bg-darkest);
}

.chapter-editor__header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.chapter-editor__back {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    transition: all 0.15s ease;
}

.chapter-editor__back:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.chapter-editor__title {
    flex: 1;
}

.chapter-editor__title h1 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.chapter-editor__chapter-num {
    font-size: 11px;
    color: var(--accent);
    font-weight: 500;
}

.chapter-editor__actions {
    display: flex;
    gap: 10px;
}

.chapter-editor__btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    background: var(--bg-input);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    transition: all 0.15s ease;
}

.chapter-editor__btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.chapter-editor__btn--analyze {
    background: rgba(59, 130, 246, 0.15);
    color: var(--status-info);
    border-color: rgba(59, 130, 246, 0.3);
}

.chapter-editor__btn--analyze:hover {
    background: var(--status-info);
    color: #fff;
}

.chapter-editor__btn--primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.chapter-editor__btn--primary:hover {
    background: var(--accent-hover);
}

.chapter-editor__main {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
}

.chapter-editor__text-panel {
    width: 40%;
    display: flex;
    flex-direction: column;
    background: var(--bg-dark);
    flex-shrink: 0;
}

/* 可拖拽分隔条 */
.chapter-editor__resizer {
    width: 10px;
    background: linear-gradient(90deg, var(--bg-panel) 0%, var(--border-color) 50%, var(--bg-panel) 100%);
    cursor: col-resize;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
    z-index: 10;
    flex-shrink: 0;
}

.chapter-editor__resizer:hover {
    background: linear-gradient(90deg, var(--bg-hover) 0%, var(--accent) 50%, var(--bg-hover) 100%);
}

.chapter-editor__resizer:active {
    background: var(--accent);
}

.resizer__handle {
    width: 4px;
    height: 50px;
    background: var(--border-light);
    border-radius: 2px;
    transition: all 0.2s ease;
    box-shadow: 0 0 4px rgba(0,0,0,0.3);
}

.chapter-editor__resizer:hover .resizer__handle {
    background: #fff;
    height: 80px;
    box-shadow: 0 0 8px var(--accent);
}

.chapter-editor__resizer:active .resizer__handle {
    background: #fff;
    height: 100px;
}

.chapter-editor__text {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-primary);
    white-space: pre-wrap;
}

/* 单一解说模式：断句显示 */
.chapter-editor__sentences {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

/* ===== 断句列表项 - 每句一行显示，按钮在文本后面 ===== */
.chapter-editor__sentences {
    padding: 16px 20px;
    font-size: 14px;
    color: var(--text-primary);
    overflow-y: auto;
}

/* 每个句子独占一行 */
.sentence-item {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 8px 12px;
    margin-bottom: 4px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.02);
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
    line-height: 1.8;
}

.sentence-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-left-color: var(--accent, #3b82f6);
}

/* 奇偶行交替背景 */
.sentence-item:nth-child(odd) {
    background: rgba(255, 255, 255, 0.03);
}

.sentence-item:nth-child(odd):hover {
    background: rgba(255, 255, 255, 0.06);
}

.sentence-item__text {
    flex: 1;
    font-size: inherit;
    color: inherit;
    word-break: break-word;
}

/* 按钮组 - 紧跟在文本后面 */
.sentence-item__actions {
    display: inline-flex;
    gap: 4px;
    flex-shrink: 0;
    opacity: 0.3;
    transition: opacity 0.2s;
}

.sentence-item:hover .sentence-item__actions {
    opacity: 1;
}

.sentence-item__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.5);
    transition: all 0.15s;
    padding: 0;
    font-size: 14px;
}

.sentence-item__btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

.sentence-item__btn--edit:hover {
    background: rgba(96, 165, 250, 0.2);
    color: #60a5fa;
}

.sentence-item__btn--delete:hover {
    background: rgba(248, 113, 113, 0.2);
    color: #f87171;
}

.sentence-item__btn svg {
    width: 14px;
    height: 14px;
}

/* 句子序号 */
.sentence-item__index {
    flex-shrink: 0;
    width: 28px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    font-weight: 500;
}

/* 播放按钮样式 */
.sentence-item__btn--play:hover {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

/* 下载按钮样式 */
.sentence-item__btn--download:hover {
    background: rgba(139, 92, 246, 0.2);
    color: #8b5cf6;
}

/* 正在播放状态 */
.sentence-item--playing {
    background: rgba(34, 197, 94, 0.1) !important;
    border-left-color: #22c55e !important;
}

.sentence-item--playing .sentence-item__index {
    background: #22c55e;
    color: white;
}

.sentence-item--playing .sentence-item__btn--play {
    color: #22c55e;
    animation: pulse-glow 1s ease infinite;
}

@keyframes pulse-glow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 已配音状态 */
.sentence-item--has-audio .sentence-item__index {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

/* ===== 单一解说模式 - 配音操作按钮 ===== */
.single-voice-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.single-voice-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.single-voice-btn--primary {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.single-voice-btn--primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.4);
}

.single-voice-btn--success {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    flex: 1;
}

.single-voice-btn--success:hover {
    transform: translateY(-1px);
}

.single-voice-btn--export {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
    flex: 1;
}

.single-voice-btn--export:hover:not(:disabled) {
    transform: translateY(-1px);
}

/* 配音进度条 */
.single-voice-progress {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.single-voice-progress__bar {
    height: 100%;
    background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 100%);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* 配音统计 */
.single-voice-stats {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    padding: 6px;
    background: rgba(34, 197, 94, 0.1);
    border-radius: 6px;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

/* 完整音频播放器 */
.single-voice-player {
    margin-top: 8px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.single-voice-player audio {
    border-radius: 4px;
}

/* ===== 音速和音调调节面板 ===== */
.voice-params-panel {
    margin-top: 16px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.voice-param-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.voice-param-row:last-child {
    margin-bottom: 0;
}

.voice-param-label {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 60px;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    flex-shrink: 0;
}

.voice-param-label svg {
    opacity: 0.7;
}

.voice-param-slider-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.voice-param-slider {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.voice-param-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
    transition: transform 0.15s, box-shadow 0.15s;
}

.voice-param-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 12px rgba(245, 158, 11, 0.5);
}

.voice-param-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.voice-param-value {
    min-width: 48px;
    padding: 4px 10px;
    font-size: 13px;
    font-weight: 600;
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.15);
    border-radius: 6px;
    text-align: center;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
}

/* 旋转动画 */
.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ===== 编辑句子模态框 Overlay ===== */
.sentence-edit-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    animation: overlayFadeIn 0.2s ease;
}

@keyframes overlayFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ===== 编辑句子模态框 - 专业美观居中 ===== */
.sentence-edit-modal {
    background: linear-gradient(180deg, #1f2329 0%, #181b20 100%);
    border-radius: 16px;
    width: 600px;
    max-width: 90vw;
    box-shadow: 
        0 0 0 1px rgba(255, 255, 255, 0.08),
        0 25px 80px rgba(0, 0, 0, 0.6),
        0 8px 30px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    animation: sentenceModalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}

@keyframes sentenceModalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.sentence-edit-modal__header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.sentence-edit-modal__header svg {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    opacity: 0.9;
}

.sentence-edit-modal__header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.sentence-edit-modal__body {
    padding: 24px;
}

.sentence-edit-modal__textarea {
    display: block;
    width: 100%;
    min-height: 160px;
    padding: 16px 18px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.25);
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.7;
    resize: vertical;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    box-sizing: border-box;
}

.sentence-edit-modal__textarea:focus {
    outline: none;
    border-color: #3b82f6;
    background: rgba(0, 0, 0, 0.35);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.sentence-edit-modal__textarea::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.sentence-edit-modal__hint {
    margin: 12px 0 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.45);
}

.sentence-edit-modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px 20px;
    background: rgba(0, 0, 0, 0.15);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.sentence-edit-modal__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    min-width: 100px;
}

.sentence-edit-modal__btn--cancel {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.sentence-edit-modal__btn--cancel:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.95);
    border-color: rgba(255, 255, 255, 0.12);
}

.sentence-edit-modal__btn--confirm {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3);
}

.sentence-edit-modal__btn--confirm:hover {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

.sentence-edit-modal__btn--confirm:active {
    transform: translateY(0);
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3);
}

.sentence-edit-modal__btn svg {
    width: 18px;
    height: 18px;
}

.sentence-edit-modal__btn svg {
    width: 16px;
    height: 16px;
}

.chapter-editor__analysis-panel {
    overflow-y: auto;
    background: var(--bg-darkest);
    flex-shrink: 0;
}

.chapter-editor__analysis-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 40px;
    text-align: center;
}

.chapter-editor__analysis-empty svg {
    color: var(--accent);
    opacity: 0.5;
    margin-bottom: 20px;
}

.chapter-editor__analysis-empty h3 {
    font-size: 18px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.chapter-editor__analysis-empty p {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 24px;
}

.chapter-editor__analyze-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--status-info) 0%, #1d4ed8 100%);
    border-radius: var(--radius-md);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.chapter-editor__analyze-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.4);
}

.chapter-editor__analysis-result {
    padding: 20px;
}

.panel-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
}

.panel-header svg {
    color: var(--accent);
}

.panel-header__count {
    margin-left: auto;
    font-size: 11px;
    color: var(--text-muted);
}

/* ===== Analysis Sections ===== */
.analysis-section {
    margin-bottom: 24px;
    padding: 16px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.analysis-section__header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.analysis-section__header svg {
    color: var(--accent);
}

.analysis-section__header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.analysis-section__count {
    margin-left: auto;
    padding: 2px 8px;
    background: rgba(0, 191, 165, 0.15);
    border-radius: 10px;
    font-size: 11px;
    color: var(--accent);
}

.analysis-section > h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.analysis-section > p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.analysis-characters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.analysis-character {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
}

.analysis-character__avatar {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    border-radius: 50%;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}

.analysis-character__name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.analysis-character__role {
    font-size: 10px;
    color: var(--text-muted);
}

.analysis-scenes {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.analysis-scene {
    padding: 12px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--accent);
}

.analysis-scene__header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.analysis-scene__num {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    border-radius: 50%;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
}

.analysis-scene__location {
    font-size: 12px;
    padding: 2px 8px;
    background: rgba(59, 130, 246, 0.15);
    color: var(--status-info);
    border-radius: var(--radius-sm);
}

.analysis-scene__time {
    font-size: 11px;
    color: var(--text-muted);
}

.analysis-scene__text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 10px;
}

/* ===== Story Elements (对话和旁白交替显�? ===== */
.story-elements {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 16px;
    background: var(--bg-panel-alt);
    border-radius: var(--radius);
    overflow: hidden;
}

.story-elements__header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(0, 191, 165, 0.15));
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 13px;
}

.story-elements__header svg {
    color: var(--accent);
}

.story-element {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--border-color);
}

.story-element:last-child {
    border-bottom: none;
}

.story-element:hover {
    background: var(--bg-hover);
}

.story-element__order {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-input);
    border-radius: 50%;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    flex-shrink: 0;
}

.story-element--narration {
    background: rgba(139, 92, 246, 0.05);
}

.story-element--narration .story-element__order {
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
}

.story-element--narration .story-element__icon {
    color: #8b5cf6;
    flex-shrink: 0;
    margin-top: 2px;
}

.story-element--dialogue {
    background: rgba(0, 191, 165, 0.05);
}

.story-element--dialogue .story-element__order {
    background: rgba(0, 191, 165, 0.2);
    color: var(--accent);
}

/* 男性角色颜色 - 蓝色调 */
.story-element--male {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(37, 99, 235, 0.05) 100%);
    border-left: 3px solid #3b82f6;
}

.story-element--male .story-element__order {
    background: rgba(59, 130, 246, 0.25);
    color: #60a5fa;
}

.story-element--male .story-element__speaker-name {
    color: #60a5fa !important;
}

/* 女性角色颜色 - 粉紫色调 */
.story-element--female {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.1) 0%, rgba(219, 39, 119, 0.05) 100%);
    border-left: 3px solid #ec4899;
}

.story-element--female .story-element__order {
    background: rgba(236, 72, 153, 0.25);
    color: #f472b6;
}

.story-element--female .story-element__speaker-name {
    color: #f472b6 !important;
}

/* 说话人头像性别颜色 */
.story-element__speaker-avatar--male {
    background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
    border: 2px solid rgba(96, 165, 250, 0.5);
}

.story-element__speaker-avatar--female {
    background: linear-gradient(135deg, #ec4899, #db2777) !important;
    border: 2px solid rgba(244, 114, 182, 0.5);
}

/* 插入行按钮 */
.insert-row-btn {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px 6px;
    font-size: 11px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 2px;
}

.insert-row-btn--above {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

.insert-row-btn--above:hover {
    background: rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

.insert-row-btn--below {
    background: rgba(251, 146, 60, 0.15);
    color: #fb923c;
}

.insert-row-btn--below:hover {
    background: rgba(251, 146, 60, 0.3);
    color: #f97316;
}

.story-element__speaker-avatar {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent), #00d4aa);
    border-radius: 50%;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.story-element__dialogue-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.story-element__speaker-name {
    color: var(--accent);
    font-weight: 600;
    font-size: 13px;
}

.story-element__content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.story-element__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

/* 内联镜头设置 */
.story-element__camera-inline {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 4px;
}

.story-element__camera-inline .camera-tag--shot {
    padding: 3px 10px;
    font-size: 11px;
}

.story-element__camera-inline .edit-camera-btn {
    padding: 4px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.story-element__camera-inline .edit-camera-btn:hover {
    background: var(--bg-hover);
    color: var(--accent);
}

.add-camera-btn-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px dashed rgba(59, 130, 246, 0.3);
    border-radius: var(--radius-sm);
    color: #3b82f6;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s ease;
    margin-left: 4px;
}

.add-camera-btn-inline:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
}

.story-element__text {
    color: #a78bfa;
    font-style: italic;
    line-height: 1.6;
    font-size: 13px;
}

.story-element__dialogue-text {
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 14px;
}

.story-element__dialogue-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.story-element__tag {
    padding: 2px 10px;
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
    font-size: 10px;
    border-radius: 10px;
}

.story-element__voiceover {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    background: rgba(236, 72, 153, 0.2);
    color: #f472b6;
    font-size: 10px;
    border-radius: 10px;
}

.voice-description {
    color: var(--text-muted);
    font-size: 11px;
    font-style: italic;
}

.expression-tag--small {
    padding: 2px 8px;
    font-size: 11px;
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
    border-radius: 10px;
}

.voice-emotion--small {
    padding: 2px 8px;
    font-size: 10px;
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(236, 72, 153, 0.15);
    color: #f472b6;
    border-radius: 10px;
}

.analysis-scene__dialogues {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-left: 12px;
    border-left: 3px solid var(--accent);
    margin-top: 12px;
}

/* 前置旁白样式 */
.preceding-narration {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(139, 92, 246, 0.1);
    border-radius: var(--radius-sm);
    border-left: 3px solid #8b5cf6;
    margin-bottom: 6px;
}

.preceding-narration svg {
    color: #8b5cf6;
    flex-shrink: 0;
    margin-top: 2px;
}

.preceding-narration__text {
    color: #a78bfa;
    font-style: italic;
    font-size: 12px;
    line-height: 1.6;
}

.analysis-dialogue-item {
    padding: 8px 0;
}

.analysis-dialogue {
    display: flex;
    gap: 8px;
    font-size: 12px;
}

.analysis-dialogue__char {
    color: var(--accent);
    font-weight: 500;
}

.analysis-dialogue__text {
    color: var(--text-primary);
    font-style: italic;
}

/* ===== AI Analysis Progress ===== */
.chapter-editor__analysis-progress {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 30px;
    text-align: center;
}

.analysis-progress__header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 30px;
}

.analysis-progress__header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.analysis-progress__header svg {
    color: var(--accent);
}

.analysis-progress__time {
    font-size: 13px;
    color: var(--text-muted);
    padding: 4px 12px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
}

.analysis-progress__bar-container {
    width: 100%;
    max-width: 400px;
    height: 12px;
    background: var(--bg-input);
    border-radius: 6px;
    position: relative;
    overflow: hidden;
    margin-bottom: 16px;
}

.analysis-progress__bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-dark), var(--accent), var(--accent-hover));
    border-radius: 6px;
    transition: width 0.3s ease;
    position: relative;
}

.analysis-progress__bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.2) 50%,
        transparent 100%
    );
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.analysis-progress__percent {
    position: absolute;
    right: -45px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
}

.analysis-progress__current {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    margin-bottom: 30px;
}

.analysis-progress__current svg {
    color: var(--accent);
}

.analysis-progress__current span {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.analysis-progress__steps {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 30px;
    max-width: 500px;
}

.analysis-progress__step {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    font-size: 12px;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.analysis-progress__step--active {
    background: rgba(0, 191, 165, 0.1);
    border-color: var(--accent);
    color: var(--accent);
}

.analysis-progress__step--done {
    background: rgba(34, 197, 94, 0.1);
    border-color: var(--status-success);
    color: var(--status-success);
}

.analysis-progress__step-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 600;
}

.analysis-progress__step--active .analysis-progress__step-icon {
    background: var(--accent);
    color: #fff;
}

.analysis-progress__step--done .analysis-progress__step-icon {
    background: var(--status-success);
    color: #fff;
}

.analysis-progress__step--pending .analysis-progress__step-icon {
    background: var(--bg-hover);
    color: var(--text-muted);
}

.analysis-progress__tips {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 16px 20px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--status-info);
    text-align: left;
    max-width: 400px;
}

.analysis-progress__tips p {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Analysis Features */
.analysis-features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 24px 0;
    max-width: 400px;
}

.analysis-feature {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap; /* 防止文字换行 */
    flex-wrap: nowrap; /* 确保在一行内 */
}

.analysis-feature svg {
    color: var(--accent);
}

/* Voice Emotion Display */
.voice-emotion {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
    border-radius: var(--radius-sm);
    font-size: 11px;
    margin-left: 8px;
}

.voice-emotion__type {
    font-weight: 500;
}

.voice-emotion__intensity {
    opacity: 0.7;
}

/* ===== AI分析情绪标签（用于配音） ===== */
.emotion-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    margin-left: 6px;
}

/* 8种标准情绪的颜色主题（与TTS配音8维情感向量对应）*/
/* 喜、怒、哀、惧、厌恶、低落、惊喜、平�?*/
.emotion-tag--happy { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }     /* �?- 金黄�?*/
.emotion-tag--angry { background: rgba(239, 68, 68, 0.15); color: #ef4444; }      /* �?- 红色 */
.emotion-tag--sad { background: rgba(96, 165, 250, 0.15); color: #60a5fa; }       /* 哀 - 蓝色 */
.emotion-tag--fear { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }      /* �?- 紫色 */
.emotion-tag--disgust { background: rgba(16, 185, 129, 0.15); color: #10b981; }   /* 厌恶 - 绿色 */
.emotion-tag--depressed { background: rgba(107, 114, 128, 0.15); color: #6b7280; }/* 低落 - 灰色 */
.emotion-tag--surprise { background: rgba(236, 72, 153, 0.15); color: #ec4899; }  /* 惊喜 - 粉色 */
.emotion-tag--neutral { background: rgba(156, 163, 175, 0.15); color: #9ca3af; }  /* 平静 - 浅灰 */

/* ===== Emotion Select Grid ===== */
.emotion-select-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.emotion-select-btn {
    padding: 8px 4px;
    background: var(--bg-panel-alt);
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.emotion-select-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border);
}

.emotion-select-btn--active {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--accent);
    color: var(--accent);
}

/* ===== Voice Actor Modal ===== */
.modal--voice-actor,
.modal--character-library {
    width: 800px;
    max-width: 90vw;
}

/* 增强版配音员选择模态框 */
.modal--voice-actor-enhanced {
    width: 1100px;
    max-width: 95vw;
    height: 720px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

/* 单一解说模式 - 专用配音员选择模态框（更大尺寸）*/
.modal--voice-actor-single-narration {
    width: 1100px;
    max-width: 95vw;
    height: 720px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal--voice-actor-enhanced .modal__body--split {
    display: flex;
    flex: 1;
    overflow: hidden;
    padding: 0;
}

/* 左侧分类导航 */
.voice-actor-sidebar {
    width: 200px;
    background: var(--bg-panel-alt);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.voice-actor-sidebar__search {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.voice-actor-sidebar__search input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 13px;
}

.voice-actor-sidebar__categories {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.voice-actor-sidebar__section {
    padding: 8px 0;
}

.voice-actor-sidebar__title {
    padding: 8px 16px;
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.voice-actor-sidebar__item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.voice-actor-sidebar__item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.voice-actor-sidebar__item--active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent);
    border-right: 3px solid var(--accent);
}

.voice-actor-sidebar__count {
    margin-left: auto;
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg-panel);
    padding: 2px 6px;
    border-radius: 10px;
}

/* 右侧配音员列�?*/
.voice-actor-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.voice-actor-main__header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.voice-actor-main__count {
    font-size: 13px;
    color: var(--text-muted);
}

.voice-actor-main__current {
    color: var(--accent);
    font-size: 0.85rem;
    background: rgba(16, 185, 129, 0.15);
    padding: 4px 12px;
    border-radius: 4px;
    border: 1px solid var(--accent);
}

.voice-actor-main__current strong {
    color: #fff;
    font-weight: 600;
}

.voice-actor-main .voice-actor-grid {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 12px;
    align-content: start;
}

/* 配音员卡片增�?*/
.voice-actor-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: var(--bg-panel-alt);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.voice-actor-card:hover {
    background: var(--bg-hover);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.voice-actor-card--selected {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
}

.voice-actor-card--selected::after {
    content: '�?;
    position: absolute;
    top: 6px;
    right: 6px;
    width: 20px;
    height: 20px;
    background: var(--accent);
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.voice-actor-card__avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #059669);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    border: 2px solid transparent;
    box-sizing: border-box;
}

.voice-actor-card__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.voice-actor-card__initials {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
}

.voice-actor-card__info {
    flex: 1;
    min-width: 0;
}

.voice-actor-card__name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.voice-actor-card__meta {
    display: flex;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.voice-actor-card__gender {
    color: var(--accent);
}

.voice-actor-card__category {
    background: var(--bg-panel);
    padding: 2px 6px;
    border-radius: 4px;
}

.voice-actor-card__desc {
    font-size: 11px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.voice-actor-card__actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.btn--playing {
    background: var(--accent) !important;
    color: #fff !important;
}

/* 配音员卡片男女颜色区分 */
.voice-actor-card--male {
    border-left: 3px solid #60a5fa;
}

.voice-actor-card--female {
    border-left: 3px solid #f472b6;
}

.voice-actor-card--male .voice-actor-card__avatar {
    border-color: #60a5fa;
}

.voice-actor-card--female .voice-actor-card__avatar {
    border-color: #f472b6;
}

.voice-actor-card__gender {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

/* 配音员分页控件 */
.voice-actor-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px;
    border-top: 1px solid var(--border-color);
    margin-top: 16px;
}

.pagination-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

/* 左侧分类中男女项的颜色 */
.voice-actor-sidebar__item--male.voice-actor-sidebar__item--active {
    background: rgba(96, 165, 250, 0.2);
    border-color: #60a5fa;
}

.voice-actor-sidebar__item--female.voice-actor-sidebar__item--active {
    background: rgba(244, 114, 182, 0.2);
    border-color: #f472b6;
}

/* 克隆音色分类按钮 */
.voice-actor-sidebar__item--clone {
    color: #a855f7;
}

.voice-actor-sidebar__item--clone.voice-actor-sidebar__item--active {
    background: rgba(168, 85, 247, 0.2);
    border-color: #a855f7;
}

/* 表单中的播放按钮 */
.form-row .btn--icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--bg-panel-alt);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    transition: all 0.2s;
}

.form-row .btn--icon:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.form-row .btn--icon.btn--playing {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* 试听预览�?*/
.voice-preview-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--accent), #059669);
    color: #fff;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.voice-preview-bar__info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.voice-preview-bar__name {
    font-weight: 600;
}

.voice-preview-bar__status {
    font-size: 12px;
    opacity: 0.8;
}

.voice-preview-bar__controls .btn {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

.voice-preview-bar__controls .btn:hover {
    background: rgba(255,255,255,0.3);
}

/* 二级选择模态框（在其他模态框之上�?*/
.modal-overlay--secondary {
    z-index: 10010 !important;
}

.modal-overlay--secondary .modal {
    z-index: 10011 !important;
    max-height: 80vh;
}

.modal--voice-actor .modal__body,
.modal--character-library .modal__body {
    max-height: 60vh;
    overflow-y: auto;
}

.voice-actor-filters,
.character-filters {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-panel-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.search-box input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
}

.search-box input:focus {
    outline: none;
}

.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.category-tab {
    padding: 6px 14px;
    background: var(--bg-panel-alt);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.category-tab:hover {
    background: var(--bg-hover);
}

.category-tab--active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* Voice Actor Grid */
.voice-actor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.voice-actor-card {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: var(--bg-panel-alt);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
}

.voice-actor-card:hover {
    background: var(--bg-hover);
    border-color: var(--border);
}

.voice-actor-card--selected {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--accent);
}

.voice-actor-card__avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--bg-panel);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.voice-actor-card__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.voice-actor-card__initials {
    font-size: 20px;
    font-weight: bold;
    color: var(--accent);
}

.voice-actor-card__info {
    flex: 1;
    min-width: 0;
}

.voice-actor-card__name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.voice-actor-card__meta {
    display: flex;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.voice-actor-card__gender {
    font-size: 14px;
}

.voice-actor-card__category {
    padding: 1px 6px;
    background: var(--bg-panel);
    border-radius: 4px;
}

.voice-actor-card__desc {
    font-size: 11px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Character Grid */
.character-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.character-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 12px;
    background: var(--bg-panel-alt);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.character-card:hover {
    background: var(--bg-hover);
    border-color: var(--border);
}

.character-card--selected {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--accent);
}

.character-card__avatar {
    position: relative;
    width: 72px;
    height: 72px;
    border-radius: var(--radius-md);
    overflow: visible; /* 允许角标溢出 */
    background: var(--bg-panel);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 人物库选择弹窗中的性别角标 */
.character-card__gender {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 600;
    z-index: 2;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.character-card__gender--male {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: #fff;
}

.character-card__gender--female {
    background: linear-gradient(135deg, #f472b6 0%, #db2777 100%);
    color: #fff;
}

.character-card__gender--unknown {
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
}

.character-card__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-md);
}

.character-card__initials {
    font-size: 28px;
    font-weight: bold;
    color: var(--accent);
}

.character-card__name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.character-card__category {
    font-size: 11px;
    color: var(--text-muted);
    padding: 2px 8px;
    background: var(--bg-panel);
    border-radius: 10px;
    margin-bottom: 4px;
}

.character-card__desc {
    font-size: 11px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

/* Form Enhancements */
.form-grid--2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.range-with-value {
    display: flex;
    align-items: center;
    gap: 10px;
}

.range-with-value input[type="range"] {
    flex: 1;
}

.range-with-value .form-value {
    min-width: 40px;
    text-align: right;
    font-weight: 500;
    color: var(--accent);
}

.btn--sm {
    padding: 6px 12px;
    font-size: 12px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-muted);
    gap: 12px;
}

.dialogue-voice-params {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
    padding-left: 12px;
}

.voice-param {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: var(--text-muted);
    padding: 2px 6px;
    background: var(--bg-panel-alt);
    border-radius: 4px;
}

.voice-param__label {
    color: var(--text-muted);
}

.voice-param__value {
    color: var(--accent);
    font-weight: 500;
}

/* ===== Analysis Modal ===== */
.modal--analysis {
    width: 450px;
    background: var(--bg-panel);
    border-radius: var(--radius-lg);
    padding: 30px;
    text-align: center;
}

.analysis-modal__header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.analysis-modal__header svg {
    color: var(--accent);
}

.analysis-modal__header h2 {
    margin: 0;
    font-size: 20px;
    color: var(--text-primary);
}

.analysis-modal__chapter {
    font-size: 13px;
    color: var(--text-muted);
    background: var(--bg-input);
    padding: 4px 12px;
    border-radius: var(--radius-sm);
}

.analysis-modal__time {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.analysis-modal__progress {
    height: 10px;
    background: var(--bg-input);
    border-radius: 5px;
    position: relative;
    overflow: hidden;
    margin-bottom: 16px;
}

.analysis-modal__progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-dark), var(--accent));
    border-radius: 5px;
    transition: width 0.3s ease;
}

.analysis-modal__progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.2) 50%, transparent 100%);
    animation: shimmer 1.5s infinite;
}

.analysis-modal__progress-text {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    color: var(--text-primary);
    font-weight: 600;
}

.analysis-modal__current {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--accent);
}

.analysis-modal__steps {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
}

.analysis-modal__step {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    font-size: 11px;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.analysis-modal__step--active {
    background: rgba(0, 191, 165, 0.1);
    border-color: var(--accent);
    color: var(--accent);
}

.analysis-modal__step--done {
    background: rgba(34, 197, 94, 0.1);
    border-color: var(--status-success);
    color: var(--status-success);
}

.analysis-modal__step-icon {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 9px;
    font-weight: 600;
    background: var(--bg-hover);
}

.analysis-modal__step--active .analysis-modal__step-icon {
    background: var(--accent);
    color: #fff;
}

.analysis-modal__step--done .analysis-modal__step-icon {
    background: var(--status-success);
    color: #fff;
}

.analysis-modal__features {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.analysis-modal__feature {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.analysis-modal__feature svg {
    color: var(--accent);
}

/* ===== Expression Display ===== */
.expression-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: rgba(249, 115, 22, 0.15);
    color: #f97316;
    border-radius: var(--radius-sm);
    font-size: 11px;
    margin-left: 6px;
}

.expression-tag__emoji {
    font-size: 12px;
}

/* ===== Narration Display ===== */
.narration-item {
    display: flex;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-panel-alt);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--status-info);
    margin-bottom: 8px;
}

.narration-item__icon {
    color: var(--status-info);
    flex-shrink: 0;
}

.narration-item__content {
    flex: 1;
}

.narration-item__text {
    font-size: 13px;
    color: var(--text-primary);
    font-style: italic;
    margin-bottom: 4px;
}

.narration-item__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 11px;
    color: var(--text-muted);
}

.narration-item__tag {
    padding: 2px 6px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
}

/* ===== Camera Settings Display ===== */
.camera-settings {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    margin-top: 10px;
}

.camera-setting {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: var(--bg-panel-alt);
    border-radius: var(--radius-sm);
    font-size: 11px;
}

.camera-setting__label {
    color: var(--text-muted);
}

.camera-setting__value {
    color: var(--secondary-color);
    font-weight: 500;
}

.camera-setting--focus {
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.camera-setting--focus .camera-setting__value {
    color: #a78bfa;
}

/* ===== Resource Edit Button ===== */
.edit-resource-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
    font-size: 11px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.edit-resource-btn:hover {
    background: var(--accent);
    color: #fff;
}

.edit-resource-btn--scene-editor {
    background: linear-gradient(135deg, var(--accent) 0%, #00d4aa 100%);
    color: #fff;
    font-weight: 500;
    padding: 6px 12px;
    margin-top: 8px;
}

.edit-resource-btn--scene-editor:hover {
    background: linear-gradient(135deg, #00d4aa 0%, var(--accent) 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 191, 165, 0.3);
}

.delete-resource-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: var(--radius-sm);
    font-size: 11px;
    color: #ef4444;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.delete-resource-btn:hover {
    background: #ef4444;
    color: #fff;
    border-color: #ef4444;
}

/* ===== Scene Background Preview ===== */
.scene-background-preview {
    margin: 10px 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
    max-height: 120px;
}

.scene-background-preview img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

/* ===== Scene Background Modal（整合版 - 重新设计�?===== */
.modal--scene-background-full {
    width: 960px;
    max-width: 95vw;
    max-height: 92vh;
    border-radius: 16px;
    overflow: hidden;
    background: linear-gradient(180deg, #1e2530 0%, #151a22 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 32px 64px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

.modal--scene-background-full .modal__header {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.2);
}

.modal--scene-background-full .modal__header h2 {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
}

.modal--scene-background-full .modal__body {
    max-height: calc(92vh - 160px);
    overflow-y: auto;
    padding: 24px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.modal--scene-background-full .modal__footer {
    padding: 16px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.2);
}

/* 左侧：预览区�?*/
.background-editor-left {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* 右侧：操作区�?*/
.background-editor-right {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* 场景信息�?*/
.scene-info-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(45, 212, 191, 0.15) 0%, rgba(45, 212, 191, 0.05) 100%);
    border: 1px solid rgba(45, 212, 191, 0.3);
    border-radius: 10px;
    color: var(--accent);
    font-size: 14px;
    font-weight: 500;
}

/* 背景大图预览 */
.background-preview-large {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.background-preview-large__label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.background-preview-large__container {
    position: relative;
    flex: 1;
    min-height: 320px;
    background: linear-gradient(135deg, #1a1f28 0%, #0f1318 100%);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3) inset;
}

.background-preview-large__container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.background-preview-large__container:hover img {
    transform: scale(1.02);
}

.background-preview-large__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 320px;
    color: var(--text-muted);
    gap: 16px;
}

.background-preview-large__empty svg {
    opacity: 0.4;
}

.background-preview-large__empty span {
    font-size: 14px;
    opacity: 0.7;
}

.background-preview-large__generating {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.9) 0%, rgba(15, 19, 24, 0.95) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    backdrop-filter: blur(8px);
}

.background-preview-large__generating span {
    color: var(--accent);
    font-size: 14px;
    font-weight: 500;
}

.background-preview-large__generating .progress-bar {
    width: 70%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.background-preview-large__generating .progress-bar__fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent) 0%, #5eead4 100%);
    transition: width 0.3s ease;
    border-radius: 4px;
}

/* 标签页切�?*/
.background-tabs {
    display: flex;
    gap: 6px;
    background: rgba(0, 0, 0, 0.3);
    padding: 6px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.background-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.25s ease;
}

.background-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.background-tab.active {
    background: linear-gradient(135deg, var(--accent) 0%, #5eead4 100%);
    color: #0f172a;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(45, 212, 191, 0.3);
}

/* 背景面板 */
.background-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.background-panel__prompt-area {
    flex: 1;
}

.background-panel__prompt-area label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.background-panel__prompt-area textarea {
    width: 100%;
    min-height: 140px;
    padding: 14px 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.6;
    resize: vertical;
    transition: all 0.2s ease;
}

.background-panel__prompt-area textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.15);
}

.background-panel__prompt-area textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

.background-panel__actions {
    margin-top: 20px;
}

.background-panel__generate-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--accent) 0%, #5eead4 100%);
    border: none;
    border-radius: 10px;
    color: #0f172a;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 16px rgba(45, 212, 191, 0.3);
}

.background-panel__generate-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(45, 212, 191, 0.4);
}

.background-panel__generate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.background-panel__tip {
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    opacity: 0.7;
}

/* 生成进度�?*/
.background-progress {
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.background-progress__bar {
    flex: 1;
    height: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.background-progress__fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #4ade80);
    border-radius: 4px;
    transition: width 0.3s ease-out;
    position: relative;
}

.background-progress__fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255,255,255,0.3), 
        transparent
    );
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.background-progress__text {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    min-width: 50px;
    text-align: right;
}

.background-panel__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 200px;
    color: var(--text-muted);
    gap: 16px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
}

.background-panel__empty svg {
    opacity: 0.4;
}

/* 场景库网�?*/
.background-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    max-height: 280px;
    overflow-y: auto;
    padding-right: 4px;
}

.background-grid::-webkit-scrollbar {
    width: 6px;
}

.background-grid::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.background-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

.background-item {
    position: relative;
    aspect-ratio: 16/9;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.25s ease;
}

.background-item:hover {
    border-color: rgba(45, 212, 191, 0.5);
    transform: scale(1.03);
}

.background-item--selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.25);
}

.background-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.background-item__name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 6px 8px;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.8) 0%, transparent 100%);
    font-size: 11px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 上传区域 */
.upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
    color: var(--text-muted);
    gap: 16px;
    background: rgba(0, 0, 0, 0.2);
}

.upload-area:hover {
    border-color: var(--accent);
    background: rgba(45, 212, 191, 0.05);
    color: var(--accent);
}

.upload-area svg {
    opacity: 0.6;
    transition: all 0.25s ease;
}

.upload-area:hover svg {
    opacity: 1;
    transform: translateY(-4px);
}

.upload-area span {
    font-size: 14px;
    font-weight: 500;
}

.upload-area__tip {
    font-size: 12px;
    color: var(--text-muted);
    opacity: 0.6;
    text-align: center;
}

/* URL输入�?*/
.url-input-area {
    margin-top: 20px;
}

.url-input-area label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.url-input-area input {
    width: 100%;
    padding: 12px 14px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
}

.url-input-area input:focus {
    outline: none;
    border-color: var(--accent);
}

/* 全屏背景预览 */
.modal-overlay--dark {
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
}

.background-fullscreen-preview {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 95vw;
    max-height: 95vh;
}

.background-fullscreen-preview img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6);
}

.background-fullscreen-preview__close {
    position: absolute;
    top: -50px;
    right: 0;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 12px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.background-fullscreen-preview__close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* 按钮样式补充 */
.btn--outline {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-secondary);
}

.btn--outline:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(45, 212, 191, 0.1);
}

/* ===== Scene Editor Modal（深色主题版�?===== */

/* 全屏遮罩�?*/
.scene-editor-overlay {
    background: rgba(0, 0, 0, 0.95) !important;
}

/* 全屏编辑器容�?*/
.scene-editor-fullscreen {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    overflow: hidden;
}

/* 顶部工具�?*/
.scene-editor__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
    gap: 16px;
}

.scene-editor__header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.scene-editor__header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 人物选择 */
.scene-editor__char-select {
    display: flex;
    align-items: center;
    gap: 8px;
}

.scene-editor__char-select label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.scene-editor__select {
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    font-size: 14px;
    min-width: 140px;
    cursor: pointer;
    color: var(--text-primary);
}

.scene-editor__select:focus {
    outline: none;
    border-color: var(--accent);
}

.scene-editor__select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* 添加背景素材按钮 */
.scene-editor__btn {
    padding: 8px 16px;
    background: var(--accent);
    color: var(--bg-primary);
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.scene-editor__btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

/* 操作按钮�?*/
.scene-editor__actions {
    display: flex;
    gap: 6px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    padding-left: 12px;
    margin-left: 4px;
}

.scene-editor__action-btn {
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.scene-editor__action-btn:hover:not(:disabled) {
    background: rgba(45, 212, 191, 0.15);
    border-color: var(--accent);
    color: var(--accent);
}

.scene-editor__action-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* 提示文字 */
.scene-editor__tip {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    padding-left: 12px;
    margin-left: 4px;
    max-width: 400px;
}

.scene-editor__tip svg {
    opacity: 0.6;
    flex-shrink: 0;
}

/* 变动控制按钮 */
.scene-editor__variation-controls {
    display: flex;
    gap: 8px;
}

.scene-editor__var-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.scene-editor__var-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

.scene-editor__var-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.scene-editor__var-btn--add {
    background: rgba(45, 212, 191, 0.15);
    border-color: rgba(45, 212, 191, 0.3);
    color: var(--accent);
}

.scene-editor__var-btn--add:hover {
    background: rgba(45, 212, 191, 0.25);
}

.scene-editor__var-btn--delete {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.scene-editor__var-btn--delete:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.25);
}

.scene-editor__var-btn--close {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

.scene-editor__var-btn--close:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* 画布区域 - Wick Editor 风格 */
.scene-editor__canvas-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: #0d1117;
    min-height: 0;
}

/* Wick风格画布（固定960x540逻辑尺寸） */
.scene-editor__canvas {
    position: relative;
    width: 960px;
    height: 540px;
    background: #1e2328;
    box-shadow: 0 4px 24px rgba(0,0,0,0.5);
    overflow: visible;
    transform-origin: top left;
}

/* 
 * [重要] 场景编辑器背景样式已移至 scene-editor.css
 * 不要在这里定义 .scene-editor__bg-container 和 .scene-editor__bg-image
 * 否则会覆盖 scene-editor.css 中的正确样式
 * 
 * scene-editor.css 中的定义:
 * .scene-editor__bg-container {
 *     position: absolute;
 *     cursor: move;
 *     z-index: 1;
 *     transform-origin: center center;
 *     pointer-events: none;
 * }
 * .scene-editor__bg-image {
 *     display: block;
 *     max-width: none;
 *     pointer-events: none;
 * }
 */

/* 背景四角缩放控制�?*/
.scene-editor__bg-handles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.scene-editor__bg-handle {
    position: absolute;
    width: 14px;
    height: 14px;
    background: var(--accent);
    border: 2px solid #fff;
    border-radius: 50%;
    cursor: nwse-resize;
    pointer-events: auto;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    transition: transform 0.15s;
    z-index: 100;
}

.scene-editor__bg-handle:hover {
    transform: scale(1.2);
}

.scene-editor__bg-handle--tl {
    top: 5%;
    left: 5%;
    cursor: nwse-resize;
}

.scene-editor__bg-handle--tr {
    top: 5%;
    right: 5%;
    cursor: nesw-resize;
}

.scene-editor__bg-handle--bl {
    bottom: 5%;
    left: 5%;
    cursor: nesw-resize;
}

.scene-editor__bg-handle--br {
    bottom: 5%;
    right: 5%;
    cursor: nwse-resize;
}

/* 图层面板背景控制 */
.layer-panel__bg-controls {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 4px;
}

.layer-panel__rotate-control {
    display: flex;
    align-items: center;
    gap: 4px;
}

.scene-editor__no-bg {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    color: var(--text-muted);
    font-size: 16px;
}

.scene-editor__no-bg svg {
    opacity: 0.4;
}

/* 镜头�?*/
.scene-editor__camera-frame {
    position: absolute;
    border: 3px solid var(--accent);
    background: transparent;
    box-sizing: border-box;
    cursor: move;
    z-index: 5;  /* 在背�?z:1)上方，人物层下方 */
}

.scene-editor__camera-frame--locked {
    border-style: dashed;
    opacity: 0.7;
    cursor: default;
}

.camera-lock-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(20, 184, 166, 0.8);
    color: #fff;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.camera-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--bg-primary);
    border: 2px solid var(--accent);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.15s;
}

.camera-handle:hover {
    transform: scale(1.3);
    background: var(--accent);
}

.camera-handle--tl { top: -6px; left: -6px; cursor: nwse-resize; }
.camera-handle--tr { top: -6px; right: -6px; cursor: nesw-resize; }
.camera-handle--bl { bottom: -6px; left: -6px; cursor: nesw-resize; }
.camera-handle--br { bottom: -6px; right: -6px; cursor: nwse-resize; }
.camera-handle--t { top: -6px; left: 50%; transform: translateX(-50%); cursor: ns-resize; }
.camera-handle--b { bottom: -6px; left: 50%; transform: translateX(-50%); cursor: ns-resize; }
.camera-handle--l { top: 50%; left: -6px; transform: translateY(-50%); cursor: ew-resize; }
.camera-handle--r { top: 50%; right: -6px; transform: translateY(-50%); cursor: ew-resize; }

/* 
 * [重要] 以下场景编辑器人物相关样式已移至 scene-editor.css
 * 不要在这里定义，否则会覆盖 scene-editor.css 中的正确样式
 * 
 * 已注释掉的样式包括：
 * - .scene-editor__character 及其变体
 * - .scene-editor__char-placeholder
 * - .scene-editor__char-image
 * - .scene-editor__char-info
 * - .scene-editor__char-name
 * - .scene-editor__char-edit-btn
 * - .scene-editor__char-replace-btn
 * - .scene-editor__char-bounds
 * - .scene-editor__bounds-border
 * - .scene-editor__bounds-corner 及其变体
 * - .scene-editor__bounds-rotate 及其变体
 * - .scene-editor__char-lock
 */

/* ========== 道具物品样式 ========== */
.scene-editor__prop {
    position: absolute;
    cursor: grab;
    transform-origin: center center;
    transition: filter 0.2s;
}

.scene-editor__prop:hover {
    filter: brightness(1.1) drop-shadow(0 0 10px rgba(45, 212, 191, 0.5));
}

.scene-editor__prop--selected {
    z-index: 110 !important;
}

.scene-editor__prop--selected .scene-editor__prop-image {
    outline: 3px solid var(--accent);
    outline-offset: 4px;
    border-radius: 8px;
}

.scene-editor__prop--locked {
    cursor: not-allowed;
}

.scene-editor__prop--dragging {
    cursor: grabbing;
    z-index: 200 !important;
}

.scene-editor__prop-image {
    max-width: 200px;
    max-height: 200px;
    object-fit: contain;
    pointer-events: none;
    filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.3));
}

.scene-editor__prop-label {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: var(--text-primary);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transform-origin: center center;
}

.scene-editor__prop-delete-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.scene-editor__prop-delete-btn:hover {
    color: var(--error);
}

/* 道具缩放手柄 */
.scene-editor__prop-resize-handle {
    position: absolute;
    bottom: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: var(--accent);
    border-radius: 50%;
    cursor: nwse-resize;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    opacity: 0.9;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transform-origin: center center;
}

.scene-editor__prop-resize-handle:hover {
    opacity: 1;
    transform: scale(1.1);
}

.scene-editor__prop--resizing {
    cursor: nwse-resize;
}

.scene-editor__prop--resizing .scene-editor__prop-resize-handle {
    background: var(--warning);
}

/* ========== 图层管理面板 ========== */
.scene-editor__layer-panel {
    position: absolute;
    right: 10px;
    top: 10px;
    width: 260px;
    max-height: calc(100% - 20px);
    background: rgba(20, 20, 25, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 500;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(12px);
}

.layer-panel__header {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.layer-panel__count {
    margin-left: auto;
    background: var(--accent);
    color: #000;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}

.layer-panel__list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    max-height: 400px;
}

.layer-panel__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    margin-bottom: 4px;
}

.layer-panel__item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.layer-panel__item--selected {
    background: rgba(45, 212, 191, 0.15);
    border-color: var(--accent);
}

.layer-panel__item--locked {
    opacity: 0.6;
}

.layer-panel__item--character .layer-panel__type {
    color: #60a5fa;
}

.layer-panel__item--prop .layer-panel__type {
    color: #f59e0b;
}

.layer-panel__thumb {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

.layer-panel__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.layer-panel__info {
    flex: 1;
    min-width: 0;
}

.layer-panel__name {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.layer-panel__type {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.layer-panel__zindex {
    background: rgba(255, 255, 255, 0.1);
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 10px;
}

.layer-panel__actions {
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.2s;
}

.layer-panel__item:hover .layer-panel__actions {
    opacity: 1;
}

.layer-panel__item--selected .layer-panel__actions {
    opacity: 1;
}

.layer-panel__btn {
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 4px;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.layer-panel__btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

.layer-panel__btn--danger:hover {
    background: rgba(239, 68, 68, 0.3);
    color: var(--error);
}

/* 背景图层样式 */
.layer-panel__item--background {
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.3);
}

.layer-panel__item--background .layer-panel__type {
    color: #a78bfa;
}

/* 镜头图层样式 */
.layer-panel__item--camera {
    background: rgba(20, 184, 166, 0.15);
    border-color: rgba(20, 184, 166, 0.4);
}

.layer-panel__item--camera .layer-panel__type {
    color: #14b8a6;
}

.layer-panel__icon {
    color: #14b8a6;
}

/* 背景缩放控制 */
.layer-panel__scale-control {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
}

.layer-panel__scale-btn {
    width: 18px;
    height: 18px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 3px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.layer-panel__scale-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

.layer-panel__scale-value {
    font-size: 11px;
    color: var(--text-secondary);
    min-width: 40px;
    text-align: center;
}

.layer-panel__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    color: var(--text-muted);
    gap: 8px;
}

.layer-panel__footer {
    padding: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 8px;
}

.layer-panel__quick-btn {
    flex: 1;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all 0.2s;
}

.layer-panel__quick-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.layer-panel__quick-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* 图层按钮激活状�?*/
.scene-editor__var-btn--active {
    background: var(--accent) !important;
    color: #000 !important;
}

/* 道具生成器模态框 */
.modal--prop-generator {
    width: 520px;
    max-width: 90vw;
}

.prop-generator__input-section {
    margin-bottom: 20px;
}

.prop-generator__label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.prop-generator__textarea {
    width: 100%;
    padding: 12px;
    background: var(--bg-tertiary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    resize: vertical;
    min-height: 80px;
    transition: border-color 0.2s;
}

.prop-generator__textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.prop-generator__textarea:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.prop-generator__tips {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.prop-generator__tips svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--warning);
}

.prop-generator__actions {
    margin-bottom: 16px;
}

.prop-generator__generate-btn {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--accent), #14b8a6);
    border: none;
    border-radius: 8px;
    color: #000;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.prop-generator__generate-btn:hover:not(:disabled) {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.prop-generator__generate-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.prop-generator__progress {
    margin-top: 12px;
}

.prop-generator__progress-bar {
    flex: 1;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.prop-generator__progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #14b8a6);
    transition: width 0.3s ease;
}

.prop-generator__progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.prop-generator__progress-text {
    font-size: 13px;
    color: var(--accent);
    font-weight: 600;
    min-width: 45px;
}

.prop-generator__progress-message {
    font-size: 12px;
    color: var(--text-muted);
    text-align: right;
    flex: 1;
    margin-left: 12px;
}

.prop-generator__preview-section {
    margin-top: 20px;
}

.prop-generator__preview {
    width: 100%;
    aspect-ratio: 1;
    max-height: 280px;
    background: var(--bg-tertiary);
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.prop-generator__preview-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: repeating-conic-gradient(#2a2a2a 0% 25%, #333 0% 50%) 50% / 20px 20px;
}

.prop-generator__preview-image img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}

.prop-generator__preview-loading,
.prop-generator__preview-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
}

.prop-generator__preview-loading svg,
.prop-generator__preview-empty svg {
    opacity: 0.5;
}

/* 二级按钮样式 */
.scene-editor__btn--secondary {
    background: var(--bg-tertiary);
    border: 1px solid rgba(45, 212, 191, 0.3);
    color: var(--accent);
}

.scene-editor__btn--secondary:hover {
    background: rgba(45, 212, 191, 0.1);
    border-color: var(--accent);
}

/* 左侧刻度�?*/
.scene-editor__ruler {
    position: absolute;
    background: rgba(0, 0, 0, 0.6);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    user-select: none;
}

.scene-editor__ruler--vertical {
    left: 0;
    top: 0;
    bottom: 0;
    width: 28px;
}

/* 角色编辑菜单 */
.scene-editor__char-menu {
    position: fixed;
    background: rgba(20, 30, 40, 0.88);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    box-shadow: 0 16px 64px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    width: 70vw;
    max-width: 720px;
    min-width: 480px;
    z-index: 1000;
    overflow: hidden;
    height: 70vh;
    max-height: 70vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.scene-editor__char-menu-header {
    padding: 14px 18px;
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, transparent 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    cursor: move;
    user-select: none;
}

.scene-editor__menu-close-btn {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: none;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.scene-editor__menu-close-btn:hover {
    background: rgba(255, 80, 80, 0.4);
    color: #ff6666;
}

/* 表情覆盖�?- 实时显示在人物头�?*/
.scene-editor__char-expression-overlay {
    position: absolute;
    top: 5%;
    left: 50%;
    transform: translateX(-50%);
    width: 45%;
    height: auto;
    pointer-events: none;
    z-index: 10;
    object-fit: contain;
}

/* [已注释] 场景人物Canvas - 由 scene-editor.css 控制
.scene-editor__char-canvas {
    display: block;
    width: 220px;
    height: 280px;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}
*/

.scene-editor__menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 18px;
    background: transparent;
    border: none;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.scene-editor__menu-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.scene-editor__menu-item--highlight {
    color: var(--accent);
    font-weight: 500;
}

.scene-editor__menu-item--confirm {
    background: var(--accent);
    color: #0a1520;
    margin: 12px auto;
    border-radius: 8px;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    padding: 10px 36px;
    width: auto;
    max-width: 180px;
    box-shadow: 0 4px 12px rgba(45, 212, 191, 0.25);
}

.scene-editor__menu-item--confirm:hover {
    background: var(--accent-hover);
    box-shadow: 0 6px 20px rgba(45, 212, 191, 0.4);
}

/* 角色菜单分区 */
.scene-editor__menu-section {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.scene-editor__menu-section--poses {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.scene-editor__menu-label {
    font-size: 12px;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    margin-bottom: 6px;
    font-weight: 600;
}

.scene-editor__toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    padding: 6px 0;
}

.scene-editor__toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

.scene-editor__menu-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.scene-editor__option-btn {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.scene-editor__option-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

.scene-editor__option-btn--active {
    background: rgba(45, 212, 191, 0.2);
    border-color: var(--accent);
    color: var(--accent);
}

/* 表情选择样式 */
.scene-editor__menu-label-hint {
    font-size: 11px;
    font-weight: 400;
    color: var(--accent);
    margin-left: 6px;
}

.scene-editor__menu-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 12px;
    padding: 8px 0;
}

.scene-editor__expression-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    max-height: 200px;
    overflow-y: auto;
    padding-right: 4px;
}

.scene-editor__expression-btn {
    position: relative;
    padding: 8px 6px;
    font-size: 11px;
    text-align: center;
    min-width: 0;
}

.scene-editor__expression-btn--configured {
    background: rgba(45, 212, 191, 0.1);
    border-color: rgba(45, 212, 191, 0.3);
}

.scene-editor__expression-check {
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 8px;
    color: var(--accent);
}

/* 表情类型列表 - 新版可展开 */
.scene-editor__expression-types {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 4px;
}

.scene-editor__expression-type-item {
    display: flex;
    flex-direction: column;
}

.scene-editor__expression-type-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.scene-editor__expression-type-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.scene-editor__expression-type-btn--active {
    background: rgba(45, 212, 191, 0.15);
    border-color: var(--accent);
    color: var(--text-primary);
}

.scene-editor__expression-type-btn--expanded {
    background: rgba(45, 212, 191, 0.1);
    border-color: var(--accent);
    border-radius: 8px 8px 0 0;
}

.scene-editor__expression-type-btn--configured {
    color: var(--text-primary);
}

.scene-editor__expression-type-btn--configured::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    flex-shrink: 0;
}

.scene-editor__expression-type-name {
    flex: 1;
    text-align: left;
}

.scene-editor__expression-type-arrow {
    color: var(--text-muted);
    opacity: 0.6;
    flex-shrink: 0;
}

/* 展开的表情面�?*/
.scene-editor__expression-items-panel {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 12px;
}

.scene-editor__expression-items-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    color: var(--text-muted);
    font-size: 12px;
}

.scene-editor__expression-items-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.scene-editor__expression-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.2s;
}

.scene-editor__expression-item:hover {
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.scene-editor__expression-item--selected {
    border-color: var(--accent);
    box-shadow: 0 0 12px rgba(45, 212, 191, 0.4);
}

.scene-editor__expression-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scene-editor__expression-item-check {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 18px;
    height: 18px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
}

/* 表情网格容器（新版直接显示） */
.scene-editor__expression-grid-container {
    min-height: 200px;
    max-height: 220px;
    overflow-y: auto;
    padding: 8px;
    background: rgba(255, 255, 255, 0.75);
    border-radius: 6px;
    border: 1px solid rgba(200, 200, 200, 0.2);
}

.scene-editor__expression-grid-container::-webkit-scrollbar {
    width: 4px;
}

.scene-editor__expression-grid-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 2px;
}

.scene-editor__expression-grid-container::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
}

.scene-editor__expression-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 6px;
}

/* 表情卡片（带右上角标签） */
.scene-editor__expression-card {
    position: relative;
    width: 100%;
    padding-bottom: 85%;
    border-radius: 3px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.95);
    transition: all 0.15s;
}

.scene-editor__expression-card:hover {
    border-color: var(--accent);
}

.scene-editor__expression-card--selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(45, 212, 191, 0.5);
}

.scene-editor__expression-card img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: transparent;
}

/* 右上角表情类型标�?*/
.scene-editor__expression-card-label {
    position: absolute;
    top: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 9px;
    padding: 1px 3px;
    border-radius: 0 2px 0 2px;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: 2;
}

/* 选中标记 */
.scene-editor__expression-card-check {
    position: absolute;
    bottom: 1px;
    left: 1px;
    width: 10px;
    height: 10px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    z-index: 2;
    font-size: 7px;
}

/* 动作预设网格 */
.scene-editor__pose-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.scene-editor__pose-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
    background: rgba(0, 0, 0, 0.35);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    overflow: hidden;
    aspect-ratio: 3/4;
}

.scene-editor__pose-card:hover {
    border-color: rgba(45, 212, 191, 0.6);
    background: rgba(45, 212, 191, 0.15);
}

.scene-editor__pose-card--active {
    border-color: var(--accent);
    background: rgba(45, 212, 191, 0.2);
}

.scene-editor__pose-thumb {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    overflow: hidden;
    position: relative;
}

.scene-editor__pose-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}

.scene-editor__pose-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    font-size: 10px;
    font-weight: 600;
    color: #ffffff;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 4px 2px;
    background: linear-gradient(180deg, transparent 0%, rgba(45, 212, 191, 0.9) 100%);
    z-index: 2;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.scene-editor__pose-check {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 18px;
    height: 18px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
}

.scene-editor__pose-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
}

.scene-editor__expression-items-empty {
    text-align: center;
    padding: 16px;
    color: var(--text-muted);
    font-size: 12px;
}

.scene-editor__expression-load-more {
    width: 100%;
    padding: 8px;
    margin-top: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    font-size: 11px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.scene-editor__expression-load-more:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

.scene-editor__menu-empty {
    color: var(--text-muted);
    font-size: 12px;
    padding: 12px 0;
    text-align: center;
}

/* 菜单背景遮罩 */
.scene-editor__menu-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
}

/* 底部状态栏 */
.scene-editor__statusbar {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.4);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 13px;
    color: var(--text-muted);
}

.scene-editor__statusbar span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.scene-editor__statusbar .btn--sm {
    margin-left: auto;
    padding: 8px 20px;
    font-size: 13px;
}

/* 保留旧样式兼容�?*/
.modal--scene-editor {
    width: 1200px;
    max-width: 95vw;
    height: 90vh;
    max-height: calc(100vh - 40px);
    border-radius: 16px;
    overflow: hidden;
    background: linear-gradient(180deg, #1a1f28 0%, #12161c 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
}

.modal--scene-editor .modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.modal--scene-editor .modal__header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal__header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.scene-editor__scene-info {
    font-size: 13px;
    color: var(--text-muted);
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
}

.scene-meta-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 6px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.scene-meta-tag svg {
    width: 14px;
    height: 14px;
    opacity: 0.7;
}

/* 全屏查看模�?*/
.modal-overlay--fullscreen {
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.scene-fullscreen-img {
    max-width: 95vw;
    max-height: 95vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.8);
    position: relative;
    z-index: 1;
}

.scene-fullscreen-close {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10001;
}

.scene-fullscreen-close:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

/* ===== Scene Library Selection Modal ===== */
.modal--scene-library {
    width: 1100px;
    max-width: 95vw;
    max-height: 90vh;
    border-radius: 16px;
    overflow: hidden;
    background: linear-gradient(180deg, #1e2530 0%, #151a22 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 32px 64px rgba(0, 0, 0, 0.5);
}

.modal--scene-library .modal__body--split {
    display: flex;
    height: calc(90vh - 140px);
    padding: 0;
    gap: 0;
}

/* 场景库左侧导�?*/
.scene-library-sidebar {
    width: 260px;
    min-width: 260px;
    background: rgba(0, 0, 0, 0.3);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.scene-library-sidebar__search {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.scene-library-sidebar__search input {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text-primary);
    font-size: 13px;
}

.scene-library-sidebar__search input:focus {
    outline: none;
    border-color: var(--accent);
}

.scene-library-sidebar__tabs {
    display: flex;
    padding: 12px;
    gap: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.scene-library-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.scene-library-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.scene-library-tab.active {
    background: var(--accent);
    color: #0f172a;
    font-weight: 600;
}

.scene-library-tab__count {
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
}

.scene-library-tab.active .scene-library-tab__count {
    background: rgba(0, 0, 0, 0.2);
}

.scene-library-sidebar__section {
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.scene-library-sidebar__title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.scene-library-sidebar__filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.scene-library-sidebar__filters--wrap {
    max-height: 200px;
    overflow-y: auto;
}

.scene-library-filter {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.scene-library-filter:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.scene-library-filter.active {
    background: rgba(45, 212, 191, 0.15);
    border-color: var(--accent);
    color: var(--accent);
}

/* 场景库右侧内容区 */
.scene-library-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.scene-library-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    color: var(--text-muted);
    gap: 16px;
}

.scene-library-loading--more {
    height: auto;
    padding: 20px;
}

.scene-library-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    color: var(--text-muted);
    gap: 16px;
}

.scene-library-empty svg {
    opacity: 0.4;
}

.scene-library-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.scene-library-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.25s ease;
    background: rgba(0, 0, 0, 0.3);
}

.scene-library-item:hover {
    border-color: rgba(45, 212, 191, 0.4);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.scene-library-item--selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.2);
}

.scene-library-item__image {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
}

.scene-library-item__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.scene-library-item:hover .scene-library-item__image img {
    transform: scale(1.05);
}

.scene-library-item__badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 4px 8px;
    background: rgba(45, 212, 191, 0.9);
    color: #0f172a;
    font-size: 10px;
    font-weight: 600;
    border-radius: 4px;
}

.scene-library-item__name {
    padding: 10px 12px;
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.scene-library-item--selected .scene-library-item__name {
    color: var(--accent);
}

/* 旧版兼容 */
.modal--scene-background {
    width: 600px;
    max-height: 80vh;
}

.modal--scene-background .modal__body {
    max-height: calc(80vh - 140px);
    overflow-y: auto;
}

.scene-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    color: var(--accent);
}

.current-background {
    margin-bottom: 16px;
}

.current-background label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.current-background img {
    width: 100%;
    max-height: 150px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 2px solid var(--accent);
}

.background-library label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.background-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.background-item {
    cursor: pointer;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.background-item:hover {
    border-color: var(--accent);
    transform: scale(1.02);
}

.background-item--selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(0, 191, 165, 0.3);
}

.background-item img {
    width: 100%;
    height: 80px;
    object-fit: cover;
}

.background-item__name {
    display: block;
    padding: 4px 6px;
    background: var(--bg-panel-alt);
    font-size: 11px;
    color: var(--text-secondary);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== Scene Background Prompt ===== */
.scene-background-prompt {
    background: var(--bg-panel-alt);
    border-radius: var(--radius-sm);
    padding: 12px;
    margin: 12px 0;
    border: 1px solid var(--border-color);
}

.scene-background-prompt__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.scene-background-prompt__label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
}

.scene-background-prompt__actions {
    display: flex;
    gap: 8px;
}

.scene-background-prompt__cn {
    font-size: 13px;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.5;
}

.scene-background-prompt__en {
    background: var(--bg-input);
    padding: 8px 10px;
    border-radius: var(--radius-xs);
    font-size: 11px;
}

.scene-background-prompt__en code {
    color: var(--text-muted);
    word-break: break-all;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
}

.scene-background-prompt__empty {
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
}

/* Scene Background Preview */
.scene-background-preview {
    position: relative;
    margin: 12px 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.scene-background-preview img {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.scene-background-preview__status {
    position: absolute;
    top: 8px;
    right: 8px;
}

/* Clickable scene preview */
.scene-background-preview--clickable {
    cursor: pointer;
    transition: all 0.3s ease;
}

.scene-background-preview--clickable:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.scene-background-preview__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    pointer-events: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
    color: white;
    font-size: 14px;
}

.scene-background-preview--clickable:hover .scene-background-preview__overlay {
    opacity: 1;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.status-badge--pending {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.status-badge--generating {
    background: rgba(33, 150, 243, 0.2);
    color: #2196f3;
    animation: pulse 1.5s infinite;
}

.status-badge--completed {
    background: rgba(0, 191, 165, 0.2);
    color: var(--accent);
}

.status-badge--failed {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Scene Header Tags */
.analysis-scene__weather,
.analysis-scene__lighting {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg-input);
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 6px;
}

/* ===== Prompt Edit Modal ===== */
.modal--prompt-edit {
    width: 600px;
    max-height: 85vh;
}

.modal--prompt-edit .modal__body {
    max-height: calc(85vh - 140px);
    overflow-y: auto;
}

.modal--prompt-edit textarea {
    width: 100%;
    padding: 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.5;
    resize: vertical;
    font-family: inherit;
}

.modal--prompt-edit textarea:focus {
    border-color: var(--accent);
    outline: none;
}

.form-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
}

.prompt-tips {
    background: rgba(0, 191, 165, 0.1);
    border: 1px solid rgba(0, 191, 165, 0.3);
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-top: 16px;
}

.prompt-tips__header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 8px;
}

.prompt-tips__list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.prompt-tips__list li {
    font-size: 11px;
    color: var(--text-secondary);
    padding: 4px 0;
    padding-left: 16px;
    position: relative;
}

.prompt-tips__list li::before {
    content: '�?;
    position: absolute;
    left: 0;
    color: var(--accent);
}

.prompt-tips__list code {
    background: var(--bg-panel);
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 10px;
    color: var(--accent);
}

/* ===== Resource Edit Modal ===== */
.modal--edit-resource {
    width: 500px;
    max-height: 80vh;
}

.modal--edit-resource .modal__body {
    max-height: calc(80vh - 140px);
    overflow-y: auto;
}

.form-group {
    margin-bottom: 16px;
}

.form-group > label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(0, 191, 165, 0.1);
}

.form-group input[type="checkbox"] {
    margin-right: 8px;
}

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

.form-row input[type="text"] {
    flex: 1;
}

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

.form-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-item label {
    font-size: 11px;
    color: var(--text-muted);
}

.form-item input[type="range"] {
    width: 100%;
}

.form-value {
    font-size: 11px;
    color: var(--accent);
    font-weight: 500;
}

.btn--icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn--icon:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* ===== Camera Styles ===== */
.story-element__camera {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 8px 12px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(147, 51, 234, 0.1));
    border-radius: var(--radius-sm);
    border: 1px solid rgba(59, 130, 246, 0.2);
    font-size: 11px;
}

.story-element__camera svg {
    color: #3b82f6;
    flex-shrink: 0;
}

.story-element__camera--narration {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(59, 130, 246, 0.1));
    border-color: rgba(139, 92, 246, 0.2);
}

.story-element__camera--narration svg {
    color: #8b5cf6;
}

.camera-tag {
    padding: 2px 8px;
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border-radius: 10px;
    font-weight: 500;
}

.camera-focus {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border-radius: 10px;
    font-weight: 500;
}

.camera-focus svg {
    color: #fbbf24 !important;
}

.camera-desc {
    color: var(--text-muted);
    font-style: italic;
    flex: 1;
    min-width: 100px;
}

.edit-camera-btn {
    padding: 4px 8px;
    background: rgba(59, 130, 246, 0.2);
    border: none;
    border-radius: var(--radius-sm);
    color: #60a5fa;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.edit-camera-btn:hover {
    background: #3b82f6;
    color: #fff;
}

.story-element__camera--empty {
    background: transparent;
    border: 1px dashed rgba(59, 130, 246, 0.3);
    padding: 6px 12px;
}

.add-camera-btn {
    padding: 6px 12px;
    background: transparent;
    border: none;
    color: #60a5fa;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    transition: all 0.2s ease;
}

.add-camera-btn:hover {
    color: #3b82f6;
}

.add-camera-btn svg {
    color: inherit;
}

/* Camera Modal */
.modal--camera {
    width: 600px;
    max-width: 95vw;
}

.modal--camera .modal__header h2 {
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal--camera .modal__header h2 svg {
    color: #3b82f6;
}

.camera-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.camera-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.camera-option {
    padding: 8px 16px;
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
}

.camera-option:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
    color: #60a5fa;
}

.camera-option--active {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border-color: transparent;
    color: #fff;
    font-weight: 500;
}

/* 大按钮样�?*/
.camera-options--large {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.camera-option--big {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
    min-height: 100px;
}

.camera-option__icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.camera-option__label {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.camera-option__desc {
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
}

.camera-option--big.camera-option--active .camera-option__desc {
    color: rgba(255,255,255,0.8);
}

.camera-tag--shot {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: #fff;
    font-weight: 500;
}

.camera-hint {
    margin-top: 6px;
    padding: 8px 12px;
    background: rgba(59, 130, 246, 0.05);
    border-left: 3px solid #3b82f6;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-muted);
    font-size: 12px;
}

/* ===== Utility ===== */
.spin {
    animation: spin 1s linear infinite;
}

/* ===== Character Settings Modal ===== */
.modal--character {
    max-width: 800px;
    width: 90%;
}

button.analysis-character--clickable {
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    text-align: left;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

.analysis-character--clickable:hover {
    background: var(--bg-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

.analysis-character__edit-hint {
    position: absolute;
    top: 6px;
    right: 6px;
    color: var(--text-muted);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.analysis-character--clickable:hover .analysis-character__edit-hint {
    opacity: 1;
}

/* 旁白角色特殊样式 */
.analysis-character--narrator {
    border: 2px dashed var(--accent);
    background: rgba(16, 185, 129, 0.05);
}

.analysis-character--narrator:hover {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--accent);
}

.analysis-character__avatar--narrator {
    background: linear-gradient(135deg, var(--accent), #059669) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

/* 男性角色样�?- 蓝色�?*/
.analysis-character--male {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(37, 99, 235, 0.08) 100%);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.analysis-character--male:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.25) 0%, rgba(37, 99, 235, 0.15) 100%);
    border-color: rgba(59, 130, 246, 0.5);
}

.analysis-character--male .analysis-character__avatar {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.analysis-character--male .analysis-character__gender {
    color: #60a5fa;
}

/* 女性角色样�?- 粉色�?*/
.analysis-character--female {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.15) 0%, rgba(219, 39, 119, 0.08) 100%);
    border: 1px solid rgba(236, 72, 153, 0.3);
}

.analysis-character--female:hover {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.25) 0%, rgba(219, 39, 119, 0.15) 100%);
    border-color: rgba(236, 72, 153, 0.5);
}

.analysis-character--female .analysis-character__avatar {
    background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
}

.analysis-character--female .analysis-character__gender {
    color: #f472b6;
}

/* 未知性别角色样式 - 紫色系（保持原样�?*/
.analysis-character--unknown {
    background: var(--bg-input);
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.analysis-character--unknown:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.4);
}

/* 性别标识样式 */
.analysis-character__gender {
    font-size: 12px;
    font-weight: 600;
    margin-left: 4px;
}

.analysis-character__info {
    flex: 1;
    min-width: 0;
}

/* 旁白设置模态框 */
.modal--narrator {
    width: 500px;
    max-width: 90%;
}

.narrator-info {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--bg-panel-alt);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
}

.narrator-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #059669);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
}

.narrator-desc h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

.narrator-desc p {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}

/* 一键配音按�?*/
.chapter-editor__btn--voice {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #fff;
    border: none;
}

.chapter-editor__btn--voice:hover:not(:disabled) {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
}

.chapter-editor__btn--voice:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 导出素材按钮 */
.chapter-editor__btn--export {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    border: none;
}

.chapter-editor__btn--export:hover:not(:disabled) {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
}

.chapter-editor__btn--export:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 导出结果展示 */
.chapter-editor__export-result {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 8px;
    margin-left: auto;
}

.export-result__label {
    color: var(--text-muted);
    font-size: 12px;
}

.export-result__link {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--accent);
    color: #fff;
    border-radius: 4px;
    font-size: 12px;
    text-decoration: none;
    transition: background 0.2s;
}

.export-result__link:hover {
    background: #0ea5e9;
}

/* 一键配音模态框 */
.modal--voice-synthesis {
    width: 700px;
    max-width: 95%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.modal--voice-synthesis .modal__body {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* 配音进度�?*/
.voice-synthesis__progress {
    padding: 16px;
    background: var(--bg-panel-alt);
    border-radius: var(--radius-md);
}

.voice-synthesis__progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.voice-synthesis__progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.voice-synthesis__progress-text {
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
}

/* 当前配音状�?*/
.voice-synthesis__current {
    margin-top: 16px;
    padding: 14px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(217, 119, 6, 0.08) 100%);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-md);
}

.voice-synthesis__current-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #f59e0b;
    margin-bottom: 8px;
}

.voice-synthesis__current-label .pulse {
    animation: pulse-mic 1s infinite;
}

@keyframes pulse-mic {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.voice-synthesis__current-speaker {
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.voice-synthesis__current-content {
    font-size: 13px;
    color: var(--text-muted);
    font-style: italic;
    line-height: 1.5;
    word-break: break-all;
}

/* 配音日志 */
.voice-synthesis__logs {
    background: var(--bg-dark-1);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-dark);
    overflow: hidden;
}

.voice-synthesis__logs-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--bg-dark-2);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-dark);
}

.voice-synthesis__logs-content {
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 12px;
}

.voice-synthesis__log {
    display: flex;
    gap: 10px;
    padding: 4px 0;
    line-height: 1.5;
}

.voice-synthesis__log-time {
    color: var(--text-muted);
    flex-shrink: 0;
}

.voice-synthesis__log--info .voice-synthesis__log-msg {
    color: var(--text-secondary);
}

.voice-synthesis__log--success .voice-synthesis__log-msg {
    color: #10b981;
}

.voice-synthesis__log--warn .voice-synthesis__log-msg {
    color: #f59e0b;
}

.voice-synthesis__log--error .voice-synthesis__log-msg {
    color: #ef4444;
}

.voice-synthesis__log--skip .voice-synthesis__log-msg {
    color: var(--text-muted);
}

/* 配音结果列表 */
.voice-synthesis__results {
    background: var(--bg-panel-alt);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-dark);
    overflow: hidden;
}

.voice-synthesis__results-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--bg-dark-2);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-dark);
}

.voice-synthesis__results-list {
    max-height: 250px;
    overflow-y: auto;
}

.voice-synthesis__result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s;
}

.voice-synthesis__result-item:last-child {
    border-bottom: none;
}

.voice-synthesis__result-item--playing {
    background: rgba(245, 158, 11, 0.1);
}

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

.voice-synthesis__result-speaker {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.voice-synthesis__result-content {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.voice-synthesis__result-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.voice-synthesis__result-status {
    width: 20px;
    text-align: center;
    font-size: 14px;
}

.voice-synthesis__result-status--success {
    color: #10b981;
}

.voice-synthesis__result-status--failed {
    color: #ef4444;
}

.voice-synthesis__result-status--skipped {
    color: var(--text-muted);
}

/* 合成完整音频 */
.voice-synthesis__merged {
    background: var(--bg-panel-alt);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-dark);
    overflow: hidden;
}

.voice-synthesis__merged-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(5, 150, 105, 0.1) 100%);
    font-size: 13px;
    font-weight: 500;
    color: var(--accent);
    border-bottom: 1px solid var(--border-dark);
}

.voice-synthesis__merged-player {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.voice-synthesis__merged-player audio {
    width: 100%;
    height: 40px;
}

/* 播放音频按钮 */
.play-audio-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #fff;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 4px;
}

.play-audio-btn:hover {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    transform: scale(1.1);
}

.play-audio-btn--playing {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    animation: pulse-audio 1s infinite;
}

@keyframes pulse-audio {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
}

/* 重新生成/单独配音按钮 */
.regenerate-audio-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg-dark-3);
    border: 1px solid var(--border-dark);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 4px;
}

.regenerate-audio-btn:hover {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    border-color: #8b5cf6;
    color: #fff;
    transform: scale(1.1);
}

.regenerate-audio-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.regenerate-audio-btn--loading {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    border-color: #8b5cf6;
    color: #fff;
}

.regenerate-audio-btn--loading svg {
    animation: spin 1s linear infinite;
}

/* ===== 配音状态标签 ===== */
.voice-status-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 500;
    border-radius: 10px;
    margin-left: 6px;
    white-space: nowrap;
}

.voice-status-tag--pending {
    background: rgba(100, 116, 139, 0.2);
    color: #94a3b8;
    border: 1px solid rgba(100, 116, 139, 0.3);
}

.voice-status-tag--synthesizing {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.4);
    animation: pulse-blue 1.5s ease-in-out infinite;
}

@keyframes pulse-blue {
    0%, 100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4); }
    50% { box-shadow: 0 0 0 4px rgba(59, 130, 246, 0); }
}

.voice-status-tag--success {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.4);
}

.voice-status-tag--failed {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.voice-status-tag--skipped {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.voice-status-tag--no_voice {
    background: rgba(156, 163, 175, 0.15);
    color: #9ca3af;
    border: 1px solid rgba(156, 163, 175, 0.3);
}

/* ===== 配音状态显示（顶部按钮区） ===== */
.voice-synthesis-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    color: #60a5fa;
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 6px;
}

/* 暂停按钮 */
.chapter-editor__btn--pause {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.4);
    color: #fbbf24;
    min-width: 32px;
    padding: 0 8px;
}

.chapter-editor__btn--pause:hover {
    background: rgba(245, 158, 11, 0.25);
    border-color: #f59e0b;
}

/* 停止按钮 */
.chapter-editor__btn--stop {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
    color: #f87171;
    min-width: 32px;
    padding: 0 8px;
}

.chapter-editor__btn--stop:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: #ef4444;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.btn--playing {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
}

/* 表单样式增强 */
.form-row--compact {
    display: flex;
    gap: 8px;
    align-items: center;
}

.form-row--2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-input--readonly {
    background: var(--bg-panel-alt);
    cursor: default;
    flex: 1;
}

.character-avatars__empty {
    padding: 30px;
    text-align: center;
    color: var(--text-muted);
    background: var(--bg-panel-alt);
    border-radius: var(--radius-md);
}

.character-current {
    display: flex;
    gap: 24px;
    padding: 20px;
    background: var(--bg-panel);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
}

.character-current__avatar {
    width: 120px;
    height: 180px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: 600;
    color: #fff;
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
}

.character-current__info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-group--inline {
    display: flex;
    align-items: center;
    gap: 12px;
}

.form-group--inline label {
    width: 50px;
    flex-shrink: 0;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group--inline input,
.form-group--inline select {
    flex: 1;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
}

.form-group--inline input:focus,
.form-group--inline select:focus {
    outline: none;
    border-color: var(--accent);
}

.character-avatars {
    margin-top: 16px;
}

.character-avatars__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.character-avatars__header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.character-avatars__hint {
    font-size: 12px;
    color: var(--text-muted);
}

.character-avatars__grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    max-height: 300px;
    overflow-y: auto;
    padding: 4px;
}

.character-avatar-item {
    background: var(--bg-panel);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.character-avatar-item:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

.character-avatar-item--selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(0, 191, 165, 0.3);
}

.character-avatar-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.character-avatar-item__placeholder {
    width: 100%;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent) 0%, #7c3aed 100%);
    font-size: 48px;
    font-weight: bold;
    color: #fff;
}

.character-avatar-item__name {
    padding: 8px;
    text-align: center;
    font-size: 12px;
    color: var(--text-primary);
    background: var(--bg-panel-alt);
}

.character-avatar-item__gender {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 600;
    z-index: 2;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.character-avatar-item__gender--male {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: #fff;
}

.character-avatar-item__gender--female {
    background: linear-gradient(135deg, #f472b6 0%, #db2777 100%);
    color: #fff;
}

.character-avatar-item__gender--unknown {
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
}

.character-avatar-item__actions {
    position: absolute;
    top: 4px;
    right: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.character-avatar-item:hover .character-avatar-item__actions {
    opacity: 1;
}

.btn--xs {
    padding: 4px 8px;
    font-size: 11px;
}

.btn--text {
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: none;
}

.btn--text:hover {
    background: rgba(0, 0, 0, 0.8);
}

.btn--danger {
    background: var(--status-error);
    color: #fff;
    border: none;
}

.btn--danger:hover {
    background: #dc2626;
}

.modal__footer-right {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.modal__footer {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal__readonly-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-sm);
    color: #f59e0b;
    font-size: 13px;
}

/* ===== 人物库页�?===== */
.characters-page {
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    background: var(--bg-darkest);
}

.characters-main {
    flex: 1;
    min-height: 0; /* 关键：允许flex项目缩小以启用子元素滚动 */
    display: flex;
    flex-direction: row;
    overflow: hidden;
}

/* 人物库左侧导�?- 与首页小说管理保持一�?*/
.characters-sidebar {
    width: 280px;
    flex-shrink: 0;
    background: var(--bg-dark);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 16px;
    overflow-y: auto;
}

.characters-sidebar .sidebar-section {
    margin-bottom: 16px;
}

.characters-sidebar .sidebar-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.characters-sidebar .sidebar-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.characters-sidebar .sidebar-filter-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.characters-sidebar .sidebar-filter-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.characters-sidebar .sidebar-filter-btn.active {
    background: rgba(0, 191, 165, 0.15);
    color: var(--accent);
}

/* 右侧内容�?*/
.characters-content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.characters-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-dark);
}

.characters-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.characters-filters {
    display: flex;
    gap: 12px;
}

.search-input {
    padding: 8px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 13px;
    width: 200px;
}

.search-input::placeholder {
    color: var(--text-muted);
}

.filter-select {
    padding: 8px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
}

/* 人物库搜索框 */
.characters-filters .search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.characters-filters .search-box svg {
    position: absolute;
    left: 12px;
    color: #666;
    z-index: 1;
}

.characters-filters .search-box .search-input {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 8px 12px 8px 36px;
    color: var(--text-primary);
    font-size: 13px;
    width: 200px;
    transition: all 0.2s;
}

.characters-filters .search-box .search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 191, 165, 0.1);
}

.characters-filters .search-box .search-input::placeholder {
    color: #666;
}

/* 资源Tab */
.characters-tabs {
    display: flex;
    gap: 0;
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border-color);
    padding: 0 24px;
}

.characters-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.characters-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.characters-tab--active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.characters-tab__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--bg-input);
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.characters-tab--active .characters-tab__count {
    background: var(--accent);
    color: white;
}

/* 人物卡片创建者显�?*/
.character-card__owner {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-muted);
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    width: fit-content;
}

.character-card__owner svg {
    opacity: 0.6;
}

/* 人物库内容区 */
.characters-content {
    flex: 1;
    min-width: 0;
    min-height: 0; /* 关键：允许flex项目缩小以启用子元素滚动 */
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 人物库网�?- 滚动容器 */
.characters-grid {
    flex: 1 1 0;
    min-height: 0; /* 关键：允许flex项目缩小以启用滚�?*/
    max-height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 24px;
    padding-bottom: 80px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    align-content: start;
    /* Firefox滚动条样�?*/
    scrollbar-width: thin;
    scrollbar-color: var(--border-light) var(--bg-dark);
}

/* 自定义滚动条样式 - Chrome/Edge/Safari */
.characters-grid::-webkit-scrollbar {
    width: 10px;
}

.characters-grid::-webkit-scrollbar-track {
    background: var(--bg-dark);
    border-radius: 5px;
}

.characters-grid::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 5px;
    min-height: 50px;
}

.characters-grid::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.characters-loading {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 分页组件 */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 24px;
    background: var(--bg-panel);
    border-top: 1px solid var(--border-color);
    position: fixed !important;
    bottom: 0 !important;
    z-index: 100 !important;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.3);
}

/* 剧本管理页面 - 分页组件从侧边栏右边开始 */
.novel-list__sidebar ~ * .pagination,
.novel-list__content .pagination {
    left: 280px !important; /* 左侧导航栏宽度 */
    right: 0 !important;
}

.pagination__btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.pagination__btn:hover:not(:disabled) {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.pagination__btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.pagination__info {
    color: var(--text-secondary);
    font-size: 13px;
    margin: 0 16px;
}

.pagination-info {
    padding: 12px 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    background: var(--bg-panel);
    border-top: 1px solid var(--border-color);
    position: fixed !important;
    bottom: 0 !important;
    z-index: 100 !important;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.3);
}

/* 剧本管理页面 - 分页组件从侧边栏右边开始 */
.novel-list__sidebar ~ * .pagination,
.novel-list__content .pagination {
    left: 280px !important; /* 左侧导航栏宽度 */
    right: 0 !important;
}

/* 人物卡片 */
.character-card {
    background: var(--bg-panel);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}

.character-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.character-card--create {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    border-style: dashed;
    background: transparent;
}

.character-card--create:hover {
    background: var(--bg-panel);
}

.character-card__add {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    margin-bottom: 12px;
    transition: all 0.2s ease;
}

.character-card--create:hover .character-card__add {
    background: var(--accent);
    color: #fff;
}

.character-card__label {
    color: var(--text-secondary);
    font-size: 14px;
}

.character-card__image {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, var(--bg-panel-alt) 0%, var(--bg-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.character-card__image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.character-card__placeholder {
    color: var(--text-muted);
    opacity: 0.5;
}

.character-card__info {
    padding: 14px;
}

.character-card__name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.character-card__meta {
    display: flex;
    gap: 8px;
}

.character-card__gender,
.character-card__era {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--bg-input);
    color: var(--text-secondary);
}

.character-card__actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.character-card:hover .character-card__actions {
    opacity: 1;
}

.character-card__official {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: rgba(245, 158, 11, 0.2);
    border-radius: 4px;
    color: #f59e0b;
}

.btn-icon {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    border: none;
    background: var(--bg-dark);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: var(--accent);
    color: #fff;
}

.btn-icon--danger:hover {
    background: var(--status-error);
}

/* 创建人物弹窗 */
.modal--character-create {
    width: 98%;
    max-width: 1800px;
    height: 96vh;
    display: flex;
    flex-direction: column;
}

.modal--character-create .modal__body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px;
    display: flex;
    flex-direction: column;
    max-height: none !important;
}

.create-step {
    padding: 20px;
}

.form-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.form-row label {
    color: var(--text-secondary);
    min-width: 60px;
}

.form-select {
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    min-width: 200px;
}

.upload-section {
    text-align: center;
    margin-bottom: 20px;
}

.upload-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--accent);
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 8px;
}

.upload-input {
    display: none;
}

.upload-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 150px;
    height: 120px;
    border: 2px dashed var(--border-light);
    border-radius: var(--radius-lg);
    background: var(--bg-input);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 8px;
}

.upload-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(0, 191, 165, 0.1);
}

.uploaded-parts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
    margin-top: 20px;
}

.uploaded-part {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: var(--bg-panel);
}

.uploaded-part img {
    width: 100%;
    height: 100px;
    object-fit: contain;
    background: var(--bg-dark);
}

.remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: none;
    background: var(--status-error);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 步骤2: 标记部位 */
.step-hint {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.label-parts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}

.label-part-item {
    background: var(--bg-panel);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    position: relative;
}

.label-part-item img {
    width: 100%;
    height: 120px;
    object-fit: contain;
    background: var(--bg-dark);
}

.label-part-item .remove-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--danger);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.9;
    z-index: 2;
}

.label-part-item .remove-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.label-parts-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.part-select {
    width: 100%;
    padding: 10px;
    background: var(--bg-input);
    border: none;
    border-top: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 12px;
}

/* 步骤3: 人物组装 */
.create-step--preview {
    display: flex;
    gap: 24px;
}

/* 步骤3: 编辑器模�?*/
.create-step--editor {
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: 100%;
    flex: 1;
    min-height: 0;
}

.create-step--editor .editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 12px 16px;
    background: var(--bg-panel-alt);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    flex-shrink: 0;
}

.create-step--editor .editor-main {
    display: flex;
    gap: 16px;
    flex: 1;
    min-height: 0;
}

.create-step--editor .editor-layers {
    width: 240px;
    background: var(--bg-panel);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
}

.create-step--editor .editor-canvas-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.create-step--editor .editor-pose-panel {
    width: 260px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex-shrink: 0;
    overflow-y: auto;
    transition: width 0.3s ease;
}

/* 表情模式加宽 */
.create-step--editor .editor-pose-panel--wide {
    width: 400px;
}

.create-step--editor .pose-section {
    background: var(--bg-panel);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    padding: 16px;
}

.create-step--editor .pose-section-title {
    color: var(--accent);
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 12px;
}

.create-step--editor .pose-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.create-step--editor .pose-btn {
    flex: 1;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.create-step--editor .pose-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent);
}

.create-step--editor .pose-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.create-step--editor .selected-part-panel {
    background: var(--bg-panel);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    padding: 16px;
}

.create-step--editor .part-controls {
    margin-bottom: 12px;
}

.create-step--editor .part-controls label {
    display: block;
    color: var(--text-secondary);
    font-size: 12px;
    margin-bottom: 4px;
}

.create-step--editor .part-controls input[type="range"] {
    width: 100%;
    height: 4px;
    background: var(--bg-input);
    border-radius: 2px;
    -webkit-appearance: none;
    appearance: none;
}

.create-step--editor .part-controls input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
}

.create-step--editor .control-value {
    display: block;
    text-align: right;
    color: var(--text-muted);
    font-size: 11px;
    margin-top: 2px;
}

.preview-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.preview-right {
    width: 260px;
}

.character-assembler {
    background: linear-gradient(135deg, #1a1d24 0%, #252932 100%);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.assembler-canvas {
    background: linear-gradient(180deg, #f0f4f8 0%, #e8ecf0 100%);
    border-radius: var(--radius-md);
    cursor: move;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.assembler-toolbar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.toolbar-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.toolbar-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.toolbar-btn--reset {
    background: var(--bg-panel);
}

.toolbar-btn--reset:hover {
    background: var(--status-warning);
    border-color: var(--status-warning);
}

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

.pose-label {
    color: var(--text-secondary);
    font-size: 12px;
}

.pose-preset-btn {
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pose-preset-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent);
}

.pose-preset-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* 部件列表 */
.parts-list {
    background: var(--bg-panel);
    border-radius: var(--radius-md);
    padding: 12px;
    max-height: 180px;
    overflow-y: auto;
}

.parts-list__header {
    color: var(--text-secondary);
    font-size: 12px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.parts-list__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s ease;
}

.parts-list__item:hover {
    background: var(--bg-hover);
}

.parts-list__item.selected {
    background: rgba(0, 191, 165, 0.2);
    border: 1px solid var(--accent);
}

.parts-list__thumb {
    width: 40px;
    height: 40px;
    object-fit: contain;
    background: var(--bg-dark);
    border-radius: 4px;
}

.parts-list__name {
    color: var(--text-primary);
    font-size: 12px;
}

/* 选中部件控制 */
.selected-part-info {
    margin-top: 16px;
    padding: 12px;
    background: var(--bg-panel);
    border-radius: var(--radius-md);
}

.selected-part-info__header {
    color: var(--accent);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 12px;
}

.selected-part-controls label {
    display: block;
    color: var(--text-muted);
    font-size: 11px;
    margin-bottom: 4px;
    margin-top: 8px;
}

.selected-part-controls input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--bg-input);
    appearance: none;
    cursor: pointer;
}

.selected-part-controls input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-size: 13px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
}

/* 人物编辑器弹�?*/
.modal--character-editor {
    width: 98%;
    max-width: 1800px;
    height: 96vh;
    display: flex;
    flex-direction: column;
}

.modal--character-editor .modal__body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px;
    display: flex;
    flex-direction: column;
    max-height: none !important;
}

.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 12px 16px;
    background: var(--bg-panel);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

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

.form-inline label {
    color: var(--text-secondary);
    font-size: 13px;
    white-space: nowrap;
}

.form-inline input,
.form-inline select {
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 13px;
}

.editor-main {
    display: flex;
    gap: 16px;
    flex: 1;
    min-height: 0;
}

/* 图层面板 */
.editor-layers {
    width: 260px;
    background: var(--bg-panel);
    border-radius: var(--radius-md);
    overflow: hidden;
    flex-shrink: 0;
}

.layers-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: var(--bg-panel-alt);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    border-bottom: 1px solid var(--border-color);
}

.layers-list {
    max-height: 500px;
    overflow-y: auto;
}

.layer-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s ease;
}

.layer-item:hover {
    background: var(--bg-hover);
}

.layer-item.selected {
    background: rgba(0, 191, 165, 0.15);
    border-left: 3px solid var(--accent);
}

.layer-item.hidden {
    opacity: 0.4;
}

.layer-visibility {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.layer-visibility:hover {
    background: var(--bg-input);
    color: var(--accent);
}

/* 图层锁定按钮 */
.layer-lock {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.layer-lock:hover {
    background: var(--bg-input);
    color: var(--accent);
}

/* 锁定状态的图层 */
.layer-item.locked {
    opacity: 0.6;
}

.layer-item.locked .layer-lock {
    color: var(--status-warning);
}

/* 禁用的拖拽手�?*/
.layer-drag-handle.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.layer-thumb {
    width: 32px;
    height: 32px;
    object-fit: contain;
    background: var(--bg-dark);
    border-radius: 4px;
}

.layer-name {
    flex: 1;
    font-size: 11px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.layer-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-left: auto;
}

.layer-actions button {
    width: 22px;
    height: 18px;
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    transition: all 0.15s ease;
}

.layer-actions button:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    transform: scale(1.1);
}

/* 图层拖拽样式 */
.layer-item {
    position: relative;
}

.layer-item.dragging {
    opacity: 0.5;
    background: var(--accent) !important;
}

.layer-item.drag-over {
    border-top: 2px solid var(--accent);
}

.layer-drag-handle {
    cursor: grab;
    padding: 4px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
}

.layer-drag-handle:active {
    cursor: grabbing;
}

/* Canvas编辑�?*/
.editor-canvas-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: var(--bg-panel);
    border-radius: var(--radius-md);
    padding: 16px;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
}

.editor-canvas-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    width: 100%;
}

.editor-canvas-real {
    background: linear-gradient(180deg, #f8f9fb 0%, #e8ecf0 100%);
    border-radius: var(--radius-md);
    cursor: move;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    /* 保持canvas原始尺寸，不使用CSS缩放，避免坐标计算错�?*/
    max-width: 100%;
    max-height: 100%;
}

.editor-canvas-toolbar {
    display: flex;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bg-panel-alt);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    flex-wrap: wrap;
    justify-content: center;
    flex-shrink: 0;
}

.editor-canvas-toolbar button {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.editor-canvas-toolbar button svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
}

.editor-canvas-toolbar button:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 191, 165, 0.3);
}

.editor-canvas-toolbar button:active {
    transform: translateY(0);
}

.editor-canvas-toolbar button:disabled,
.editor-canvas-toolbar button.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
    background: var(--bg-dark);
    border-color: var(--border-color);
    color: var(--text-muted);
}

.editor-canvas-toolbar button:disabled:hover,
.editor-canvas-toolbar button.disabled:hover {
    transform: none;
    box-shadow: none;
}

.toolbar-divider {
    width: 1px;
    height: 32px;
    background: var(--border-color);
    margin: 4px 8px;
    align-self: center;
}

/* 编辑控制面板 */
.editor-controls {
    width: 280px;
    background: var(--bg-panel);
    border-radius: var(--radius-md);
    flex-shrink: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* 编辑器面板Tab */
.editor-panel-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
}

.editor-panel-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 8px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.editor-panel-tab:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.editor-panel-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.editor-panel-tab .tab-badge {
    background: var(--accent);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.editor-panel-content {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
}

.editor-controls h4 {
    font-size: 13px;
    color: var(--text-primary);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.pose-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.pose-btn {
    flex: 1;
    padding: 8px 6px;
    font-size: 11px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.pose-btn:hover {
    background: var(--bg-hover);
}

.pose-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* 部件属性面�?*/
.part-properties {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.part-properties h4 {
    color: var(--accent);
    font-size: 12px;
    margin-bottom: 12px;
}

.property-row {
    margin-bottom: 12px;
}

.property-row label {
    display: block;
    color: var(--text-muted);
    font-size: 11px;
    margin-bottom: 4px;
}

.property-row input[type="range"] {
    width: calc(100% - 45px);
    height: 6px;
    border-radius: 3px;
    background: var(--bg-input);
    appearance: none;
    cursor: pointer;
    vertical-align: middle;
}

.property-row input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
}

.property-value {
    display: inline-block;
    width: 40px;
    text-align: right;
    color: var(--text-secondary);
    font-size: 11px;
    font-family: monospace;
}

/* ===== 场景库页�?===== */
.scenes-page {
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    background: var(--bg-darkest);
}

.scenes-page__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-dark);
}

.scenes-page__header h1 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.scenes-page__filters {
    display: flex;
    gap: 12px;
    align-items: center;
}

.scenes-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.scenes-grid {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    align-content: start;
}

.scenes-loading,
.scenes-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    gap: 16px;
}

.scenes-empty h3 {
    font-size: 16px;
    color: var(--text-secondary);
}

.scenes-empty p {
    font-size: 13px;
}

/* 场景卡片 */
.scene-card {
    background: var(--bg-panel);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}

.scene-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.scene-card__image {
    width: 100%;
    height: 140px;
    background: linear-gradient(135deg, var(--bg-panel-alt) 0%, var(--bg-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.scene-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scene-card__placeholder {
    color: var(--text-muted);
    opacity: 0.5;
}

.scene-card__info {
    padding: 14px;
}

.scene-card__name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.scene-card__meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.scene-card__category,
.scene-card__mood {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--bg-input);
    color: var(--text-secondary);
}

.scene-card__actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.scene-card:hover .scene-card__actions {
    opacity: 1;
}

/* 场景弹窗 */
.modal--scene {
    width: 90%;
    max-width: 500px;
}

/* ===== 右侧面板Tab样式 ===== */
.right-panel-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 12px;
}

.right-panel-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.right-panel-tab:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.right-panel-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    background: transparent;
}

.tab-badge {
    background: var(--accent);
    color: white;
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 8px;
    font-weight: bold;
}

.panel-content {
    height: calc(100% - 48px);
    overflow-y: auto;
}

/* ===== 表情选择面板样式 ===== */
.expression-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.expression-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 4px;
}

.expression-info {
    font-size: 12px;
    color: var(--text-secondary);
}

.expression-info strong {
    color: var(--accent);
    font-size: 14px;
}

/* 表情风格分类 */
.expression-styles {
    margin-bottom: 12px;
}

.expression-section-title {
    font-size: 11px;
    color: var(--text-secondary);
    padding: 4px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 8px;
}

.style-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.style-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--bg-input);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.style-item:hover {
    border-color: var(--accent);
    background: var(--bg-hover);
}

.style-item.active {
    border-color: var(--accent);
    background: var(--accent);
    color: white;
}

.style-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    border-radius: 4px;
}

.style-name {
    font-size: 12px;
    white-space: nowrap;
}

/* 情绪类型选择 */
.emotion-types {
    margin-bottom: 12px;
}

.emotion-type-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    max-height: 120px;
    overflow-y: auto;
}

.emotion-type-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s ease;
}

.emotion-type-item:hover {
    border-color: var(--accent);
    background: var(--bg-hover);
}

.emotion-type-item.active {
    border-color: var(--accent);
    background: var(--accent);
    color: white;
}

.emotion-type-item.configured {
    border-color: var(--status-success);
}

.emotion-type-item.configured .configured-icon {
    color: var(--status-success);
}

.emotion-type-item.active.configured .configured-icon {
    color: white;
}

.emotion-icon {
    font-size: 14px;
}

.emotion-name {
    white-space: nowrap;
}

.emotion-count {
    font-size: 10px;
    color: var(--text-secondary);
    margin-left: 2px;
}

.emotion-type-item.active .emotion-count {
    color: rgba(255,255,255,0.7);
}

/* 右侧控制面板 - 默认宽度 */
.editor-controls {
    width: 280px;
    flex-shrink: 0;
    transition: width 0.3s ease;
}

/* 右侧控制面板 - 表情模式加宽 */
.editor-controls--wide {
    width: 400px;
}

/* 宽表情面板样�?*/
.expression-panel-wide {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    padding-bottom: 20px;
}

.expression-panel-wide .expression-header {
    font-size: 13px;
    color: var(--text-secondary);
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.expression-panel-wide .expression-header strong {
    color: var(--accent);
    font-size: 16px;
}

.expression-panel-wide .expression-section {
    margin-bottom: 8px;
}

.expression-panel-wide .expression-section-title {
    font-size: 12px;
    font-weight: bold;
    color: var(--accent);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.expression-panel-wide .expression-section-title small {
    font-weight: normal;
    color: var(--text-secondary);
    font-size: 10px;
}

/* 风格列表 - 横向排列 */
.style-list-wide {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.style-item-wide {
    padding: 6px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.style-item-wide:hover {
    border-color: var(--accent);
}

.style-item-wide.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* 情绪类型列表 */
.emotion-type-list-wide {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-height: 150px;
    overflow-y: auto;
}

.emotion-type-item-wide {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s ease;
    position: relative;
}

.emotion-type-item-wide:hover {
    border-color: var(--accent);
}

.emotion-type-item-wide.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.emotion-type-item-wide.configured {
    border-color: var(--status-success);
}

.emotion-type-item-wide .emotion-icon {
    font-size: 14px;
}

.emotion-type-item-wide .count {
    color: var(--text-secondary);
    font-size: 10px;
}

.emotion-type-item-wide.active .count {
    color: rgba(255,255,255,0.8);
}

.emotion-type-item-wide .check-icon {
    color: var(--status-success);
}

.emotion-type-item-wide.active .check-icon {
    color: white;
}

/* 表情网格 */
.expression-grid-wide {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    max-height: 280px;
    overflow-y: auto;
}

.expression-item-wide {
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.expression-item-wide:hover {
    border-color: var(--accent);
}

.expression-item-wide.selected {
    border-color: var(--accent);
    background: rgba(32, 201, 151, 0.1);
}

.expression-item-wide img {
    width: 100%;
    height: 80px;
    object-fit: contain;
    background: var(--bg-main);
}

.expression-item-wide .expr-info {
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.expression-item-wide .expr-name {
    font-size: 11px;
    font-weight: bold;
}

.expression-item-wide .expr-frames {
    font-size: 9px;
    color: var(--text-secondary);
}

.expression-item-wide .selected-mark {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

/* 已配置表情列�?*/
.configured-list-wide {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.configured-item-wide {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 10px;
}

.configured-item-wide:hover {
    background: var(--bg-hover);
}

.configured-item-wide img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    border-radius: 4px;
}

.configured-item-wide .remove-btn {
    padding: 2px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.configured-item-wide:hover .remove-btn {
    opacity: 1;
}

.configured-item-wide .remove-btn:hover {
    background: var(--status-error);
    color: white;
}

.expression-panel--large .expression-section-title {
    font-size: 12px;
    font-weight: bold;
    color: var(--accent);
}

.expression-panel--large .hint {
    font-size: 10px;
    color: var(--text-secondary);
    margin-left: 8px;
}

/* 增大的表情网�?*/
.expression-grid--large {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.expression-item--large {
    min-height: 100px;
}

.expression-item--large img {
    height: 80px;
    object-fit: contain;
}

.expression-item--large .expression-item-info {
    padding: 8px 6px;
}

.expression-item--large .expression-item-name {
    font-size: 12px;
}

/* 风格选择样式优化 */
.expression-styles {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.style-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.style-item {
    padding: 8px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.style-item:hover {
    border-color: var(--accent);
    background: var(--bg-hover);
}

.style-item.active {
    border-color: var(--accent);
    background: var(--accent);
    color: white;
    font-weight: bold;
}

/* 已配置表情可点击效果 */
.configured-item {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.configured-item:hover {
    transform: scale(1.05);
    background: var(--bg-hover);
}

/* 表情列表 */
.expression-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.expression-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 4px;
    font-size: 12px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.expression-loading,
.expression-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 24px;
    color: var(--text-muted);
    font-size: 12px;
}

.expression-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 8px 0;
    overflow-y: auto;
    max-height: 200px;
}

.expression-item {
    position: relative;
    aspect-ratio: 1;
    background: var(--bg-input);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    overflow: hidden;
    transition: all 0.2s ease;
}

.expression-item:hover {
    border-color: var(--accent);
    transform: scale(1.02);
}

.expression-item.selected {
    border-color: var(--status-success);
    background: var(--status-success);
}

.expression-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
}

.expression-item-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 4px;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    font-size: 9px;
    color: white;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.expression-item-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.expression-item-frames {
    display: flex;
    align-items: center;
    gap: 2px;
    opacity: 0.8;
}

.expression-selected-mark {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    background: var(--status-success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.expression-load-more {
    padding: 8px;
    text-align: center;
}

/* 已配置表�?*/
.configured-expressions {
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    padding-top: 8px;
}

.configured-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 0;
    max-height: 100px;
    overflow-y: auto;
}

.configured-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 6px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    font-size: 11px;
}

.configured-item img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    border-radius: 4px;
}

.configured-item .remove-btn {
    width: 16px;
    height: 16px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.configured-item .remove-btn:hover {
    background: var(--status-error);
    color: white;
}

/* 旋转动画 */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.spin {
    animation: spin 1s linear infinite;
}

/* ===== 动作预设面板样式 ===== */
.pose-preset-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 8px;
}

/* 资源类型筛选Tab */
.pose-filter-tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
}

.pose-filter-tab {
    flex: 1;
    padding: 6px 8px;
    font-size: 11px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.pose-filter-tab:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.pose-filter-tab.active {
    background: var(--accent);
    color: white;
}

.pose-filter-tab .tab-count {
    display: inline-block;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    padding: 0 4px;
    font-size: 10px;
    font-weight: 600;
    background: rgba(255,255,255,0.2);
    border-radius: 8px;
    margin-left: 4px;
}

.pose-filter-tab.active .tab-count {
    background: rgba(255,255,255,0.3);
}

/* 预设区域 */
.pose-presets-section {
    flex: 1;
    overflow-y: auto;
}

.pose-section-title {
    font-size: 11px;
    color: var(--text-secondary);
    padding: 4px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 8px;
}

.pose-loading,
.pose-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px;
    font-size: 12px;
    color: var(--text-muted);
}

/* 预设网格 - 响应式一�?�?*/
.pose-presets-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    max-height: 450px;
    overflow-y: auto;
    padding-right: 4px;
}

.pose-preset-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 8px;
    background: var(--bg-input);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.pose-preset-item:hover {
    border-color: var(--accent);
    background: var(--bg-hover);
}

.pose-preset-item.active {
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.15);
}

.pose-preset-item.official {
    background: linear-gradient(135deg, var(--bg-input) 0%, rgba(99, 102, 241, 0.1) 100%);
}

.preset-icon {
    font-size: 24px;
    line-height: 1;
}

/* 带缩略图的预设项 - 紧凑布局 */
.pose-preset-item--with-thumb {
    padding: 4px;
    min-height: 80px;
}

.preset-thumb {
    width: 100%;
    aspect-ratio: 3/4;
    border-radius: 6px;
    overflow: hidden;
    background: linear-gradient(180deg, #0f1419 0%, #0a0e14 100%);
    margin-bottom: 6px;
}

.preset-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.preset-name {
    font-size: 11px;
    color: var(--text-primary);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.preset-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 10px;
}

.preset-delete-btn {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 18px;
    height: 18px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
}

.pose-preset-item:hover .preset-delete-btn {
    opacity: 1;
}

.preset-delete-btn:hover {
    background: var(--status-error);
}

/* 快捷操作�?*/
.pose-actions-section {
    display: flex;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

.pose-actions-section .btn {
    flex: 1;
    font-size: 11px;
    padding: 8px 12px;
}

/* 只读模式提示 */
.pose-actions-readonly {
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    padding: 12px !important;
}

.pose-actions-readonly .readonly-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 12px;
}

/* 工具栏只读徽�?*/
.toolbar-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 500;
}

.toolbar-badge--readonly {
    background: rgba(245, 158, 11, 0.15);
    color: var(--status-warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* 禁用状态的输入框样�?*/
.editor-toolbar input:disabled,
.editor-toolbar select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: var(--bg-panel);
}

.part-properties input[type="range"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.property-row input[type="range"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 图标选择�?*/
.icon-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
}

.icon-btn {
    width: 36px;
    height: 36px;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.icon-btn:hover {
    border-color: var(--accent);
    transform: scale(1.1);
}

.icon-btn.active {
    border-color: var(--accent);
    background: var(--accent);
}

/* 名称建议选择�?*/
.name-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
}

.suggestion-btn {
    padding: 6px 12px;
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.suggestion-btn:hover {
    color: var(--text-primary);
    border-color: var(--accent);
    background: rgba(var(--accent-rgb), 0.1);
}

.suggestion-btn.active {
    color: var(--accent);
    border-color: var(--accent);
    background: rgba(var(--accent-rgb), 0.15);
}

/* 表单提示 */
.form-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: var(--radius-sm);
    font-size: 11px;
    color: var(--text-secondary);
}

/* 小尺寸弹�?*/
.modal--small {
    max-width: 400px;
}

.modal--small .modal__body {
    padding: 16px 20px;
}

.modal--small .form-group {
    margin-bottom: 12px;
}

.modal--small .form-group label {
    font-size: 12px;
    margin-bottom: 6px;
}

.modal--small .form-group input {
    font-size: 14px;
}

/* ===== 人物选择模态框 ===== */
.modal--character-library {
    width: 1100px;
    max-width: 95vw;
    max-height: 90vh;
    background: #0d1117;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.8);
}

.modal--character-library .modal__header {
    background: #161b22;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 16px 24px;
}

.modal--character-library .modal__header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
}

.modal--character-library .modal__body {
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: calc(90vh - 150px);
    overflow: hidden;
    background: #0d1117;
}

/* 搜索�?*/
.character-library__search {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    background: #21262d;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    transition: all 0.2s;
}

.character-library__search:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.15);
}

.character-library__search svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.character-library__search-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
}

.character-library__search-input::placeholder {
    color: var(--text-muted);
}

.character-library__search-clear {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
}

.character-library__search-clear:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

/* 分类标签 */
.character-library__tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.character-library__tab {
    padding: 8px 16px;
    background: #21262d;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.character-library__tab:hover {
    background: #30363d;
    color: var(--text-primary);
}

.character-library__tab--active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* 筛选区�?*/
.character-library__filters {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.character-library__filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.character-library__filter-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.character-library__filter-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.character-library__filter-btn {
    padding: 6px 14px;
    background: #21262d;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.character-library__filter-btn:hover {
    background: #30363d;
    color: var(--text-primary);
}

.character-library__filter-btn--active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* 人物网格 */
.character-library__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    overflow-y: auto;
    flex: 1;
    padding: 8px 4px;
}

.character-library__item {
    background: #161b22;
    border: 2px solid transparent;
    border-radius: 16px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.character-library__item:hover {
    background: #21262d;
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.character-library__item--selected {
    background: rgba(76, 175, 80, 0.2);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

.character-library__item-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-radius: 12px;
    background: #0d1117;
    display: flex;
    align-items: center;
    justify-content: center;
}

.character-library__item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.character-library__item-placeholder {
    color: var(--text-muted);
}

.character-library__item-info {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.character-library__item-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.character-library__item-gender {
    font-size: 14px;
    font-weight: 500;
}

.character-library__item-gender.gender--�?{
    color: #60a5fa;
}

.character-library__item-gender.gender--�?{
    color: #f472b6;
}

.character-library__item-category {
    font-size: 12px;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 3px 10px;
    border-radius: 10px;
}

.character-library__item-era {
    font-size: 11px;
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.15);
    padding: 2px 8px;
    border-radius: 8px;
}

.character-library__empty,
.character-library__loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px;
    color: var(--text-muted);
    grid-column: 1 / -1;
}

.modal--character-library .modal__footer {
    background: #161b22;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.character-library__count {
    color: var(--text-muted);
    font-size: 13px;
    margin-right: auto;
}

.character-library__selected-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--accent);
    font-size: 13px;
}

.character-library__selected-info img {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: cover;
}

/* 保存成功动画 */
@keyframes fadeInOut {
    0% { opacity: 0; transform: translateX(-10px); }
    20% { opacity: 1; transform: translateX(0); }
    80% { opacity: 1; transform: translateX(0); }
    100% { opacity: 0; transform: translateX(10px); }
}

.scene-editor__save-toast {
    animation: fadeInOut 2s forwards;
}

/* ===== 镜头比例选择 ===== */
.scene-editor__ratio-select {
    display: flex;
    align-items: center;
    gap: 8px;
}

.scene-editor__ratio-select label {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
}

.scene-editor__ratio-buttons {
    display: flex;
    gap: 4px;
}

.scene-editor__ratio-btn {
    padding: 6px 12px;
    background: var(--bg-dark-3);
    border: 1px solid var(--border-dark);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.scene-editor__ratio-btn:hover {
    background: var(--bg-dark-2);
    color: var(--text-primary);
}

.scene-editor__ratio-btn--active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* ===== 人物缩放手柄 ===== */
.scene-editor__char-resize-handle {
    position: absolute;
    bottom: -10px;
    right: -10px;
    width: 24px;
    height: 24px;
    background: var(--bg-dark-2);
    border: 2px solid var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: nwse-resize;
    color: var(--accent);
    transition: all 0.2s;
    z-index: 10;
}

.scene-editor__char-resize-handle:hover {
    background: var(--accent);
    color: #fff;
    transform: scale(1.1);
}

/* ===== 添加人物按钮样式 ===== */
.scene-editor__btn--primary {
    background: linear-gradient(135deg, var(--accent) 0%, #00d4aa 100%);
    color: #fff;
    font-weight: 500;
    border: none;
}

.scene-editor__btn--primary:hover {
    background: linear-gradient(135deg, #00d4aa 0%, var(--accent) 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

/* ===== 属性面板样�?===== */
.property-panel {
    padding: 16px;
}

.property-panel .part-properties--full {
    background: var(--bg-input);
    border-radius: var(--radius-md);
    padding: 16px;
}

.property-panel .part-properties--full h4 {
    font-size: 14px;
    color: var(--accent);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.property-panel .property-row {
    margin-bottom: 16px;
}

.property-panel .property-row label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.property-panel .property-row input[type="range"] {
    width: calc(100% - 50px);
    height: 6px;
    border-radius: 3px;
    background: #3a4556;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    vertical-align: middle;
}

.property-panel .property-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.property-panel .property-row input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: none;
}

.property-panel .property-row input[type="range"]::-moz-range-track {
    height: 6px;
    border-radius: 3px;
    background: #3a4556;
}

.property-panel .property-row input[type="range"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.property-panel .property-value {
    display: inline-block;
    width: 45px;
    text-align: right;
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
}

.property-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: var(--text-muted);
    text-align: center;
}

.property-empty svg {
    margin-bottom: 12px;
    opacity: 0.5;
}

.property-empty p {
    font-size: 13px;
}

/* 预设名称紧凑显示 */
.pose-preset-item--with-thumb .preset-name {
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* 编辑�?Tab 样式优化 */
.editor-panel-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border-color);
}

.editor-panel-tab {
    flex: 1;
    padding: 10px 8px;
    font-size: 12px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    position: relative;
}

.editor-panel-tab:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.editor-panel-tab.active {
    color: var(--accent);
}

.editor-panel-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent);
}


/* ========================================
   安全区域标签样式（场景编辑器专用�?======================================== */
.safe-zone__label {
    position: absolute;
    background: rgba(0, 0, 0, 0.7);
    color: #00bfa5;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
    pointer-events: none;
    z-index: 52;
    white-space: nowrap;
}

.safe-zone__label--tl { top: 4px; left: 4px; }
.safe-zone__label--tr { top: 4px; right: 4px; }
.safe-zone__label--bl { bottom: 4px; left: 4px; }
.safe-zone__label--br { bottom: 4px; right: 4px; }
.safe-zone__label--center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 191, 165, 0.9);
    color: #fff;
}

.safe-zone__size {
    position: absolute;
    top: -24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent, #00bfa5);
    color: #fff;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    pointer-events: none;
    z-index: 52;
}

.safe-zone__crosshair {
    position: absolute;
    background: rgba(0, 191, 165, 0.3);
    pointer-events: none;
}

.safe-zone__crosshair--h {
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    transform: translateY(-50%);
}

.safe-zone__crosshair--v {
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    transform: translateX(-50%);
}

.safe-zone__mask {
    position: absolute;
    background: rgba(0, 0, 0, 0.5);
    pointer-events: none;
    z-index: 45;
}
/* ===== Scene Editor Styles ===== */
/* 场景编辑器专用样�?- novels.html */

/* ========================================
   场景编辑器全屏容�?
======================================== */
.scene-editor-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--bg-darkest, #101014);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ========================================
   场景编辑器头�?
======================================== */
.scene-editor__header {
    height: 56px;
    background: var(--bg-dark, #16181d);
    border-bottom: 1px solid var(--border-color, #2a2d34);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    flex-shrink: 0;
}

.scene-editor__header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.scene-editor__header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* 角色选择下拉�?*/
.scene-editor__char-select {
    display: flex;
    align-items: center;
    gap: 8px;
}

.scene-editor__char-select label {
    font-size: 13px;
    color: var(--text-secondary, #9ea4b3);
}

.scene-editor__select {
    background: var(--bg-input, #2a2d36);
    border: 1px solid var(--border-color, #2a2d34);
    border-radius: var(--radius-md, 6px);
    padding: 8px 12px;
    color: var(--text-primary, #e8ebf2);
    font-size: 13px;
    min-width: 120px;
    cursor: pointer;
}

.scene-editor__select:focus {
    outline: none;
    border-color: var(--accent, #00bfa5);
}

/* 操作按钮�?*/
.scene-editor__actions {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    background: var(--bg-input, #2a2d36);
    border-radius: var(--radius-md, 6px);
}

.scene-editor__action-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm, 4px);
    color: var(--text-secondary, #9ea4b3);
    cursor: pointer;
    transition: all 0.15s ease;
}

.scene-editor__action-btn:hover:not(:disabled) {
    background: var(--bg-hover, #333744);
    color: var(--text-primary, #e8ebf2);
}

.scene-editor__action-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* 比例选择按钮 */
.scene-editor__ratio-select {
    display: flex;
    align-items: center;
    gap: 8px;
}

.scene-editor__ratio-select label {
    font-size: 12px;
    color: var(--text-muted, #6b7280);
}

.scene-editor__ratio-buttons {
    display: flex;
    gap: 4px;
}

.scene-editor__ratio-btn {
    padding: 6px 12px;
    background: var(--bg-input, #2a2d36);
    border: 1px solid var(--border-color, #2a2d34);
    border-radius: var(--radius-sm, 4px);
    color: var(--text-secondary, #9ea4b3);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.scene-editor__ratio-btn:hover {
    border-color: var(--accent, #00bfa5);
    color: var(--text-primary, #e8ebf2);
}

.scene-editor__ratio-btn.active {
    background: var(--accent, #00bfa5);
    border-color: var(--accent, #00bfa5);
    color: #fff;
}

/* 提示文字 */
.scene-editor__tip {
    font-size: 11px;
    color: var(--text-muted, #6b7280);
    margin-left: 8px;
}

/* 变动按钮 */
.scene-editor__var-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--bg-input, #2a2d36);
    border: 1px solid var(--border-color, #2a2d34);
    border-radius: var(--radius-md, 6px);
    color: var(--text-secondary, #9ea4b3);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.scene-editor__var-btn:hover {
    background: var(--bg-hover, #333744);
    color: var(--text-primary, #e8ebf2);
}

.scene-editor__var-btn--close {
    background: var(--status-error, #ef4444);
    border-color: var(--status-error, #ef4444);
    color: #fff;
}

.scene-editor__var-btn--close:hover {
    background: #dc2626;
}

/* 通用按钮 */
.scene-editor__btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-md, 6px);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    border: none;
}

.scene-editor__btn--primary {
    background: var(--accent, #00bfa5);
    color: #fff;
}

.scene-editor__btn--primary:hover {
    background: var(--accent-hover, #00d4b8);
}

.scene-editor__btn--secondary {
    background: var(--bg-input, #2a2d36);
    color: var(--text-secondary, #9ea4b3);
    border: 1px solid var(--border-color, #2a2d34);
}

.scene-editor__btn--secondary:hover {
    background: var(--bg-hover, #333744);
    color: var(--text-primary, #e8ebf2);
}

/* ========================================
   响应�?
======================================== */
@media (max-width: 768px) {
    .scene-editor__header {
        flex-wrap: wrap;
        height: auto;
        padding: 8px 12px;
        gap: 8px;
    }
    
    .scene-editor__header-left,
    .scene-editor__header-right {
        flex-wrap: wrap;
    }
    
    .scene-editor__layer-panel {
        width: 240px;
    }
    
    .scene-editor__char-menu {
        width: 280px;
    }
}

/* [删除重复样式块，见下方正确的确认对话框样式] */

/* 安全区域角标 */
.scene-editor__safe-zone-corner {
    position: absolute;
    background: rgba(0, 0, 0, 0.7);
    color: var(--text-muted, #6b7280);
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    pointer-events: none;
    z-index: 51;
}

/* 安全区域坐标标签 */
.safe-zone__label {
    position: absolute;
    background: rgba(0, 0, 0, 0.7);
    color: #00bfa5;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
    pointer-events: none;
    z-index: 52;
    white-space: nowrap;
}

.safe-zone__label--tl { top: 4px; left: 4px; }
.safe-zone__label--tr { top: 4px; right: 4px; }
.safe-zone__label--bl { bottom: 4px; left: 4px; }
.safe-zone__label--br { bottom: 4px; right: 4px; }
.safe-zone__label--center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 191, 165, 0.9);
    color: #fff;
}

/* 安全区域尺寸标签 */
.safe-zone__size {
    position: absolute;
    top: -24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent, #00bfa5);
    color: #fff;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    pointer-events: none;
    z-index: 52;
}

/* 安全区域十字�?*/
.safe-zone__crosshair {
    position: absolute;
    background: rgba(0, 191, 165, 0.3);
    pointer-events: none;
}

.safe-zone__crosshair--h {
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    transform: translateY(-50%);
}

.safe-zone__crosshair--v {
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    transform: translateX(-50%);
}

/* 安全区域遮罩 */
.safe-zone__mask {
    position: absolute;
    background: rgba(0, 0, 0, 0.5);
    pointer-events: none;
    z-index: 45;
}

/* ========================================
   镜头�?
======================================== */
.scene-editor__camera-frame {
    position: absolute;
    border: 3px solid #f59e0b;
    background: transparent;
    cursor: move;
    z-index: 100;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.3);
}

.scene-editor__camera-frame::before {
    content: '';
    position: absolute;
    inset: -1px;
    border: 1px dashed rgba(255, 255, 255, 0.5);
    pointer-events: none;
}

/* 镜头框角�?*/
.scene-editor__camera-corner {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #f59e0b;
    border: 2px solid #fff;
    border-radius: 2px;
    z-index: 101;
}

.scene-editor__camera-corner--tl { top: -6px; left: -6px; cursor: nwse-resize; }
.scene-editor__camera-corner--tr { top: -6px; right: -6px; cursor: nesw-resize; }
.scene-editor__camera-corner--bl { bottom: -6px; left: -6px; cursor: nesw-resize; }
.scene-editor__camera-corner--br { bottom: -6px; right: -6px; cursor: nwse-resize; }

/* 镜头框旋转控�?*/
.scene-editor__camera-rotate {
    position: absolute;
    top: -36px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    background: var(--accent, #00bfa5);
    border: 2px solid #fff;
    border-radius: 50%;
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 101;
}

/* 镜头信息 */
.scene-editor__camera-info {
    position: absolute;
    bottom: -28px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    pointer-events: none;
}

/* 镜头锁定图标 */
.scene-editor__camera-lock {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 28px;
    height: 28px;
    background: var(--accent, #00bfa5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    z-index: 102;
}

/* 
 * [重要] 以下人物角色相关样式已移至 scene-editor.css
 * 不要在这里定义，否则会覆盖 scene-editor.css 中的正确样式
 * 
 * 已注释掉的样式包括：
 * - .scene-editor__character 及其变体
 * - .scene-editor__char-canvas
 * - .scene-editor__char-image
 * - .scene-editor__char-placeholder
 * - .scene-editor__char-info
 * - .scene-editor__char-edit-btn
 * - .scene-editor__char-replace-btn
 * - .scene-editor__char-name
 * - .scene-editor__char-bounds
 * - .scene-editor__bounds-border
 * - .scene-editor__bounds-corner
 * - .scene-editor__bounds-rotate
 * - .scene-editor__char-lock
 */

/* ========================================
   道具物品
======================================== */
.scene-editor__prop {
    position: absolute;
    cursor: move;
    user-select: none;
    z-index: 15;
}

.scene-editor__prop--selected {
    z-index: 22;
}

.scene-editor__prop--dragging {
    cursor: grabbing;
}

.scene-editor__prop-image {
    display: block;
    max-width: 200px;
    max-height: 200px;
    object-fit: contain;
    pointer-events: none;
}

.scene-editor__prop-label {
    position: absolute;
    bottom: -24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.scene-editor__prop-delete-btn {
    width: 18px;
    height: 18px;
    background: var(--status-error, #ef4444);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scene-editor__prop-resize-handle {
    position: absolute;
    bottom: -6px;
    right: -6px;
    width: 12px;
    height: 12px;
    background: var(--accent, #00bfa5);
    border: 2px solid #fff;
    border-radius: 2px;
    cursor: nwse-resize;
}

/* ========================================
   标尺
======================================== */
.scene-editor__ruler {
    position: absolute;
    background: var(--bg-dark, #16181d);
    z-index: 200;
}

.scene-editor__ruler--vertical {
    left: 0;
    top: 56px;
    width: 24px;
    height: calc(100% - 56px - 40px);
    border-right: 1px solid var(--border-color, #2a2d34);
}

.scene-editor__ruler--horizontal {
    top: 56px;
    left: 24px;
    right: 0;
    height: 24px;
    border-bottom: 1px solid var(--border-color, #2a2d34);
}

.scene-editor__ruler span {
    position: absolute;
    font-size: 9px;
    color: var(--text-muted, #6b7280);
}

/* ========================================
   图层面板
======================================== */
.scene-editor__layer-panel {
    position: absolute;
    top: 56px;
    right: 0;
    width: 280px;
    height: calc(100% - 56px - 40px);
    background: var(--bg-panel, #1c1e24);
    border-left: 1px solid var(--border-color, #2a2d34);
    display: flex;
    flex-direction: column;
    z-index: 300;
    overflow: hidden;
}

.scene-editor__layer-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color, #2a2d34);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.scene-editor__layer-header h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #e8ebf2);
    display: flex;
    align-items: center;
    gap: 8px;
}

.scene-editor__layer-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.scene-editor__layer-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-input, #2a2d36);
    border: 1px solid transparent;
    border-radius: var(--radius-md, 6px);
    margin-bottom: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.scene-editor__layer-item:hover {
    background: var(--bg-hover, #333744);
}

.scene-editor__layer-item--selected {
    border-color: var(--accent, #00bfa5);
    background: rgba(0, 191, 165, 0.1);
}

.scene-editor__layer-item--locked {
    opacity: 0.6;
}

.scene-editor__layer-thumb {
    width: 40px;
    height: 40px;
    background: var(--bg-dark, #16181d);
    border-radius: var(--radius-sm, 4px);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

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

.scene-editor__layer-info {
    flex: 1;
    min-width: 0;
}

.scene-editor__layer-name {
    font-size: 13px;
    color: var(--text-primary, #e8ebf2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.scene-editor__layer-type {
    font-size: 11px;
    color: var(--text-muted, #6b7280);
}

.scene-editor__layer-actions {
    display: flex;
    gap: 4px;
}

.scene-editor__layer-btn {
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm, 4px);
    color: var(--text-muted, #6b7280);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.scene-editor__layer-btn:hover {
    background: var(--bg-hover, #333744);
    color: var(--text-primary, #e8ebf2);
}

.scene-editor__layer-btn--danger:hover {
    background: var(--status-error, #ef4444);
    color: #fff;
}

/* ========================================
   角色编辑菜单
======================================== */
.scene-editor__char-menu {
    position: fixed;
    width: 320px;
    max-height: 80vh;
    background: var(--bg-panel, #1c1e24);
    border: 1px solid var(--border-color, #2a2d34);
    border-radius: var(--radius-lg, 8px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    z-index: 10001;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.scene-editor__char-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color, #2a2d34);
    cursor: move;
    background: var(--bg-dark, #16181d);
}

.scene-editor__char-menu-header h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #e8ebf2);
}

.scene-editor__menu-close-btn {
    width: 28px;
    height: 28px;
    background: var(--bg-input, #2a2d36);
    border: none;
    border-radius: var(--radius-sm, 4px);
    color: var(--text-muted, #6b7280);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.scene-editor__menu-close-btn:hover {
    background: var(--bg-hover, #333744);
    color: var(--text-primary, #e8ebf2);
}

.scene-editor__menu-section {
    padding: 16px;
    border-bottom: 1px solid var(--border-color, #2a2d34);
}

.scene-editor__menu-section--poses {
    flex: 1;
    overflow-y: auto;
    max-height: 300px;
}

.scene-editor__menu-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary, #9ea4b3);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.scene-editor__menu-label-hint {
    font-size: 11px;
    font-weight: normal;
    color: var(--text-muted, #6b7280);
}

.scene-editor__menu-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: var(--text-muted, #6b7280);
    font-size: 13px;
}

.scene-editor__menu-empty {
    padding: 20px;
    text-align: center;
    color: var(--text-muted, #6b7280);
    font-size: 13px;
}

/* 表情网格 */
.scene-editor__expression-grid-container {
    max-height: 200px;
    overflow-y: auto;
}

.scene-editor__expression-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.scene-editor__expression-card {
    aspect-ratio: 1;
    background: var(--bg-input, #2a2d36);
    border: 2px solid transparent;
    border-radius: var(--radius-md, 6px);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    flex-direction: column;
}

.scene-editor__expression-card:hover {
    border-color: var(--accent, #00bfa5);
}

.scene-editor__expression-card--selected {
    border-color: var(--accent, #00bfa5);
    background: rgba(0, 191, 165, 0.1);
}

.scene-editor__expression-card img {
    width: 100%;
    height: 70%;
    object-fit: contain;
    background: var(--bg-dark, #16181d);
}

.scene-editor__expression-card-label {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: var(--text-secondary, #9ea4b3);
    padding: 2px;
    text-align: center;
}

/* 动作预设网格 */
.scene-editor__pose-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.scene-editor__pose-card {
    background: var(--bg-input, #2a2d36);
    border: 2px solid transparent;
    border-radius: var(--radius-md, 6px);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
}

.scene-editor__pose-card:hover {
    border-color: var(--accent, #00bfa5);
}

.scene-editor__pose-card--selected {
    border-color: var(--accent, #00bfa5);
}

.scene-editor__pose-thumb {
    aspect-ratio: 1;
    background: var(--bg-dark, #16181d);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.scene-editor__pose-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.scene-editor__pose-name {
    display: block;
    padding: 6px 8px;
    font-size: 11px;
    color: var(--text-secondary, #9ea4b3);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.scene-editor__pose-check {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    background: var(--accent, #00bfa5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.scene-editor__pose-loading {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 菜单�?*/
.scene-editor__menu-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    background: transparent;
    border: none;
    color: var(--text-secondary, #9ea4b3);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.scene-editor__menu-item:hover {
    background: var(--bg-hover, #333744);
    color: var(--text-primary, #e8ebf2);
}

.scene-editor__menu-item--confirm {
    background: var(--accent, #00bfa5);
    color: #fff;
}

.scene-editor__menu-item--confirm:hover {
    background: var(--accent-hover, #00d4b8);
}

/* 菜单背景遮罩 */
.scene-editor__menu-backdrop {
    position: fixed;
    inset: 0;
    background: transparent;
    z-index: 10000;
}

/* Toggle 开�?*/
.scene-editor__toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.scene-editor__toggle input {
    width: 40px;
    height: 22px;
    appearance: none;
    background: var(--bg-input, #2a2d36);
    border-radius: 11px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}

.scene-editor__toggle input::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: all 0.2s ease;
}

.scene-editor__toggle input:checked {
    background: var(--accent, #00bfa5);
}

.scene-editor__toggle input:checked::before {
    left: 20px;
}

.scene-editor__toggle span {
    font-size: 13px;
    color: var(--text-secondary, #9ea4b3);
}

/* ========================================
   状态栏
======================================== */
.scene-editor__statusbar {
    height: 40px;
    background: var(--bg-dark, #16181d);
    border-top: 1px solid var(--border-color, #2a2d34);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    flex-shrink: 0;
}

.scene-editor__statusbar-left,
.scene-editor__statusbar-center,
.scene-editor__statusbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.scene-editor__statusbar span {
    font-size: 12px;
    color: var(--text-muted, #6b7280);
}

.scene-editor__statusbar-actions {
    display: flex;
    gap: 8px;
}

/* ========================================
   响应�?
======================================== */
@media (max-width: 768px) {
    .scene-editor__header {
        flex-wrap: wrap;
        height: auto;
        padding: 8px 12px;
        gap: 8px;
    }
    
    .scene-editor__header-left,
    .scene-editor__header-right {
        flex-wrap: wrap;
    }
    
    .scene-editor__layer-panel {
        width: 240px;
    }
    
    .scene-editor__char-menu {
        width: 280px;
    }
}
