.hero-bg {
    background-image: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)),
    url('../images/bg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}
.generate-btn {
    background: linear-gradient(135deg, #059669, #047857);
    transition: all 0.3s ease;
}
.generate-btn:hover {
    background: linear-gradient(135deg, #047857, #065f46);
    transform: translateY(-1px);
    box-shadow: 0 10px 25px rgba(5, 150, 105, 0.3);
}
.input-field {
    transition: all 0.3s ease;
}
.input-field:focus {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}
.get-started-btn {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background-color: white;
    border-radius: 9999px;
    border: 1px solid rgba(16, 185, 129, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
}
.get-started-btn:hover {
    border-color: rgba(16, 185, 129, 0.8);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2), 0 0 25px rgba(16, 185, 129, 0.15);
    background-color: rgba(255, 255, 255, 1);
    transform: translateY(-1px);
}
.mobile-menu {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-100%);
    opacity: 0;
    position: fixed;
    top: 56px;
    left: 0;
    width: 100%;
    z-index: 50;
}
.mobile-menu.show {
    transform: translateX(0);
    opacity: 1;
}
.menu-icon {
    transition: all 0.3s ease;
}
.menu-icon.open {
    transform: rotate(180deg);
}
.nav-link {
    white-space: nowrap;
    font-size: 0.75rem;
    gap: 0.2rem;
}
@media (min-width: 1024px) {
    .nav-link {
        font-size: 0.8rem;
        gap: 0.25rem;
    }
}
@media (min-width: 1280px) {
    .nav-link {
        font-size: 0.875rem;
        gap: 0.375rem;
    }
}
@media (min-width: 1536px) {
    .nav-link {
        font-size: 1rem;
        gap: 0.5rem;
    }
}
.nav-link svg {
    width: 0.6rem;
    height: 0.6rem;
    flex-shrink: 0;
}
@media (min-width: 1024px) {
    .nav-link svg {
        width: 0.65rem;
        height: 0.65rem;
    }
}
@media (min-width: 1280px) {
    .nav-link svg {
        width: 0.75rem;
        height: 0.75rem;
    }
}
@media (min-width: 1536px) {
    .nav-link svg {
        width: 1rem;
        height: 1rem;
    }
}

/* 高DPI显示器和缩放优化 */
@media (min-resolution: 144dpi), (min-resolution: 1.5dppx) {
    .nav-link {
        font-size: 0.7rem;
    }
    .nav-link svg {
        width: 0.55rem;
        height: 0.55rem;
    }
}

@media (min-resolution: 144dpi) and (min-width: 1280px),
(min-resolution: 1.5dppx) and (min-width: 1280px) {
    .nav-link {
        font-size: 0.8rem;
    }
    .nav-link svg {
        width: 0.65rem;
        height: 0.65rem;
    }
}

/* PC端按钮尺寸优化 */
@media (min-width: 1024px) {
    .get-started-btn {
        padding: 0.6rem 1rem;
        font-size: 0.875rem;
    }
}

@media (min-width: 1280px) {
    .get-started-btn {
        padding: 0.625rem 1.125rem;
        font-size: 0.875rem;
    }
}

/* 为高分辨率优化按钮文字 */
@media (min-resolution: 144dpi) and (max-width: 1536px),
(min-resolution: 1.5dppx) and (max-width: 1536px) {
    .get-started-btn {
        padding: 0.55rem 0.9rem;
        font-size: 0.8rem;
    }
}

/* 防止移动端水平滚动 */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* 确保所有元素不超出视窗宽度 */
* {
    box-sizing: border-box;
}

/* 移动端优化 */
@media (max-width: 640px) {
    .container, .max-w-5xl, .max-w-7xl {
        margin-left: auto;
        margin-right: auto;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* 确保文字不会溢出 */
    h1, h2, h3, h4, h5, h6, p {
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }

    /* 优化移动端间距 */
    .hero-bg {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
}
/* 回到顶部按钮样式 */
#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 40px;
    height: 40px;
    background: #059669;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease-in-out;
    z-index: 1000;
}

#back-to-top.show {
    opacity: 0.6;
    visibility: visible;
    transform: translateY(0);
}

#back-to-top:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
    opacity: 1;
}

#back-to-top svg {
    width: 20px;
    height: 20px;
    color: white;
}

/* 图片模态框样式 */
#image-modal {
    backdrop-filter: blur(8px);
}

#image-modal.show {
    animation: modalFadeIn 0.4s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(8px);
        transform: scale(1);
    }
}

/* 图片容器优化 */
#image-modal .image-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    min-width: 0;
}

/* 模态框图片样式 */
#modal-image {
    display: block;
    margin: auto;
    max-width: min(90vw, 1200px);
    max-height: min(90vh, 800px);
    width: auto !important;
    height: auto !important;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* 响应式优化 */
@media (max-width: 640px) {
    #modal-image {
        max-width: 95vw;
        max-height: 85vh;
        border-radius: 8px;
    }

    #image-modal {
        padding: 0.5rem;
    }
}

/* 下载按钮悬停效果 */
.recipe-download-btn:hover {
    transform: translateY(-2px) scale(1.08);
}

#download-image-modal:hover {
    transform: translateY(-1px) scale(1.05);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* 图片悬停缩放效果 */
#recipe-image img {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 模态框按钮样式 */
#close-image-modal,
#download-image-modal {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#close-image-modal:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* 底部下载按钮样式 */
#download-image-modal:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* 食谱图片下载按钮样式 */
.recipe-download-btn {
    z-index: 20 !important;
    position: absolute !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateZ(0); /* 启用硬件加速 */
}

.recipe-download-btn:hover {
    transform: translateY(-2px) scale(1.05) translateZ(0);
    background-color: rgba(255, 255, 255, 1) !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2) !important;
}

.recipe-download-btn:active {
    transform: translateY(0) scale(0.95) translateZ(0);
}

/* 响应式优化 */
@media (max-width: 640px) {
    .recipe-download-btn {
        bottom: 0.5rem !important;
        right: 0.5rem !important;
        padding: 0.5rem !important;
    }

    .recipe-download-btn svg {
        width: 1rem !important;
        height: 1rem !important;
    }

    #download-image-modal {
        bottom: 1rem;
        padding: 0.75rem;
    }

    #close-image-modal {
        top: 0.75rem;
        right: 0.75rem;
        padding: 0.625rem;
    }
}

/* 图片容器优化 */
#recipe-image {
    transition: all 0.3s ease;
}

#recipe-image:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

/* 确保下载按钮始终可见 */
#recipe-image .recipe-download-btn {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: absolute !important;
    z-index: 30 !important;
    pointer-events: auto !important;
}

/* 防止图片容器遮挡按钮 */
#recipe-image .relative {
    position: relative !important;
}

#recipe-image .overflow-hidden {
    overflow: hidden !important;
    border-radius: 1rem !important;
}

/* User Menu Styles */
#user-menu-btn {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

#user-menu-btn:hover {
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.15);
    background-color: rgba(255, 255, 255, 0.25) !important;
}

/* User avatar icon styling */
#user-menu-btn .w-8 {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#user-menu-btn:hover .w-8 {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

/* VIP badge pulse effect */
#user-menu-btn .absolute {
    animation: vipPulse 2s ease-in-out infinite;
}

@keyframes vipPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.9;
    }
}

#user-menu-dropdown {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(229, 231, 235, 0.8);
    animation: dropdownFadeIn 0.2s ease-out;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* User avatar in dropdown */
.user-avatar {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

/* VIP badge styling */
.vip-badge {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    animation: vipGlow 2s ease-in-out infinite alternate;
}

@keyframes vipGlow {
    from {
        box-shadow: 0 0 5px rgba(245, 158, 11, 0.4);
    }
    to {
        box-shadow: 0 0 15px rgba(245, 158, 11, 0.6);
    }
}

/* Hover effects for dropdown items */
#user-menu-dropdown a:hover {
    transform: translateX(4px);
    transition: all 0.2s ease;
}

#user-menu-dropdown a:hover svg {
    transform: scale(1.1);
    transition: transform 0.2s ease;
}

/* Sign out button special styling */
#user-menu-dropdown a[href*="logout"]:hover {
    background: linear-gradient(90deg, #fef2f2, #fee2e2);
    border-left: 3px solid #ef4444;
}

/* Mobile user menu styling */
.mobile-user-avatar {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

/* Responsive user menu adjustments */
@media (max-width: 1279px) {
    #user-menu-dropdown {
        width: 240px;
    }
}

@media (max-width: 640px) {
    #user-menu-dropdown {
        width: 220px;
        right: 1rem;
    }
}
