/* Pro版卡片样式扩展 */

/* 图文并茂卡片基础样式 */
.card.with-images {
    height: auto;
    min-height: 480px;
    max-height: 600px;
}

/* 图片容器样式 */
.card-image {
    width: 100%;
    border-radius: 8px;
    margin: 4px 0;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    position: relative;
}

.card-image img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 6px;
}

.card-image.placeholder {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 14px;
    text-align: center;
    padding: 20px;
    position: relative;
}

.card-image.placeholder::before {
    content: '🖼️';
    font-size: 24px;
    display: block;
    margin-bottom: 8px;
}

/* 图片位置布局 */
.card.image-position-top {
    display: flex;
    flex-direction: column;
}

.card.image-position-top h2 {
    order: -2;
}

.card.image-position-top .card-image {
    order: -1;
    margin-bottom: 16px;
}

.card.image-position-top .content {
    order: 0;
}

.card.image-position-side {
    display: block;
}

.card.image-position-side .card-image {
    margin: 12px 0;
}

.card.image-position-side .content {
    padding: 0;
}

.card.image-position-bottom .card-image {
    order: 1;
    margin-top: 16px;
}



/* 多图片布局 */
.card-images-grid {
    display: grid;
    gap: 8px;
    margin: 12px 0;
}

.card-images-grid.two-images {
    grid-template-columns: 1fr 1fr;
}

.card-images-grid .card-image {
    margin: 0;
    min-height: 80px;
}

/* 图片加载状态 */
.card-image.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* 图片加载状态 */
.image-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading-shimmer 1.5s infinite;
    color: #666;
    font-size: 14px;
    border-radius: 6px;
}

@keyframes loading-shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* 图片错误状态 */
.card-image.error {
    background: #ffebee;
    color: #c62828;
    border: 1px dashed #e57373;
}

.image-error {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    background: #ffebee;
    color: #c62828;
    font-size: 14px;
    text-align: center;
    border-radius: 6px;
    border: 1px dashed #e57373;
    padding: 20px;
}

.card-image.error::before {
    content: '❌';
    font-size: 20px;
    display: block;
    margin-bottom: 4px;
}

/* 免费用户图片限制提示 */
.card-image.free-user-limit {
    background: linear-gradient(135deg, #ffd54f 0%, #ffb74d 100%);
    color: #e65100;
    border: 1px dashed #ff9800;
    min-height: 120px;
}

.image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    font-size: 14px;
    text-align: center;
    padding: 20px;
    font-weight: 500;
}

.card-image.free-user-limit::before {
    content: '🔒';
    font-size: 20px;
    display: block;
    margin-bottom: 8px;
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
}

/* 图片工具栏 */
.image-toolbar {
    margin-top: 8px;
    display: flex;
    gap: 8px;
    justify-content: center;
}

.image-toolbar button {
    padding: 4px 8px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.image-toolbar button:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.image-toolbar button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 图片控制按钮 */
.image-position-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.image-position-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--surface-color);
    color: var(--text-color);
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* 图片风格按钮样式 */
.image-style-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.image-style-btn {
    padding: 8px 12px;
    border: 1px solid transparent;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
    color: #666;
}

.image-style-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(var(--primary-color), 0.05);
}

.image-style-btn.active {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

.image-style-btn.active:hover {
    background: var(--primary-color);
    opacity: 0.9;
}

/* 图片提示词输入框样式 */
.image-prompt-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.4;
    resize: vertical;
    min-height: 60px;
    transition: border-color 0.2s;
}

.image-prompt-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

/* 图片风格链接样式 */
.image-style-link {
    text-decoration: none;
    margin: 0 4px;
    padding: 2px 4px;
    border-radius: 3px;
    transition: all 0.2s;
}

.image-style-link:hover {
    background-color: rgba(var(--primary-color), 0.1);
    color: var(--primary-color);
    text-decoration: underline;
}

/* 悬停时恢复图标完全不透明度 */
.image-style-link:hover span {
    opacity: 1 !important;
}

.image-style-link.active {
    background-color: rgba(var(--primary-color), 0.2);
    color: var(--primary-color);
    font-weight: bold;
}

/* 激活时恢复图标完全不透明度 */
.image-style-link.active span {
    opacity: 1 !important;
}

.image-position-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    opacity: 0.9;
    transform: translateY(-1px);
}

.image-position-btn.active {
    background: var(--primary-color) !important;
    color: white !important;
    border-color: var(--primary-color) !important;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .card-images-grid.two-images {
        grid-template-columns: 1fr;
    }
}

/* 图片标记样式 */
.image-marker {
    display: inline-block;
    background: #e3f2fd;
    color: #1976d2;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    margin: 0 2px;
    border: 1px solid #bbdefb;
}

/* 图片预览模式 */
.card.preview-mode .image-marker {
    display: none;
}

/* 图片生成进度 */
.image-generation-progress {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    z-index: 10;
}

/* 图片质量选择 */
.image-quality-selector {
    margin-top: 8px;
}

.image-quality-selector label {
    font-size: 12px;
    color: #666;
    margin-right: 8px;
}

.image-quality-selector select {
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
}

/* 图片缓存指示器 */
.image-cache-indicator {
    position: absolute;
    top: 4px;
    right: 4px;
    background: #4caf50;
    color: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 图片替换按钮 */
.image-replace-btn {
    position: absolute;
    top: 4px;
    left: 4px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 10px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
}

.card-image:hover .image-replace-btn {
    opacity: 1;
}

/* 图片标题和描述 */
.image-caption {
    font-size: 11px;
    color: #666;
    text-align: center;
    margin-top: 4px;
    font-style: italic;
}

/* 图片水印 */
.image-watermark {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(255, 255, 255, 0.9);
    padding: 2px 4px;
    border-radius: 2px;
    font-size: 8px;
    color: #666;
}

/* 图片拖拽排序 */
.card-image.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
}

.card-image.drop-target {
    border: 2px dashed var(--primary-color);
    background: rgba(var(--primary-color-rgb), 0.1);
}

/* 图片编辑工具栏 */
.image-toolbar {
    position: absolute;
    top: -30px;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px;
    border-radius: 4px;
    display: none;
    justify-content: center;
    gap: 8px;
}

.card-image:hover .image-toolbar {
    display: flex;
}

.image-toolbar button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 2px;
    font-size: 10px;
}

.image-toolbar button:hover {
    background: rgba(255, 255, 255, 0.2);
}