/* Tailwind CSS 配置 */
@tailwind base;
@tailwind components;
@tailwind utilities;

/* 自定义工具类 */
@layer utilities {
    .content-auto {
        content-visibility: auto;
    }
    .text-shadow {
        text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    .card-hover {
        transition: all 0.3s ease;
    }
    .card-hover:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    }
    .logo-hover {
        transition: all 0.3s ease;
    }
    .logo-hover:hover {
        transform: scale(1.05);
    }
}

/* 全局样式 */
body {
    font-family: 'Inter', system-ui, sans-serif;
    background-color: #F9FAFB;
}

/* 导航链接样式 */
.nav-link {
    position: relative;
    transition: all 0.3s ease;
    padding: 0.5rem 0;
    font-size: 0.95rem;
    font-weight: 500;
    color: #4B5563;
}

.nav-link:hover {
    color: #3B82F6;
    transform: translateY(-1px);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #3B82F6;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.nav-link.active {
    color: #3B82F6;
    font-weight: 600;
}

.nav-link.active::after {
    width: 100%;
}

/* 搜索框样式 */
.search-input {
    transition: all 0.3s ease;
    border: 1px solid #E5E7EB;
    padding: 0.6rem 1rem;
}

.search-input:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    border-color: #3B82F6;
}

.search-btn {
    transition: all 0.3s ease;
    padding: 0.5rem;
}

.search-btn:hover {
    transform: scale(1.1);
    color: #3B82F6;
}

/* 导航栏样式 */
header {
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

.header-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: #3B82F6;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.logo:hover {
    transform: scale(1.05);
}

.search-container {
    flex: 1;
    min-width: 200px;
    max-width: 400px;
    margin: 0;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin: 0;
    flex-shrink: 0;
}

/* 响应式调整 */
@media (max-width: 1024px) {
    .search-container {
        max-width: 300px;
    }
    
    .nav-container ul {
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-container {
        width: 100%;
        max-width: none;
        margin: 0.5rem 0;
    }
    
    .nav-container {
        width: 100%;
        justify-content: center;
        margin-top: 0.5rem;
    }
    
    .nav-container ul {
        gap: 0.75rem;
    }
    
    .login-btn,
    .register-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
        margin: 0 0.25rem;
    }
    
    .logo {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .nav-container ul {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .nav-link {
        font-size: 0.85rem;
    }
    
    .login-btn,
    .register-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .header-container {
        padding: 0.75rem 0;
    }
}

/* 登录注册按钮样式 */
.login-btn {
    background-color: white;
    border: 2px solid #3B82F6;
    color: #3B82F6;
    padding: 0.6rem 1.25rem;
    border-radius: 0.5rem;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-left: 1rem;
    position: relative;
    overflow: hidden;
    z-index: 1;
    display: inline-block;
    white-space: nowrap;
}

.login-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background-color: rgba(59, 130, 246, 0.1);
    transition: all 0.3s ease;
    z-index: -1;
}

.login-btn:hover::before {
    left: 0;
}

.login-btn:hover {
    background-color: #3B82F6;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.4);
}

.register-btn {
    background-color: #3B82F6;
    color: white;
    padding: 0.6rem 1.25rem;
    border-radius: 0.5rem;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
    position: relative;
    overflow: hidden;
    z-index: 1;
    display: inline-block;
    white-space: nowrap;
    margin-left: 0.5rem;
}

.register-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    z-index: -1;
}

.register-btn:hover::before {
    left: 0;
}

.register-btn:hover {
    background-color: #2563EB;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.5);
}

/* 导航菜单调整 */
.nav-container ul {
    align-items: center;
}

/* 响应式按钮调整 */
@media (max-width: 768px) {
    .login-btn,
    .register-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
        margin: 0 0.25rem;
    }
    
    .nav-container ul {
        gap: 0.5rem;
    }
}

/* 页脚样式 */
footer {
    background-color: #1F2937;
    color: white;
    padding: 2rem 0;
    margin-top: 2.5rem;
}

.footer-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    align-items: start;
}

/* 优化底部布局 */
.footer-container > div:first-child {
    grid-column: span 1;
}

.footer-container > div:nth-child(2),
.footer-container > div:nth-child(3) {
    grid-column: span 1;
}

/* 确保在大屏幕上布局合理 */
@media (min-width: 1024px) {
    .footer-container {
        grid-template-columns: 1.4fr 1fr 1fr;
        gap: 1.75rem;
    }
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.footer-logo i {
    margin-right: 0.6rem;
    color: #3B82F6;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.footer-links a {
    color: #D1D5DB;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    padding: 0.2rem 0;
}

.footer-links a:hover {
    color: #3B82F6;
    transform: translateX(6px);
}

.footer-bottom {
    border-top: 1px solid #374151;
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    text-align: center;
    color: #9CA3AF;
    font-size: 0.85rem;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1.25rem;
}

.social-links a {
    color: #D1D5DB;
    font-size: 1.25rem;
    transition: all 0.3s ease;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: rgba(59, 130, 246, 0.1);
}

.social-links a:hover {
    color: white;
    background-color: #3B82F6;
    transform: scale(1.1);
}

/* 底部标题样式 */
.footer-container h3 {
    font-size: 1rem;
    font-weight: 600;
    color: white;
    margin-bottom: 1rem;
    position: relative;
    padding-bottom: 0.4rem;
}

.footer-container h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 35px;
    height: 2px;
    background-color: #3B82F6;
}

/* 底部描述文本 */
.footer-container p {
    color: #9CA3AF;
    line-height: 1.5;
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
}

/* 模态框样式 */
.modal {
    transition: all 0.3s ease;
}

.modal-content {
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式调整 */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.25rem;
    }
    
    .category-card {
        padding: 1rem;
    }
    
    .nav-container {
        justify-content: center;
    }
    
    .login-btn, .register-btn {
        padding: 0.4rem 1rem;
        font-size: 0.875rem;
    }
    
    /* 分类图标导航响应式调整 */
    .container .flex.justify-center .flex.space-x-8 {
        gap: 1rem;
    }
    
    .container .flex.justify-center .flex.space-x-8 .w-12.h-12 {
        width: 80px;
        height: 80px;
    }
    
    .container .flex.justify-center .flex.space-x-8 .text-xl {
        font-size: 0.9rem;
    }
    
    .container .flex.justify-center .flex.space-x-8 .text-sm {
        font-size: 0.7rem;
    }
    
    /* 底部响应式调整 */
    .footer-container {
        grid-template-columns: 1fr;
        gap: 1.75rem;
    }
    
    .footer-container > div {
        grid-column: span 1 !important;
    }
    
    .footer-logo {
        font-size: 1.4rem;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .footer-bottom {
        margin-top: 1.5rem;
        padding-top: 1.25rem;
    }
}

@media (max-width: 480px) {
    .footer-container {
        gap: 1.5rem;
    }
    
    .footer-logo {
        font-size: 1.3rem;
    }
    
    .footer-container h3 {
        font-size: 0.95rem;
    }
    
    .footer-links a {
        font-size: 0.85rem;
    }
    
    .social-links a {
        width: 34px;
        height: 34px;
        font-size: 1.15rem;
    }
    
    .footer-bottom {
        margin-top: 1.25rem;
        padding-top: 1rem;
    }
}

@media (max-width: 640px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .nav-links {
        gap: 0.5rem;
    }
    
    .nav-link {
        font-size: 0.875rem;
    }
    
    .logo {
        font-size: 1.25rem;
    }
    
    .footer-container {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .social-links {
        justify-content: center;
    }
}