/*
 * @file templates.css
 * @description 范米花儿的网站模版，Trae搭建，仅供学习使用
 * @author 范米花儿
 * @copyright 范米花儿
 */

/* 字体定义 */
@font-face {
    font-family: 'AlimamaShuHeiTi-Bold';
    src: url('assets/fonts/AlimamaShuHeiTi-Bold.ttf') format('truetype');
}

/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 基础样式设置 */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #1D2129;
}

p {
    color: #4E5969;
}

/* 页面头部样式 */
.header {
    color: #1D2129;
    padding: 1rem 0;
    min-height: 2vh;
    display: flex;
    flex-direction: column;
}

.main-content {
    padding-top: 120px; /* 增加上边距以避免内容被固定导航栏遮挡 */
}

/* 导航栏样式 */
.nav-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
    height: 70px;
    background: linear-gradient(120deg, rgba(255, 255, 255, 0.9), rgba(197, 214, 255, 0.3));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(22, 93, 255, 0.1);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* Logo样式 */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    fill: #165DFF;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: bold;
    color: #1D2129;
}

/* 导航菜单样式 */
.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-menu a {
    color: #1D2129;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s;
}

.nav-menu a:hover {
    color: #165DFF;
    text-decoration: underline;
}

.nav-menu a.active {
    color: #165DFF;
    text-decoration: none;
}

/* 登录按钮样式 */
.nav-menu .login-button {
    display: inline-block;
    padding: 8px 16px;
    background-color: transparent;
    color: #165DFF !important;
    text-decoration: none;
    border-radius: 4px;
    border: 1px solid #165DFF;
    transition: all 0.3s;
}

.nav-menu .login-button:hover {
    background-color: #165DFF;
    color: #ffffff !important;
    text-decoration: none !important;
}

/* 主内容区域样式 */
.main-content {
    padding-top: 70px;
    background: linear-gradient(180deg, rgba(222, 237, 255, 0.9) 0%, rgba(255, 255, 255, 0.95) 100%);
}

/* 模版展示区域样式 */
.templates-showcase {
    padding: 40px 0;
}

/* 模版网格布局 */
.template-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 20px;
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* 响应式布局 */
@media (max-width: 1200px) {
    .template-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .template-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .template-grid {
        grid-template-columns: 1fr;
    }
    
    .template-categories {
        flex-wrap: wrap;
        gap: 16px;
    }
}

.template-grid[style*="display: none"] {
    opacity: 0;
}

/* 模版卡片样式 */
.template-card {
    background:#ffffff;
    border: 1px solid #165cff1a;
    border-radius: 12px;
    padding: 12px 12px 8px 12px;
    transition: all 0.3s ease;
    position: relative;
}

.hot-tag {
    position: absolute;
    top: -1px;
    left: -1px;
    background-color: #ff4d4f;
    color: white;
    padding: 4px 12px;
    border-radius: 10px 0px;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 2px 6px rgba(255, 77, 79, 0.3);
    z-index: 1;
}

.template-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(22, 93, 255, 0.15);
    background: linear-gradient(180deg, rgba(22, 92, 255, 0.173), #ffffff);
    border: 1px solid #165DFF;
}

/* 添加新的模版预览图样式 */
.template-preview {
    width: 100%;
    height: 130px;
    margin-bottom: 16px;
    border-radius: 8px;
    overflow: hidden;
}

.template-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

/* 添加图片悬停效果 */
.template-card:hover .template-preview img {
    transform: scale(1.05);
}

/* 模版信息 */
.template-info {
    padding: 4px;
    text-align: center;
}

.template-info h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: #1D2129;
    text-align: center;
}

.template-info p {
    font-size: 14px;
    color: #4E5969;
    margin-bottom: 16px;
    text-align: center;
}

/* 模版特性标签 */
.template-features {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    justify-content: center;
}

.feature-tag {
    margin-top: 12px;
    padding: 4px 12px;
    background-color: rgba(22, 93, 255, 0.1);
    color: #165DFF;
    border-radius: 12px;
    font-size: 12px;
}

/* 模版按钮 */
.template-cta {
    display: inline-flex;
    align-items: center;
    color: #165DFF;
    text-decoration: none;
    font-size: 14px;
    transition: gap 0.3s ease;
    gap: 4px;
}

.template-cta:hover {
    gap: 8px;
}

/* 响应式布局 */
@media (max-width: 1200px) {
    .template-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .template-grid {
        grid-template-columns: 1fr;
    }
    
    .template-categories {
        flex-wrap: wrap;
        gap: 16px;
    }
}

.section-block {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 区块标题样式 */
.section-title {
    margin-bottom: 40px;
    text-align: center;
}

.section-title h2 {
    font-family: 'AlimamaShuHeiTi-Bold', sans-serif;
    font-size: 40px;
    margin-bottom: 12px;
    color: #1D2129;
}

.section-title h2 .highlight {
    color: #165DFF;
    position: relative;
    display: inline-block;
    padding-bottom: 2px;
}

.section-title h2 .highlight::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(22, 93, 255, 0.1);
    border-radius: 4px;
}

.section-title p {
    font-size: 16px;
    color: #4E5969;
}

/* 模版分类导航样式 */
.template-categories {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
}

.category-item {
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    color: #4E5969;
}

.category-item:hover {
    color: #165DFF;
    background-color: rgba(22, 93, 255, 0.1);
}

.category-item.active {
    color: #165DFF;
    background-color: rgba(22, 93, 255, 0.1);
}

/* 搜索框样式 */
.template-search {
    margin: 24px 0;
    display: flex;
    justify-content: center;
}

.search-container {
    position: relative;
    width: 100%;
    max-width: 480px;
}

.search-input {
    width: 100%;
    padding: 12px 40px 12px 44px;
    border: 1px solid #E5E6EB;
    border-radius: 24px;
    font-size: 16px;
    color: #1D2129;
    transition: all 0.3s ease;
    background-color: #ffffff;
}

.clear-button {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: #86909C;
    cursor: pointer;
    display: none;
    padding: 0;
    background: none;
    border: none;
    outline: none;
}

.clear-button:hover {
    color: #165DFF;
}

.clear-button.visible {
    display: block;
}

.search-input:focus {
    outline: none;
    border-color: #165DFF;
    box-shadow: 0 0 0 2px rgba(22, 93, 255, 0.1);
}

.search-input::placeholder {
    color: #86909C;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: #86909C;
    pointer-events: none;
    transition: color 0.3s ease;
}

.search-input:focus + .search-icon {
    color: #165DFF;
}

/* 页脚样式 */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(197, 214, 255, 0.3));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 1rem 0;
    text-align: center;
    z-index: 100;
}

.footer p {
    margin: 0;
    color: #4E5969;
}

/* 为底部内容添加边距，避免被固定footer遮挡 */
.main-content {
    padding-bottom: 60px;
}

/* 响应式布局适配 */
@media (max-width: 768px) {
    .search-container {
        max-width: 100%;
        margin: 0 16px;
    }

    .search-input {
        padding: 12px 40px;
    }

    .search-icon {
        left: 12px;
    }

    .clear-button {
        right: 12px;
    }
}
/* 响应式布局样式 - 针对移动设备的样式调整 */
@media (max-width: 768px) {
    /* 导航容器响应式调整 - 改为垂直布局以适应小屏幕 */
    .nav-container {
        flex-direction: column;
        height: auto;
        padding: 1rem 5%;
    }

    /* 导航菜单响应式调整 - 优化移动端显示效果和间距 */
    .nav-menu {
        margin-top: 1rem;
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }

    /* 主标题响应式调整 - 减小字体大小以适应移动端显示 */
    .hero-section h1 {
        font-size: 2rem;
    }

    /* 主标题描述文本响应式调整 - 优化移动端文本大小 */
    .hero-section p {
        font-size: 1rem;
    }

    /* 内容区域响应式调整 - 减小内边距以优化移动端空间利用 */
    section {
        padding: 3rem 5%;
    }

    /* 二级标题响应式调整 - 调整字体大小以保持移动端的视觉层次 */
    h2 {
        font-size: 2rem;
    }
}