/* 自定义样式，补充 Tailwind CSS */

/* 美化滚动条 */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #1f1d2b;
}

::-webkit-scrollbar-thumb {
    background: #9932CC;
    border-radius: 6px;
    border: 2px solid #1f1d2b;
}

::-webkit-scrollbar-thumb:hover {
    background: #7B2D9D;
}

/* 平滑滚动 */
html {
    scroll-behavior: smooth;
}

/* 渐变文本效果 */
.gradient-text {
    background: linear-gradient(90deg, #9932CC, #9F2BC1, #B625B1, #D01F9E);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: gradient 8s ease infinite;
    background-size: 300% 300%;
}

@keyframes gradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* 图片悬停效果 */
.image-hover {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    will-change: transform;
}

.image-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(153, 50, 204, 0.4);
}

/* 自定义输入框焦点效果 */
textarea:focus, select:focus, input:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(153, 50, 204, 0.5);
}

/* 优化 range 滑块样式 */
input[type="range"] {
    height: 6px;
    appearance: none;
    background: #4B0082;
    border-radius: 6px;
    background-image: linear-gradient(#9932CC, #9932CC);
    background-repeat: no-repeat;
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #9932CC;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(153, 50, 204, 0.5);
    transition: all 0.15s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    background: #B625B1;
}

/* 加载动画 */
.loading {
    display: inline-block;
    position: relative;
    width: 80px;
    height: 80px;
}

.loading:after {
    content: " ";
    display: block;
    border-radius: 50%;
    width: 0;
    height: 0;
    margin: 8px;
    box-sizing: border-box;
    border: 32px solid #9932CC;
    border-color: #9932CC transparent #9932CC transparent;
    animation: loading 1.2s infinite;
}

@keyframes loading {
    0% {
        transform: rotate(0);
        animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
    }
    50% {
        transform: rotate(900deg);
        animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
    }
    100% {
        transform: rotate(1800deg);
    }
}

/* 卡片悬停效果 */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(75, 0, 130, 0.2);
}

/* 背景星星效果 */
.night-bg {
    background: radial-gradient(ellipse at bottom, #1B2735 0%, #090A0F 100%);
    position: relative;
    overflow: hidden;
}

.stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.star {
    position: absolute;
    background-color: white;
    border-radius: 50%;
    opacity: 0.5;
    animation: twinkle var(--duration) infinite ease-in-out;
    animation-delay: var(--delay);
}

@keyframes twinkle {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 1; }
}

/* 按钮悬停效果 */
.btn-glow:hover {
    box-shadow: 0 0 20px rgba(153, 50, 204, 0.8);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .container {
        padding-left: 16px;
        padding-right: 16px;
    }
    
    h1 {
        font-size: 2.5rem;
    }
    
    h2 {
        font-size: 1.8rem;
    }
}

/* 生成结果容器 */
.generated-image-container {
    position: relative;
    overflow: hidden;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    will-change: transform;
}

.generated-image-container:hover .image-overlay {
    opacity: 1;
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(75, 0, 130, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* 闪烁动画 */
@keyframes pulse-slow {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

.animate-pulse-slow {
    animation: pulse-slow 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* 浮动效果 */
@keyframes float {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
    100% {
        transform: translateY(0px);
    }
}

.floating {
    animation: float 5s ease-in-out infinite;
}

/* 打字效果 */
.typing-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background-color: currentColor;
    margin-left: 2px;
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* 页面过渡动画 */
.page-transition-fade {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 轮播样式 */
.carousel {
    position: relative;
    overflow: hidden;
}

.carousel-inner {
    display: flex;
    transition: transform 0.5s ease;
}

.carousel-item {
    flex: 0 0 100%;
}

/* 标签页样式 */
.tabs {
    display: flex;
    border-bottom: 1px solid rgba(153, 50, 204, 0.3);
}

.tab {
    padding: 10px 20px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.tab.active {
    border-color: #9932CC;
}

/* 美化选择器样式 */
select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%239932CC' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 20px;
    padding-right: 30px !important;
}

/* 生成结果新增样式 */
/* 图像加载效果 */
.generated-image-container img {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.generated-image-container img.loaded {
    opacity: 1;
}

/* 图像卡片反馈效果 */
.generated-image-container .feedback-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #9932CC;
    margin-right: 4px;
}

/* 生成中图像骨架屏样式 */
.image-skeleton {
    background: linear-gradient(
        100deg,
        rgba(255, 255, 255, 0) 40%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0) 60%
    );
    background-size: 200% 100%;
    background-position-x: 180%;
    animation: 1.5s skeleton-loading ease-in-out infinite;
}

@keyframes skeleton-loading {
    to {
        background-position-x: -20%;
    }
}

/* 图像加载进度UI */
.image-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    background-color: #9932CC;
    transition: width 0.3s ease;
}

/* 图像水印样式 */
.image-watermark {
    position: absolute;
    bottom: 12px;
    right: 12px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    padding: 4px 8px;
    border-radius: 4px;
    background-color: rgba(0, 0, 0, 0.4);
    pointer-events: none;
}

/* 图像缩放查看效果 */
.image-zoom-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.image-zoom-modal.active {
    opacity: 1;
    pointer-events: all;
}

.image-zoom-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
}

.image-zoom-content img {
    max-width: 100%;
    max-height: 90vh;
    border: 2px solid #9932CC;
    border-radius: 8px;
}

.image-zoom-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

/* 生成历史记录样式 */
.history-item {
    border-left: 3px solid #9932CC;
    transition: all 0.2s ease;
}

.history-item:hover {
    background-color: rgba(153, 50, 204, 0.1);
}

/* 复制提示词按钮样式 */
.copy-prompt {
    position: absolute;
    right: 8px;
    top: 8px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border-radius: 4px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.prompt-container:hover .copy-prompt {
    opacity: 1;
}

/* 添加生成参数标签样式 */
.generation-tag {
    display: inline-block;
    background-color: rgba(153, 50, 204, 0.2);
    color: #9932CC;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 11px;
    margin-right: 6px;
    white-space: nowrap;
}

/* 错误状态闪烁效果 */
@keyframes error-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
}

.error-pulse {
    animation: error-pulse 2s infinite;
}

/* 成功生成闪烁效果 */
@keyframes success-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(153, 50, 204, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(153, 50, 204, 0); }
}

.success-pulse {
    animation: success-pulse 2s infinite;
}

/* 提示词输入智能建议样式 */
.prompt-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #1f1d2b;
    border: 1px solid #4B0082;
    border-radius: 0 0 8px 8px;
    z-index: 10;
    max-height: 200px;
    overflow-y: auto;
}

.suggestion-item {
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.suggestion-item:hover, .suggestion-item.active {
    background-color: rgba(153, 50, 204, 0.2);
}

/* 生成样式选择器 */
.style-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.style-option {
    padding: 6px 12px;
    border-radius: 20px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    background-color: #2d2b3a;
}

.style-option:hover {
    border-color: #9932CC80;
}

.style-option.active {
    border-color: #9932CC;
    background-color: rgba(153, 50, 204, 0.2);
}

/* 自定义提示词标签样式 */
.prompt-tag {
    display: inline-flex;
    align-items: center;
    background-color: rgba(153, 50, 204, 0.2);
    border-radius: 16px;
    padding: 4px 10px;
    margin: 3px;
    font-size: 12px;
    color: #fff;
    max-width: 100%;
}

.prompt-tag-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.prompt-tag-remove {
    margin-left: 6px;
    width: 16px;
    height: 16px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.prompt-tag-remove:hover {
    background-color: rgba(255, 255, 255, 0.5);
} 