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

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-image: url('img/bjtp.jpg');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-position: center;
}

.container {
    width: 100%;
    margin: 0 auto;
    padding: 0 40px;
}

/* 合并导航栏和横幅 */
.navbar-banner {
    background: linear-gradient(rgba(129, 199, 132, 0.1), rgba(102, 187, 106, 0.1)), url('data:image/svg+xml,%3Csvg width="100" height="100" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"%3E%3Cpath d="M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z" fill="rgba(255,255,255,0.3)" fill-opacity="0.3" fill-rule="evenodd"/%3E%3C/svg%3E');
    color: black;
    padding: 40px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar-banner .container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.banner-content {
    display: flex;
    align-items: center;
    gap: 30px;
    justify-content: center;
    width: 100%;
}

.banner-content h2 {
    font-size: 36px;
    margin: 0;
    text-align: center;
}

.site-logo-large {
    height: 160px; /* 放大一倍 */
    object-fit: contain;
}

/* 主要内容 */
.main-content {
    padding: 40px 0;
}

.section {
    margin-bottom: 60px;
}

.section h3 {
    font-size: 28px;
    color: #333;
    margin-bottom: 30px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(129, 199, 132, 0.5);
}

/* 工具分类 - 竖排显示 */
.tool-categories {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

/* 分类卡片 */
.category-card {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

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

/* 分类头部 */
.category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: linear-gradient(rgba(129, 199, 132, 0.1), rgba(102, 187, 106, 0.1)), url('data:image/svg+xml,%3Csvg width="100" height="100" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"%3E%3Cpath d="M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z" fill="rgba(255,255,255,0.3)" fill-opacity="0.3" fill-rule="evenodd"/%3E%3C/svg%3E');
    color: black;
    cursor: pointer;
    transition: background-color 0.3s;
}

.category-header:hover {
    background-color: rgba(102, 187, 106, 0.3);
    color: black;
}

/* 分类图标 */
.category-icon {
    font-size: 24px;
    margin-right: 15px;
}

.category-title {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.category-header h4 {
    margin: 0;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
}

/* 折叠按钮 */
.toggle-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.3s;
    padding: 5px;
    border-radius: 4px;
}

.toggle-btn:hover {
    background-color: rgba(255,255,255,0.2);
}

.toggle-btn.collapsed {
    transform: rotate(-90deg);
}

/* 分类内容 - 可折叠 */
.category-content {
    max-height: 2000px;
    overflow: hidden;
    padding: 20px;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out;
    background-color: rgba(248, 249, 250, 0.1);
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: flex-start;
}

/* 折叠状态 */
.category-content.collapsed {
    max-height: 0;
    padding: 0 20px;
}

/* 响应式设计 - 调整卡片数量 */
@media (max-width: 1200px) {
    .feature-card {
        flex: 0 0 calc(25% - 15px); /* 一排显示4个卡片 */
    }
}

@media (max-width: 992px) {
    .feature-card {
        flex: 0 0 calc(33.333% - 13px); /* 一排显示3个卡片 */
    }
}

@media (max-width: 768px) {
    .feature-card {
        flex: 0 0 calc(50% - 10px); /* 一排显示2个卡片 */
    }
}

@media (max-width: 480px) {
    .feature-card {
        flex: 0 0 100%; /* 一排显示1个卡片 */
    }
}

/* 功能卡片 - 横排显示 */
.feature-card {
    flex: 0 0 calc(20% - 16px); /* 一排显示5个卡片，考虑gap间距 */
    min-width: 180px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

/* 功能链接 */
.feature-link {
    display: block;
    padding: 20px;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.3s;
    text-align: center;
    background-color: rgba(129, 199, 132, 0.1);
    color: black;
    border-radius: 4px;
}
.feature-link:hover {
    background-color: rgba(129, 199, 132, 0.3);
    color: black;
}

/* 功能图标 */
.feature-icon {
    font-size: 32px;
    margin-bottom: 15px;
    color: rgba(129, 199, 132, 0.5);
    text-align: center;
}

/* 功能标题 */
.feature-card h5 {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin: 0 0 10px 0;
    text-align: center;
}

/* 功能描述 */
.feature-card p {
    font-size: 13px;
    color: #666;
    margin: 0;
    text-align: center;
    line-height: 1.5;
}

/* 功能图片 - 固定大小，确保居中，无背景框 */
.feature-image {
    display: block;
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin: 0 auto 10px;
    /* 确保在容器中完全居中 */
    text-align: center;
    line-height: 60px;
    box-sizing: border-box;
}

/* 确保图片容器也居中 */
.feature-link {
    text-align: center;
}

/* 响应式设计 - 调整卡片数量 */
@media (max-width: 1200px) {
    .feature-card {
        flex: 0 0 calc(25% - 15px); /* 一排显示4个卡片 */
    }
}

@media (max-width: 992px) {
    .feature-card {
        flex: 0 0 calc(33.333% - 13px); /* 一排显示3个卡片 */
    }
}

@media (max-width: 768px) {
    .feature-card {
        flex: 0 0 calc(50% - 10px); /* 一排显示2个卡片 */
    }
}

@media (max-width: 480px) {
    .feature-card {
        flex: 0 0 100%; /* 一排显示1个卡片 */
    }
}

/* 工具卡片 - 保留旧样式，用于其他地方 */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.tool-card {
    background-color: white;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

.tool-card h4 {
    font-size: 20px;
    color: rgba(129, 199, 132, 0.5);
    margin-bottom: 10px;
}

.tool-card p {
    color: #666;
    margin-bottom: 20px;
}

/* 筛选栏 */
.filter-bar {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-group label {
    font-weight: bold;
    color: #333;
}

.filter-group select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    min-width: 150px;
}

/* 工具列表 */
.tool-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 40px;
    padding: 0 20px;
}

.tool-item {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    gap: 15px;
    aspect-ratio: 3/4;
    min-height: 400px;
    cursor: pointer;
}

.tool-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

.tool-preview {
    width: 100%;
    aspect-ratio: 1/1;
    overflow: hidden;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tool-preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
    background-color: white;
}

.tool-item:hover .tool-preview-img {
    transform: scale(1.05);
}

.tool-info {
    flex: 1;
}

.tool-info h4 {
    font-size: 20px;
    color: #333;
    margin-bottom: 5px;
}

.tool-info p {
    color: #666;
    margin-bottom: 10px;
}

.tool-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.tool-meta span {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.tool-meta .subject {
    background-color: #e3f2fd;
    color: #1976d2;
}

.tool-meta .grade {
    background-color: #f3e5f5;
    color: #7b1fa2;
}

/* 工具链接 */
.tool-link {
    display: inline-block;
    background: linear-gradient(rgba(129, 199, 132, 0.1), rgba(102, 187, 106, 0.1)), url('data:image/svg+xml,%3Csvg width="100" height="100" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"%3E%3Cpath d="M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z" fill="rgba(255,255,255,0.3)" fill-opacity="0.3" fill-rule="evenodd"/%3E%3C/svg%3E');
    color: black;
    padding: 10px 20px;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.3s;
    font-weight: bold;
    text-align: center;
    align-self: flex-start;
}

.tool-link:hover {
    background-color: rgba(102, 187, 106, 0.3);
    color: black;
}

/* 页脚 */
.footer {
    background-color: #333;
    color: white;
    padding: 40px 0;
    margin-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h4 {
    font-size: 18px;
    margin-bottom: 15px;
    color: rgba(129, 199, 132, 0.5);
}

.footer-section p {
    color: #ccc;
    line-height: 1.8;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section ul a:hover {
    color: rgba(129, 199, 132, 0.5);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #555;
    color: #999;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar .container {
        flex-direction: column;
        gap: 15px;
    }

    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }

    .nav-menu li {
        margin-left: 0;
    }

    .banner h2 {
        font-size: 28px;
    }

    .tool-list {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 30px;
        padding: 0 15px;
    }

    .tool-item {
        text-align: center;
        gap: 12px;
        aspect-ratio: 3/4;
        min-height: 350px;
        padding: 15px;
    }

    .tool-preview {
        aspect-ratio: 1/1;
    }

    .tool-meta {
        justify-content: center;
    }

    .tool-link {
        align-self: center;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        justify-content: space-between;
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 20px;
    }

    .banner {
        padding: 50px 0;
    }

    .banner h2 {
        font-size: 24px;
    }

    .section h3 {
        font-size: 24px;
    }

    .tool-grid {
        grid-template-columns: 1fr;
    }

    .tool-list {
        grid-template-columns: 1fr;
        gap: 25px;
        padding: 0 10px;
    }

    .tool-item {
        aspect-ratio: 3/4;
        gap: 12px;
        min-height: 300px;
        padding: 15px;
    }

    .tool-preview {
        aspect-ratio: 1/1;
    }
}