/* ============================================================
   码工具箱 - 首页样式
   ============================================================ */

/* ---------- Hero ---------- */
.hero {
    text-align: center;
    padding: 44px 0 28px;
}

.hero-title {
    font-size: 36px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 1px;
}

.hero-sub {
    margin: 12px auto 0;
    max-width: 640px;
    color: var(--text-2);
    font-size: 15px;
    line-height: 1.7;
}

.search-box {
    position: relative;
    max-width: 520px;
    margin: 22px auto 0;
}

.search-ico {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-3);
    font-size: 14px;
}

.search-input {
    width: 100%;
    height: 46px;
    padding: 0 16px 0 38px;
    border: 1px solid var(--border-2);
    border-radius: var(--radius);
    background: var(--card);
    color: var(--text);
    font-size: 14px;
    box-shadow: var(--shadow);
    transition: all .15s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-border);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

/* ---------- 分类区块 ---------- */
.cat-block {
    margin: 32px 0;
}

.cat-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.cat-ico {
    font-size: 18px;
}

.cat-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

.cat-count {
    font-size: 12px;
    color: var(--text-3);
}

/* ---------- 工具网格 ---------- */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}

.tool-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: all .15s;
}

.tool-card:hover {
    border-color: var(--primary-border);
    box-shadow: 0 4px 14px rgba(37, 99, 235, .10);
    transform: translateY(-2px);
}

.tc-icon {
    width: 42px;
    height: 42px;
    flex: none;
    border-radius: var(--radius-sm);
    background: var(--primary-soft);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
}

.tc-body {
    flex: 1;
    min-width: 0;
}

.tc-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}

.tc-desc {
    font-size: 13px;
    color: var(--text-2);
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tc-arrow {
    color: var(--text-3);
    font-size: 16px;
    transition: all .15s;
}

.tool-card:hover .tc-arrow {
    color: var(--primary);
    transform: translateX(2px);
}

/* ---------- 无结果提示 ---------- */
.no-result {
    text-align: center;
    padding: 40px 0;
    color: var(--text-3);
    font-size: 14px;
}

/* ---------- 首页 SEO 文案 ---------- */
.home-seo {
    margin-top: 48px;
}
.home-seo h2 { font-size: 18px; font-weight: 600; margin-top: 18px; margin-bottom: 8px; color: var(--text); }
.home-seo h2:first-child { margin-top: 0; }
.home-seo p  { color: var(--text-2); font-size: 14px; margin-bottom: 8px; }
.home-seo ul { padding-left: 20px; color: var(--text-2); font-size: 14px; }
.home-seo ul li { margin: 4px 0; }
.home-seo strong { color: var(--text); }

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
    .hero { padding: 28px 0 18px; }
    .hero-title { font-size: 26px; letter-spacing: .5px; }
    .hero-sub { font-size: 13px; margin-top: 10px; }
    .search-box { margin-top: 16px; }
    .search-input { height: 42px; font-size: 13px; }
    .cat-block { margin: 22px 0; }
    .cat-head { margin-bottom: 10px; }
    .cat-title { font-size: 16px; }
    .tool-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .tool-card { padding: 12px; gap: 10px; }
    .tc-icon { width: 36px; height: 36px; font-size: 16px; }
    .tc-name { font-size: 14px; }
    .tc-desc { font-size: 12px; white-space: normal; }
    .tc-arrow { display: none; }
    .home-seo { margin-top: 32px; }
    .home-seo h2 { font-size: 16px; }
    .home-seo p, .home-seo ul { font-size: 13px; }
    .no-result { padding: 24px 0; }
}

@media (max-width: 480px) {
    .hero-title { font-size: 22px; }
    .hero-sub { font-size: 12px; line-height: 1.6; }
    .tool-grid { grid-template-columns: 1fr; }
    .tc-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
}
