/* ===== 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;
}

/* 首页样式的登录/注册按钮 */
.btn-login, .btn-register {
    padding: 10px 20px;
    background: transparent;
    border: 1px solid var(--border, rgba(255,255,255,0.08));
    color: var(--text-secondary, rgba(255,255,255,0.7));
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    font-family: inherit;
}

.btn-login:hover, .btn-register:hover {
    background: var(--bg-card, #1a1a24);
    border-color: var(--accent, #00d4aa);
    color: var(--accent, #00d4aa);
}

.app-header__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    transition: opacity 0.2s;
    cursor: pointer;
}

.app-header__brand:hover {
    opacity: 0.8;
}

.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;
}

/* ===== 用户信息样式（与首页一致） ===== */
.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: var(--bg-card, #1a1a24);
    border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
    border-radius: 8px;
}

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

.user-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary, #ffffff);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-points {
    font-size: 12px;
    color: var(--accent, #00d4aa);
    font-weight: 600;
    white-space: nowrap;
}

.user-menu {
    position: relative;
    flex-shrink: 0;
}

.user-menu-btn {
    padding: 8px 12px;
    background: transparent;
    border: none;
    color: var(--text-secondary, rgba(255, 255, 255, 0.7));
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    transition: color 0.2s;
}

.user-menu-btn:hover {
    color: var(--text-primary, #ffffff);
}

.user-menu-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 8px;
    background: var(--bg-card, #1a1a24);
    border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
    border-radius: 8px;
    padding: 8px;
    min-width: 150px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

.user-menu-dropdown a,
.user-menu-dropdown button {
    display: block;
    width: 100%;
    padding: 8px 12px;
    background: transparent;
    border: none;
    color: var(--text-primary, #ffffff);
    text-align: left;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    text-decoration: none;
    transition: background 0.2s;
}

.user-menu-dropdown a:hover,
.user-menu-dropdown button:hover {
    background: var(--bg-secondary, #12121a);
}

/* ===== 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 {
    padding-bottom: 80px; /* 为固定分页组件留出空间 */
    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;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    /* 默认显示，兼容Vue的v-if控制的模态框 */
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* 用于需要隐藏/显示动画的模态框（如AuthModal） */
.modal-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

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

.modal {
    width: 480px;
    max-width: 90%;
    background: var(--bg-panel, #1a1a24);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    border-radius: var(--radius-lg, 16px);
    z-index: 10000;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-overlay.show .modal {
    transform: scale(1);
}

.modal-header {
    padding: 24px 24px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary, #ffffff);
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary, rgba(255, 255, 255, 0.7));
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
    line-height: 1;
}

.modal-close:hover {
    background: var(--bg-secondary, #12121a);
    color: var(--text-primary, #ffffff);
}

.modal-body {
    padding: 24px;
}

.modal-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
}

.modal-tab {
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary, rgba(255, 255, 255, 0.7));
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.modal-tab:hover {
    color: var(--text-primary, #ffffff);
}

.modal-tab.active {
    color: var(--accent, #00d4aa);
    border-bottom-color: var(--accent, #00d4aa);
}

.modal-footer {
    padding: 0 24px 24px;
    text-align: center;
    color: var(--text-muted, rgba(255, 255, 255, 0.5));
    font-size: 13px;
}

.btn-submit {
    width: 100%;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--accent, #00d4aa), #00bfa5);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    margin-top: 16px;
}

.btn-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 212, 170, 0.3);
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.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;
}

.form-error {
    padding: 12px 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    color: #ef4444;
    font-size: 13px;
    margin-top: 16px;
    display: none;
}

.form-error.show {
    display: block;
}

.form-success {
    padding: 12px 16px;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 8px;
    color: #22c55e;
    font-size: 13px;
    margin-top: 16px;
    display: none;
}

.form-success.show {
    display: block;
}

/* ===== 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__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__arrow {
    color: var(--text-muted);
}

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

/* 章节编辑器 Loading 状态 */
.chapter-editor__loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 20px;
    background: var(--bg-darkest);
}

.chapter-editor__loading-text {
    color: var(--text-muted);
    font-size: 14px;
    margin: 0;
}

.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__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__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);
}

.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: 900px;
    max-width: 95vw;
    height: 600px;
    max-height: 85vh;
    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;
}

.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;
}

/* 表单中的播放按钮 */
.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: nowrap;  /* 确保按钮横排不换行 */
    overflow-x: auto;    /* 如果空间不够可以滚动 */
}

.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;
    align-items: center;
    gap: 4px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    padding-left: 12px;
    margin-left: 4px;
}

.scene-editor__action-btn {
    min-width: 32px;
    height: 32px;
    padding: 6px 10px;
    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;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    white-space: nowrap;
}

.scene-editor__action-btn svg {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
}

.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坐标系统：960x540） */
.scene-editor__canvas-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: #0a0c0f;
    padding: 20px;
}

/* Wick画布（固定960x540，通过transform缩放适配） */
.scene-editor__canvas {
    width: 960px;
    height: 540px;
    position: relative;
    overflow: hidden;
    background: #0d1117;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    /* 坐标参考线背景（可选） */
    /* background-image: 
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 48px 48px; */
}

/* 背景图容器（使用Wick坐标定位） */
.scene-editor__bg-container {
    position: absolute;
    /* 位置由JavaScript控制 */
    transition: transform 0.05s ease-out;
}

/* 背景图片 */
.scene-editor__bg-image {
    display: block;
    width: auto;
    height: auto;
    max-width: none;
    max-height: none;
    /* 保持原始尺寸，缩放由容器transform控制 */
}

/* 背景四角缩放控制点 */
.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__character {
    position: absolute;
    cursor: grab;
    user-select: none;
    transition: filter 0.2s, box-shadow 0.2s;
    z-index: 100;
    /* 确保容器尺寸由内联style精确控制 */
    box-sizing: border-box;
    overflow: visible;
    /* 【关键修复】非选中人物不接收点击事件，让点击穿透到画布 */
    pointer-events: none;
}

.scene-editor__character:active {
    cursor: grabbing;
}

.scene-editor__character:hover {
    filter: brightness(1.1);
}

.scene-editor__character--selected {
    z-index: 200;  /* 选中时在镜头框和其他人物之上 */
    /* 【关键修复】只有选中的人物接收点击/拖拽事件 */
    pointer-events: auto;
}

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

.scene-editor__character--dragging {
    cursor: grabbing;
    z-index: 100;
}

/* 角色占位图 */
.scene-editor__char-placeholder {
    width: 100px;
    height: 180px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    backdrop-filter: blur(4px);
}

/* 角色立绘图片 */
.scene-editor__char-image {
    max-width: 252px;
    max-height: 280px;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
    pointer-events: none;
}

/* 移除旧的选中样式，改用线框 */
.scene-editor__character--selected .scene-editor__char-placeholder,
.scene-editor__character--selected .scene-editor__char-image,
.scene-editor__character--selected .scene-editor__char-canvas {
    /* 不再使用outline，改用线框组件 */
}

/* 角色信息（编辑按钮+名称，右上方） */
.scene-editor__char-info {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    z-index: 200;
    transform-origin: right top;
}

.scene-editor__char-name {
    padding: 4px 10px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    backdrop-filter: blur(8px);
}

.scene-editor__char-edit-btn {
    padding: 4px 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    border: none;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    color: #fff;
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
}

.scene-editor__char-edit-btn:hover {
    background: var(--accent-hover);
}

.scene-editor__char-replace-btn {
    padding: 4px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(139, 92, 246, 0.9);
    border: none;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    color: #fff;
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
}

.scene-editor__char-replace-btn:hover {
    background: rgba(139, 92, 246, 1);
}

/* 缩放线框容器（紧贴人物边界） */
.scene-editor__char-bounds {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 10;
}

/* 边框线（独立元素，方便控制粗细） */
.scene-editor__bounds-border {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 1px solid #4fc3f7;
    box-sizing: border-box;
    pointer-events: none;
}

/* 四角缩放点（Wick风格：小方块） */
.scene-editor__bounds-corner {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #4fc3f7;
    border: 1px solid #fff;
    border-radius: 1px;
    pointer-events: auto;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.scene-editor__bounds-corner:hover {
    background: #29b6f6;
    transform: scale(1.2);
}

.scene-editor__bounds-corner--tl {
    top: -4px;
    left: -4px;
    cursor: nw-resize;
}

.scene-editor__bounds-corner--tr {
    top: -4px;
    right: -4px;
    cursor: ne-resize;
}

.scene-editor__bounds-corner--bl {
    bottom: -4px;
    left: -4px;
    cursor: sw-resize;
}

.scene-editor__bounds-corner--br {
    bottom: -4px;
    right: -4px;
    cursor: se-resize;
}

/* 旋转控制点（Wick风格：顶部小圆点） */
.scene-editor__bounds-rotate {
    position: absolute;
    top: -24px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 16px;
    background: #4fc3f7;
    border: 1px solid #fff;
    border-radius: 50%;
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
    z-index: 20;
    transition: all 0.15s;
    pointer-events: auto;
}

.scene-editor__bounds-rotate svg {
    width: 10px;
    height: 10px;
}

.scene-editor__bounds-rotate:hover {
    background: #29b6f6;
    transform: translateX(-50%) scale(1.15);
}

.scene-editor__bounds-rotate:active {
    cursor: grabbing;
}

.scene-editor__bounds-rotate-line {
    position: absolute;
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 15;
    width: 1px;
    height: 16px;
    background: #4fc3f7;
    pointer-events: none;
}

/* 背景拖拽样式 */
.scene-editor__bg-container--dragging {
    cursor: grabbing !important;
}

/* 锁定图标 */
.scene-editor__char-lock {
    position: absolute;
    bottom: 8px;
    right: -24px;
    width: 28px;
    height: 28px;
    background: rgba(0,0,0,0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    backdrop-filter: blur(8px);
}

/* ========== 道具物品样式 ========== */
.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;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.layer-panel__thumb .layer-panel__icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.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-btn--reset {
    background: rgba(100, 150, 255, 0.3);
    margin-left: 4px;
}

.layer-panel__scale-btn--reset:hover {
    background: rgba(100, 150, 255, 0.5);
}

.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;
}

/* ========== 人物预设选择模态框（美化版） ========== */
.pose-preset-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(160deg, #1a2332 0%, #0f1722 100%);
    border: 1px solid rgba(45, 212, 191, 0.2);
    border-radius: 20px;
    box-shadow: 
        0 25px 80px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 0 60px rgba(45, 212, 191, 0.1);
    width: 560px;
    max-width: 90vw;
    max-height: 85vh;
    z-index: 10002;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: poseModalSlideIn 0.25s ease-out;
}

@keyframes poseModalSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -48%) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.pose-preset-modal__header {
    padding: 18px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(180deg, rgba(45, 212, 191, 0.08) 0%, transparent 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    cursor: move;
    user-select: none;
}

.pose-preset-modal__title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pose-preset-modal__name {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.pose-preset-modal__close {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.pose-preset-modal__close:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

/* 预设同步控制 */
.pose-preset-modal__sync {
    padding: 16px 24px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.pose-preset-modal__sync-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 12px;
}

.pose-preset-modal__sync-title {
    font-size: 13px;
    font-weight: 600;
    color: rgba(45, 212, 191, 0.9);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pose-preset-modal__sync-hint {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
}

.pose-preset-modal__toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.pose-preset-modal__toggle input {
    display: none;
}

.pose-preset-modal__toggle-slider {
    width: 44px;
    height: 24px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    position: relative;
    transition: all 0.25s ease;
    flex-shrink: 0;
}

.pose-preset-modal__toggle-slider::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: #ffffff;
    border-radius: 50%;
    transition: all 0.25s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.pose-preset-modal__toggle input:checked + .pose-preset-modal__toggle-slider {
    background: var(--accent);
}

.pose-preset-modal__toggle input:checked + .pose-preset-modal__toggle-slider::after {
    left: 23px;
}

.pose-preset-modal__toggle-text {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
}

/* 动作预设区域 */
.pose-preset-modal__section {
    padding: 20px 24px;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.pose-preset-modal__section-title {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

.pose-preset-modal__loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px;
    color: rgba(255, 255, 255, 0.5);
}

.pose-preset-modal__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px;
    color: rgba(255, 255, 255, 0.35);
    font-size: 13px;
}

/* 动作预设网格 */
.pose-preset-modal__grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

/* 动作预设卡片 */
.pose-preset-card {
    position: relative;
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.08);
}

.pose-preset-card:hover {
    border-color: rgba(45, 212, 191, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.pose-preset-card--active {
    border-color: var(--accent);
    background: rgba(45, 212, 191, 0.1);
}

.pose-preset-card--active:hover {
    border-color: var(--accent);
}

.pose-preset-card__thumb {
    position: relative;
    aspect-ratio: 3/4;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.3) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.pose-preset-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
}

.pose-preset-card__placeholder {
    color: rgba(255, 255, 255, 0.2);
}

.pose-preset-card__check {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    box-shadow: 0 2px 8px rgba(45, 212, 191, 0.5);
}

.pose-preset-card__loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pose-preset-card__name {
    padding: 10px 8px;
    font-size: 12px;
    font-weight: 600;
    color: #ffffff;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: linear-gradient(180deg, rgba(45, 212, 191, 0.15) 0%, rgba(45, 212, 191, 0.4) 100%);
}

.pose-preset-card--active .pose-preset-card__name {
    background: linear-gradient(180deg, rgba(45, 212, 191, 0.3) 0%, rgba(45, 212, 191, 0.6) 100%);
}

/* 底部操作区 */
.pose-preset-modal__footer {
    padding: 16px 24px;
    display: flex;
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.pose-preset-modal__confirm {
    min-width: 160px;
    padding: 12px 32px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* 模态框遮罩层 */
.pose-preset-modal__backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    z-index: 10001;
    animation: fadeIn 0.2s ease;
}

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

/* 响应式调整 */
@media (max-width: 640px) {
    .pose-preset-modal {
        width: 95vw;
        max-height: 90vh;
    }
    
    .pose-preset-modal__grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .pose-preset-modal__header {
        padding: 14px 16px;
    }
    
    .pose-preset-modal__section {
        padding: 16px;
    }
}

/* 旧版角色编辑菜单样式（保留兼容） */
.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__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%;
}

/* ===== 全屏人物设置模态框 ===== */
.modal-overlay--fullscreen {
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(8px);
}

.modal--character-fullscreen {
    width: 96vw;
    height: 94vh;
    max-width: 1600px;
    background: linear-gradient(180deg, #0f1216 0%, #0a0c0f 100%);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

/* 头部 */
.char-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 28px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, transparent 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.char-modal__title {
    display: flex;
    align-items: center;
    gap: 14px;
}

.char-modal__icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}

.char-modal__title-text h2 {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

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

.char-modal__close {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.char-modal__close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* 主体 */
.char-modal__body {
    flex: 1;
    display: flex;
    gap: 0;
    overflow: hidden;
}

/* 左侧面板 */
.char-modal__left {
    width: 360px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.02);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* 角色预览卡片 */
.char-preview-card {
    padding: 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.08) 0%, transparent 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.char-preview__avatar {
    width: 180px;
    height: 260px;
    border-radius: 16px;
    background: linear-gradient(135deg, #1e1f26 0%, #16171c 100%);
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.char-preview__avatar-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.2);
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
}

.char-preview__gender-badge {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.char-preview__gender-badge--male {
    background: rgba(59, 130, 246, 0.8);
    border-color: rgba(59, 130, 246, 0.4);
}

.char-preview__gender-badge--female {
    background: rgba(236, 72, 153, 0.8);
    border-color: rgba(236, 72, 153, 0.4);
}

.char-preview__info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.char-preview__name-input {
    width: 100%;
    max-width: 240px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    transition: all 0.2s;
}

.char-preview__name-input:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(0, 191, 165, 0.15);
}

.char-preview__meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.char-preview__tag {
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.char-preview__tag--accent {
    background: rgba(0, 191, 165, 0.15);
    color: var(--accent);
}

/* 配音设置区域 */
.char-voice-section {
    padding: 20px;
    flex: 1;
}

.char-section__header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.char-voice__selector {
    margin-bottom: 20px;
}

.char-voice__current {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.char-voice__current:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.char-voice__avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #f97316 0%, #fb923c 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.char-voice__info {
    flex: 1;
    min-width: 0;
}

.char-voice__name {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.char-voice__hint {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.char-voice__arrow {
    color: var(--text-muted);
}

/* 参数滑块 */
.char-voice__params {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.char-param {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.char-param__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.char-param__header label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.char-param__value {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    background: rgba(0, 191, 165, 0.15);
    padding: 2px 8px;
    border-radius: 6px;
}

.char-param__slider {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
}

.char-param__slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 191, 165, 0.4);
    transition: transform 0.15s;
}

.char-param__slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.char-param__marks {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-tertiary);
    padding: 0 2px;
}

/* 危险操作区域 */
.char-danger-zone {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin-top: auto;
}

.char-danger-btn {
    width: 100%;
    padding: 12px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 10px;
    color: #f87171;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.char-danger-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
}

/* 右侧面板 */
.char-modal__right {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
}

.char-avatars-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.char-avatars__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* 统一的工具栏（过滤器整合到同一行） */
.char-avatars__toolbar-unified {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-wrap: wrap;
}

.char-avatars__title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    flex-shrink: 0;
}

.char-avatars__count {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 8px;
    border-radius: 10px;
}

/* 内联过滤器组 */
.char-avatars__inline-filters {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    flex: 1;
    justify-content: flex-end;
}

/* 搜索框 */
.char-filter-search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 6px 12px;
    min-width: 180px;
    max-width: 220px;
}

.char-filter-search:focus-within {
    border-color: var(--accent);
    background: rgba(0, 0, 0, 0.4);
}

.char-filter-search input {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 13px;
    outline: none;
    width: 100%;
}

.char-filter-search input::placeholder {
    color: var(--text-muted);
}

.char-filter-search__clear {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    padding: 2px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all 0.2s;
}

.char-filter-search__clear:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* 来源切换 Tabs（官方/我的/全部）*/
.char-avatars__source-tabs {
    display: flex;
    gap: 4px;
    background: rgba(0, 0, 0, 0.3);
    padding: 4px;
    border-radius: 10px;
    margin-left: 12px;
}

.char-source-tab {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.char-source-tab:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.char-source-tab--active {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 191, 165, 0.3);
}

/* 内联过滤按钮组 */
.char-filter-inline {
    display: flex;
    gap: 4px;
    background: rgba(0, 0, 0, 0.2);
    padding: 3px;
    border-radius: 8px;
}

/* 小尺寸过滤标签 */
.char-filter-tab--sm {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 6px;
}

/* 过滤器区域 */
.char-avatars__filters {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 16px 24px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.char-filter-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.char-filter-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    min-width: 36px;
}

.char-filter-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.char-filter-tab {
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.char-filter-tab:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.char-filter-tab--active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 191, 165, 0.3);
}

.char-avatars__filter-badge {
    padding: 4px 10px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.char-avatars__more-btn {
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.char-avatars__more-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* 加载状态 */
.char-avatars__loading {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    color: var(--text-muted);
}

.loading-spinner--lg {
    width: 48px;
    height: 48px;
    border-width: 3px;
}

/* 形象网格 */
.char-avatars__grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 16px;
    padding: 20px 24px;
    overflow-y: auto;
    align-content: start;
    /* 确保有滚动条 */
    min-height: 0;
    max-height: 100%;
}

.char-avatar-card {
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.char-avatar-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

.char-avatar-card--selected {
    border-color: var(--accent) !important;
    background: rgba(0, 191, 165, 0.08);
    box-shadow: 0 0 0 4px rgba(0, 191, 165, 0.15);
}

.char-avatar-card__image {
    aspect-ratio: 3/4.5; /* 更高的比例，适合全身人物 */
    background: linear-gradient(135deg, #1e1f26 0%, #16171c 100%);
    position: relative;
    overflow: hidden;
}

.char-avatar-card__image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center top; /* 从顶部开始显示，确保头部可见 */
}

.char-avatar-card__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.2);
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
}

.char-avatar-card__check {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 191, 165, 0.4);
}

.char-avatar-card__footer {
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.char-avatar-card__name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.char-avatar-card__gender {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}

.char-avatar-card__gender--male {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.char-avatar-card__gender--female {
    background: rgba(236, 72, 153, 0.2);
    color: #f472b6;
}

/* ========== 人物卡片响应式布局 ========== */

/* 中等屏幕 (平板) */
@media (max-width: 1200px) {
    .char-avatars__grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 12px;
        padding: 16px 20px;
    }
    
    .char-avatar-card__footer {
        padding: 10px;
    }
    
    .char-avatar-card__name {
        font-size: 12px;
    }
}

/* 小屏幕 */
@media (max-width: 900px) {
    .char-avatars__grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
        padding: 12px 16px;
    }
    
    .char-avatar-card {
        border-radius: 10px;
    }
    
    .char-avatar-card__image {
        aspect-ratio: 3/4; /* 保持较高比例 */
    }
    
    .char-avatar-card__footer {
        padding: 8px;
        gap: 4px;
    }
    
    .char-avatar-card__name {
        font-size: 11px;
    }
    
    .char-avatar-card__gender {
        width: 18px;
        height: 18px;
        font-size: 10px;
    }
    
    .char-avatar-card__check {
        top: 6px;
        right: 6px;
        width: 22px;
        height: 22px;
    }
    
    .char-avatar-card__placeholder {
        font-size: 28px;
    }
}

/* 更小屏幕 (手机横屏) */
@media (max-width: 768px) {
    .char-avatars__grid {
        grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
        gap: 8px;
        padding: 10px 12px;
    }
    
    .char-avatar-card {
        border-width: 1px;
        border-radius: 8px;
    }
    
    .char-avatar-card__image {
        aspect-ratio: 3/4;
    }
    
    .char-avatar-card__footer {
        padding: 6px;
    }
    
    .char-avatar-card__name {
        font-size: 10px;
    }
    
    .char-avatar-card__gender {
        width: 16px;
        height: 16px;
        font-size: 9px;
    }
    
    .char-avatar-card__check {
        top: 4px;
        right: 4px;
        width: 18px;
        height: 18px;
    }
    
    .char-avatar-card__placeholder {
        font-size: 22px;
    }
}

/* 手机竖屏 */
@media (max-width: 480px) {
    .char-avatars__grid {
        grid-template-columns: repeat(3, 1fr); /* 固定3列 */
        gap: 6px;
        padding: 8px;
    }
    
    .char-avatar-card__image {
        aspect-ratio: 3/4;
    }
    
    .char-avatar-card__footer {
        padding: 4px 6px;
    }
    
    .char-avatar-card__name {
        font-size: 9px;
    }
    
    .char-avatar-card__gender {
        display: none; /* 超小屏隐藏性别标识 */
    }
}

/* 空状态 */
.char-avatars__empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--text-muted);
    padding: 60px 40px;
}

.char-avatars__empty svg {
    opacity: 0.2;
}

.char-avatars__empty p {
    font-size: 15px;
    margin: 0;
    color: var(--text-secondary);
}

.char-avatars__empty .char-avatars__empty-hint {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-bottom: 8px;
}

/* 人物形象分页 */
.char-avatars__pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.char-page-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.char-page-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.char-page-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.char-page-numbers {
    display: flex;
    gap: 4px;
}

.char-page-num {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.char-page-num:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.char-page-num--active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.char-page-num--ellipsis {
    background: transparent;
    border-color: transparent;
    cursor: default;
}

.char-page-info {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: 8px;
}

/* 底部 */
.char-modal__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 28px;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.char-modal__footer-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
}

.char-modal__footer-actions {
    display: flex;
    gap: 12px;
}

/* ========== 人物设置弹窗响应式布局 ========== */

/* 大屏幕调整 */
@media (max-width: 1400px) {
    .modal--character-fullscreen {
        width: 98vw;
        height: 96vh;
    }
    
    .char-modal__left {
        width: 320px;
    }
    
    .char-preview__avatar {
        width: 160px;
        height: 220px;
    }
}

/* 中等屏幕 */
@media (max-width: 1100px) {
    .char-modal__left {
        width: 280px;
    }
    
    .char-preview-card {
        padding: 20px;
        gap: 16px;
    }
    
    .char-preview__avatar {
        width: 140px;
        height: 190px;
        border-radius: 12px;
    }
    
    .char-modal__header {
        padding: 16px 20px;
    }
    
    .char-modal__footer {
        padding: 12px 20px;
    }
}

/* 小屏幕 - 左右布局改为上下布局 */
@media (max-width: 900px) {
    .char-modal__body {
        flex-direction: column;
    }
    
    .char-modal__left {
        width: 100%;
        max-height: 35vh;
        min-height: 200px;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        overflow-y: auto;
    }
    
    .char-preview-card {
        flex-direction: row;
        align-items: flex-start;
        padding: 16px;
        gap: 16px;
    }
    
    .char-preview__avatar {
        width: 100px;
        height: 140px;
        flex-shrink: 0;
    }
    
    .char-preview__info {
        flex: 1;
    }
    
    .char-preview__name {
        font-size: 16px;
    }
    
    .char-preview__tags {
        flex-wrap: wrap;
    }
    
    /* 配置部分改为横向紧凑布局 */
    .char-config-section {
        padding: 12px 16px;
    }
    
    .char-config-section__title {
        font-size: 13px;
        margin-bottom: 8px;
    }
    
    .char-config-row {
        gap: 8px;
    }
    
    .char-modal__footer-hint {
        display: none;
    }
}

/* 更小屏幕 */
@media (max-width: 768px) {
    .modal--character-fullscreen {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }
    
    .char-modal__header {
        padding: 12px 16px;
    }
    
    .char-modal__icon {
        width: 36px;
        height: 36px;
        border-radius: 10px;
    }
    
    .char-modal__title-text h2 {
        font-size: 16px;
    }
    
    .char-modal__subtitle {
        font-size: 12px;
    }
    
    .char-modal__close {
        width: 36px;
        height: 36px;
    }
    
    .char-modal__left {
        max-height: 30vh;
        min-height: 180px;
    }
    
    .char-preview-card {
        padding: 12px;
        gap: 12px;
    }
    
    .char-preview__avatar {
        width: 80px;
        height: 110px;
        border-radius: 10px;
    }
    
    .char-preview__gender-badge {
        width: 24px;
        height: 24px;
        font-size: 12px;
        bottom: 6px;
        right: 6px;
    }
    
    .char-modal__footer {
        padding: 10px 16px;
    }
    
    .char-modal__footer-actions {
        gap: 8px;
    }
}

/* 手机屏幕 */
@media (max-width: 480px) {
    .char-modal__left {
        max-height: 25vh;
        min-height: 150px;
    }
    
    .char-preview__avatar {
        width: 60px;
        height: 85px;
        border-radius: 8px;
    }
    
    .char-preview__name {
        font-size: 14px;
    }
    
    .char-preview__tags {
        gap: 4px;
    }
    
    .char-preview__tag {
        font-size: 10px;
        padding: 2px 6px;
    }
    
    .char-config-section {
        padding: 10px 12px;
    }
}

/* ========== 场景人物选择模态框（全屏分页版） ========== */
.modal--scene-character {
    width: 90vw;
    max-width: 1400px;
    height: 85vh;
    max-height: 900px;
    display: flex;
    flex-direction: column;
    background: var(--bg-tertiary);
    border-radius: 16px;
    overflow: hidden;
}

.scene-char-modal__header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-wrap: wrap;
}

.scene-char-modal__title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    flex-shrink: 0;
}

.scene-char-modal__count {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 8px;
    border-radius: 10px;
}

.scene-char-modal__filters {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    flex: 1;
}

.scene-char-modal__close {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.scene-char-modal__close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.scene-char-modal__body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    min-height: 0;
}

.scene-char-modal__loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 16px;
    color: var(--text-muted);
}

.scene-char-modal__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 16px;
}

/* 场景人物弹窗响应式 */
@media (max-width: 900px) {
    .scene-char-modal__grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 12px;
    }
}

@media (max-width: 768px) {
    .scene-char-modal__grid {
        grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .scene-char-modal__grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
}

.scene-char-modal__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 12px;
    color: var(--text-muted);
    padding: 60px 40px;
}

.scene-char-modal__empty svg {
    opacity: 0.2;
}

.scene-char-modal__empty p {
    font-size: 15px;
    margin: 0;
    color: var(--text-secondary);
}

.scene-char-modal__empty-hint {
    font-size: 13px;
    color: var(--text-tertiary);
}

.scene-char-modal__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    gap: 16px;
}

.scene-char-modal__footer-spacer {
    flex: 1;
}

.scene-char-modal__actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.scene-char-modal__selected {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(0, 191, 165, 0.1);
    border: 1px solid rgba(0, 191, 165, 0.3);
    border-radius: 8px;
    font-size: 13px;
    color: var(--accent);
}

.scene-char-modal__selected img {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    object-fit: cover;
}

.btn--ghost {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn--ghost:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.btn--lg {
    padding: 12px 24px;
    font-size: 15px;
}

/* 响应式适配 */
@media (max-width: 1200px) {
    .char-modal__left {
        width: 320px;
    }
    
    .char-avatars__grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

@media (max-width: 900px) {
    .modal--character-fullscreen {
        width: 98vw;
        height: 98vh;
    }
    
    .char-modal__body {
        flex-direction: column;
    }
    
    .char-modal__left {
        width: 100%;
        max-height: 40vh;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }
    
    .char-preview-card {
        flex-direction: row;
        padding: 16px;
    }
    
    .char-preview__avatar {
        width: 100px;
        height: 140px;
    }
    
    .char-modal__footer-hint {
        display: none;
    }
}

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;
}

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

/* 下载配音按钮 */
.download-audio-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: #fff;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 4px;
}

.download-audio-btn:hover {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    transform: scale(1.1);
}

.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-avatars__empty-hint {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 8px;
}

.character-avatars__loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    gap: 12px;
    color: var(--text-muted);
    background: var(--bg-panel-alt);
    border-radius: var(--radius-md);
}

.character-avatars__gender-hint {
    font-size: 12px;
    color: var(--accent);
    background: rgba(0, 191, 165, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
    margin-right: auto;
    margin-left: 8px;
}

.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;
}

/* 收到的分享Tab特殊样式 */
.characters-tab--received {
    color: var(--status-info);
}

.characters-tab--received:hover {
    color: var(--status-info);
    background: rgba(59, 130, 246, 0.1);
}

.characters-tab--received.characters-tab--active {
    color: var(--status-info);
    border-bottom-color: var(--status-info);
}

.characters-tab--received .characters-tab__count {
    background: rgba(59, 130, 246, 0.2);
    color: var(--status-info);
}

.characters-tab--received.characters-tab--active .characters-tab__count {
    background: var(--status-info);
    color: white;
}

/* 分享者信息标签 */
.character-card__shared-by {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    font-size: 11px;
    color: var(--status-info);
    padding: 2px 6px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: var(--radius-sm);
    width: fit-content;
}

/* 人物卡片创建者显示 */
.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项目缩小以启用滚动 */
    overflow-y: auto;
    overflow-x: hidden;
    padding: 24px;
    padding-bottom: 100px; /* 增加底部padding，避免被固定分页组件遮挡 */
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    grid-auto-rows: min-content;  /* 确保每行高度适应内容 */
    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;
    left: 0 !important; /* 默认占据整个宽度 */
    right: 0 !important;
    z-index: 100 !important;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.3);
}

/* 人物库页面 - 分页组件从侧边栏右边开始（最高优先级，必须放在最后） */
html body .characters-page .characters-main .characters-content-area .characters-content .pagination,
html body .characters-page .characters-main .characters-content .pagination,
html body .characters-page .characters-content-area .pagination,
html body .characters-page .characters-content .pagination,
html body .characters-page .characters-main .pagination,
html body .characters-page .pagination {
    left: 280px !important; /* 左侧导航栏宽度 */
    right: 0 !important;
}

/* 剧本管理页面 - 分页组件从侧边栏右边开始 */
.novel-list .pagination,
.novel-list__content .pagination,
.novel-list__main .pagination {
    left: 280px !important; /* 左侧导航栏宽度 */
    right: 0 !important;
}

/* 场景库页面 - 分页组件从侧边栏右边开始 */
.scenes-sidebar ~ * .pagination,
.scenes-content .pagination {
    left: 280px !important; /* 左侧导航栏宽度 */
    right: 0 !important;
}

/* 配音库页面 - 分页组件从侧边栏右边开始 */
.voice-sidebar ~ * .pagination,
.voice-content .pagination {
    left: 280px !important; /* 左侧导航栏宽度 */
    right: 0 !important;
}

/* 道具库页面 - 分页组件从侧边栏右边开始 */
.props-sidebar ~ * .pagination,
.props-content .pagination {
    left: 280px !important; /* 左侧导航栏宽度 */
    right: 0 !important;
}

/* 没有侧边栏的页面 - 分页组件占据整个宽度（排除有侧边栏的页面） */
.app-main > *:not(.characters-main):not(.novel-list):not(.scenes-page):not(.voice-page):not(.props-main) .pagination {
    left: 0 !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;
}

/* 文字按钮样式 (Previous/Next) */
.pagination__btn--text {
    width: auto;
    padding: 0 16px;
    font-size: 14px;
    font-weight: 500;
}

/* 页码按钮样式 */
.pagination__btn--page {
    min-width: 36px;
    font-size: 14px;
    font-weight: 500;
}

/* 当前页高亮 */
.pagination__btn--active {
    background: #0d6efd !important;
    border-color: #0d6efd !important;
    color: #fff !important;
}

/* 省略号 */
.pagination__dots {
    color: var(--text-muted);
    padding: 0 8px;
    font-size: 14px;
}

.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);
}

/* 人物库页面 - 分页信息从侧边栏右边开始（最高优先级，必须放在最后） */
html body .characters-page .characters-main .characters-content-area .characters-content .pagination-info,
html body .characters-page .characters-main .characters-content .pagination-info,
html body .characters-page .characters-content-area .pagination-info,
html body .characters-page .characters-content .pagination-info,
html body .characters-page .characters-main .pagination-info,
html body .characters-page .pagination-info {
    left: 280px !important; /* 左侧导航栏宽度 */
    right: 0 !important;
}

/* 其他有侧边栏的页面 */
.characters-main .pagination-info,
.characters-content-area .pagination-info,
.characters-content .pagination-info {
    left: 280px !important; /* 左侧导航栏宽度 */
    right: 0 !important;
}

/* 剧本管理页面 - 分页信息从侧边栏右边开始 */
.novel-list .pagination-info,
.novel-list__content .pagination-info,
.novel-list__main .pagination-info {
    left: 280px !important; /* 左侧导航栏宽度 */
    right: 0 !important;
}

/* 场景库页面 - 分页信息从侧边栏右边开始 */
.scenes-sidebar ~ * .pagination-info,
.scenes-content .pagination-info {
    left: 280px !important; /* 左侧导航栏宽度 */
    right: 0 !important;
}

/* 配音库页面 - 分页信息从侧边栏右边开始 */
.voice-sidebar ~ * .pagination-info,
.voice-content .pagination-info {
    left: 280px !important; /* 左侧导航栏宽度 */
    right: 0 !important;
}

/* 道具库页面 - 分页信息从侧边栏右边开始 */
.props-sidebar ~ * .pagination-info,
.props-content .pagination-info {
    left: 280px !important; /* 左侧导航栏宽度 */
    right: 0 !important;
}

/* 没有侧边栏的页面 - 分页信息占据整个宽度 */
.app-main > *:not(.characters-main):not(.novel-list):not(.scenes-page):not(.voice-page):not(.props-main) .pagination-info {
    left: 0 !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: 320px;
    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: 240px;
    min-height: 240px;  /* 确保高度不会因为 lazy loading 图片而塌陷 */
    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;
    height: 100%;
}

.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;
    position: relative;
}

/* 编辑器加载覆盖层 */
.editor-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 27, 30, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    gap: 16px;
}

.editor-loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.editor-loading-text {
    color: var(--text-secondary);
    font-size: 14px;
}

.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;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.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);
    flex-shrink: 0;
}

.layers-header .btn-icon--small {
    margin-left: auto;
    width: 22px;
    height: 22px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.layers-header .btn-icon--small:hover {
    background: var(--accent-hover);
    transform: scale(1.1);
}

.layers-list {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.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;
}

/* 标尺控制区域 */
.ruler-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    background: var(--bg-panel-alt);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    width: 100%;
    justify-content: flex-start;
}

.ruler-btn {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    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;
}

.ruler-btn:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.ruler-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.ruler-hint {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-left: auto;
}

/* 带标尺的画布容器 */
.canvas-with-rulers {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1;
    min-height: 0;
    width: 100%;
}

.canvas-row {
    display: flex;
    flex: 1;
    min-height: 0;
    width: 100%;
}

/* 标尺样式 - Photoshop风格 */
.ruler {
    background: linear-gradient(180deg, #1e1e2e 0%, #16161e 100%);
    position: relative;
    cursor: crosshair;
    user-select: none;
}

.ruler-horizontal {
    height: 20px;
    width: 100%;
    margin-left: 20px;
    border-bottom: 1px solid rgba(0, 212, 255, 0.5);
    background: repeating-linear-gradient(
        90deg,
        transparent 0px,
        transparent 47px,
        rgba(0, 212, 255, 0.3) 47px,
        rgba(0, 212, 255, 0.3) 48px
    );
}

.ruler-vertical {
    width: 20px;
    height: 100%;
    border-right: 1px solid rgba(0, 212, 255, 0.5);
    background: repeating-linear-gradient(
        180deg,
        transparent 0px,
        transparent 47px,
        rgba(0, 212, 255, 0.3) 47px,
        rgba(0, 212, 255, 0.3) 48px
    );
}

.ruler-marks {
    position: relative;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.ruler-horizontal .ruler-mark {
    position: absolute;
    font-size: 8px;
    color: rgba(0, 212, 255, 0.7);
    transform: translateX(-50%);
    top: 3px;
}

.ruler-vertical .ruler-mark {
    position: absolute;
    font-size: 8px;
    color: rgba(0, 212, 255, 0.7);
    transform: translateY(-50%) rotate(-90deg);
    left: -8px;
    white-space: nowrap;
}

.ruler:hover {
    background: linear-gradient(180deg, #252538 0%, #1a1a28 100%);
}

.ruler:active {
    background: linear-gradient(180deg, #2a2a40 0%, #1e1e30 100%);
}

/* 拖拽时的光标提示 */
.ruler-horizontal:active {
    cursor: col-resize;
}

.ruler-vertical:active {
    cursor: row-resize;
}

.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: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* 编辑器面板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: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.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;
    padding-bottom: 100px; /* 为固定分页组件留出空间 */
    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;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

/* 资源类型筛选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: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.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);
}

/* 预设网格 - 响应式一行3个 */
.pose-presets-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    overflow-y: auto;
    padding-right: 4px;
    align-content: start; /* 让内容从顶部开始，不拉伸 */
}

.pose-preset-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; /* 内容顶部对齐 */
    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;
    height: fit-content; /* 高度自适应内容 */
}

.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: auto; /* 自动高度，不设置最小高度 */
}

.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,
.scene-editor__ratio-btn.active {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    color: #fff !important;
}

/* ===== 人物缩放手柄 ===== */
.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);
}

/* ===== 分享功能样式 ===== */

/* 分享按钮 */
.btn-icon--share {
    color: var(--accent);
}

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

/* 分享模态框 */
.modal--share {
    width: 520px;
    max-width: 95%;
    background: var(--bg-panel);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

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

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

.modal--share .modal__body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modal--share .modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-dark);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* 分享的人物信息卡片 */
.share-character-info {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.share-character-info__image {
    width: 64px;
    height: 80px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-dark);
    flex-shrink: 0;
}

.share-character-info__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.share-character-info__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.share-character-info__details {
    flex: 1;
}

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

.share-character-info__meta {
    font-size: 13px;
    color: var(--text-secondary);
}

/* 分享表单 */
.share-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.share-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.share-user-search {
    display: flex;
    gap: 8px;
}

.share-input {
    flex: 1;
    height: 40px;
    padding: 0 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s ease;
}

.share-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 191, 165, 0.1);
}

.share-search-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 16px;
    height: 40px;
    background: var(--accent);
    border: none;
    border-radius: var(--radius-md);
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.share-search-btn:hover:not(:disabled) {
    background: var(--accent-hover);
}

.share-search-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 目标用户信息 */
.share-target-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(0, 191, 165, 0.1);
    border: 1px solid var(--accent);
    border-radius: var(--radius-md);
}

.share-target-user__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.share-target-user__info {
    flex: 1;
}

.share-target-user__name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.share-target-user__email {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.share-target-user__check {
    color: var(--status-success);
}

/* 权限选择 */
.share-permissions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.share-permission-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.share-permission-option:hover {
    background: var(--bg-hover);
}

.share-permission-option--selected {
    border-color: var(--accent);
    background: rgba(0, 191, 165, 0.05);
}

.share-permission-option input[type="radio"] {
    display: none;
}

.share-permission-option span {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.share-permission-option small {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
    margin-left: auto;
    flex: 1;
    text-align: right;
}

/* 留言输入框 */
.share-textarea {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    transition: all 0.2s ease;
}

.share-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 191, 165, 0.1);
}

.share-textarea::placeholder {
    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;
    padding-bottom: 100px; /* 为固定分页组件留出空间 */
    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;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

/* 资源类型筛选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: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.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);
}

/* 预设网格 - 响应式一行3个 */
.pose-presets-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    overflow-y: auto;
    padding-right: 4px;
    align-content: start; /* 让内容从顶部开始，不拉伸 */
}

.pose-preset-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; /* 内容顶部对齐 */
    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;
    height: fit-content; /* 高度自适应内容 */
}

.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: auto; /* 自动高度，不设置最小高度 */
}

.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,
.scene-editor__ratio-btn.active {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    color: #fff !important;
}

/* ===== 人物缩放手柄 ===== */
.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);
}

/* ===== 分享功能样式 ===== */

/* 分享按钮 */
.btn-icon--share {
    color: var(--accent);
}

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

/* 分享模态框 */
.modal--share {
    width: 520px;
    max-width: 95%;
    background: var(--bg-panel);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

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

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

.modal--share .modal__body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modal--share .modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-dark);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* 分享的人物信息卡片 */
.share-character-info {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.share-character-info__image {
    width: 64px;
    height: 80px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-dark);
    flex-shrink: 0;
}

.share-character-info__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.share-character-info__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.share-character-info__details {
    flex: 1;
}

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

.share-character-info__meta {
    font-size: 13px;
    color: var(--text-secondary);
}

/* 分享表单 */
.share-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.share-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.share-user-search {
    display: flex;
    gap: 8px;
}

.share-input {
    flex: 1;
    height: 40px;
    padding: 0 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s ease;
}

.share-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 191, 165, 0.1);
}

.share-search-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 16px;
    height: 40px;
    background: var(--accent);
    border: none;
    border-radius: var(--radius-md);
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.share-search-btn:hover:not(:disabled) {
    background: var(--accent-hover);
}

.share-search-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 目标用户信息 */
.share-target-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(0, 191, 165, 0.1);
    border: 1px solid var(--accent);
    border-radius: var(--radius-md);
}

.share-target-user__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.share-target-user__info {
    flex: 1;
}

.share-target-user__name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.share-target-user__email {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.share-target-user__check {
    color: var(--status-success);
}

/* 权限选择 */
.share-permissions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.share-permission-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.share-permission-option:hover {
    background: var(--bg-hover);
}

.share-permission-option--selected {
    border-color: var(--accent);
    background: rgba(0, 191, 165, 0.05);
}

.share-permission-option input[type="radio"] {
    display: none;
}

.share-permission-option span {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.share-permission-option small {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
    margin-left: auto;
    flex: 1;
    text-align: right;
}

/* 留言输入框 */
.share-textarea {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    transition: all 0.2s ease;
}

.share-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 191, 165, 0.1);
}

.share-textarea::placeholder {
    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;
    padding-bottom: 100px; /* 为固定分页组件留出空间 */
    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;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

/* 资源类型筛选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: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.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);
}

/* 预设网格 - 响应式一行3个 */
.pose-presets-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    overflow-y: auto;
    padding-right: 4px;
    align-content: start; /* 让内容从顶部开始，不拉伸 */
}

.pose-preset-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; /* 内容顶部对齐 */
    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;
    height: fit-content; /* 高度自适应内容 */
}

.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: auto; /* 自动高度，不设置最小高度 */
}

.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,
.scene-editor__ratio-btn.active {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    color: #fff !important;
}

/* ===== 人物缩放手柄 ===== */
.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);
}

/* ===== 分享功能样式 ===== */

/* 分享按钮 */
.btn-icon--share {
    color: var(--accent);
}

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

/* 分享模态框 */
.modal--share {
    width: 520px;
    max-width: 95%;
    background: var(--bg-panel);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

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

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

.modal--share .modal__body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modal--share .modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-dark);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* 分享的人物信息卡片 */
.share-character-info {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.share-character-info__image {
    width: 64px;
    height: 80px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-dark);
    flex-shrink: 0;
}

.share-character-info__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.share-character-info__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.share-character-info__details {
    flex: 1;
}

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

.share-character-info__meta {
    font-size: 13px;
    color: var(--text-secondary);
}

/* 分享表单 */
.share-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.share-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.share-user-search {
    display: flex;
    gap: 8px;
}

.share-input {
    flex: 1;
    height: 40px;
    padding: 0 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s ease;
}

.share-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 191, 165, 0.1);
}

.share-search-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 16px;
    height: 40px;
    background: var(--accent);
    border: none;
    border-radius: var(--radius-md);
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.share-search-btn:hover:not(:disabled) {
    background: var(--accent-hover);
}

.share-search-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 目标用户信息 */
.share-target-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(0, 191, 165, 0.1);
    border: 1px solid var(--accent);
    border-radius: var(--radius-md);
}

.share-target-user__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.share-target-user__info {
    flex: 1;
}

.share-target-user__name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.share-target-user__email {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.share-target-user__check {
    color: var(--status-success);
}

/* 权限选择 */
.share-permissions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.share-permission-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.share-permission-option:hover {
    background: var(--bg-hover);
}

.share-permission-option--selected {
    border-color: var(--accent);
    background: rgba(0, 191, 165, 0.05);
}

.share-permission-option input[type="radio"] {
    display: none;
}

.share-permission-option span {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.share-permission-option small {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
    margin-left: auto;
    flex: 1;
    text-align: right;
}

/* 留言输入框 */
.share-textarea {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    transition: all 0.2s ease;
}

.share-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 191, 165, 0.1);
}

.share-textarea::placeholder {
    color: var(--text-muted);
}