/* ============================================================
   index.css —— 首页（AI工具集）专属样式
   包含：Hero 区高度覆盖、广告模块、中间栏目列表模块
   ============================================================ */

/* --- Hero 区（页面差异：min-height 400px） --- */
.page-header { min-height: 400px; }

/* ================= 广告模块 ================= */
.ad-section-wrapper {
    /* 顶部起始透明度与 header 底部渐变尾巴的淡出颜色(约0.45)对齐，
       避免与 header 底边出现色差分界；向下逐渐淡出融入页面背景 */
    background: linear-gradient(to bottom, rgba(251, 253, 255, 0.45) 0%, rgba(251, 253, 255, 0) 100%);
    padding: 30px 20px 0 20px;
    display: flex; flex-direction: column; flex-shrink: 0; z-index: 10;
}

.ad-block-1 { background-color: #ffffff; border-radius: 10px; padding: 10px; display: flex; }
.ad-nav { display: flex; flex-direction: column; gap: 2px; width: 65px; flex-shrink: 0; }
.ad-nav-item {
    width: 65px; height: 65px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    cursor: pointer; border-radius: 6px; background-color: #f9fafb; transition: all 0.2s; color: #6b7280; font-size: 12px;
}
.ad-nav-item i { font-size: 20px; }
.ad-nav-item:hover { background-color: #f3f4f6; color: #4b5563; }
.ad-nav-item.active { background-color: #dbeafe; color: #2563eb; font-weight: 600; }

.ad-content {
    flex: 1; margin-left: 10px; height: 199px;
    background-color: rgba(132, 132, 132, 0.1); border-radius: 10px;
    padding: 10px 15px; overflow: hidden; position: relative;
}
.ad-scroll-container { display: flex; gap: 10px; height: 100%; align-items: center; overflow: hidden; width: max-content; will-change: transform; }
.ad-item {
    height: 100%; aspect-ratio: 5 / 3; flex-shrink: 0; border-radius: 8px; overflow: hidden;
    position: relative; cursor: pointer; border: 5px solid transparent; transition: border-color 0.3s ease; box-sizing: border-box;
}
.ad-item:hover { border-color: #C2C2C2; }
.ad-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.3s ease; }
.ad-item:hover img { transform: scale(1.08); }
.ad-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(0, 0, 0, 0.3); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.3s ease; pointer-events: none; }
.ad-item:hover .ad-overlay { opacity: 1; }
.ad-title { color: #fff; font-size: 15px; font-weight: 600; text-align: center; padding: 0 10px; text-shadow: 0 2px 4px rgba(0,0,0,0.5); }

.ad-block-2 { background-color: transparent; border-radius: 0; padding: 30px 0; margin-top: 10px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.ad-grid-item { position: relative; border-radius: 8px; overflow: hidden; cursor: pointer; height: 220px; border: 5px solid transparent; transition: border-color 0.3s ease; }
.ad-grid-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.3s ease; }
.ad-grid-item:hover { border-color: #C2C2C2; }
.ad-grid-item:hover img { transform: scale(1.08); }
.ad-grid-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(0, 0, 0, 0.3); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.3s ease; pointer-events: none; }
.ad-grid-item:hover .ad-grid-overlay { opacity: 1; }
.ad-grid-title { color: #fff; font-size: 16px; font-weight: 600; text-align: center; padding: 0 10px; text-shadow: 0 2px 4px rgba(0,0,0,0.5); }

/* ================= 中间栏目列表模块 ================= */
.tool-list-wrapper { padding: 0 20px 60px 20px; display: flex; flex-direction: column; gap: 30px; }
.tool-section { display: flex; flex-direction: column; gap: 15px; }

/* 区块标题 */
.section-header { display: flex; justify-content: space-between; align-items: center; }
.section-title { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 700; color: #1e3a8a; }

.section-title .title-icon {
    width: 28px; height: 28px; border-radius: 50%;
    background: #dbeafe; color: #2563eb;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
}

.section-title .plain-icon {
    font-size: 20px; color: #2563eb; margin-right: 4px;
    background: transparent; width: auto; height: auto; border-radius: 0;
}

.view-more { font-size: 13px; color: #6b7280; cursor: pointer; transition: color 0.2s; }
.view-more:hover { color: #2563eb; }

/* 🔥 语义化列表布局，行列间距30px，且绝不溢出容器 */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 30px; /* 行与行、列与列距离 30px */
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%; /* 占满父容器，不产生横向滚动 */
    /* 确保 grid 自身不会因为内容溢出而产生横向滚动条 */
    overflow: visible;
}

/* 🔥 li 包裹层：核心防挤压设置 min-width: 0 */
.tool-item {
    width: 100%;
    min-width: 0; /* 确保 Grid 子项可以被压缩，不撑开网格 */
}

/* 工具卡片（a 标签） */
.tool-card {
    width: 100%;
    height: 80px;
    background: #ffffff; border-radius: 10px;
    padding: 0 15px;
    display: flex; align-items: center; gap: 12px; cursor: pointer;
    border: 1px solid transparent; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    text-decoration: none;
    color: inherit;
    overflow: hidden; /* 确保内部内容不溢出卡片 */
}

.tool-card:hover, .tool-card.active {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.08);
    border-color: #dbeafe;
}

.tool-logo {
    width: 50px; height: 50px;
    border-radius: 8px; object-fit: cover;
    flex-shrink: 0; /* 图标固定大小不压缩 */
    background-color: #f3f4f6;
}

/* 🔥 文字信息区：核心防挤压设置 min-width: 0 */
.tool-info {
    display: flex; flex-direction: column; gap: 10px;
    overflow: hidden;
    min-width: 0; /* 确保内部文字能正确触发省略号 */
}

.tool-name { font-size: 14px; font-weight: 600; color: #1f2937; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1; }
.tool-desc { font-size: 12px; color: #6b7280; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1; }

/* 响应式适配 */
@media (max-width: 1600px) { .tool-grid { grid-template-columns: repeat(5, 1fr); } }
@media (max-width: 1400px) { .tool-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 992px) {
    .tool-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    .tool-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
}
