/**
 * AI图片生成页面特有样式
 */

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

@keyframes sceneBoxAppear {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes zoomIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

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

.settings-panel {
    background: linear-gradient(135deg, var(--bg-light) 0%, #f0f4ff 100%);
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1), inset 0 1px 0 rgba(255,255,255,0.9);
    margin: 0 auto;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.settings-panel::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -25%;
    width: 50%;
    height: 100%;
    background: radial-gradient(circle,rgba(102,126,234,0.05) 0%,transparent 70%);
    pointer-events: none;
}

.import-section {
    background: linear-gradient(135deg, var(--bg-light) 0%, #f0f4ff 100%);
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1), inset 0 1px 0 rgba(255,255,255,0.9);
    margin-bottom: 28px;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.import-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -25%;
    width: 50%;
    height: 100%;
    background: radial-gradient(circle,rgba(102,126,234,0.05) 0%,transparent 70%);
    pointer-events: none;
}

.import-section textarea {
    width: 100%;
    min-height: 200px;
    padding: 16px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    font-size: 14px;
    font-family: monospace;
    resize: vertical;
    margin-bottom: 20px;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    background: #fff;
}

.import-section textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(102,126,234,0.15);
    transform: translateY(-1px);
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.btn-secondary {
    background: #f3f4f6;
    color: var(--text-dark);
    border: 1px solid #e5e7eb;
}

.btn-secondary:hover {
    background: #e5e7eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
    color: #fff;
    box-shadow: 0 6px 20px rgba(16,185,129,0.4);
}

.btn-success:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 35px rgba(16,185,129,0.55);
}

.btn-sm {
    padding: 10px 20px;
    font-size: 13px;
}

.btn-sm:hover {
    transform: translateY(-2px) scale(1.02);
}

.canvas-area {
    background: linear-gradient(135deg, var(--bg-light) 0%, #f0f4ff 100%);
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1), inset 0 1px 0 rgba(255,255,255,0.9);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.canvas-area::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -25%;
    width: 50%;
    height: 100%;
    background: radial-gradient(circle,rgba(102,126,234,0.05) 0%,transparent 70%);
    pointer-events: none;
}

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

.scene-box {
    border: 2px dashed #d1d5db;
    border-radius: 16px;
    padding: 12px;
    background: #fafafa;
    transition: all 0.4s cubic-bezier(0.4,0,0.2,1);
    animation: sceneBoxAppear 0.5s cubic-bezier(0.4,0,0.2,1);
}

.scene-box:hover {
    border-color: var(--primary-color);
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(102,126,234,0.2);
}

.scene-box.has-image {
    border-style: solid;
    border-color: var(--success-color);
    background: #fff;
    box-shadow: 0 8px 25px rgba(16,185,129,0.15);
}

.preview-box {
    width: 100%;
    aspect-ratio: 3/4;
    background: #f3f4f6;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.preview-box:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    transform: scale(1.02);
}

.preview-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.4,0,0.2,1);
}

.preview-box:hover img {
    transform: scale(1.08);
}

.preview-box.has-image::after {
    content: '🖱️ 点击放大';
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    transform: translateY(10px);
}

.preview-box.has-image:hover::after {
    opacity: 1;
    transform: translateY(0);
}

.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.image-modal.show {
    display: flex;
}

.image-modal-content {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    animation: zoomIn 0.3s ease;
}

.image-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    transition: background 0.3s;
}

.image-modal-close:hover {
    background: rgba(255,255,255,0.3);
}

.preview-placeholder {
    text-align: center;
    color: #9ca3af;
    padding: 20px;
}

.preview-placeholder span {
    font-size: 32px;
    display: block;
    margin-bottom: 8px;
}

.preview-placeholder p {
    font-size: 12px;
    line-height: 1.5;
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    border-radius: 12px;
}

.loading-icon {
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 12px;
}

.loading-text {
    font-size: 14px;
    color: #6b7280;
}

.prompt-edit {
    margin-bottom: 8px;
}

.prompt-edit textarea {
    width: 100%;
    min-height: 60px;
    padding: 8px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 11px;
    font-family: inherit;
    resize: vertical;
    background: #fff;
}

.prompt-edit textarea:focus {
    outline: none;
    border-color: #667eea;
}

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

@media (max-width:1200px) {
    .scene-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width:900px) {
    .scene-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width:600px) {
    .nav-tabs { flex-wrap: wrap; gap: 4px; padding: 5px; border-radius: 12px; margin-bottom: 12px; }
    .nav-tab { padding: 8px 10px; font-size: 11px; border-radius: 8px; }
    .scene-grid { grid-template-columns: 1fr; gap: 12px; }
    .scene-box { padding: 10px; border-radius: 12px; }
    .preview-box { min-height: 100px; border-radius: 10px; }
    .scene-actions { gap: 4px; }
    .toolbar { flex-wrap: nowrap; gap: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
    .toolbar .btn { padding: 10px 16px; font-size: 12px; flex-shrink: 0; }
}
