/* FoodAI - 外卖菜品AI作图平台 自定义样式 */

:root {
    --brand-primary: #7c3aed;
    --brand-secondary: #f97316;
    --brand-gradient: linear-gradient(135deg, #7c3aed 0%, #f97316 100%);
    --brand-gradient-hover: linear-gradient(135deg, #6d28d9 0%, #ea580c 100%);
}

/* 全局基础 */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* 品牌渐变文字 */
.brand-text {
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 品牌渐变背景 */
.brand-gradient {
    background: var(--brand-gradient);
}

.brand-gradient-hover:hover {
    background: var(--brand-gradient-hover);
}

/* 玻璃态效果 */
.glass {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* 导航栏 */
.nav-blur {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* 按钮动效 */
.btn-brand {
    background: var(--brand-gradient);
    color: white;
    border: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

.btn-brand:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4);
}

.btn-brand:active {
    transform: translateY(0);
}

/* 卡片悬浮效果 */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
}

/* 生成动画 */
@keyframes pulse-ring {
    0% { transform: scale(0.5); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

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

.generating-pulse {
    animation: pulse-ring 1.5s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

.shimmer {
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

/* 图片网格 */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.image-grid .image-card {
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 12px;
    position: relative;
}

.image-grid .image-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.image-grid .image-card:hover img {
    transform: scale(1.05);
}

.image-grid .image-card .overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: flex-end;
    padding: 16px;
}

.image-grid .image-card:hover .overlay {
    opacity: 1;
}

/* VIP 徽章 */
.vip-badge {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* 价格标签 */
.price-tag {
    position: relative;
}

.price-tag::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--brand-gradient);
    border-radius: 2px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem !important;
    }
    .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 10px;
    }
}

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

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* 图片预览模态 */
.image-preview-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

.image-preview-modal img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
}

/* Toast 通知 */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast-item {
    padding: 12px 20px;
    border-radius: 10px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    animation: slideInRight 0.3s ease-out;
}

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

/* 标签选择器 */
.tag-selector .tag {
    padding: 6px 16px;
    border-radius: 9999px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid #e5e7eb;
    color: #6b7280;
}

.tag-selector .tag:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}

.tag-selector .tag.active {
    background: var(--brand-gradient);
    border-color: transparent;
    color: white;
}

/* 加载骨架 */
.skeleton {
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 8px;
}

/* 管理后台侧边栏 */
.admin-sidebar {
    scrollbar-width: thin;
    scrollbar-color: #4b5563 transparent;
}

.admin-sidebar::-webkit-scrollbar {
    width: 4px;
}

.admin-sidebar::-webkit-scrollbar-thumb {
    background: #4b5563;
    border-radius: 2px;
}

/* 管理后台侧边栏项 */
.sidebar-item {
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.sidebar-item:hover {
    background: rgba(124, 58, 237, 0.1);
    border-left-color: rgba(124, 58, 237, 0.3);
}

.sidebar-item.active {
    background: rgba(124, 58, 237, 0.15);
    border-left-color: #7c3aed;
    color: #7c3aed;
}

/* 表格行选中 */
.table-row-selected {
    background-color: #f5f3ff !important;
}

/* 数据卡片动效 */
.stat-card {
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

/* Alpine cloak */
[x-cloak] {
    display: none !important;
}
