/* ===== Scene Page Styles ===== */
/* 使用与 style.css 相同的 CSS 变量 */
: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;
}

/* Layout */
.scene-app {
    min-height: 100vh;
    background: var(--bg-darkest);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
}

.scene-main {
    flex: 1;
    display: flex;
    flex-direction: row;
    min-height: 0; /* 关键：允许flex项目缩小以启用子元素滚动 */
    overflow: hidden;
}

/* Sidebar - 与首页小说管理保持一致 */
.scene-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;
}

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

.sidebar-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

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

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

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

.sidebar-filter-group {
    width: 100%;
    margin-top: 8px;
}

.sidebar-filter-group-label {
    font-size: 11px;
    color: var(--text-muted);
    padding: 4px 0;
    display: block;
    margin-bottom: 4px;
}

.sidebar-filter-group .sidebar-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Content Area */
.scene-content {
    flex: 1;
    min-width: 0; /* 允许flex项目缩小 */
    min-height: 0; /* 允许flex项目缩小以启用子元素滚动 */
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.scene-content__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-dark);
}

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

/* Scene Tabs - 与人物库Tab样式一致 */
.scene-tabs {
    display: flex;
    gap: 0;
    padding: 0 24px;
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border-color);
}

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

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

.scene-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    background: transparent;
}

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

.scene-tab.active .scene-tab__count {
    background: var(--accent);
    color: white;
}

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

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box svg {
    position: absolute;
    left: 12px;
    color: #666;
}

.search-box input {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 12px 10px 40px;
    color: var(--text-primary);
    font-size: 14px;
    width: 280px;
    transition: all 0.2s;
}

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

.search-box input::placeholder {
    color: #666;
}

/* Scene Content Wrapper - 滚动容器 */
.scene-content-wrapper {
    flex: 1 1 0; /* flex-grow, flex-shrink, flex-basis */
    min-height: 0; /* 关键：允许flex项目缩小以启用滚动 */
    max-height: 100%; /* 确保不超过父容器 */
    overflow-y: auto; /* 使用auto以便在需要时显示滚动条 */
    overflow-x: hidden;
    padding: 24px;
    padding-bottom: 80px; /* 确保底部内容有足够空间 */
    /* 强制显示滚动条 - Firefox */
    scrollbar-width: thin;
    scrollbar-color: var(--border-light) var(--bg-dark);
}

/* 自定义滚动条样式 - Chrome/Edge/Safari */
.scene-content-wrapper::-webkit-scrollbar {
    width: 10px;
    display: block; /* 确保显示 */
}

.scene-content-wrapper::-webkit-scrollbar-track {
    background: var(--bg-dark);
    border-radius: 5px;
}

.scene-content-wrapper::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 5px;
    min-height: 50px; /* 确保滚动条手柄足够大 */
}

.scene-content-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Scene Grid */
.scene-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    align-content: start;
}

/* 创建场景卡片 - 与其他卡片大小一致 */
.scene-card--create {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 260px;
    border: 2px dashed var(--border-color);
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: var(--radius-lg);
}

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

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

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

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

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

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

.scene-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

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

.scene-card__image {
    height: 180px;
    background: #0a0a0a;
    position: relative;
    overflow: hidden;
}

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

.scene-card__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
}

.scene-card__badges {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    gap: 6px;
}

.badge {
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.badge--official {
    background: #f59e0b;
    color: #000;
}

.badge--shared {
    background: #3b82f6;
    color: #fff;
}

.scene-card__info {
    padding: 16px;
}

.scene-card__name {
    font-size: 15px;
    font-weight: 500;
    color: #fff;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.scene-card__tag {
    font-size: 11px;
    padding: 3px 8px;
    background: #252525;
    border-radius: 4px;
    color: #aaa;
}

.scene-card__mood {
    font-size: 11px;
    color: var(--accent);
}

.scene-card__actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

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

/* Loading & Empty States */
.scene-loading,
.scene-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 40px;
    color: #666;
    text-align: center;
}

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

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

.scene-empty h3 {
    font-size: 18px;
    color: #888;
    margin: 16px 0 8px;
}

.scene-empty p {
    color: #666;
    margin-bottom: 24px;
}

/* Modal - Large Scene Modal */
.modal--scene-large {
    width: 95%;
    max-width: 680px;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal--scene-large .modal__body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    min-height: 400px;
}

/* Scene Form Layout */
.scene-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

.scene-form__left,
.scene-form__right {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Simplified Scene Form Layout */
.scene-form--simple {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.scene-form__top {
    display: flex;
    gap: 16px;
    align-items: flex-end;
}

.scene-form__top .form-group--flex {
    flex: 1;
}

.scene-form__top .form-group--small {
    flex: 0 0 180px;
}

.scene-form__main {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Form Elements */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: #aaa;
}

.form-group label .required {
    color: #ef4444;
}

.form-group input,
.form-group select,
.form-group textarea {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s;
}

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

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #555;
}

.form-group select {
    cursor: pointer;
}

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

/* Checkbox */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 10px 0;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #10b981;
}

/* Tags Input */
.tags-input {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 8px;
    min-height: 44px;
}

.tags-input input {
    background: transparent;
    border: none;
    padding: 4px;
    width: 100%;
    margin-top: 4px;
}

.tags-input input:focus {
    outline: none;
    box-shadow: none;
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--accent);
    color: #fff;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 12px;
}

.tag button {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 0;
    font-size: 14px;
    line-height: 1;
    opacity: 0.7;
}

.tag button:hover {
    opacity: 1;
}

/* Preset Tags */
.preset-tags {
    margin-top: 8px;
}

.preset-tags-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.preset-tags-label {
    font-size: 11px;
    color: #666;
    min-width: 50px;
}

.preset-tag-btn {
    background: var(--bg-panel-alt);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s;
}

.preset-tag-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.preset-tag-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* Upload Tabs */
.upload-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-input);
    padding: 4px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.upload-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.upload-tab:hover {
    color: var(--text-primary);
}

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

/* Upload Area */
.upload-area {
    border: 2px dashed var(--border-light);
    border-radius: var(--radius-lg);
    padding: 40px 20px;
    text-align: center;
    transition: all 0.2s;
    position: relative;
}

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

.upload-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: #666;
    cursor: pointer;
}

.upload-label span {
    font-size: 14px;
    color: #aaa;
}

.upload-label small {
    font-size: 12px;
    color: #555;
}

/* Image Preview */
.image-preview {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #0a0a0a;
}

.image-preview img {
    width: 100%;
    height: 280px;
    object-fit: contain;
}

.remove-image-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.remove-image-btn:hover {
    background: #ef4444;
}

/* Prompt Panel */
.prompt-panel,
.reference-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.prompt-panel .form-group {
    margin-bottom: 0;
}

.prompt-panel textarea {
    min-height: 80px;
}

.prompt-hint {
    font-size: 12px;
    color: #666;
    text-align: center;
    margin-top: 8px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

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

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

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

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

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

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

.btn--block {
    width: 100%;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-icon--danger:hover {
    background: #ef4444;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

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

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

.modal__close {
    width: 32px;
    height: 32px;
    background: var(--bg-input);
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

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

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

/* 无限滚动加载提示 */
.load-more {
    padding: 24px;
    text-align: center;
}

.load-more__loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 14px;
}

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

.load-more__end {
    color: var(--text-muted);
    font-size: 13px;
    padding: 8px 16px;
    background: var(--bg-dark);
    border-radius: var(--radius-md);
    display: inline-block;
}

.loading-spinner--small {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

/* 场景内容容器 - 支持滚动 */
.scene-content-wrapper {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 24px;
}

/* 注意：.app-header 样式已移至 style.css 全局样式，不再在此重复定义 */
/* 这样可以确保场景库的 header 与其他页面保持一致的 flex 布局 */

/* Responsive */
@media (max-width: 600px) {
    .scene-form {
        grid-template-columns: 1fr;
    }
    
    .scene-sidebar {
        display: none;
    }
}

@media (max-width: 768px) {
    .scene-content__header {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    
    .scene-content__actions {
        flex-direction: column;
    }
    
    .search-box input {
        width: 100%;
    }
    
    .modal--scene-large {
        width: 100%;
        max-width: none;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* ===== AI 生成相关样式 ===== */

.ai-options {
    margin-bottom: 8px;
}

.ai-options .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.ai-options select {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    color: var(--text-primary);
    font-size: 14px;
}

.ai-options select:focus {
    outline: none;
    border-color: var(--accent);
}

/* AI 状态显示 */
.ai-status {
    background: var(--bg-panel-alt);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
    margin-bottom: 16px;
}

.ai-status__progress {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-status__icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-input);
    border-radius: 50%;
    color: var(--accent);
}

.ai-status__progress.stage-error .ai-status__icon {
    background: rgba(239, 68, 68, 0.1);
    color: var(--status-error);
}

.ai-status__progress.stage-completed .ai-status__icon {
    background: rgba(34, 197, 94, 0.1);
    color: var(--status-success);
}

.ai-status__text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ai-status__message {
    font-size: 14px;
    color: var(--text-primary);
}

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

.ai-status__machine {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

.ai-status__machine small {
    color: var(--text-muted);
    font-size: 11px;
}

/* 加载动画 */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.ai-status__icon .spinner {
    width: 20px;
    height: 20px;
}

/* AI 操作按钮 */
.ai-actions {
    margin-top: 12px;
}

/* 集群信息 */
.ai-cluster-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.ai-cluster-info small {
    color: var(--text-muted);
    font-size: 11px;
}

.btn-link {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 11px;
    cursor: pointer;
    padding: 4px 8px;
}

.btn-link:hover {
    text-decoration: underline;
}

/* 必填标记 */
.required {
    color: var(--status-error);
}

/* 排队动画 */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.ai-status__progress.stage-queued .ai-status__message {
    animation: pulse 2s ease-in-out infinite;
}

/* 进度条 */
.ai-progress-bar {
    height: 4px;
    background: var(--bg-input);
    border-radius: 2px;
    margin-top: 12px;
    overflow: hidden;
}

.ai-progress-bar__fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-hover));
    border-radius: 2px;
    transition: width 0.3s ease;
    animation: progress-shine 2s ease-in-out infinite;
}

@keyframes progress-shine {
    0% { opacity: 0.8; }
    50% { opacity: 1; }
    100% { opacity: 0.8; }
}

/* 时间信息 */
.ai-status__time {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-muted);
}

.time-elapsed {
    display: flex;
    align-items: center;
    gap: 4px;
}

.time-estimated {
    color: var(--text-secondary);
}

/* 响应式 */
@media (max-width: 768px) {
    .ai-options .form-row {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   场景卡片悬停覆盖层
======================================== */
.scene-card__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.2s ease;
    color: #fff;
    font-size: 13px;
}

.scene-card:hover .scene-card__overlay {
    opacity: 1;
}

/* ========================================
   预览模态框样式
======================================== */
.preview-modal-overlay {
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-modal {
    display: flex;
    flex-direction: row;
    background: var(--bg-panel);
    border-radius: var(--radius-lg);
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.preview-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    transition: all 0.2s;
    z-index: 10;
}

.preview-close-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

/* 图片预览区域 */
.preview-image-container {
    flex: 1;
    min-width: 500px;
    max-width: 70vw;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.preview-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

.preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    color: #555;
    padding: 80px;
}

/* 场景信息面板 */
.preview-info {
    width: 320px;
    padding: 24px;
    background: var(--bg-panel);
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
}

.preview-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.preview-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.preview-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.badge--private {
    background: rgba(107, 114, 128, 0.2);
    color: #9ca3af;
}

/* 元数据 */
.preview-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.preview-meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.meta-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.meta-value {
    font-size: 14px;
    color: var(--text-primary);
}

.preview-description {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
    padding: 12px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
}

/* 操作按钮 */
.preview-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.preview-actions .btn {
    flex: 1;
    min-width: 80px;
}

.preview-readonly-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 13px;
    padding: 8px 12px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
}

/* 危险按钮样式 */
.btn--danger {
    background: var(--status-error);
    border-color: var(--status-error);
    color: #fff;
}

.btn--danger:hover {
    background: #dc2626;
    border-color: #dc2626;
}

/* 响应式预览 */
@media (max-width: 900px) {
    .preview-modal {
        flex-direction: column;
        max-height: 95vh;
    }
    
    .preview-image-container {
        min-width: auto;
        max-width: 100%;
        max-height: 50vh;
    }
    
    .preview-info {
        width: 100%;
    }
}

