/* 图画变故事模块样式 */

/* 返回按钮 */
.back-btn {
    position: fixed;
    top: 12px;
    left: 12px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: var(--shadow-sm);
    z-index: 101;
    transition: all var(--transition-fast);
}

.back-btn:active {
    transform: scale(0.9);
}

/* 故事模块容器 */
.story-container {
    padding: var(--spacing-md);
    padding-bottom: calc(var(--spacing-xl) * 2);
}

/* 步骤指示器 */
.step-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
    padding: var(--spacing-md) 0;
}

.step-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--border-color);
    transition: all var(--transition-normal);
}

.step-dot.active {
    background: var(--primary-color);
    transform: scale(1.3);
}

.step-dot.completed {
    background: var(--secondary-color);
}

/* 步骤区域 */
.story-step {
    display: none;
    animation: fadeIn var(--transition-normal);
}

.story-step.active {
    display: block;
}

.step-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

/* 图片上传区域 */
.upload-area {
    background: var(--card-bg);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    margin-bottom: var(--spacing-md);
}

.upload-area:active {
    border-color: var(--primary-color);
    background: rgba(255, 107, 107, 0.05);
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: var(--spacing-md);
}

.upload-text {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
}

.upload-hint {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

#imageInput {
    display: none;
}

/* 图片预览 */
.image-preview {
    display: none;
    position: relative;
    margin-bottom: var(--spacing-md);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.image-preview.show {
    display: block;
}

.preview-img {
    width: 100%;
    height: auto;
    max-height: 300px;
    object-fit: contain;
    background: #000;
}

.remove-img-btn {
    position: absolute;
    top: var(--spacing-sm);
    right: var(--spacing-sm);
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

/* 标签选择器 */
.tag-selector {
    margin-bottom: var(--spacing-lg);
}

.selector-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
}

.tag-options {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.tag-option {
    flex: 0 0 calc(33.333% - var(--spacing-sm));
    padding: var(--spacing-md);
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tag-option:active {
    transform: scale(0.95);
}

.tag-option.selected {
    border-color: var(--primary-color);
    background: rgba(255, 107, 107, 0.1);
}

.tag-emoji {
    font-size: 2rem;
    display: block;
    margin-bottom: var(--spacing-xs);
}

.tag-label {
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* 故事预览 */
.story-preview {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--spacing-md);
    min-height: 200px;
}

.story-text {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text-primary);
    white-space: pre-line;
}

.story-paragraph {
    margin-bottom: var(--spacing-md);
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 封面预览 */
.cover-preview {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.cover-canvas-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 100%; /* 1:1 比例 */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: var(--radius-md);
    overflow: hidden;
}

#coverCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* 按钮组 */
.btn-group {
    display: flex;
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

.btn-group .btn {
    flex: 1;
}

/* 贴纸动画 */
.sticker {
    position: absolute;
    font-size: 3rem;
    animation: stickerFloat 3s ease-in-out infinite;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2));
}

@keyframes stickerFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-10px) rotate(5deg);
    }
}

.sticker:nth-child(1) { top: 10%; left: 10%; animation-delay: 0s; }
.sticker:nth-child(2) { top: 15%; right: 15%; animation-delay: 0.5s; }
.sticker:nth-child(3) { bottom: 20%; left: 20%; animation-delay: 1s; }
.sticker:nth-child(4) { bottom: 15%; right: 10%; animation-delay: 1.5s; }

/* 响应式调整 */
@media (max-width: 375px) {
    .tag-option {
        flex: 0 0 calc(50% - var(--spacing-sm));
    }
    
    .tag-emoji {
        font-size: 1.5rem;
    }
}
