/* ========= 首页样式 ========= */

/* 板块容器 - 只保留间距 */
.home-section {
    margin-bottom: 40px;
}

/* 板块标题 - card-title 风格（蓝色左边框） */
.home-section-title {
    font-size: 18px;
    font-weight: 600;
    color: #333333;
    margin: 0 0 20px 0;
    padding-left: 12px;
    border-left: 4px solid #0d6efd;
}

/* 工具列表网格 - 一行3个 */
.home-tools-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* 工具卡片 - 左右布局，独立卡片，固定高度 */
.home-tool-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
    height: 160px;  /* 固定高度，6行简介需要更高 */
    overflow: hidden;
}

.home-tool-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    border-color: #0d6efd;
}

/* 卡片左边：图标（上）+ 名称（下）- 固定宽度 */
.home-tool-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100px;
    flex-shrink: 0;
}

.home-tool-icon {
    width: 72px;
    height: 72px;
    background: #e8f0fe;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    transition: all 0.3s ease;
}

.home-tool-icon img {
    width: 72px;
    height: 72px;
    border-radius: 16px;
    object-fit: cover;
}

.home-tool-card:hover .home-tool-icon {
    background: #0d6efd;
    color: #ffffff;
}

.home-tool-name {
    font-size: 15px;
    font-weight: 700;
    color: #333333;
    text-align: center;
    width: 6em;  /* 第2行可以显示6个字 */
    line-height: 1.4;
    max-height: 42px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-all;  /* 第1行显示5个字后换行，第2行可以显示6个字 */
}

.home-tool-card:hover .home-tool-name {
    color: #0d6efd;
}

/* 卡片右边：工具简介 */
.home-tool-right {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
}

.home-tool-desc {
    font-size: 13px;
    color: #666666;
    line-height: 1.6;
    margin: 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 6;  /* 最多显示6行 */
    -webkit-box-orient: vertical;
}

/* 空状态 */
.home-empty {
    padding: 40px;
    text-align: center;
    color: #666666;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    grid-column: 1 / -1;
}

/* 关于我们内容 */
.home-intro {
    font-size: 15px;
    color: #666666;
    line-height: 1.8;
    padding: 20px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.home-intro p {
    margin-bottom: 12px;
}

.home-intro p:last-child {
    margin-bottom: 0;
}

/* 友情链接 */
.home-friend-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 20px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.home-friend-link {
    padding: 8px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    text-decoration: none;
    color: #666666;
    font-size: 14px;
    transition: all 0.3s;
}

.home-friend-link:hover {
    background: #0d6efd;
    color: #ffffff;
}

/* ========= 网站迭代日志 ========= */
.home-iteration-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.home-iteration-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    cursor: pointer;
}

.home-iteration-item:hover {
    background: #0d6efd;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13,110,253,0.25);
}

.home-iteration-title {
    font-size: 14px;
    font-weight: 500;
    color: inherit;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;  /* 手机端允许换行 */
    margin-right: 12px;
    line-height: 1.5;  /* 添加行高 */
}

.home-iteration-date {
    font-size: 13px;
    color: #888888;
    flex-shrink: 0;
}

.home-iteration-item:hover .home-iteration-date {
    color: #e0e0e0;
}

/* ========= 响应式设计 ========= */

/* 平板端：一行2个 */
@media (max-width: 768px) {
    .home-tools-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .home-iteration-grid {
        grid-template-columns: 1fr;  /* 平板端：一行1篇 */
        gap: 10px;
    }

    .home-tool-card {
        padding: 12px;
        gap: 12px;
        height: 140px;  /* 平板端：6行简介 */
    }

    .home-tool-left {
        width: 72px;
    }

    .home-tool-icon {
        width: 56px;
        height: 56px;
        font-size: 26px;
        border-radius: 12px;
    }

    .home-tool-icon img {
        width: 56px;
        height: 56px;
        border-radius: 12px;
    }

    .home-tool-name {
        font-size: 13px;
        width: 72px;
    }

    .home-tool-desc {
        font-size: 12px;
    }

    .home-intro,
    .home-friend-links {
        padding: 16px;
    }
}

/* 手机端：一行1个，图标和名称加大 */
@media (max-width: 480px) {
    .home-tools-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .home-iteration-grid {
        grid-template-columns: 1fr;  /* 手机端：一行1篇 */
        gap: 8px;
    }

    .home-iteration-item {
        padding: 10px 12px;
    }

    .home-iteration-title {
        font-size: 13px;
    }

    .home-iteration-date {
        font-size: 12px;
    }

    .home-tool-card {
        padding: 14px;
        gap: 14px;
        height: 160px;  /* 手机端：6行简介 */
    }

    .home-tool-left {
        width: 100px;
    }

    .home-tool-icon {
        width: 72px;
        height: 72px;
        font-size: 36px;
        border-radius: 16px;
    }

    .home-tool-icon img {
        width: 72px;
        height: 72px;
        border-radius: 16px;
    }

    .home-tool-name {
        font-size: 15px;
        width: 100px;
        font-weight: 700;
    }

    .home-tool-desc {
        font-size: 13px;
    }

    .home-intro,
    .home-friend-links {
        padding: 12px;
    }

    .home-intro {
        font-size: 14px;
    }
}
