/* 组件相关样式 */

/* 🔥 新增：爆款库下拉菜单样式 */
.dropdown-container {
    position: relative;
    display: inline-block;
}

.dropdown-arrow {
    margin-left: 4px;
    font-size: 10px;
    transition: transform 0.2s ease;
}

.dropdown-container:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    min-width: 300px;
    max-height: 400px;
    overflow-y: auto;
}

.dropdown-header {
    padding: 12px 16px;
    background: #2a2a2a;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    border-bottom: 1px solid #333;
    border-radius: 8px 8px 0 0;
}

.dropdown-list {
    padding: 8px 0;
}

.dropdown-item {
    padding: 12px 16px;
    color: #ccc;
    cursor: pointer;
    transition: background 0.2s ease;
    border-bottom: 1px solid #222;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dropdown-item:hover {
    background: #333;
    color: #fff;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item-icon {
    font-size: 16px;
}

.dropdown-item-content {
    flex: 1;
}

.dropdown-item-title {
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 2px;
}

.dropdown-item-desc {
    font-size: 12px;
    color: #999;
}

.dropdown-item-meta {
    font-size: 11px;
    color: #666;
    margin-top: 4px;
}

.dropdown-empty {
    padding: 24px 16px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

.dropdown-loading {
    padding: 24px 16px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

.dropdown-loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #333;
    border-top: 2px solid #f59e0b;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

.dropdown-subheader {
    padding: 6px 16px;
    font-size: 12px;
    font-weight: 600;
    color: #bbb;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dropdown-subheader-search {
    padding: 10px 12px;
    background: #111;
    border-bottom: 1px solid #222;
}

.dropdown-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
}

.dropdown-search-icon {
    position: absolute;
    left: 8px;
    font-size: 14px;
    color: #666;
    pointer-events: none;
}

.dropdown-search-input {
    width: 100%;
    padding: 6px 28px 6px 28px;
    border: 1px solid #333;
    border-radius: 999px;
    background: #1f1f1f;
    color: #f3f4f6;
    font-size: 13px;
    outline: none;
    transition: border 0.2s ease, box-shadow 0.2s ease;
}

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

.dropdown-search-input:focus {
    border-color: #f59e0b;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.25);
}

.dropdown-item {
    display: flex;
    align-items: center;
}

.dropdown-item-index {
    width: 22px;
    text-align: right;
    font-size: 12px;
    color: #666;
    margin-right: 8px;
}

.dropdown-item-remove {
    margin-left: 8px;
    border: none;
    background: transparent;
    color: #f87171;
    font-size: 14px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.2s ease;
}

.dropdown-item-remove:hover {
    color: #dc2626;
}

/* Gemini连接方式开关 */
.compact-connection-switch {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    user-select: none;
}

.compact-connection-switch .connection-label {
    font-weight: 500;
    color: #9ca3af;
    transition: color 0.2s ease;
}

.compact-connection-switch .connection-label.active {
    color: #fbbf24;
}

.compact-connection-switch .compact-switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 18px;
    margin: 0;
}

.compact-connection-switch .compact-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.compact-connection-switch .compact-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #0f172a;
    border: 1px solid #1f2937;
    border-radius: 999px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.compact-connection-switch .compact-slider::before {
    position: absolute;
    content: "";
    height: 12px;
    width: 12px;
    left: 2px;
    top: 50%;
    transform: translateY(-50%);
    background-color: #d1d5db;
    border-radius: 50%;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.compact-connection-switch input:checked + .compact-slider {
    background-color: #f97316;
    border-color: #f97316;
}

.compact-connection-switch input:checked + .compact-slider::before {
    transform: translate(16px, -50%);
    background-color: #fff;
}

.compact-connection-switch .compact-slider.disabled {
    opacity: 0.4;
    pointer-events: none;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 🔥 流式加载动画 */
.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(96, 165, 250, 0.2);
    border-top-color: #60a5fa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* 爆款复刻场景卡片样式 */
.scene-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.scene-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.scene-card-horizontal {
    /* 横屏布局 - 使用网格布局 */
    display: block;
}

.scene-card-vertical {
    /* 竖屏布局 - 使用垂直布局 */
    display: block;
}

.scene-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.scene-header h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.scene-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.action-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

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

.scene-content {
    padding: 20px;
}

.scene-description {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    color: #555;
    font-size: 14px;
    line-height: 1.5;
}

.media-cell {
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 16px;
    background: #fafbfc;
}

.media-cell h5 {
    margin: 0 0 12px 0;
    color: #333;
    font-size: 14px;
    font-weight: 600;
}

.image-preview, .video-preview {
    margin-bottom: 12px;
    text-align: center;
}

.scene-image {
    max-width: 100%;
    max-height: 200px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.scene-video {
    max-width: 100%;
    max-height: 200px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.placeholder {
    background: #e9ecef;
    color: #6c757d;
    padding: 40px 20px;
    border-radius: 6px;
    text-align: center;
    font-size: 14px;
}

.prompt-section {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.prompt-textarea {
    flex: 1;
    min-height: 60px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.4;
    resize: vertical;
    font-family: inherit;
}

.prompt-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.prompt-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.regenerate-btn {
    background: #28a745;
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
    min-width: 40px;
}

.regenerate-btn:hover {
    background: #218838;
    transform: translateY(-1px);
}

.regenerate-btn:active {
    transform: translateY(0);
}

/* 竖屏布局调整 */
.scene-card-vertical .media-cell {
    display: flex;
    flex-direction: column;
}

.scene-card-vertical .scene-image,
.scene-card-vertical .scene-video {
    max-height: 300px;
}

/* 横屏布局调整 */
.scene-card-horizontal .scene-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.scene-card-horizontal .scene-description {
    grid-column: 1 / -1;
}

/* 按钮样式扩展 */
.btn-link {
    background: none;
    border: none;
    color: #3498db;
    text-decoration: underline;
    cursor: pointer;
    font-size: inherit;
    padding: 2px 5px;
    border-radius: 3px;
    transition: all 0.2s ease;
}

/* 表头生成按钮样式 */
.header-with-generate {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.generate-header-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    font-size: 12px;
    padding: 4px 8px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.generate-header-btn:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.generate-header-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-link:hover {
    background: rgba(52, 152, 219, 0.1);
    color: #2980b9;
    text-decoration: none;
}

/* 顶部导航按钮样式 */
.vps-management-trigger,
.youtube-batch-upload-trigger,
.youtube-upload-trigger {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    color: white;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    text-decoration: none;
    font-size: 14px;
}

.vps-management-trigger:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4) !important;
}

.youtube-batch-upload-trigger:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4) !important;
}

.youtube-upload-trigger:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(255, 0, 0, 0.4) !important;
}

/* VPS管理模块样式 */
.nodes-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    background: #fafafa;
}

.node-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background: white;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.node-item:hover {
    border-color: #1890ff;
    box-shadow: 0 2px 8px rgba(24, 144, 255, 0.15);
}

.node-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.node-name {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    margin-bottom: 4px;
}

.node-details {
    font-size: 12px;
    color: #666;
    display: flex;
    gap: 15px;
}

.node-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 500;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-online {
    background: #52c41a;
}

.status-offline {
    background: #ff4d4f;
}

.status-warning {
    background: #faad14;
}

.node-actions {
    display: flex;
    gap: 8px;
}

.btn-action {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-edit {
    background: #1890ff;
    color: white;
}

.btn-edit:hover {
    background: #40a9ff;
}

.btn-delete {
    background: #ff4d4f;
    color: white;
}

.btn-delete:hover {
    background: #ff7875;
}

.mapping-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    background: #fafafa;
}

.mapping-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: white;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.mapping-item:hover {
    border-color: #1890ff;
}

.mapping-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.account-name {
    font-weight: 600;
    font-size: 13px;
    color: #333;
    margin-bottom: 2px;
}

.mapped-node {
    font-size: 11px;
    color: #666;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    background: #fafafa;
}

.status-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e8e8e8;
    transition: all 0.3s ease;
}

.status-card:hover {
    border-color: #1890ff;
    box-shadow: 0 2px 8px rgba(24, 144, 255, 0.15);
}

.status-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.status-title {
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.status-metrics {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.metric-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}

.metric-label {
    color: #666;
}

.metric-value {
    font-weight: 500;
    color: #333;
}

.upload-queue {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    background: #fafafa;
}

.queue-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: white;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.queue-item:hover {
    border-color: #1890ff;
}

.queue-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.video-title {
    font-weight: 600;
    font-size: 13px;
    color: #333;
    margin-bottom: 4px;
}

.queue-details {
    font-size: 11px;
    color: #666;
    display: flex;
    gap: 10px;
}

.upload-status {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    background: #fafafa;
}

.upload-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: white;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
}

.upload-progress {
    width: 100%;
    height: 4px;
    background: #f0f0f0;
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #1890ff, #40a9ff);
    transition: width 0.3s ease;
}

/* 输入框区域样式 */
.input-group {
    position: relative;
}

/* 带下载按钮的输入框样式 */
.input-with-download {
    position: relative;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.input-with-download .input {
    flex: 1 !important;
    background: var(--bg-elevated) !important;
    border: 1px solid var(--border-primary) !important;
    color: var(--text-primary) !important;
    display: block !important;
    visibility: visible !important;
    width: auto !important;
}

#videoLinkInput {
    flex: 1 !important;
    background: var(--bg-elevated) !important;
    border: 1px solid var(--border-primary) !important;
    color: var(--text-primary) !important;
    display: block !important;
    visibility: visible !important;
    width: auto !important;
}

.input-with-download .input:focus {
    background: var(--bg-secondary) !important;
    border-color: var(--border-accent) !important;
}

#videoLinkInput:focus {
    background: var(--bg-secondary) !important;
    border-color: var(--border-accent) !important;
}

/* 下载进度容器 */
.download-progress-container {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #f5f5f5;
    border-radius: 6px;
    min-width: 250px;
}

.download-progress-bar {
    flex: 1;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
}

.download-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #1890ff, #40a9ff);
    transition: width 0.3s ease;
    width: 0%;
}

.download-progress-text {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
    min-width: 80px;
}

.download-btn {
    width: 40px !important;
    height: 40px !important;
    border: none !important;
    border-radius: 6px !important;
    background: linear-gradient(135deg, #1890ff, #40a9ff) !important;
    color: white !important;
    flex-shrink: 0 !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 16px !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 8px rgba(24, 144, 255, 0.3) !important;
    z-index: 10 !important;
    visibility: visible !important;
}

#videoDownloadBtn {
    width: 40px !important;
    height: 40px !important;
    border: none !important;
    border-radius: 6px !important;
    background: linear-gradient(135deg, #1890ff, #40a9ff) !important;
    color: white !important;
    flex-shrink: 0 !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 16px !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 8px rgba(24, 144, 255, 0.3) !important;
    z-index: 10 !important;
    visibility: visible !important;
}

.download-btn:hover {
    background: linear-gradient(135deg, #40a9ff, #69c0ff);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(24, 144, 255, 0.4);
}

.download-btn:active {
    transform: scale(0.95);
}

.download-btn:disabled {
    background: #d9d9d9;
    cursor: not-allowed;
    box-shadow: none;
}

.download-icon {
    font-size: 18px;
    line-height: 1;
}

/* 打开文件夹按钮 */
.open-folder-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 6px;
    background: linear-gradient(135deg, #52c41a, #73d13d);
    color: white;
    flex-shrink: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(82, 196, 26, 0.3);
}

.open-folder-btn:hover {
    background: linear-gradient(135deg, #73d13d, #95de64);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(82, 196, 26, 0.4);
}

.open-folder-btn:active {
    transform: scale(0.95);
}

/* 播放视频按钮 */
.play-video-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 6px;
    background: linear-gradient(135deg, #ff4d4f, #ff7875);
    color: white;
    flex-shrink: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(255, 77, 79, 0.3);
}

.play-video-btn:hover {
    background: linear-gradient(135deg, #ff7875, #ffa39e);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 77, 79, 0.4);
}

.play-video-btn:active {
    transform: scale(0.95);
}

/* 场景拆分按钮 */
.split-scene-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 6px;
    background: linear-gradient(135deg, #722ed1, #9254de);
    color: white;
    font-size: 16px;
    font-weight: bold;
    flex-shrink: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(114, 46, 209, 0.3);
}

.split-scene-btn:hover {
    background: linear-gradient(135deg, #9254de, #b37feb);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(114, 46, 209, 0.4);
}

.split-scene-btn:active {
    transform: scale(0.95);
}

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

/* ffmpeg阈值滑块样式 */
#ffmpegThresholdSlider {
    -webkit-appearance: none;
    appearance: none;
    background: #333;
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

#ffmpegThresholdSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: linear-gradient(135deg, #722ed1, #9254de);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(114, 46, 209, 0.3);
    transition: all 0.2s ease;
}

#ffmpegThresholdSlider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 2px 6px rgba(114, 46, 209, 0.5);
}

#ffmpegThresholdSlider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: linear-gradient(135deg, #722ed1, #9254de);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(114, 46, 209, 0.3);
    transition: all 0.2s ease;
}

#ffmpegThresholdSlider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 2px 6px rgba(114, 46, 209, 0.5);
}

/* 视频播放器弹窗样式 */
.video-player-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-player-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.video-player-container {
    position: relative;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 90vw;
    max-height: 90vh;
    width: 800px;
    overflow: hidden;
    animation: videoPlayerSlideIn 0.3s ease-out;
}

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

.video-player-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.video-player-header h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.video-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.video-duration {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.video-path {
    font-size: 12px;
    color: #999;
    font-family: monospace;
}

.close-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: #f5f5f5;
    color: #666;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: #e9ecef;
    color: #333;
}

.video-player-content {
    padding: 24px;
}

.video-player-content video {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.video-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    font-family: monospace;
}

.time-display {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.progress-info {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

/* 表头复制按钮样式 */
.header-with-copy {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.copy-header-btn {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.copy-header-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    opacity: 1;
    transform: scale(1.1);
}

.copy-header-btn:active {
    transform: scale(0.95);
}

/* 在表格头部应用样式 */
.shots-table th .header-with-copy {
    width: 100%;
}

.shots-table th .header-with-copy span {
    flex: 1;
    text-align: left;
}

/* 新对话按钮样式 */
.new-chat-btn-mini {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: #1890ff;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    z-index: 10;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.new-chat-btn-mini:hover {
    background: #40a9ff;
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* 工具集下拉菜单样式 */
.tools-dropdown {
    position: fixed;
    top: 60px;
    left: 20px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 1001;
    min-width: 280px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .tools-dropdown {
        left: 10px;
        right: 10px;
        min-width: auto;
        width: calc(100vw - 20px);
    }
}

.tools-dropdown.hidden {
    display: none;
}

.dropdown-content {
    padding: 8px;
}

.tool-option {
    display: flex;
    align-items: center;
    padding: 12px;
    border: none;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
    margin-bottom: 4px;
}

.tool-option:hover {
    background: #2a2a2a;
}

.tool-option.active {
    background: #1890ff;
}

.tool-icon {
    font-size: 20px;
    margin-right: 12px;
    flex-shrink: 0;
}

.tool-info {
    flex: 1;
}

.tool-title {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 2px;
}

.tool-desc {
    font-size: 12px;
    color: #999;
    line-height: 1.3;
}

.tool-option.active .tool-desc {
    color: rgba(255, 255, 255, 0.8);
}

.dropdown-arrow {
    margin-left: 8px;
    font-size: 12px;
    transition: transform 0.3s ease;
}

.app-title:hover .dropdown-arrow {
    transform: rotate(180deg);
}

/* 模块容器样式 */
.module-container {
    width: 100%;
}

.module-content {
    width: 100%;
    min-height: 100vh;
    padding-top: 80px;
}

.module-content.hidden {
    display: none;
}

/* 简化输入容器样式 */
.simple-input-container {
    max-width: 800px;
    margin: 30px auto;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.simple-input-container .input-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.simple-input-container textarea {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 16px;
    color: #e0e0e0;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
}

.simple-input-container textarea:focus {
    outline: none;
    border-color: #1890ff;
    box-shadow: 0 0 0 3px rgba(24, 144, 255, 0.1);
    background: #222;
}

.simple-input-container textarea::placeholder {
    color: #666;
}

/* 聊天界面样式 */
.chat-container {
    max-width: 95%;
    width: 95%;
    margin: 20px auto 20px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    max-height: calc(100vh - 150px);
    min-height: 500px;
    display: flex;
    flex-direction: column;
    position: relative;
}

.chat-messages {
    min-height: 300px;
    max-height: none;
    overflow-y: auto;
    padding: 20px;
    background: #1a1a1a;
    flex: 1;
    overflow-x: hidden;
}

.welcome-message {
    margin-bottom: 20px;
}

.message-content {
    background: #333;
    padding: 16px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    line-height: 1.6;
    color: #fff;
}

.chat-input-area {
    padding: 20px;
    background: #1a1a1a;
    border-top: 1px solid #333;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
    overflow: visible;
}

.chat-input-area textarea {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 12px;
    color: #e0e0e0;
    font-size: 14px;
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
    width: 100%;
}

.chat-input-area textarea:focus {
    outline: none;
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.1);
    background: #222;
}

.chat-input-area textarea::placeholder {
    color: #666;
}

.input-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    position: relative;
    z-index: 10;
    overflow: visible;
}

/* 提示词选择器包装器 */
.prompt-selector-wrapper {
    display: flex;
    align-items: center;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 6px;
    overflow: hidden;
}

.prompt-selector {
    background: transparent;
    border: none;
    color: #e0e0e0;
    font-size: 13px;
    padding: 10px 12px;
    cursor: pointer;
    min-width: 100px;
    outline: none;
    height: 40px;
}

.prompt-selector option {
    background: #2a2a2a;
    color: #e0e0e0;
}

.prompt-upload-btn {
    background: #444;
    border: none;
    color: #e0e0e0;
    cursor: pointer;
    font-size: 12px;
    padding: 10px 8px;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border-left: 1px solid #555;
    height: 40px;
    box-sizing: border-box;
}

.prompt-upload-btn:hover {
    background: #555;
}

/* 导出按钮样式 */
.export-btn {
    background: #28a745;
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    font-size: 13px;
    padding: 10px 16px;
    transition: all 0.3s ease;
    white-space: nowrap;
    height: 40px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

.export-btn:hover {
    background: #218838;
    transform: translateY(-1px);
}

/* 份数选择器样式 */
.input-actions .export-count,
.simple-input-container .export-count,
.chat-input-area .export-count {
    background: #2a2a2a !important;
    border: 1px solid #444 !important;
    border-radius: 6px !important;
    color: #e0e0e0 !important;
    font-size: 13px !important;
    padding: 10px 16px !important;
    cursor: pointer !important;
    width: auto !important;
    min-width: 80px !important;
    outline: none !important;
    height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
}

.input-actions .export-count option,
.simple-input-container .export-count option,
.chat-input-area .export-count option {
    background: #2a2a2a !important;
    color: #e0e0e0 !important;
}

/* Word文档容器样式 */
.word-documents-container {
    margin: 15px 0;
    padding: 15px;
    background: #2a2a2a;
    border-radius: 8px;
    border: 1px solid #444;
}

.word-documents-container.hidden {
    display: none;
}

.word-controls-container.hidden {
    display: none;
}

.word-document-item {
    display: inline-block;
    margin: 6px;
    padding: 10px;
    background: #333;
    border: 1px solid #555;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    width: 100px;
    max-width: 100px;
    transition: all 0.3s ease;
}

.word-document-item:hover {
    background: #444;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.word-document-item.selected {
    background: #007bff;
    border-color: #0056b3;
}

.word-document-icon {
    font-size: 24px;
    display: block;
    margin-bottom: 8px;
}

.word-document-name {
    font-size: 11px;
    color: #e0e0e0;
    word-break: break-all;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 90px;
}

.batch-download-btn {
    background: #28a745;
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    font-size: 13px;
    padding: 8px 16px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.batch-download-btn:hover {
    background: #218838;
}

/* Word控制按钮样式 */
.word-controls {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    justify-content: flex-start;
    align-items: center;
}

.control-btn {
    background: #007bff;
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    font-size: 13px;
    padding: 8px 12px;
    transition: all 0.3s ease;
}

.control-btn:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

/* Word文档下载按钮 - 使用更具体的选择器避免冲突 */
.word-controls .download-btn {
    background: #6c757d;
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    font-size: 13px;
    padding: 8px 12px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    white-space: nowrap;
    width: auto;
    height: auto;
}

.word-controls .download-btn:hover {
    background: #5a6268;
}

/* 🔥 横竖比例切换开关样式 */
.aspect-ratio-switch-container {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 2px solid var(--border-primary);
}

.aspect-ratio-btn {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-secondary);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.aspect-ratio-btn:hover {
    background: var(--bg-elevated);
    border-color: var(--border-accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.aspect-ratio-btn.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    border-color: var(--border-accent);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
}

.aspect-ratio-btn.active::before {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: var(--border-accent);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}

.ratio-icon {
    flex-shrink: 0;
}

.ratio-preview {
    width: 60px;
    height: 60px;
    border: 3px solid var(--text-secondary);
    border-radius: 8px;
    background: var(--bg-primary);
    position: relative;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.aspect-ratio-btn.active .ratio-preview {
    border-color: var(--border-accent);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.ratio-preview.ratio-16-9 {
    width: 70px;
    height: 40px;
}

.ratio-preview.ratio-9-16 {
    width: 40px;
    height: 70px;
}

.ratio-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ratio-label strong {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.ratio-label span {
    font-size: 13px;
    color: var(--text-secondary);
}

.aspect-ratio-btn.active .ratio-label strong {
    color: var(--border-accent);
}

.aspect-ratio-btn.active .ratio-label span {
    color: var(--text-accent);
}

.file-upload-btn {
    display: inline-flex;
    align-items: center;
    padding: 10px 16px;
    background: #333;
    border: 1px solid #555;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    height: 40px;
    box-sizing: border-box;
}

.file-upload-btn:hover {
    background: #444;
    border-color: #666;
}

.send-btn, .history-btn {
    padding: 10px 20px;
    background: #1890ff;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-btn:hover, .history-btn:hover {
    background: #40a9ff;
    transform: translateY(-1px);
}

.history-btn {
    background: #52c41a;
}

.history-btn:hover {
    background: #73d13d;
}

/* 图片生成容器样式 */
.image-gen-container {
    max-width: 800px;
    margin: 0 auto;
}

.image-gen-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* 复刻功能样式 */
.replication-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.analysis-results {
    margin-top: 30px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    overflow: visible;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    position: relative;
}

.analysis-results.hidden {
    display: none;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background: #2a2a2a;
    border-bottom: 1px solid #444;
    width: 100%;
    box-sizing: border-box;
}

.results-header h3 {
    margin: 0;
    color: #fff;
}

.analysis-table {
    padding: 0;
    background: #1a1a1a;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    position: relative;
    max-height: none;
    overflow: visible;
}

.shots-table-container {
    max-height: 80vh;
    overflow-x: auto;
    overflow-y: auto;
    position: relative;
}

.analysis-table table {
    background: #1a1a1a;
    color: #fff;
    width: 100%;
    min-width: 1700px;
    table-layout: fixed;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
    border-collapse: separate;
    border-spacing: 0;
}

/* 表头锁定 - 滚动时始终可见 */
.analysis-table thead {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #1a1a1a;
}

.analysis-table th {
    background: #2a2a2a !important;
    color: #fff !important;
    border-color: #444 !important;
    white-space: nowrap;
    padding: 4px 8px !important;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* 定义各列的固定宽度 - 9:16竖版比例 */
.analysis-table .col-scene { width: 80px; }
.analysis-table .col-shot { width: 60px; }
.analysis-table .col-frame { width: 101px; min-width: 101px; max-width: 101px; } /* 首帧图列 9:16 */
.analysis-table .col-original-frame-image { width: 101px; min-width: 101px; max-width: 101px; } /* 原首帧图列 9:16 */
.analysis-table .col-frame-image { width: 101px; min-width: 101px; max-width: 101px; } /* 首帧图列 9:16 */
.analysis-table .col-video { width: 101px; min-width: 101px; max-width: 101px; } /* 视频列 9:16 */
.analysis-table .col-last-frame-image { width: 101px; min-width: 101px; max-width: 101px; } /* 尾帧图列 9:16 */
.analysis-table .col-character { width: 60px; min-width: 60px; max-width: 60px; }
.analysis-table .col-shot-type { width: 35.36px; min-width: 35.36px; max-width: 35.36px; }
.analysis-table .col-camera { width: 65.15px; min-width: 65.15px; max-width: 65.15px; }
.analysis-table .col-description { width: 150px; min-width: 150px; }
.analysis-table .col-frame-prompt { width: 200px; }
.analysis-table .col-video-prompt { width: 200px; }
.analysis-table .col-dialogue { width: 120px; }

/* 视频提示词+对白合并列：单行显示，不换行 */
.analysis-table td.cell-video-prompt {
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
}

.analysis-table td.cell-video-prompt .cell-content {
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* 收缩状态下，合并单元格允许换行显示 */
.shots-table.collapsed-table td.cell-description,
.shots-table.collapsed-table td.cell-frame-prompt,
.shots-table.collapsed-table td.cell-video-prompt {
    white-space: pre-wrap !important;
    overflow: visible;
    text-overflow: unset;
    vertical-align: top;
    height: auto;
    min-height: 60px;
}

.shots-table.collapsed-table td.cell-description .cell-content,
.shots-table.collapsed-table td.cell-frame-prompt .cell-content,
.shots-table.collapsed-table td.cell-video-prompt .cell-content {
    white-space: pre-wrap !important;
    overflow: visible;
    text-overflow: unset;
    max-width: 100%;
    word-wrap: break-word;
    word-break: break-word;
}
.analysis-table .col-duration { 
    width: 75px; 
    min-width: 75px;
    max-width: 75px;
}
.analysis-table .col-audio { 
    width: 100px; 
    min-width: 100px;
    max-width: 100px;
}
.analysis-table .col-notes { width: 80px; }

.analysis-table td {
    background: #1a1a1a !important;
    color: #fff !important;
    border-color: #444 !important;
    padding: 2px 4px !important;
    max-width: none;
    vertical-align: top;
}

/* 🔥 确保时长列和音效列完全分开 */
.analysis-table td.cell-duration {
    width: 75px !important;
    min-width: 75px !important;
    max-width: 75px !important;
    white-space: normal;
    line-height: 1.4;
    font-size: 11px;
    padding: 2px 4px !important;
    vertical-align: middle;
    text-align: center;
    border-right: 1px solid #444 !important;
}

.analysis-table td.cell-audio {
    width: 100px !important;
    min-width: 100px !important;
    max-width: 100px !important;
    white-space: normal;
    line-height: 1.4;
    font-size: 11px;
    padding: 2px 4px !important;
    vertical-align: middle;
    text-align: center;
}

/* 统一文本内容列的显示格式 */
.analysis-table td.prompt-cell {
    max-width: 200px;
    height: 60px !important;
    cursor: pointer;
    position: relative;
    vertical-align: top;
    padding: 2px 4px !important;
}

.analysis-table td.cell-description {
    max-width: 150px;
    width: 150px;
    height: auto;
    min-height: 60px;
    cursor: pointer;
    position: relative;
    vertical-align: top;
    padding: 2px 4px !important;
}

.analysis-table td.prompt-cell .prompt-content {
    height: 52px;
    line-height: 1.3;
    overflow: hidden;
    word-wrap: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    margin: 0;
    padding: 0;
    font-size: 12px;
}

.analysis-table td.cell-description .description-content {
    min-height: 52px;
    height: auto;
    line-height: 1.4;
    overflow: visible;
    word-wrap: break-word;
    white-space: normal;
    margin: 0;
    padding: 0;
    font-size: 12px;
}

.analysis-table td.prompt-cell:hover,
.analysis-table td.cell-description:hover {
    background: #2a2a2a !important;
}

/* 确保其他单元格高度一致 */
.analysis-table td {
    height: 60px;
    vertical-align: middle;
}

/* 角色列允许换行 - 支持HTML换行标签 */
.analysis-table td.cell-character {
    white-space: normal !important;
    word-wrap: break-word;
    word-break: keep-all;
    overflow-wrap: break-word;
    max-width: 60px;
    vertical-align: top;
    line-height: 1.6;
}

/* 确保角色列内的换行标签正确显示 */
.analysis-table td.cell-character .cell-content {
    white-space: normal !important;
    line-height: 1.6;
}

.analysis-table td.cell-character .cell-content br {
    display: block;
    content: "";
    margin: 4px 0;
}

/* 其他列保持单行显示 */
.analysis-table td:not(.prompt-cell):not(.cell-description):not(.cell-character):not(.cell-duration) {
    white-space: nowrap;
}

/* 时长列特殊处理：显示多行（起始时间、结束时间、时长） */
.analysis-table td.cell-duration {
    white-space: normal;
    line-height: 1.4;
    font-size: 11px;
    padding: 2px 4px !important;
    vertical-align: middle;
    text-align: center;
}

/* 历史图片网格样式 - 支持滚动 */
.image-history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    padding: 20px 0;
    max-height: 70vh; /* 限制最大高度 */
    overflow-y: auto; /* 垂直滚动 */
    overflow-x: hidden; /* 隐藏水平滚动 */
    scrollbar-width: thin; /* Firefox 细滚动条 */
    scrollbar-color: #ccc #f0f0f0; /* Firefox 滚动条颜色 */
}

/* Webkit浏览器滚动条样式 */
.image-history-grid::-webkit-scrollbar {
    width: 8px;
}

.image-history-grid::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 4px;
}

.image-history-grid::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.image-history-grid::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.history-image-item {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
}

.history-image-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.history-image-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.history-image-info {
    padding: 12px;
}

.history-image-prompt {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.history-image-time {
    font-size: 11px;
    color: #999;
    margin-top: 8px;
}

/* 聊天消息样式 */
.chat-message {
    display: flex;
    margin-bottom: 16px;
    animation: slideIn 0.3s ease-out;
}

.chat-message.user {
    justify-content: flex-end;
}

.chat-message.assistant,
.chat-message.error,
.chat-message.thinking {
    justify-content: flex-start;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    margin: 0 8px;
}

.chat-message.user .message-avatar {
    order: 2;
    background: #333;
    color: white;
}

.chat-message.assistant .message-avatar {
    background: #52c41a;
    color: white;
}

.chat-message.error .message-avatar {
    background: #ff4d4f;
    color: white;
}

.chat-message.thinking .message-avatar {
    background: #722ed1;
    color: white;
    animation: pulse 1.5s infinite;
}

.chat-message .message-content {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 12px;
    line-height: 1.5;
    word-wrap: break-word;
}

.chat-message.user .message-content {
    background: #333;
    color: white;
    order: 1;
}

.chat-message.assistant .message-content {
    background: #2a2a2a;
    color: #fff;
    border: 1px solid #444;
}

.chat-message.error .message-content {
    background: #3d1a1a;
    color: #ff7875;
    border: 1px solid #5c2626;
}

.chat-message.thinking .message-content {
    background: #2e1a3d;
    color: #b37feb;
    border: 1px solid #4e2a5c;
}

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

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

/* 分析表格样式 */
.type-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    color: white;
}

.type-badge.type-plot {
    background: #1890ff;
}

.type-badge.type-character {
    background: #52c41a;
}

.type-badge.type-environment {
    background: #fa8c16;
}

.btn-small {
    padding: 4px 12px;
    background: #f0f0f0;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    color: #333;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.btn-small:hover {
    background: #e6f7ff;
    border-color: #1890ff;
    color: #1890ff;
}

/* 文件上传显示样式 */
.uploaded-files, .uploaded-images {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    padding: 8px 0;
}

.uploaded-file-item, .uploaded-image-item {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    background: #333;
    border: 1px solid #555;
    border-radius: 6px;
    color: #fff;
    font-size: 12px;
    max-width: 200px;
}

.uploaded-image-item {
    padding: 4px;
    flex-direction: column;
    width: 80px;
}

.uploaded-image-item img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 4px;
}

.file-icon {
    margin-right: 6px;
    font-size: 14px;
}

.file-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.remove-file {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 16px;
    height: 16px;
    background: #ff4d4f;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.remove-file:hover {
    background: #ff7875;
}

.uploaded-file-item .remove-file {
    position: static;
    margin-left: 8px;
    width: 14px;
    height: 14px;
}

.file-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.file-size {
    font-size: 10px;
    color: #999;
    margin-top: 2px;
}

/* 图片错误处理样式 - 增强版 */
.image-load-failed {
    position: relative;
    border: 2px dashed var(--border-color);
    background: var(--background-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px;
}

.image-load-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(255, 244, 244, 0.5);
    border: 1px solid rgba(255, 77, 79, 0.2);
    border-radius: 8px;
    margin: 10px;
    text-align: center;
}

.error-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.error-icon {
    font-size: 24px;
    opacity: 0.6;
}

.error-text {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.error-subtitle {
    font-size: 12px;
    color: #999;
    margin-bottom: 8px;
}

.retry-btn, .open-browser-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 2px;
}

.retry-btn:hover, .open-browser-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.open-browser-btn {
    background: #52c41a;
}

.open-browser-btn:hover {
    background: #389e0d;
}

.retry-image-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    z-index: 10;
}

.retry-image-btn:hover {
    background: var(--primary-hover);
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.retry-image-btn:active {
    transform: translate(-50%, -50%) scale(0.95);
}

/* 英雄区域 */
.hero-section {
    text-align: center;
    margin-bottom: 16px;
    padding: 20px 20px;
    background: radial-gradient(ellipse at center, rgba(102, 126, 234, 0.1) 0%, transparent 70%);
    border-radius: 20px;
}

.main-title {
    font-size: 32px;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
    position: relative;
}

.main-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--primary-gradient);
    border-radius: 2px;
}

.main-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 0;
    font-weight: 400;
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.5;
}

/* API状态指示灯 */
.api-status-lights {
    display: flex;
    align-items: center;
    gap: 6px;
}

.api-light {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #666;
    transition: all 0.3s ease;
    position: relative;
}

.api-light.success {
    background: #52c41a;
    box-shadow: 0 0 8px rgba(82, 196, 26, 0.6);
}

.api-light.error {
    background: #ff4d4f;
    box-shadow: 0 0 8px rgba(255, 77, 79, 0.6);
}

.api-light.testing {
    background: #faad14;
    animation: pulse-light 1.5s infinite;
}

/* API模型选择框 */
.api-model-select {
    font-size: 12px;
    padding: 4px 8px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    background: white;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 140px;
}

.api-model-select:hover {
    border-color: #40a9ff;
}

.api-model-select:focus {
    border-color: #1890ff;
    outline: none;
    box-shadow: 0 0 4px rgba(24, 144, 255, 0.2);
}

.model-change-indicator {
    color: #faad14;
    font-size: 10px;
}

/* 图片滑动选择器 */
.image-slider {
    margin: 12px 0;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.slider-container {
    position: relative;
    overflow-x: auto;
    padding: 8px 0;
}

.slider-track {
    display: flex;
    gap: 8px;
    min-width: min-content;
}

.slider-item {
    flex: 0 0 120px;
    height: 80px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    position: relative;
}

.slider-item:hover {
    border-color: #1890ff;
    transform: scale(1.05);
}

.slider-item.selected {
    border-color: #52c41a;
    box-shadow: 0 0 12px rgba(82, 196, 26, 0.4);
}

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

.slider-item .item-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    text-align: center;
    padding: 2px 4px;
    font-size: 10px;
}

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

/* 任务队列组件 */
.task-queue-section {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.task-queue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.task-queue-title {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

.task-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.task-item:hover {
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.task-info {
    flex: 1;
}

.task-title {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 4px;
}

.task-meta {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: #6c757d;
}

.task-status {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
}

.task-status.pending { background: #fff3cd; color: #856404; }
.task-status.processing { background: #d1ecf1; color: #0c5460; }
.task-status.completed { background: #d4edda; color: #155724; }
.task-status.failed { background: #f8d7da; color: #721c24; }

.task-cost {
    font-weight: 600;
    color: #28a745;
}

.task-progress {
    margin-top: 10px;
    position: relative;
}

.task-progress-bar {
    height: 4px;
    background: linear-gradient(90deg, #4CAF50, #45a049);
    border-radius: 2px;
    transition: width 0.3s ease;
    position: relative;
}

.task-progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #e9ecef;
    border-radius: 2px;
    z-index: -1;
}

.task-progress-text {
    font-size: 11px;
    color: #666;
    text-align: right;
    margin-top: 2px;
}

.task-details {
    margin-top: 10px;
    font-size: 12px;
    color: #6c757d;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.task-details.expanded {
    max-height: 200px;
}

/* 图片和视频网格 */
.images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
}

.image-item, .video-item {
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.image-item img {
    width: 100%;
    border-radius: 6px;
    margin-bottom: 10px;
}

.video-item video {
    width: 100%;
    border-radius: 6px;
    margin-bottom: 10px;
}

.video-placeholder {
    width: 100%;
    height: 200px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.image-title {
    font-weight: bold;
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.image-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

/* 上传状态样式 */
.upload-status {
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    margin: 4px 0;
    text-align: center;
}

.upload-status.uploading {
    background-color: #e3f2fd;
    color: #1976d2;
    border: 1px solid #bbdefb;
}

.upload-status.success {
    background-color: #e8f5e8;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.upload-status.error {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

/* 文件类型标识 */
.file-type-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 500;
}

/* 风格选择和操作按钮布局 */
.style-and-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 16px;
    width: 100%;
}

/* 风格选择器样式 */
.style-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 67px;
}

.style-selector label {
    font-size: 14px;
    font-weight: 500;
    color: #e0e0e0;
    white-space: nowrap;
}

.style-selector select {
    flex: 1;
    padding: 0 14px;
    border: 2px solid #444;
    border-radius: 8px;
    background: #2a2a2a;
    font-size: 14px;
    color: #e0e0e0;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 50px;
    height: 40px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
}

.style-selector select:hover {
    border-color: #667eea;
    background: #2f2f2f;
}

.style-selector select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
    background: #2f2f2f;
}

.style-selector select option {
    padding: 8px;
    background: #2a2a2a;
    color: #e0e0e0;
}

/* 形式爆款选择器样式 */
/* 🔥 统一输入区域样式 */
.input-actions {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 16px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    width: 100%;
}

/* 🔥 统一的选择框和输入框样式 */
.hot-elements-selector,
.model-selector,
.quantity-selector,
.aspect-ratio-selector,
.txt-file-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.hot-elements-selector select,
.model-selector select,
.quantity-selector input[type="number"],
.style-selector select {
    height: 40px;
    padding: 0 14px;
    border: 2px solid #444;
    border-radius: 8px;
    background: #2a2a2a;
    font-size: 14px;
    color: #e0e0e0;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
}

.style-selector {
    display: flex;
    align-items: center;
}

.style-selector select {
    min-width: 100px;
}

.style-selector select:hover {
    border-color: #667eea;
    background: #2f2f2f;
}

.style-selector select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
    background: #2f2f2f;
}

/* 🔥 爆款元素框增强可见性 */
.hot-elements-selector {
    min-width: 120px;
    max-width: 150px;
}

.hot-elements-selector select {
    border: 2px solid #667eea;
    background: linear-gradient(135deg, #2a2a2a 0%, #1f1f1f 100%);
    font-weight: 500;
    width: 100%;
    min-width: 120px;
    max-width: 150px;
}

.hot-elements-selector select option[disabled] {
    color: #999;
}

.hot-elements-selector select option:not([disabled]) {
    color: #e0e0e0;
}

.hot-elements-selector select:not(:focus):not(:hover) {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.hot-elements-selector select:hover {
    border-color: #7c8ef5;
    background: linear-gradient(135deg, #2f2f2f 0%, #242424 100%);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
    transform: translateY(-1px);
}

.hot-elements-selector select:focus {
    outline: none;
    border-color: #7c8ef5;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.4), 0 4px 12px rgba(102, 126, 234, 0.3);
    background: linear-gradient(135deg, #2f2f2f 0%, #242424 100%);
}

.hot-elements-selector select option {
    padding: 10px 12px;
    background: #2a2a2a;
    color: #e0e0e0;
    border: none;
}

.hot-elements-selector select option:hover {
    background: rgba(102, 126, 234, 0.2);
}

/* 模型选择器 */
.model-selector {
    min-width: 180px;
    max-width: 220px;
}

.model-selector select {
    min-width: 180px;
}

.model-selector select:hover {
    border-color: #667eea;
    background: #2f2f2f;
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.2);
}

.model-selector select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
    background: #2f2f2f;
}

/* 数量输入框 */
.quantity-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quantity-selector label {
    font-size: 14px;
    color: #e0e0e0;
    font-weight: 500;
    white-space: nowrap;
}

.quantity-selector input[type="number"] {
    width: 80px;
    min-width: 80px;
    text-align: center;
    padding: 0 10px;
}

.quantity-selector input[type="number"]:hover {
    border-color: #667eea;
    background: #2f2f2f;
}

.quantity-selector input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
    background: #2f2f2f;
}

/* 比例选择器 */
.aspect-ratio-selector {
    display: flex;
    align-items: center;
}

.ratio-buttons {
    display: flex;
    gap: 2px;
    background: #2a2a2a;
    border: 2px solid #444;
    border-radius: 8px;
    padding: 2px;
    height: 40px;
    box-sizing: border-box;
    min-width: 100px;
}

.ratio-buttons input[type="radio"] {
    display: none;
}

.ratio-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    height: 100%;
    border-radius: 6px;
    font-size: 13px;
    color: #999;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-weight: 500;
    flex: 1;
}

.ratio-buttons input[type="radio"]:checked + .ratio-btn {
    background: #667eea;
    color: #fff;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.ratio-btn:hover {
    color: #e0e0e0;
    background: #333;
}

/* txt文件选择器样式 */
.txt-file-selector {
    display: flex;
    align-items: center;
}

.txt-upload-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0 16px;
    height: 40px;
    border: 2px solid #444;
    border-radius: 8px;
    background: #2a2a2a;
    color: #e0e0e0;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-sizing: border-box;
    white-space: nowrap;
    min-width: 100px;
}

.txt-upload-btn:hover {
    border-color: #667eea;
    background: #2f2f2f;
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.2);
}

.txt-upload-btn:active {
    transform: translateY(1px);
}

.txt-file-selector input[type="file"] {
    display: none;
}

/* 统一按钮样式 */
.input-actions .send-btn {
    height: 40px;
    padding: 0 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    flex-shrink: 0;
}

/* 响应式布局 */
@media (max-width: 768px) {
    .style-and-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .style-selector {
        justify-content: space-between;
        min-width: auto;
        width: 100%;
    }
    
    .style-selector select {
        width: 100%;
        min-width: auto;
    }
    
    .input-actions {
        justify-content: flex-start;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .hot-elements-selector,
    .model-selector,
    .aspect-ratio-selector,
    .txt-file-selector {
        width: 100%;
    }
    
    .hot-elements-selector select,
    .model-selector select {
        width: 100%;
        min-width: auto;
        max-width: none;
    }
    
    .ratio-buttons {
        width: 100%;
        min-width: auto;
    }
    
    .txt-upload-btn {
        width: 100%;
        min-width: auto;
    }
    
    .input-actions .send-btn {
        width: 100%;
        min-width: auto;
    }
}

/* 上传的图片/视频项样式 */
.uploaded-image-item {
    position: relative;
    display: inline-block;
    margin: 8px;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 8px;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}

.uploaded-image-item:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}

/* 上传中状态 */
.uploaded-image-item.uploading {
    border-color: #ffc107;
    background: #fff3cd;
    animation: pulse 1.5s infinite;
}

/* 上传成功状态 */
.uploaded-image-item.success {
    border-color: #28a745;
    background: #d4edda;
}

/* 上传失败状态 */
.uploaded-image-item.error {
    border-color: #dc3545;
    background: #f8d7da;
}

/* 脉冲动画 */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

.uploaded-image-item .file-name {
    font-size: 11px;
    color: #666;
    margin-top: 4px;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.uploaded-image-item .remove-file {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ff4757;
    color: white;
    border: none;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.uploaded-image-item .remove-file:hover {
    background: #ff3742;
    transform: scale(1.1);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .hero-section {
        margin-bottom: 16px;
    }
    
    .main-title {
        font-size: 22px;
    }
    
    .chat-container {
        margin: 10px;
        max-height: calc(100vh - 100px);
        min-height: 400px;
    }
    
    .chat-messages {
        min-height: 200px;
        padding: 15px;
    }
    
    .chat-input-area {
        padding: 15px;
        margin-bottom: 0;
    }
    
    .input-actions {
        margin-bottom: 10px;
    }
}

/* 聊天界面样式 */
.chat-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.new-chat-btn {
    background: #f8f9fa;
    color: #666;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.new-chat-btn:hover {
    background: #e6f7ff;
    border-color: #40a9ff;
    color: #40a9ff;
}

/* 聊天底部区域 */
.chat-footer {
    display: flex;
    justify-content: center;
    padding: 15px;
    border-top: 1px solid #f0f0f0;
    margin-top: 20px;
}

/* 拖拽上传效果 */
.drag-highlight {
    background-color: rgba(64, 169, 255, 0.1) !important;
    border: 2px dashed #40a9ff !important;
    border-radius: 8px !important;
}

/* 图片预览管理 */
.uploaded-image-item {
    position: relative;
    display: inline-block;
    margin: 4px;
    border-radius: 6px;
    overflow: hidden;
    background: #f8f9fa;
    border: 1px solid #e8e8e8;
    width: 64px;
    height: 64px;
}

.uploaded-image-item.uploading {
    border-color: #1890ff;
    background: #e6f7ff;
}

.uploaded-image-item.success {
    border-color: #52c41a;
    background: #f6ffed;
    box-shadow: none; /* 移除阴影 */
}

.uploaded-image-item.error {
    border-color: #ff4d4f;
    background: #fff2f0;
}

.uploaded-image-item .remove-file {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.uploaded-image-item .remove-file:hover {
    background: #ff4d4f;
    transform: scale(1.1);
}

.uploaded-image-item .file-name {
    display: none; /* 隐藏文件名，只显示缩略图 */
}

.uploaded-image-item .upload-status {
    position: absolute;
    top: 2px;
    left: 2px;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.file-type-badge {
    position: absolute;
    bottom: 2px;
    left: 2px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 8px;
    padding: 2px 4px;
    border-radius: 2px;
}

/* ==================== AI音频模块样式 ==================== */

/* 音频模式选择器 */
.audio-mode-selector {
    margin-bottom: 20px;
}

.mode-tabs {
    display: flex;
    gap: 0;
    background: var(--bg-light);
    border-radius: 12px;
    padding: 4px;
    border: 1px solid var(--border-light);
}

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

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

.mode-tab.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 2px 8px rgba(24, 144, 255, 0.3);
}

.tab-icon {
    font-size: 16px;
}

.tab-text {
    font-size: 14px;
}

/* 音频模式内容 */
.audio-mode-content {
    display: none;
}

.audio-mode-content.active {
    display: block;
}

/* 灵感模式样式 */
.inspiration-options {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 15px;
    padding: 15px;
    background: var(--bg-light);
    border-radius: 8px;
    border: 1px solid var(--border-light);
}

.option-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.option-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
}

.option-group input[type="checkbox"] {
    margin: 0;
    transform: scale(1.1);
}

/* 定制模式样式 */
.custom-form {
    background: var(--bg-light);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border-light);
}

.form-row {
    margin-bottom: 20px;
}

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

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

.form-row input[type="text"],
.form-row textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-secondary);
    transition: all 0.3s ease;
    resize: vertical;
    min-height: auto;
    box-sizing: border-box;
}

.form-row input[type="text"]:focus,
.form-row textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(24, 144, 255, 0.1);
}

.form-row textarea {
    min-height: 120px;
    font-family: inherit;
    line-height: 1.5;
}

/* 上传音频样式 */
.upload-container {
    background: var(--bg-light);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border-light);
}

.upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    border: 2px dashed var(--border-light);
    border-radius: 12px;
    background: var(--bg-secondary);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: rgba(24, 144, 255, 0.05);
}

.upload-area.dragover {
    border-color: var(--primary-color);
    background: rgba(24, 144, 255, 0.1);
    transform: scale(1.02);
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.7;
}

.upload-text {
    text-align: center;
    margin-bottom: 20px;
}

.upload-text p {
    font-size: 16px;
    color: var(--text-primary);
    margin: 0 0 8px 0;
    font-weight: 500;
}

.upload-text small {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.upload-btn {
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(24, 144, 255, 0.3);
}

/* 已上传音频信息 */
.uploaded-audio-info {
    margin-top: 20px;
    padding: 15px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: 8px;
}

.audio-file-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.file-icon {
    font-size: 20px;
}

.file-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.file-size {
    font-size: 12px;
    color: var(--text-secondary);
}

.remove-file-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: var(--error);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
    transition: all 0.3s ease;
}

.remove-file-btn:hover {
    background: var(--danger-hover);
    transform: scale(1.1);
}

/* 音频生成结果样式 */
.audio-results {
    margin-top: 30px;
    background: var(--bg-light);
    border-radius: 12px;
    border: 1px solid var(--border-light);
    overflow: hidden;
}

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
}

.results-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.clear-results-btn {
    padding: 6px 12px;
    background: var(--error);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clear-results-btn:hover {
    background: var(--danger-hover);
}

.results-content {
    padding: 20px;
}

/* 单个音频结果项 */
.audio-result-item {
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.audio-result-item:last-child {
    margin-bottom: 0;
}

.audio-result-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.audio-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

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

.audio-result-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.audio-result-status.completed {
    background: var(--success-bg);
    color: var(--success);
}

.audio-result-status.processing {
    background: var(--warning-bg);
    color: var(--warning);
}

.audio-result-status.failed {
    background: var(--danger-bg);
    color: var(--error);
}

.audio-result-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
    padding: 15px;
    background: var(--bg-light);
    border-radius: 6px;
}

.audio-info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.audio-info-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

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

.audio-player-container {
    margin-top: 15px;
}

.audio-player-container audio {
    width: 100%;
    height: 40px;
}

.audio-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.audio-action-btn {
    padding: 8px 16px;
    border: 1px solid var(--border-light);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.audio-action-btn:hover {
    background: var(--bg-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.audio-action-btn.primary {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

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

/* 任务状态显示 */
.task-status {
    margin-top: 20px;
    padding: 20px;
    background: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: 8px;
}

.status-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

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

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

.status-message {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

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

.status-subtext {
    font-size: 12px;
    color: var(--text-secondary);
    display: none;
}

.status-progress {
    margin-top: 16px;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-track {
    flex: 1;
    height: 6px;
    background: var(--bg-secondary);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary-color) 0%, #45a049 100%);
    transition: width 0.3s ease;
}

.task-status.indeterminate .progress-fill {
    background: linear-gradient(90deg, transparent 0%, var(--primary-color) 50%, transparent 100%);
    animation: shimmer 1.5s ease-in-out infinite;
    width: 50%;
}

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

.progress-value {
    font-size: 12px;
    color: var(--text-secondary);
    min-width: 42px;
    text-align: right;
}

.task-status.completed .status-spinner {
    display: none;
}

/* ==================== TTS (AI配音) 模块样式 ==================== */

/* IndexTTS-2 高级参数设置样式 */
.advanced-tts-settings {
    margin-top: 20px;
    background: #2d3748;
    border-radius: 12px;
    border: 1px solid #4a5568;
    overflow: hidden;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
    color: white;
}

.settings-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.toggle-settings-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.toggle-settings-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.advanced-settings-content {
    padding: 20px;
    background: #1a202c;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.settings-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
}

.settings-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.settings-section h4 {
    margin: 0 0 15px 0;
    font-size: 14px;
    font-weight: 600;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.setting-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.setting-group label {
    font-size: 13px;
    font-weight: 500;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.setting-group label span {
    color: #667eea;
    font-weight: 600;
    min-width: 40px;
}

.setting-group input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e9ecef;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.setting-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

.setting-group input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

.setting-group select {
    padding: 8px 12px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    background: white;
    font-size: 13px;
    color: #495057;
    cursor: pointer;
    transition: all 0.3s ease;
}

.setting-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.setting-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #667eea;
    cursor: pointer;
}

.setting-hint {
    font-size: 11px;
    color: #a0aec0;
    font-style: italic;
    line-height: 1.4;
}

.preset-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.preset-btn {
    padding: 8px 16px;
    border: 1px solid #4a5568;
    border-radius: 6px;
    background: #2d3748;
    color: #e2e8f0;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.preset-btn:hover {
    background: #4a5568;
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-1px);
}

.preset-btn:active {
    transform: translateY(0);
}

/* 参考音频状态样式 */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.upload-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #2d3748;
    border: 1px solid #4a5568;
    border-radius: 20px;
    color: #e2e8f0;
    font-size: 12px;
    font-weight: 500;
}

.status-icon {
    font-size: 14px;
}

.status-text {
    color: #68d391;
}

/* 进度条样式 */
.progress-container {
    margin-top: 20px;
    padding: 20px;
    background: #2d3748;
    border-radius: 12px;
    border: 1px solid #4a5568;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.progress-text {
    color: #e2e8f0;
    font-size: 14px;
    font-weight: 500;
}

.progress-time {
    color: #a0aec0;
    font-size: 12px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #4a5568;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
    position: relative;
}

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

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

.progress-stages {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.stage {
    flex: 1;
    padding: 8px 12px;
    background: #4a5568;
    border-radius: 6px;
    color: #a0aec0;
    font-size: 12px;
    text-align: center;
    transition: all 0.3s ease;
}

.stage.active {
    background: #667eea;
    color: white;
    transform: scale(1.05);
}

.stage.completed {
    background: #68d391;
    color: white;
}

/* TTS模式选择器 */
.tts-mode-selector {
    margin-bottom: 30px;
}

.tts-mode-selector .mode-tabs {
    display: flex;
    gap: 10px;
    background: #f8f9fa;
    padding: 8px;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.tts-mode-selector .mode-tab {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 500;
}

.tts-mode-selector .mode-tab:hover {
    background: #e9ecef;
    color: #495057;
}

.tts-mode-selector .mode-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.tts-mode-selector .tab-icon {
    font-size: 16px;
}

.tts-mode-selector .tab-text {
    font-size: 14px;
}

/* TTS模式内容 */
.tts-mode-content {
    display: none;
}

.tts-mode-content.active {
    display: block;
}

/* TTS设置区域 */
.tts-settings {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    border: 1px solid #e9ecef;
}

.tts-settings .setting-row {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-bottom: 18px;
}

.tts-settings .setting-row:last-child {
    margin-bottom: 0;
}

.tts-settings .setting-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    min-width: 220px;
}

.tts-settings label {
    font-weight: 500;
    color: #495057;
    font-size: 14px;
}

.tts-settings select {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: white;
    font-size: 14px;
    color: #495057;
}

.tts-settings input[type="range"] {
    width: 100%;
}

.tts-settings span {
    font-size: 14px;
    color: #6c757d;
}

.tts-settings .setting-hint {
    font-size: 12px;
    color: #868e96;
    line-height: 1.4;
}

.tts-settings .setting-group.vertical {
    min-width: 200px;
}

.tts-settings .toggle-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.tts-settings .toggle-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #495057;
}

.tts-settings .toggle-item input {
    width: 16px;
    height: 16px;
}

.tts-settings .setting-action {
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: center;
    align-items: flex-start;
    min-width: 220px;
}

.tts-settings .setting-action .generate-btn {
    width: auto;
    padding: 10px 20px;
}

.tts-settings .setting-action .action-hint {
    font-size: 12px;
    color: #868e96;
    max-width: 220px;
    line-height: 1.5;
}

@media (max-width: 768px) {
    .tts-settings .setting-row {
        flex-direction: column;
    }

    .tts-settings .setting-group,
    .tts-settings .setting-action {
        width: 100%;
    }
}

/* 声音克隆表单 */
.clone-form .form-row {
    margin-bottom: 20px;
}

.clone-form .form-row:last-child {
    margin-bottom: 0;
}

.clone-form label {
    display: block;
    font-weight: 500;
    color: #495057;
    margin-bottom: 8px;
    font-size: 14px;
}

.clone-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
    resize: vertical;
    min-height: 100px;
}

/* 音频上传区域 */
.audio-upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    background: #f8f9fa;
    transition: all 0.3s ease;
    cursor: pointer;
}

.audio-upload-area:hover {
    border-color: #667eea;
    background: #f0f2ff;
}

.audio-upload-area .upload-icon {
    font-size: 48px;
    margin-bottom: 15px;
    color: #6c757d;
}

.audio-upload-area .upload-text p {
    font-size: 16px;
    color: #495057;
    margin-bottom: 5px;
    font-weight: 500;
}

.audio-upload-area .upload-text small {
    color: #6c757d;
    font-size: 12px;
}

.audio-upload-area .upload-btn {
    margin-top: 15px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.audio-upload-area .upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* 已上传音频信息 */
.uploaded-reference-info {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #e9ecef;
}

.uploaded-reference-info .remove-file-btn {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 12px;
    margin-top: 10px;
    transition: all 0.3s ease;
}

.uploaded-reference-info .remove-file-btn:hover {
    background: #c82333;
}

/* 克隆设置 */
.clone-settings {
    display: flex;
    gap: 20px;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.clone-settings .setting-group {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.clone-settings label {
    font-weight: 500;
    color: #495057;
    min-width: 60px;
    font-size: 14px;
    margin-bottom: 0;
}

.clone-settings input[type="range"] {
    flex: 1;
}

.clone-settings span {
    min-width: 30px;
    font-size: 14px;
    color: #6c757d;
    text-align: center;
}

/* 批量配音表单 */
.batch-form .form-row {
    margin-bottom: 20px;
}

.batch-form .form-row:last-child {
    margin-bottom: 0;
}

.batch-form label {
    display: block;
    font-weight: 500;
    color: #495057;
    margin-bottom: 8px;
    font-size: 14px;
}

/* 批量输入方法选择 */
.batch-input-methods {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.batch-input-methods .method-btn {
    padding: 8px 16px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: white;
    color: #6c757d;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.batch-input-methods .method-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.batch-input-methods .method-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

/* 批量输入内容 */
.batch-input-content {
    display: none;
}

.batch-input-content.active {
    display: block;
}

.batch-input-content textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
    resize: vertical;
    min-height: 150px;
}

/* 文件上传区域 */
.file-upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    background: #f8f9fa;
    transition: all 0.3s ease;
    cursor: pointer;
}

.file-upload-area:hover {
    border-color: #667eea;
    background: #f0f2ff;
}

.file-upload-area .upload-icon {
    font-size: 48px;
    margin-bottom: 15px;
    color: #6c757d;
}

.file-upload-area .upload-text p {
    font-size: 16px;
    color: #495057;
    margin-bottom: 5px;
    font-weight: 500;
}

.file-upload-area .upload-text small {
    color: #6c757d;
    font-size: 12px;
}

.file-upload-area .upload-btn {
    margin-top: 15px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.file-upload-area .upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* 批量设置 */
.batch-settings {
    display: flex;
    gap: 20px;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.batch-settings .setting-group {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.batch-settings label {
    font-weight: 500;
    color: #495057;
    min-width: 80px;
    font-size: 14px;
    margin-bottom: 0;
}

.batch-settings select {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: white;
    font-size: 14px;
    color: #495057;
}

/* TTS结果显示 */
.tts-results {
    margin-top: 30px;
    background: var(--bg-elevated);
    border-radius: 12px;
    border: 1px solid var(--border-primary);
    overflow: hidden;
}

.tts-results .results-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tts-results .results-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.tts-results .clear-results-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.tts-results .clear-results-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.tts-results .results-content {
    padding: 20px;
}

/* TTS结果项 */
.tts-result-item {
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    margin-bottom: 15px;
    overflow: hidden;
}

.tts-result-item:last-child {
    margin-bottom: 0;
}

.tts-result-item .result-header {
    background: var(--bg-card);
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tts-result-item .result-title {
    font-weight: 500;
    color: #495057;
    font-size: 14px;
}

.tts-result-item .result-actions {
    display: flex;
    gap: 8px;
}

.tts-result-item .result-actions button {
    padding: 6px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.tts-result-item .download-btn {
    background: #28a745;
    color: white;
}

.tts-result-item .download-btn:hover {
    background: #218838;
}

.tts-result-item .delete-btn {
    background: #dc3545;
    color: white;
}

.tts-result-item .delete-btn:hover {
    background: #c82333;
}

.tts-result-item .result-content {
    padding: 15px;
}

.tts-result-item .result-text {
    margin-bottom: 10px;
    font-size: 14px;
    color: #495057;
}

.tts-result-item .result-text strong {
    color: #212529;
}

.tts-result-item .result-params {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.tts-result-item .result-params span {
    background: #e9ecef;
    color: #6c757d;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.tts-result-item .result-audio {
    margin-top: 10px;
}

/* 试听按钮 */
.preview-btn {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 12px 24px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-left: 10px;
}

.preview-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.3);
}

.preview-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .tts-settings .setting-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .clone-settings {
        flex-direction: column;
        gap: 15px;
    }
    
    .batch-settings {
        flex-direction: column;
        gap: 15px;
    }
    
    .tts-result-item .result-params {
        flex-direction: column;
        gap: 8px;
    }
    
    .tts-result-item .result-actions {
        flex-direction: column;
        gap: 5px;
    }
}

/* 替换模态框样式 */
.replace-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

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

/* 🎯 双击复制反馈动画 */
@keyframes fadeInOut {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    10% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    90% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
}

.replace-modal-content {
    background: var(--bg-elevated);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-primary);
    max-width: 90%;
    max-height: 90%;
    width: 800px;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

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

.replace-modal-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.replace-modal-header .header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.replace-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
}

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.close-modal:hover {
    background: #f3f4f6;
    color: #374151;
}

.replace-modal-body {
    padding: 24px;
    max-height: 500px;
    overflow-y: auto;
}

.character-library-section,
.scene-library-section,
.style-library-section {
    margin-bottom: 24px;
}

.character-library-section h4,
.scene-library-section h4,
.style-library-section h4 {
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 600;
    color: #374151;
}

.character-library-grid,
.scene-library-grid,
.style-library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.character-option,
.scene-option,
.style-option {
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.character-option:hover,
.scene-option:hover,
.style-option:hover {
    background: #f3f4f6;
    border-color: #10b981;
    transform: translateY(-2px);
}

.character-option.selected,
.scene-option.selected,
.style-option.selected {
    background: #ecfdf5;
    border-color: #10b981;
}

.character-preview,
.scene-preview,
.style-preview {
    font-size: 32px;
    margin-bottom: 8px;
}

.character-name,
.scene-name,
.style-name {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

.character-desc,
.style-desc {
    font-size: 12px;
    color: #6b7280;
}

.custom-character-section,
.custom-scene-section,
.custom-style-section {
    margin-top: 24px;
}

.custom-character-section h4,
.custom-scene-section h4,
.custom-style-section h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.custom-character-input,
.custom-scene-input,
.custom-style-input {
    width: 100%;
    height: 80px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 12px;
    font-size: 14px;
    resize: vertical;
    transition: border-color 0.2s ease;
}

.custom-character-input:focus,
.custom-scene-input:focus,
.custom-style-input:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.replace-modal-footer {
    padding: 16px 24px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.cancel-btn {
    background: #6b7280;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cancel-btn:hover {
    background: #4b5563;
}

.confirm-btn {
    background: #10b981;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.confirm-btn:hover {
    background: #059669;
}

.loading-placeholder,
.error-message {
    text-align: center;
    color: #6b7280;
    padding: 24px;
    font-size: 14px;
}

/* 进度和成功提示样式 */
.replacement-progress {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-elevated);
    padding: 24px 32px;
    border-radius: 12px;
    border: 1px solid var(--border-primary);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 10001;
    min-width: 300px;
    text-align: center;
}

.progress-text {
    margin-bottom: 16px;
    font-size: 16px;
    color: #374151;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #059669);
    border-radius: 2px;
    animation: progressPulse 1.5s infinite;
}

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

.success-toast {
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 操作按钮组样式 */
.action-buttons {
    display: flex;
    gap: 12px;
}

.action-buttons .primary-button {
    min-width: 140px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .replace-modal-content {
        width: 95%;
        max-height: 85%;
    }
    
    .character-library-grid,
    .scene-library-grid,
    .style-library-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 8px;
    }
    
    .replace-modal-body {
        padding: 16px;
        max-height: 400px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-buttons .primary-button {
        min-width: auto;
    }
}

/* 增强版元素样式 */
.enhanced-item {
    display: block !important;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    margin-bottom: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.enhanced-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #10b981;
}

.item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid var(--border-primary);
}

.item-header .character-number,
.item-header .scene-number,
.item-header .style-number {
    background: #1976d2;
    color: white;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    margin-right: 12px;
}

.item-header .character-name,
.item-header .scene-name,
.item-header .style-name {
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.item-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.item-content {
    padding: 16px;
    display: flex;
    gap: 16px;
}

.item-preview {
    flex-shrink: 0;
    width: 120px;
}

.preview-placeholder {
    width: 120px;
    height: 80px;
    background: #f3f4f6;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.preview-placeholder:hover {
    background: #e5e7eb;
    border-color: #10b981;
}

.preview-icon {
    font-size: 24px;
    margin-bottom: 4px;
    opacity: 0.6;
}

.preview-text {
    font-size: 12px;
    color: #6b7280;
    text-align: center;
}

.preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.preview-image:hover {
    transform: scale(1.05);
}

.item-prompt {
    flex: 1;
    min-width: 0;
}

.prompt-label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.prompt-content {
    margin-bottom: 12px;
}

.prompt-display {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 12px;
    font-size: 14px;
    line-height: 1.5;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 20px;
}

.prompt-display:hover {
    background: #f3f4f6;
    border-color: #10b981;
}

.prompt-display.collapsed {
    max-height: 60px;
    overflow: hidden;
    position: relative;
}

.prompt-display.collapsed::after {
    content: '点击展开...';
    position: absolute;
    bottom: 4px;
    right: 8px;
    font-size: 11px;
    color: #10b981;
    background: linear-gradient(to right, transparent 0%, #f9fafb 30%);
    padding-left: 20px;
}

.prompt-display.expanded {
    max-height: none;
}

.prompt-editor {
    width: 100%;
    min-height: 80px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 12px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s ease;
}

.prompt-editor:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.prompt-actions {
    display: flex;
    gap: 8px;
}

.edit-btn,
.save-btn,
.cancel-btn,
.regenerate-btn {
    background: #10b981;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.edit-btn:hover,
.regenerate-btn:hover {
    background: #059669;
    transform: translateY(-1px);
}

.save-btn {
    background: #3b82f6;
}

.save-btn:hover {
    background: #2563eb;
}

.cancel-btn {
    background: #6b7280;
}

.cancel-btn:hover {
    background: #4b5563;
}

.regenerate-btn {
    background: #f59e0b;
}

.regenerate-btn:hover {
    background: #d97706;
}

.hidden {
    display: none !important;
}

/* 提示词状态样式 */
.saved-toast {
    animation: slideIn 0.3s ease;
}

/* 增强版场景和角色响应式 */
@media (max-width: 768px) {
    .item-content {
        flex-direction: column;
        gap: 12px;
    }
    
    .item-preview {
        width: 100%;
    }
    
    .preview-placeholder {
        width: 100%;
        height: 120px;
    }
    
    .prompt-actions {
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .edit-btn,
    .save-btn,
    .cancel-btn,
    .regenerate-btn {
        font-size: 11px;
        padding: 4px 8px;
    }
}

/* ==================== 分镜媒体容器样式 ==================== */

/* 媒体单元格样式 - 默认 9:16 竖版比例 */
.cell-frame-image,
.cell-video,
.cell-last-frame-image,
.cell-original-frame-image {
    position: relative;
    overflow: hidden;
    padding: 0 !important;
    vertical-align: top;
    text-align: center;
    width: 90px;
    min-width: 90px;
    max-width: 90px;
    height: 160px;
    min-height: 160px;
    max-height: 160px;
    aspect-ratio: 9 / 16;
}

.cell-frame-image .media-content,
.cell-video .media-content,
.cell-last-frame-image .media-content,
.cell-original-frame-image .media-content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 0;
    background: #1a1a1a;
    width: 100%;
    height: 100%;
}

.cell-frame-image img,
.cell-video video,
.cell-last-frame-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
}

/* 确保没有文字覆盖在媒体上 */
.cell-frame-image *,
.cell-video *,
.cell-last-frame-image * {
    position: relative;
    z-index: 1;
}

/* 移除可能覆盖的伪元素 */
.cell-frame-image::before,
.cell-frame-image::after,
.cell-video::before,
.cell-video::after,
.cell-last-frame-image::before,
.cell-last-frame-image::after {
    display: none !important;
}

/* 横屏 16:9 覆盖样式 */
/* 🔥 修复：同时更新列宽和单元格尺寸 */
.professional-shots-table.ratio-169 th.col-original-frame-image,
.professional-shots-table.ratio-169 th.col-frame-image,
.professional-shots-table.ratio-169 th.col-video,
.professional-shots-table.ratio-169 th.col-last-frame-image,
.professional-shots-table.ratio-169 .col-original-frame-image,
.professional-shots-table.ratio-169 .col-frame-image,
.professional-shots-table.ratio-169 .col-video,
.professional-shots-table.ratio-169 .col-last-frame-image,
.shots-table.ratio-169 th.col-original-frame-image,
.shots-table.ratio-169 th.col-frame-image,
.shots-table.ratio-169 th.col-video,
.shots-table.ratio-169 th.col-last-frame-image,
.shots-table.ratio-169 .col-original-frame-image,
.shots-table.ratio-169 .col-frame-image,
.shots-table.ratio-169 .col-video,
.shots-table.ratio-169 .col-last-frame-image,
.analysis-table.ratio-169 th.col-original-frame-image,
.analysis-table.ratio-169 th.col-frame-image,
.analysis-table.ratio-169 th.col-video,
.analysis-table.ratio-169 th.col-last-frame-image,
.analysis-table.ratio-169 .col-original-frame-image,
.analysis-table.ratio-169 .col-frame-image,
.analysis-table.ratio-169 .col-video,
.analysis-table.ratio-169 .col-last-frame-image {
    width: 160px !important;
    min-width: 160px !important;
    max-width: 160px !important;
}

.professional-shots-table.ratio-169 .cell-frame-image,
.professional-shots-table.ratio-169 .cell-video,
.professional-shots-table.ratio-169 .cell-last-frame-image,
.shots-table.ratio-169 .cell-frame-image,
.shots-table.ratio-169 .cell-video,
.shots-table.ratio-169 .cell-last-frame-image,
.analysis-table .shots-table.ratio-169 .cell-frame-image,
.analysis-table .shots-table.ratio-169 .cell-video,
.analysis-table .shots-table.ratio-169 .cell-last-frame-image {
    width: 160px !important;
    min-width: 160px !important;
    max-width: 160px !important;
    height: 90px !important;
    min-height: 90px !important;
    max-height: 90px !important;
    aspect-ratio: 16 / 9 !important;
}

/* 🔥 修复：确保media-content容器填充父容器，不设置aspect-ratio */
.professional-shots-table.ratio-169 .cell-original-frame-image .media-content,
.professional-shots-table.ratio-169 .cell-frame-image .media-content,
.professional-shots-table.ratio-169 .cell-video .media-content,
.professional-shots-table.ratio-169 .cell-last-frame-image .media-content,
.shots-table.ratio-169 .cell-original-frame-image .media-content,
.shots-table.ratio-169 .cell-frame-image .media-content,
.shots-table.ratio-169 .cell-video .media-content,
.shots-table.ratio-169 .cell-last-frame-image .media-content,
.analysis-table .shots-table.ratio-169 .cell-original-frame-image .media-content,
.analysis-table .shots-table.ratio-169 .cell-frame-image .media-content,
.analysis-table .shots-table.ratio-169 .cell-video .media-content,
.analysis-table .shots-table.ratio-169 .cell-last-frame-image .media-content {
    width: 100% !important;
    height: 100% !important;
}

.professional-shots-table.ratio-169 .shots-table td,
.shots-table.ratio-169 td {
    height: 90px;
}

.professional-shots-table.ratio-169 .shots-table td .cell-content,
.shots-table.ratio-169 td .cell-content {
    min-height: 90px;
}

/* 竖屏 9:16 强制 */
/* 🔥 修复：同时更新列宽和单元格尺寸 */
.professional-shots-table.ratio-916 th.col-frame-image,
.professional-shots-table.ratio-916 th.col-video,
.professional-shots-table.ratio-916 th.col-last-frame-image,
.professional-shots-table.ratio-916 .col-frame-image,
.professional-shots-table.ratio-916 .col-video,
.professional-shots-table.ratio-916 .col-last-frame-image,
.shots-table.ratio-916 th.col-frame-image,
.shots-table.ratio-916 th.col-video,
.shots-table.ratio-916 th.col-last-frame-image,
.shots-table.ratio-916 .col-frame-image,
.shots-table.ratio-916 .col-video,
.shots-table.ratio-916 .col-last-frame-image,
.analysis-table.ratio-916 th.col-frame-image,
.analysis-table.ratio-916 th.col-video,
.analysis-table.ratio-916 th.col-last-frame-image,
.analysis-table.ratio-916 .col-frame-image,
.analysis-table.ratio-916 .col-video,
.analysis-table.ratio-916 .col-last-frame-image {
    width: 101px !important;
    min-width: 101px !important;
    max-width: 101px !important;
}

.professional-shots-table.ratio-916 .cell-frame-image,
.professional-shots-table.ratio-916 .cell-video,
.professional-shots-table.ratio-916 .cell-last-frame-image,
.shots-table.ratio-916 .cell-frame-image,
.shots-table.ratio-916 .cell-video,
.shots-table.ratio-916 .cell-last-frame-image {
    width: 90px !important;
    min-width: 90px !important;
    max-width: 90px !important;
    height: 160px !important;
    min-height: 160px !important;
    max-height: 160px !important;
    aspect-ratio: 9 / 16 !important;
}

/* 🔥 修复：确保media-content容器填充父容器，不设置aspect-ratio */
.professional-shots-table.ratio-916 .cell-frame-image .media-content,
.professional-shots-table.ratio-916 .cell-video .media-content,
.professional-shots-table.ratio-916 .cell-last-frame-image .media-content,
.shots-table.ratio-916 .cell-frame-image .media-content,
.shots-table.ratio-916 .cell-video .media-content,
.shots-table.ratio-916 .cell-last-frame-image .media-content {
    width: 100% !important;
    height: 100% !important;
}

/* 方形 1:1 强制 */
/* 🔥 修复：同时更新列宽和单元格尺寸 */
.professional-shots-table.ratio-11 th.col-frame-image,
.professional-shots-table.ratio-11 th.col-video,
.professional-shots-table.ratio-11 th.col-last-frame-image,
.professional-shots-table.ratio-11 .col-frame-image,
.professional-shots-table.ratio-11 .col-video,
.professional-shots-table.ratio-11 .col-last-frame-image,
.shots-table.ratio-11 th.col-frame-image,
.shots-table.ratio-11 th.col-video,
.shots-table.ratio-11 th.col-last-frame-image,
.shots-table.ratio-11 .col-frame-image,
.shots-table.ratio-11 .col-video,
.shots-table.ratio-11 .col-last-frame-image,
.analysis-table.ratio-11 th.col-frame-image,
.analysis-table.ratio-11 th.col-video,
.analysis-table.ratio-11 th.col-last-frame-image,
.analysis-table.ratio-11 .col-frame-image,
.analysis-table.ratio-11 .col-video,
.analysis-table.ratio-11 .col-last-frame-image {
    width: 120px !important;
    min-width: 120px !important;
    max-width: 120px !important;
}

.professional-shots-table.ratio-11 .cell-frame-image,
.professional-shots-table.ratio-11 .cell-video,
.professional-shots-table.ratio-11 .cell-last-frame-image,
.shots-table.ratio-11 .cell-frame-image,
.shots-table.ratio-11 .cell-video,
.shots-table.ratio-11 .cell-last-frame-image {
    width: 120px !important;
    min-width: 120px !important;
    max-width: 120px !important;
    height: 120px !important;
    min-height: 120px !important;
    max-height: 120px !important;
    aspect-ratio: 1 / 1 !important;
}

/* 🔥 修复：确保media-content容器填充父容器，不设置aspect-ratio */
.professional-shots-table.ratio-11 .cell-frame-image .media-content,
.professional-shots-table.ratio-11 .cell-video .media-content,
.professional-shots-table.ratio-11 .cell-last-frame-image .media-content,
.shots-table.ratio-11 .cell-frame-image .media-content,
.shots-table.ratio-11 .cell-video .media-content,
.shots-table.ratio-11 .cell-last-frame-image .media-content {
    width: 100% !important;
    height: 100% !important;
}

.professional-shots-table.ratio-11 .shots-table td,
.shots-table.ratio-11 td {
    height: 120px;
}

.professional-shots-table.ratio-11 .shots-table td .cell-content,
.shots-table.ratio-11 td .cell-content {
    min-height: 120px;
}

.media-container {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-top: 8px;
}

.media-container .preview-placeholder {
    flex: 0 0 200px;
    height: 140px;
    border: 2px dashed var(--border-secondary);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-elevated);
    position: relative;
    overflow: hidden;
}

.media-container .preview-placeholder:hover {
    border-color: var(--border-accent);
    background: var(--bg-secondary);
    transform: scale(1.02);
}

.media-container .preview-placeholder .preview-icon {
    font-size: 32px;
    margin-bottom: 4px;
    opacity: 0.6;
}

.media-container .preview-placeholder .preview-text {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
}

/* 当有图片/视频时的样式 */
.media-container .preview-placeholder img,
.media-container .preview-placeholder video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.prompt-wrapper {
    flex: 1;
    min-width: 0;
}

/* 首帧图和视频区域特殊样式 */
.frame-section .preview-placeholder {
    border-color: #ff7875;
}

.frame-section .preview-placeholder:hover {
    border-color: #ff4d4f;
    box-shadow: 0 4px 12px rgba(255, 77, 79, 0.2);
}

.video-section .preview-placeholder {
    border-color: #36cfc9;
}

.video-section .preview-placeholder:hover {
    border-color: #13c2c2;
    box-shadow: 0 4px 12px rgba(19, 194, 194, 0.2);
}

/* 增强的提示词显示 */
.prompt-display.collapsed {
    background: var(--bg-elevated);
    border: 1px solid var(--border-secondary);
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 36px;
}

.prompt-display.collapsed:hover {
    border-color: var(--border-accent);
    background: var(--bg-secondary);
}

.prompt-display .prompt-preview {
    flex: 1;
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.4;
    margin-right: 8px;
}

.prompt-display .expand-btn {
    background: var(--bg-accent);
    border: none;
    border-radius: 4px;
    color: var(--text-accent);
    cursor: pointer;
    padding: 2px 6px;
    font-size: 12px;
    transition: all 0.2s ease;
}

.prompt-display .expand-btn:hover {
    background: var(--border-accent);
    transform: scale(1.1);
}

.prompt-full-text {
    margin-top: 8px;
}

.prompt-full-text .prompt-textarea {
    width: 100%;
    min-height: 80px;
    max-height: 200px;
    padding: 8px 12px;
    border: 1px solid var(--border-secondary);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.4;
    resize: vertical;
    font-family: inherit;
}

.prompt-full-text .prompt-textarea:focus {
    outline: none;
    border-color: var(--border-accent);
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.prompt-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.prompt-actions .save-btn {
    background: var(--success-color, #52c41a);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.prompt-actions .save-btn:hover {
    background: #73d13d;
    transform: translateY(-1px);
}

.prompt-actions .cancel-btn {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-secondary);
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.prompt-actions .cancel-btn:hover {
    border-color: var(--border-accent);
    color: var(--text-primary);
}

.prompt-actions .regenerate-btn {
    background: linear-gradient(135deg, #1890ff, #40a9ff);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.prompt-actions .regenerate-btn:hover {
    background: linear-gradient(135deg, #40a9ff, #69c0ff);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(24, 144, 255, 0.3);
}

.prompt-actions .regenerate-btn:disabled {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.prompt-actions .regenerate-status {
    margin-left: 8px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    min-width: 72px;
}

.regenerate-status.status-pending {
    color: #60a5fa;
}

.regenerate-status.status-success {
    color: #34d399;
}

.regenerate-status.status-error {
    color: #f87171;
}

/* 图片预览模态框样式 */
.image-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-preview-modal .modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.image-preview-modal .modal-content {
    background: var(--bg-elevated);
    border-radius: 12px;
    padding: 20px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    cursor: default;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.image-preview-modal .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-secondary);
}

.image-preview-modal .modal-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 16px;
}

.image-preview-modal .close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: all 0.2s ease;
}

.image-preview-modal .close-btn:hover {
    color: var(--text-primary);
    transform: scale(1.1);
}

.image-preview-modal .modal-body {
    text-align: center;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .media-container {
        flex-direction: column;
        gap: 12px;
    }
    
    .media-container .preview-placeholder {
        flex: none;
        width: 100%;
        height: 120px;
    }
    
    .prompt-actions {
        gap: 6px;
    }
    
    .prompt-actions .save-btn,
    .prompt-actions .cancel-btn,
    .prompt-actions .regenerate-btn {
        font-size: 11px;
        padding: 5px 10px;
    }
}

/* Toast 动画 */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* ==================== 专业分镜头表格样式 ==================== */

.professional-shots-table {
    margin: 20px 0;
    background: var(--bg-elevated);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
    width: 100%;
    max-width: none;
}

.shots-table {
    width: 100%;
    min-width: 1600px;
    border-collapse: collapse;
    font-size: 13px;
    background: var(--bg-primary);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.shots-table th {
    background: linear-gradient(135deg, var(--bg-accent), var(--border-accent));
    color: var(--text-accent);
    font-weight: 600;
    padding: 12px 8px;
    text-align: center;
    border: 1px solid var(--border-secondary);
    font-size: 12px;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
}

.shots-table td {
    padding: 2px 4px;
    border: 1px solid var(--border-secondary);
    vertical-align: top;
    background: var(--bg-primary);
    transition: background-color 0.2s ease;
}

.shots-table tr:hover td {
    background: var(--bg-elevated);
}

/* professional-shots-table 容器样式 - 支持滚动和表头锁定 */
.professional-shots-table {
    padding: 0;
    background: #1a1a1a;
    width: 100%;
    max-height: 80vh;
    overflow-x: auto;
    overflow-y: auto;
    position: relative;
}

/* shots-table 表格样式 */
.shots-table {
    width: 100%;
    min-width: 1650px;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--border-secondary);
    border-radius: 8px;
    overflow: hidden;
}

/* 表头锁定 - 滚动时始终可见 */
.professional-shots-table thead,
.shots-table thead {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #1a1a1a;
}

.professional-shots-table th,
.shots-table th {
    background: #2a2a2a !important;
    color: #fff !important;
    border: 1px solid #444 !important;
    white-space: nowrap;
    padding: 4px 8px !important;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* 列宽设置 - 9:16竖版比例 */
.col-scene { width: 100px; }
.col-shot { width: 70px; }
.col-frame { width: 101px; min-width: 101px; max-width: 101px; } /* 9:16竖版 */
.col-original-frame-image { width: 101px; min-width: 101px; max-width: 101px; } /* 原首帧图列 9:16竖版 */
.col-frame-image { width: 101px; min-width: 101px; max-width: 101px; } /* 9:16竖版 */
.col-video { width: 101px; min-width: 101px; max-width: 101px; } /* 9:16竖版 */
.col-last-frame-image { width: 101px; min-width: 101px; max-width: 101px; } /* 尾帧图列 9:16竖版 */
.col-character { width: 60px; }
.col-shot-type { width: 35.36px; }

/* 分镜表格角色列允许换行显示多个角色 */
.shots-table td.cell-character {
    white-space: normal;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    vertical-align: top;
    line-height: 1.4;
    max-width: 60px;
}

.shots-table td .cell-content {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* 分镜表格运镜列允许换行显示 */
.shots-table td.cell-camera {
    white-space: normal;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    vertical-align: top;
    line-height: 1.4;
}

/* 分镜表格镜头描述列样式 */
.shots-table td.cell-description {
    white-space: normal;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    vertical-align: top;
    line-height: 1.4;
    max-width: 200px;
    width: 200px;
}

.shots-table td.cell-description .cell-content {
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.4;
}

.col-camera { width: 65.15px; }
.col-description { width: 150px; }
.col-frame-prompt { width: 200px; }
.col-video-prompt { width: 200px; }
.col-dialogue { width: 180px; }
.col-duration { width: 75px; }
.col-audio { width: 100px; }
.col-notes { width: 120px; }

/* 表格单元格内容样式 */
.shot-row[data-shot] {
    position: relative;
}

.scene-info, .shot-number, .character-info, .shot-type-info, 
.camera-info, .duration-info {
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 60px;
}

.shot-badge {
    background: var(--bg-accent);
    color: var(--text-accent);
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 11px;
}

.scene-name, .character-list, .shot-type, .camera-movement, .duration {
    font-size: 12px;
    color: var(--text-primary);
    font-weight: 500;
}

/* 预览单元格样式 */
.frame-preview-cell, .video-preview-cell {
    width: 100%;
    height: 60px;
    cursor: pointer;
}

.frame-preview-cell .preview-placeholder,
.video-preview-cell .preview-placeholder {
    width: 100%;
    height: 100%;
    border: 1px dashed var(--border-secondary);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    background: var(--bg-elevated);
}

.frame-preview-cell .preview-placeholder:hover {
    border-color: #ff4d4f;
    background: #fff2f0;
}

.video-preview-cell .preview-placeholder:hover {
    border-color: #13c2c2;
    background: #e6fffb;
}

.frame-preview-cell .preview-icon,
.video-preview-cell .preview-icon {
    font-size: 16px;
    margin-bottom: 2px;
    opacity: 0.6;
}

.frame-preview-cell .preview-text,
.video-preview-cell .preview-text {
    font-size: 10px;
    color: var(--text-secondary);
}

/* 描述内容样式 */
.description-content {
    width: 100%;
    height: 100%;
    max-height: 100%;
    font-size: 12px;
    line-height: 1.4;
    color: var(--text-primary);
    cursor: help;
    overflow: hidden;
    white-space: normal;
}

/* 提示词单元格样式 */
.prompt-cell {
    display: flex;
    align-items: center;
    gap: 4px;
    width: 100%;
}

.prompt-cell .prompt-preview {
    flex: 1;
    font-size: 11px;
    line-height: 1.3;
    color: var(--text-primary);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
}

.clickable-prompt {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    transition: all 0.2s ease;
    color: var(--text-primary);
}

.clickable-prompt:hover {
    background: #e3f2fd;
    border-color: #1890ff;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(24, 144, 255, 0.2);
}

.prompt-cell .prompt-preview:hover {
    border-color: var(--border-accent);
    background: var(--bg-secondary);
}

.edit-prompt-btn {
    background: var(--bg-accent);
    border: none;
    border-radius: 3px;
    color: var(--text-accent);
    cursor: pointer;
    padding: 2px 4px;
    font-size: 10px;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.edit-prompt-btn:hover {
    opacity: 1;
    background: var(--border-accent);
    transform: scale(1.1);
}

/* 对话、音频、备注单元格样式 */
.dialogue-content, .audio-info, .notes-info {
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 4px;
    background: var(--bg-elevated);
    border: 1px solid transparent;
    transition: all 0.2s ease;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dialogue-content:hover, .audio-info:hover, .notes-info:hover {
    border-color: var(--border-accent);
    background: var(--bg-secondary);
}

.dialogue-text, .audio-text, .notes-text {
    font-size: 12px;
    color: var(--text-primary);
    text-align: center;
    word-break: break-word;
}

/* 表格工具栏样式 */
.table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0 0 0;
    margin-top: 16px;
    border-top: 1px solid var(--border-secondary);
}

.toolbar-left {
    display: flex;
    gap: 8px;
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-secondary);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-secondary:hover {
    border-color: var(--border-accent);
    background: var(--bg-elevated);
    transform: translateY(-1px);
}

.table-stats {
    font-size: 12px;
    color: var(--text-secondary);
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .shots-table {
        font-size: 11px;
    }
    
    .col-description, .col-frame-prompt, .col-video-prompt, .col-dialogue {
        width: 120px;
    }
    
    .description-content, .prompt-cell .prompt-preview {
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }
}

@media (max-width: 768px) {
    .professional-shots-table {
        overflow-x: auto;
        padding: 8px;
    }
    
    .shots-table {
        min-width: 1200px;
        font-size: 10px;
    }
    
    .shots-table th, .shots-table td {
        padding: 6px 4px;
    }
    
    .toolbar-left {
        flex-direction: column;
        gap: 4px;
    }
    
    .btn-secondary {
        font-size: 11px;
        padding: 4px 8px;
    }
}

/* 横向画廊样式 */
.horizontal-gallery {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 16px 0;
    margin-bottom: 20px;
}

.gallery-item {
    flex-shrink: 0;
    width: 160px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.gallery-item:hover {
    transform: translateY(-4px);
}

.gallery-preview {
    width: 120px;
    height: 90px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.gallery-item:hover .gallery-preview {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.gallery-preview .preview-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f0f0f0, #e8e8e8);
    border: none;
    border-radius: 8px;
}

.gallery-preview .preview-icon {
    font-size: 32px;
    opacity: 0.6;
}

.gallery-name {
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
    width: 100%;
}

.gallery-keywords {
    text-align: center;
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.4;
    opacity: 0.8;
    width: 100%;
    padding: 0 8px;
    word-wrap: break-word;
}

/* 详情模态框样式 */
.detail-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.detail-modal-content {
    background: var(--bg-elevated);
    border-radius: 12px;
    padding: 24px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-primary);
}

.detail-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eee;
}

.detail-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.detail-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.detail-modal-close:hover {
    background: #f5f5f5;
    color: #666;
}

.detail-modal-body {
    display: flex;
    gap: 20px;
}

.detail-preview {
    flex-shrink: 0;
    width: 200px;
}

.detail-preview .preview-placeholder {
    width: 200px;
    height: 150px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f0f0f0, #e8e8e8);
    margin-bottom: 16px;
}

.detail-info {
    flex: 1;
}

.detail-section {
    margin-bottom: 20px;
}

.detail-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #666;
    margin-bottom: 8px;
}

.detail-description {
    background: var(--bg-secondary);
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    min-height: 80px;
    border: 1px solid var(--border-primary);
}

.detail-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.detail-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.detail-btn-primary {
    background: #1890ff;
    color: white;
}

.detail-btn-primary:hover {
    background: #40a9ff;
}

.detail-btn-secondary {
    background: #f0f0f0;
    color: #666;
}

.detail-btn-secondary:hover {
    background: #e8e8e8;
}

/* 反推词相关样式 */
.detail-prompt-section {
    margin-top: 12px;
}

.detail-prompt-textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    font-family: inherit;
    margin-bottom: 12px;
}

.detail-prompt-textarea:focus {
    outline: none;
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

.detail-prompt-textarea::placeholder {
    color: #999;
}

.detail-prompt-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* 表格单元格截断样式 */
.cell-content {
    cursor: pointer;
    position: relative;
}

.cell-content.truncate {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

.cell-content.truncate:hover {
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 4px;
    border-radius: 4px;
}

/* 单元格内容模态框样式 */
.cell-content-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cell-content-modal .modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.cell-content-modal .modal-content {
    position: relative;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 12px;
    width: 95%;
    max-width: 900px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.cell-content-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #444;
}

.cell-content-modal .modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

.cell-content-modal .modal-close {
    background: none;
    border: none;
    color: #999;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.cell-content-modal .modal-close:hover {
    background: #333;
    color: #fff;
}

.cell-content-modal .modal-body {
    padding: 16px 20px;
    overflow-y: auto;
    flex: 1;
}

.cell-content-modal .content-display {
    background: #1a1a1a;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #333;
    color: #e0e0e0;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    min-height: 100px;
}

.cell-content-modal .library-detail {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cell-content-modal .detail-row {
    display: flex;
    gap: 12px;
}

.cell-content-modal .detail-label {
    color: #999;
    font-weight: 600;
    min-width: 60px;
}

.cell-content-modal .detail-value {
    color: #e0e0e0;
    flex: 1;
    line-height: 1.6;
}

.cell-content-modal .modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #444;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.cell-content-modal .btn-secondary {
    padding: 8px 20px;
    background: #444;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.cell-content-modal .btn-secondary:hover {
    background: #555;
}

/* 按钮样式扩展 - 角色库和场景库编辑 */
.cell-content-modal .btn-primary {
    padding: 8px 20px;
    background: #1890ff;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.cell-content-modal .btn-primary:hover {
    background: #40a9ff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(24, 144, 255, 0.3);
}

.cell-content-modal .btn-success {
    padding: 8px 20px;
    background: #52c41a;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.cell-content-modal .btn-success:hover {
    background: #73d13d;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(82, 196, 26, 0.3);
}

/* 加载动画 */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 角色替换弹窗样式 */
.replace-character-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid #444;
}

.replace-character-modal .header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.replace-character-modal .btn-replace-character {
    background: #ff6b35;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.replace-character-modal .btn-replace-character:hover {
    background: #ff8c5a;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.replace-character-modal .character-selection {
    margin-top: 20px;
}

.replace-character-modal .character-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
    margin-top: 12px;
}

.replace-character-modal .character-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.replace-character-modal .character-option:hover {
    background: #2a2a2a;
    border-color: #1890ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(24, 144, 255, 0.2);
}

.replace-character-modal .character-preview {
    margin-bottom: 12px;
}

.replace-character-modal .character-details {
    width: 100%;
}

.replace-character-modal .character-details strong {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    display: block;
    word-break: break-word;
}

.replace-character-modal .csv-import-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #333;
}

.replace-character-modal .csv-import-section h4 {
    color: #fff;
    margin-bottom: 12px;
}

/* CSV角色选择弹窗样式 */
.csv-character-selection-modal .csv-character-list {
    max-height: 400px;
    overflow-y: auto;
}

.csv-character-selection-modal .character-option {
    display: flex;
    align-items: center;
    padding: 12px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.csv-character-selection-modal .character-option:hover {
    background: #2a2a2a;
    border-color: #1890ff;
}

.csv-character-selection-modal .character-details strong {
    color: #fff;
    font-size: 14px;
    display: block;
    margin-bottom: 4px;
}

.csv-character-selection-modal .character-details p {
    color: #999;
    font-size: 12px;
    margin: 0;
    line-height: 1.4;
}

/* 角色导入确认弹窗样式 */
.character-import-confirmation-modal .character-preview-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #333;
    border-radius: 8px;
    background: #1a1a1a;
}

.character-import-confirmation-modal .character-preview-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid #333;
    transition: background 0.2s ease;
}

.character-import-confirmation-modal .character-preview-item:hover {
    background: #2a2a2a;
}

.character-import-confirmation-modal .character-preview-item:last-child {
    border-bottom: none;
}

.character-import-confirmation-modal .character-info {
    flex: 1;
}

.character-import-confirmation-modal .character-info strong {
    color: #fff;
    font-size: 14px;
    display: block;
    margin-bottom: 4px;
}

.character-import-confirmation-modal .character-info p {
    color: #999;
    font-size: 12px;
    margin: 0;
    line-height: 1.4;
}

.character-import-confirmation-modal .btn-small {
    background: #dc3545;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.character-import-confirmation-modal .btn-small:hover {
    background: #c82333;
    transform: translateY(-1px);
}

/* 角色名称编辑区域样式 */
.character-name-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #333;
}

.character-name-section .input-group {
    margin-bottom: 0;
}

.character-name-section input {
    font-size: 16px;
    font-weight: 500;
}

/* 角色库标题区域样式 */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-header h4 {
    margin: 0;
    color: #fff;
    font-size: 18px;
    font-weight: 600;
}

.section-actions {
    display: flex;
    gap: 8px;
}

.section-actions button {
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.section-actions button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ==================== CSV 导入导出相关样式 ==================== */

/* 数据表格样式 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.data-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.data-table th {
    padding: 12px 8px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
}

.data-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
}

.data-table tr:hover {
    background: #f5f7fa;
}

.data-table .prompt-cell {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: help;
}

.data-table .edit-btn {
    padding: 4px 12px;
    background: #1890ff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.data-table .edit-btn:hover {
    background: #40a9ff;
    transform: translateY(-1px);
}

/* 弹窗样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.modal-content h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 20px;
}

.modal-content .form-group {
    margin-bottom: 20px;
}

.modal-content label {
    display: block;
    margin-bottom: 8px;
    color: #666;
    font-weight: 500;
}

.modal-content textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
}

.modal-content textarea:focus {
    outline: none;
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.1);
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.secondary-button {
    padding: 8px 20px;
    background: #f0f0f0;
    color: #666;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.secondary-button:hover {
    background: #e0e0e0;
}

/* 按钮容器样式调整 */
.button-container {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}


/* ==================== 角色库和场景库卡片样式 ==================== */

.csv-section {
    margin: 30px 0;
    padding: 20px;
    background: #f9fafb;
    border-radius: 12px;
}

.section-header {
    margin-bottom: 20px;
}

.section-header h4 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

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

.character-card,
.scene-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.character-card:hover,
.scene-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.character-preview,
.scene-preview {
    width: 100%;
    height: 200px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.character-image,
.scene-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.placeholder-image {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.placeholder-image .icon {
    font-size: 48px;
    opacity: 0.5;
}

.generate-btn {
    padding: 8px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.character-info,
.scene-info {
    padding: 15px;
}

.character-info h5,
.scene-info h5 {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.character-desc,
.scene-desc {
    margin: 0 0 15px 0;
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}

.character-actions,
.scene-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #666;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    cursor: pointer;
}

.edit-btn-small {
    padding: 4px 12px;
    background: #52c41a;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.edit-btn-small:hover {
    background: #73d13d;
    transform: translateY(-1px);
}

/* 表单元素美化 */
.form-group input[type="text"] {
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
}

.form-group input[type="text"]:focus {
    outline: none;
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.1);
}

/* 收缩状态下，视频提示词和对白列合并显示 */
.shots-table.collapsed-table .col-video-prompt-collapsed {
    width: 320px !important;
}

.shots-table.collapsed-table .col-video-prompt-collapsed .header-with-copy span {
    white-space: nowrap;
}

/* 收缩行（collapsed-row）隐藏对白列表头 - 只在收缩模式下生效 */
.shots-table.collapsed-table thead tr:last-child .col-dialogue-collapsed {
    display: none;
}

/* ========================================
   参考音频上传区拖拽样式
   ======================================== */
#referenceAudioUpload {
    transition: all 0.3s ease;
}

#referenceAudioUpload.drag-over {
    border-color: #667eea !important;
    background-color: #f0f2ff !important;
    transform: scale(1.02);
}

#referenceAudioUpload.drag-over .upload-icon {
    animation: bounce 0.5s ease infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* ========================================
   CSV拖拽上传区域样式
   ======================================== */
.csv-drop-zone {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

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

.csv-drop-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 3px dashed rgba(255, 255, 255, 0.8);
    border-radius: 24px;
    padding: 60px 80px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(102, 126, 234, 0.4);
    animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.csv-drop-icon {
    font-size: 80px;
    margin-bottom: 20px;
    animation: bounce 1s ease infinite;
}

.csv-drop-text {
    font-size: 28px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 12px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.csv-drop-hint {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
}

/* 拖拽时给模块添加高亮效果 */
#videoReplicationModule.drag-over {
    background: rgba(102, 126, 234, 0.05);
    transition: background 0.3s ease;
}

