/* ========================================
   AI智能工具箱 - 自定义样式
   ======================================== */

/* 暗色/亮色主题切换的过渡效果 */
html {
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* 工具卡片悬停效果 */
.tool-card {
    position: relative;
    overflow: hidden;
    border: 1px solid transparent;
}

.tool-card:not(.opacity-60):hover {
    border-color: rgba(147, 112, 219, 0.3);
    transform: translateY(-4px);
}

/* 广告位样式 */
.ad-banner-top {
    background: linear-gradient(to right, #f5f5f5, #e0e0e0);
    padding: 8px;
    text-align: center;
}

.dark .ad-banner-top {
    background: linear-gradient(to right, #1f1f1f, #2a2a2a);
}

.ad-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f0f0f0 0%, #e8e8e8 100%);
    border: 2px dashed #d0d0d0;
    border-radius: 8px;
    min-height: 90px;
    font-size: 14px;
    margin: 0 auto;
    max-width: 100%;
}

.ad-placeholder[data-size="728x90"] {
    width: 728px;
    height: 90px;
}

.ad-placeholder[data-size="300x250"] {
    width: 300px;
    height: 250px;
}

.dark .ad-placeholder {
    background: linear-gradient(135deg, #2a2a2a 0%, #1f1f1f 100%);
    border-color: #404040;
}

/* 响应式广告位 */
@media (max-width: 768px) {
    .ad-placeholder[data-size="728x90"] {
        width: 100%;
        max-width: 320px;
        height: 50px;
    }
    
    .ad-placeholder[data-size="300x250"] {
        width: 100%;
        max-width: 300px;
        height: 250px;
    }
}

/* Hero区域渐变背景 */
.hero-gradient {
    background: linear-gradient(135deg, 
        rgba(102, 126, 234, 0.1) 0%, 
        rgba(118, 75, 162, 0.1) 50%,
        rgba(102, 126, 234, 0.1) 100%);
}

.dark .hero-gradient {
    background: linear-gradient(135deg, 
        rgba(102, 126, 234, 0.05) 0%, 
        rgba(118, 75, 162, 0.05) 50%,
        rgba(102, 126, 234, 0.05) 100%);
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.dark ::-webkit-scrollbar-track {
    background: #1f2937;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.dark ::-webkit-scrollbar-thumb {
    background: #4b5563;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

/* 搜索框聚焦效果 */
#search-input:focus {
    box-shadow: 0 0 0 4px rgba(147, 112, 219, 0.1);
}

.dark #search-input:focus {
    box-shadow: 0 0 0 4px rgba(147, 112, 219, 0.2);
}

/* 工具卡片图标动画 */
.tool-card:not(.opacity-60) .group-hover\:scale-110 {
    transition: transform 0.3s ease;
}

/* 渐变文字动画 */
@keyframes gradient-shift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.animate-gradient {
    background-size: 200% 200%;
    animation: gradient-shift 3s ease infinite;
}

/* 移动端菜单动画 */
#mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

#mobile-menu.show {
    max-height: 200px;
}

/* 上传区域样式 */
.upload-zone {
    border: 2px dashed #d1d5db;
    border-radius: 16px;
    padding: 48px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: linear-gradient(135deg, #fafafa 0%, #f5f5f5 100%);
}

.dark .upload-zone {
    border-color: #4b5563;
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
}

.upload-zone i {
    font-size: 48px;
    color: #9ca3af;
    margin-bottom: 16px;
}

.upload-zone h3 {
    color: #374151;
    font-size: 18px;
    margin-bottom: 8px;
}

.dark .upload-zone h3 {
    color: #f3f4f6;
}

.upload-zone p {
    color: #9ca3af;
    font-size: 14px;
}

/* 预览区域样式 */
.preview-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 768px) {
    .preview-container {
        grid-template-columns: 1fr;
    }
}

.preview-box {
    background: #f9fafb;
    border-radius: 16px;
    padding: 24px;
    text-align: center;
}

.dark .preview-box {
    background: #1f2937;
}

.preview-box img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    object-fit: contain;
}

.preview-label {
    margin-top: 12px;
    font-size: 14px;
    color: #6b7280;
}

.dark .preview-label {
    color: #9ca3af;
}

/* 按钮样式 */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.dark .btn-secondary {
    background: #374151;
    color: #f9fafb;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

.dark .btn-secondary:hover {
    background: #4b5563;
}

/* 设置面板样式 */
.settings-panel {
    background: #f9fafb;
    border-radius: 16px;
    padding: 24px;
}

.dark .settings-panel {
    background: #1f2937;
}

.setting-group {
    margin-bottom: 20px;
}

.setting-group:last-child {
    margin-bottom: 0;
}

.setting-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.dark .setting-label {
    color: #f3f4f6;
}

.setting-select {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    color: #374151;
}

.dark .setting-select {
    background: #374151;
    border-color: #4b5563;
    color: #f3f4f6;
}

.setting-checkbox {
    display: flex;
    align-items: center;
    gap: 12px;
}

.setting-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #667eea;
}

/* 进度条样式 */
.progress-container {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin: 16px 0;
}

.dark .progress-container {
    background: #374151;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* 图层树样式 */
.layer-tree {
    background: #1e1e1e;
    border-radius: 12px;
    padding: 16px;
    max-height: 400px;
    overflow-y: auto;
}

.layer-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    margin-bottom: 4px;
    background: #2d2d2d;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.layer-item:hover {
    background: #3d3d3d;
}

.layer-item.selected {
    background: #667eea;
}

.layer-item.hidden {
    opacity: 0.5;
}

.layer-icon {
    width: 24px;
    height: 24px;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a0a0a0;
}

.layer-name {
    flex: 1;
    color: #e0e0e0;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.layer-toggle {
    color: #a0a0a0;
    cursor: pointer;
    margin-right: 8px;
}

.layer-toggle:hover {
    color: #ffffff;
}

/* 颜色选择器 */
.color-picker {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.color-option {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.2s;
}

.color-option:hover {
    transform: scale(1.1);
}

.color-option.selected {
    border-color: #667eea;
}

/* Toast通知样式 */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 16px 24px;
    background: #374151;
    color: white;
    border-radius: 12px;
    font-size: 14px;
    z-index: 1000;
    animation: slideIn 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.toast.success {
    background: #10b981;
}

.toast.error {
    background: #ef4444;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 加载动画 */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 模态框样式 */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    dark:bg-gray-800;
    border-radius: 16px;
    padding: 24px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s;
}

.modal-overlay.show .modal-content {
    transform: scale(1);
}

/* 响应式优化 */
@media (max-width: 640px) {
    .upload-zone {
        padding: 32px 16px;
    }
    
    .upload-zone i {
        font-size: 36px;
    }
    
    .preview-box {
        padding: 16px;
    }
}

/* 平滑滚动 */
html {
    scroll-behavior: smooth;
}

/* 焦点样式优化 */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}
