* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
    padding: 10px;
}

.alert-notification {
    position: fixed;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 12px 20px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    font-weight: 500;
    transition: top 0.4s ease;
    max-width: 500px;
    text-align: center;
    font-size: 1em;
}

.alert-notification.show {
    top: 10px;
}

.alert-notification.error {
    background: #fff5f5;
    border-left: 3px solid #f56565;
    color: #c53030;
}

.alert-notification.info {
    background: #f0fdf4;
    border-left: 3px solid #22c55e;
    color: #166534;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 15px;
    min-height: 95vh;
    display: flex;
    flex-direction: column;
}

h1 {
    text-align: center;
    color: #333;
    margin: 0 0 8px 0;
    font-size: 1.5em;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2 {
    color: #555;
    margin: 0 0 8px 0;
    font-size: 1.1em;
    font-weight: 600;
}

h3 {
    color: #555;
    margin: 0 0 6px 0;
    font-size: 1em;
}

/* ==================== 编辑区域 ==================== */
.editor-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

/* 第一层：上方横向四列布局 */
.top-layout {
    display: grid;
    grid-template-columns: 260px 260px 260px 280px;
    gap: 15px;
    align-items: start;
}

/* 默认上传模式：仅显示上传容器 */
.top-layout .section-video,
.top-layout .section-control,
.top-layout .section-player {
    display: none;
}

.preview-section {
    display: none;
}

/* 视频加载后：显示所有内容 */
.top-layout.video-loaded .section-video,
.top-layout.video-loaded .section-control {
    display: block;
}

/* 播放器仅有添加visible类时显示 */
.top-layout.video-loaded .section-player {
    display: none;
}

.top-layout.video-loaded .section-player.visible {
    display: flex;
}

.preview-section.show {
    display: flex;
}

/* 左侧：上传容器 */
.section-upload {
    background: white;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: center;
    align-items: center;
}

.upload-area {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.upload-label {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    border: 2px dashed #667eea;
    border-radius: 6px;
    padding: 12px;
    text-align: center;
    transition: all 0.3s ease;
    color: #667eea;
    font-weight: 500;
    font-size: 1em;
}

.upload-label:hover {
    background: #f0f4ff;
    border-color: #764ba2;
    color: #764ba2;
}

.upload-label span {
    pointer-events: none;
}

.upload-area.dragover .upload-label {
    background: #f0f4ff;
    border-color: #764ba2;
    transform: scale(1.02);
}

#videoInput {
    display: none;
}

/* 左侧：播放器 */
.section-player {
    background: #f8f9ff;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #e0e7ff;
    display: none;
    flex-direction: column;
    height: 100%;
}

/* 播放器可见状态 */
.section-player.visible {
    display: flex;
}

.section-player h2 {
    margin-bottom: 10px;
}

.player-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

/* 中间：视频预览 */
.section-video {
    background: white;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
}

.section-video h2 {
    margin-bottom: 8px;
    flex-shrink: 0;
}

.video-container {
    position: relative;
    background: #000;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 400px;
    margin: 0 auto 8px;
    width: 100%;
    aspect-ratio: 16/9;
}

.video-container video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.frame-display {
    position: absolute;
    bottom: 6px;
    left: 6px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 0.7em;
}

.player-display {
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #f5f5f5;
    background-image: 
        linear-gradient(45deg, #e8e8e8 25%, transparent 25%),
        linear-gradient(-45deg, #e8e8e8 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #e8e8e8 75%),
        linear-gradient(-45deg, transparent 75%, #e8e8e8 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.player-info {
    background: white;
    padding: 6px;
    border-radius: 4px;
    font-size: 0.9em;
    color: #666;
}

.player-info p {
    margin: 2px 0;
}

.player-info span {
    color: #667eea;
    font-weight: 600;
}

.frame-label {
    color: #667eea !important;
}

.player-controls {
    display: flex;
    gap: 4px;
}

.player-btn {
    flex: 1;
    padding: 6px;
    border: none;
    border-radius: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    font-size: 0.95em;
    transition: all 0.2s ease;
}

.player-btn:hover {
    transform: scale(1.05);
}

.player-play.playing {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
}

.player-slider {
    flex: 1;
}

.player-range {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    border-radius: 5px;
    background: linear-gradient(to right, #667eea 0%, #764ba2 100%);
    outline: none;
    cursor: pointer;
}

.player-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    border: 1px solid #667eea;
}

.player-range::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    border: 1px solid #667eea;
}

.player-fps {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.95em;
    color: #666;
    margin-top: 6px;
}

.player-fps label {
    font-weight: 500;
    min-width: 60px;
}

.fps-control {
    display: flex;
    gap: 4px;
    align-items: center;
    flex: 1;
}

.fps-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    border-radius: 5px;
    background: linear-gradient(to right, #667eea 0%, #764ba2 100%);
    outline: none;
    cursor: pointer;
}

.fps-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    border: 1px solid #667eea;
}

.fps-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    border: 1px solid #667eea;
}

.fps-value {
    min-width: 28px;
    text-align: center;
    color: #667eea;
    font-weight: 600;
    background: white;
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 1em;
}



/* 右侧：控制面板 */
.section-control {
    background: #f8f9ff;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #e0e7ff;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.section-control h2 {
    margin-bottom: 10px;
}

.slider-group {
    margin-bottom: 10px;
}

.slider-group label {
    display: block;
    margin-bottom: 4px;
    color: #555;
    font-weight: 500;
    font-size: 0.95em;
}

.slider-container {
    display: flex;
    gap: 6px;
    align-items: center;
}

/* 双滑块 */
.dual-slider-container {
    position: relative;
    margin-bottom: 4px;
}

.dual-slider-wrapper {
    position: relative;
    height: 24px;
    display: flex;
    align-items: center;
}

.slider-track-background {
    position: absolute;
    width: 100%;
    height: 4px;
    background: #e0e7ff;
    border-radius: 5px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
}

.slider-track-fill {
    position: absolute;
    height: 4px;
    background: linear-gradient(to right, #667eea 0%, #764ba2 100%);
    border-radius: 5px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
}

.slider {
    flex: 1;
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    border-radius: 5px;
    background: linear-gradient(to right, #667eea 0%, #764ba2 100%);
    outline: none;
    cursor: pointer;
    position: relative;
    z-index: 5;
}

.slider.slider-start,
.slider.slider-end {
    background: transparent;
}

.slider-start {
    z-index: 6;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    border: 2px solid #667eea;
    transition: all 0.2s ease;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    border: 2px solid #667eea;
}

.frame-value {
    min-width: 36px;
    text-align: right;
    color: #667eea;
    font-weight: 600;
    background: white;
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 0.95em;
}

.slider-values {
    display: flex;
    justify-content: space-between;
    font-size: 0.85em;
    color: #666;
    margin-top: 2px;
}

.slider-values span span {
    color: #667eea;
    font-weight: 600;
}

/* 信息框 */
.info-box {
    background: #f8f9ff;
    padding: 8px;
    border-radius: 6px;
    margin-top: 8px;
    flex-shrink: 0;
}

.info-box p {
    color: #333;
    margin: 3px 0;
    font-weight: 600;
}

.info-row {
    display: flex;
    justify-content: space-between;
    color: #666;
    margin: 2px 0;
}

.info-row span {
    color: #666;
}

.info-row span span {
    color: #667eea;
    font-weight: 600;
}

/* 按钮 */
.action-section {
    display: flex;
    gap: 6px;
    margin-top: auto;
}

.btn {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 6px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #e0e7ff;
    color: #667eea;
}

.btn-secondary:hover:not(:disabled) {
    background: #d0d9ff;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==================== 进度条 ==================== */
.progress-section {
    margin: 0;
}

.progress-section h3 {
    margin-bottom: 6px;
    display: none;
}

#progressContainer {
    background: white;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #ddd;
    margin-top: 8px;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: #e0e7ff;
    border-radius: 10px;
    overflow: hidden;
    margin: 4px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 0.3s ease;
}

#progressText {
    color: #666;
    font-size: 0.75em;
    text-align: center;
    margin: 0;
}

/* ==================== 预览区域 ==================== */
.preview-section {
    flex: 1;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.preview-section h2 {
    margin-bottom: 8px;
    flex-shrink: 0;
}

.frame-stats {
    display: flex;
    gap: 20px;
    padding: 8px 12px;
    background: #f0f4ff;
    border-radius: 6px;
    margin-bottom: 8px;
    color: #555;
    flex-shrink: 0;
}

.frame-stats span {
    display: flex;
    align-items: center;
}

.frame-stats span span {
    font-weight: 600;
    color: #667eea;
    margin-left: 4px;
}

.frame-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(122px, 1fr));
    gap: 6px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #ddd;
    min-height: 0;
}

.frame-item {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid #667eea;
    background: #eee;
}

.frame-item:hover {
    transform: scale(1.05);
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.25);
    z-index: 10;
}

.frame-item:hover .frame-disable-btn {
    opacity: 1;
}

.frame-item:hover .frame-insert-btn {
    opacity: 1;
}

.frame-item:hover .frame-delete-btn {
    opacity: 1;
}

.frame-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.frame-item-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    text-align: center;
    padding: 2px 0;
    font-size: 0.75em;
}

.frame-disable-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
    font-size: 0.8em;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.frame-disable-btn:hover {
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.frame-insert-btn {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 50%;
    background: rgba(102, 126, 234, 0.9);
    color: white;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
    font-size: 0.8em;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.frame-insert-btn:hover {
    background: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.frame-delete-btn {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 50%;
    background: rgba(245, 101, 101, 0.9);
    color: white;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
    font-size: 0.8em;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.frame-delete-btn:hover {
    background: #f56565;
    box-shadow: 0 2px 8px rgba(245, 101, 101, 0.4);
}

/* 禁用状态 */
.frame-item-disabled {
    opacity: 0.5;
    filter: grayscale(100%);
    border-color: #888;
}

.frame-item-disabled img {
    filter: grayscale(100%) brightness(0.7);
}

/* 插入的帧样式 */
.frame-item-inserted {
    border-color: #f56565;
}

.frame-item-inserted:hover {
    border-color: #f56565;
    box-shadow: 0 2px 8px rgba(245, 101, 101, 0.25);
}

/* ==================== 加载动画 ==================== */
.loading {
    text-align: center;
    padding: 40px 20px;
}

.spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading p {
    margin-top: 15px;
    color: #667eea;
    font-weight: 500;
}

/* ==================== 智能抠图模态框 ==================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.modal-header h2 {
    margin: 0;
    color: #333;
    font-size: 1.2em;
}

.modal-close {
    font-size: 28px;
    cursor: pointer;
    color: #999;
    line-height: 1;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
}

.koutu-input-group {
    margin-bottom: 20px;
}

.koutu-input-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
    font-size: 0.95em;
}

.koutu-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95em;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.koutu-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.koutu-input::placeholder {
    color: #aaa;
}

.koutu-option {
    margin-bottom: 15px;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.koutu-option:hover {
    border-color: #667eea;
    background: #f9f9ff;
}

.koutu-option input[type="radio"] {
    margin-right: 10px;
    cursor: pointer;
}

.koutu-option label {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.option-title {
    font-weight: 600;
    color: #333;
}

.option-cost {
    font-size: 0.95em;
    color: #ff0000;
}

.koutu-option input[type="radio"]:checked + label .option-title {
    color: #667eea;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal-footer .btn {
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.modal-footer .btn-secondary {
    background: #667eea;
    color: white;
}

.modal-footer .btn-secondary:hover {
    background: #764ba2;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 1200px) {
    .top-layout {
        grid-template-columns: 1fr;
        height: auto;
        gap: 12px;
    }
    
    .section-player,
    .section-video,
    .section-control,
    .section-upload {
        height: auto;
        min-height: 300px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    h1 {
        font-size: 1.3em;
    }
    
    .frame-preview {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    }
}

/* ==================== AI生成视频模态框 ==================== */
.image-upload-box {
    margin-bottom: 10px;
}

.image-preview {
    width: 100%;
    height: 150px;
    border: 2px dashed #667eea;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9f9ff;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #667eea;
    font-weight: 500;
}

.image-preview:hover {
    background: #f0f4ff;
    border-color: #764ba2;
}

.image-preview.has-image {
    background: #f8f9ff;
    border-color: #667eea;
    padding: 4px;
}

.image-preview.has-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ai-prompt-textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95em;
    font-family: inherit;
    resize: vertical;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.ai-prompt-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.ai-prompt-textarea::placeholder {
    color: #aaa;
}

/* AI生成进度条 */
.ai-progress-container {
    margin-top: 15px;
    padding: 10px 12px;
    background: #f9f9ff;
    border-radius: 6px;
    border-left: 3px solid #667eea;
    display: none;
}

.ai-progress-bar {
    width: 100%;
    height: 10px;
    background: #e0e7ff;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.ai-progress-fill {
    height: 100%;
    background: linear-gradient(to right, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 5px;
    box-shadow: 0 0 8px rgba(102, 126, 234, 0.4);
}

#aiProgressText {
    font-size: 0.9em;
    color: #667eea;
    text-align: center;
    font-weight: 500;
    margin: 0;
}

/* AI预设指令按钮 */
.ai-preset-prompts {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.ai-preset-btn {
    flex: 1;
    min-width: 60px;
    padding: 4px 8px;
    border: 1px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.ai-preset-btn:hover {
    background: #f0f4ff;
    border-color: #764ba2;
    color: #764ba2;
}

.ai-preset-btn:active {
    transform: scale(0.95);
}

/* ==================== AI固定摄像機邕头开关 ==================== */
.ai-switch-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding: 8px;
    background: #f9f9ff;
    border-radius: 4px;
}

.ai-switch-group label:first-child {
    font-size: 0.9em;
    color: #555;
    font-weight: 500;
    margin: 0;
}

/* 开关样式 */
.ai-toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 24px;
    margin: 0;
}

.ai-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.ai-toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s ease;
    border-radius: 24px;
    cursor: pointer;
}

.ai-toggle-slider::before {
    content: '';
    position: absolute;
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: 0.3s ease;
    border-radius: 50%;
}

.ai-toggle-switch input:checked + .ai-toggle-slider {
    background-color: #667eea;
}

.ai-toggle-switch input:checked + .ai-toggle-slider::before {
    transform: translateX(16px);
}

/* ==================== 页面标题栏样式 ==================== */
.header-bar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 12px 15px;
    margin: 0 -10px 15px -10px;
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-logo {
    flex: 0 0 auto;
}

.logo-link {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.logo-link:hover {
    opacity: 0.8;
    transform: translateX(-2px);
}

.logo-text {
    font-size: 16px;
    font-weight: 700;
    color: white;
    letter-spacing: 0.5px;
}

.header-content {
    display: flex;
    gap: 30px;
    align-items: center;
}

.user-info,
.coin-info {
    font-size: 14px;
    color: white;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-info span,
.coin-info span {
    color: #fff;
    font-weight: 600;
    min-width: 80px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

/* 登录按钮 */
.header-login-btn {
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.header-login-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.header-login-btn:active {
    transform: translateY(0px);
    background: rgba(255, 255, 255, 0.15);
}

/* 链接按钮 */
.header-link-btn {
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.header-link-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    color: white;
}

.header-link-btn:active {
    transform: translateY(0px);
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

/* 响应式：移动端标题栏 */
@media (max-width: 1160px) {
    .header-bar {
        flex-direction: column;
        gap: 15px;
    }
    
    .header-logo {
        width: 100%;
        text-align: center;
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
        width: 100%;
        text-align: center;
    }
    
    .user-info,
    .coin-info {
        justify-content: center;
        width: 100%;
    }
}

/* ==================== AI视频生成模态框布局 ==================== */
.ai-modal-content {
    max-width: 900px;
    width: 95% !important;
}

.ai-modal-body {
    display: flex;
    gap: 20px;
    max-height: 600px;
    overflow-y: auto;
}

.ai-modal-left {
    flex: 0 0 400px;
    padding-right: 10px;
}

.ai-modal-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* 视频预览组 */
.ai-video-preview-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.ai-video-preview-group label {
    color: #333;
    font-weight: 500;
    font-size: 0.95em;
}

.ai-video-preview-box {
    flex: 1;
    background: #000;
    border-radius: 6px;
    overflow: hidden;
    min-height: 250px;
    max-height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-video-preview-box video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* 视频比例选项 */
.ai-aspect-ratio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ai-aspect-ratio-group label {
    color: #333;
    font-weight: 500;
    font-size: 0.95em;
}

.ai-aspect-ratio-options {
    display: flex;
    gap: 10px;
}

.ai-ratio-option {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #f0f4ff;
    border: 2px solid #e0e7ff;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ai-ratio-option input[type="radio"] {
    cursor: pointer;
}

.ai-ratio-option span {
    font-size: 0.9em;
    color: #555;
    font-weight: 500;
}

.ai-ratio-option:hover {
    background: #e8ecff;
    border-color: #667eea;
}

.ai-ratio-option input[type="radio"]:checked + span {
    color: #667eea;
    font-weight: 600;
}

/* 响应式：小屏幕时改为上下布局 */
@media (max-width: 1000px) {
    .ai-modal-body {
        flex-direction: column;
        max-height: none;
    }
    
    .ai-modal-left {
        flex: 1;
        padding-right: 0;
    }
}
