/* ==========================================================
   O泡 全站工具目录 /tools
   密集工具矩阵，与首页场景化留白区分
   ========================================================== */

body.cat-page {
    background:
        radial-gradient(60% 40% at 50% -10%, rgba(99, 102, 241, 0.12), transparent 70%),
        #080b12;
    color: #e2e8f0;
}

.cat-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 96px 20px 64px;
}

/* ---------- 面包屑 ---------- */
.cat-crumb {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    width: fit-content;
    max-width: 100%;
    height: auto;
    gap: 8px;
    margin-bottom: 18px;
    font-size: 0.78rem;
    color: #64748b;
}

.cat-crumb a {
    color: #94a3b8;
    text-decoration: none;
}

.cat-crumb a:hover { color: #a5b4fc; }

.cat-crumb i { font-size: 0.6rem; color: #475569; }

.cat-crumb span { color: #cbd5e1; }

/* ---------- 页头 ---------- */
.cat-head { margin-bottom: 26px; }

.cat-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px 11px;
    margin-bottom: 12px;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: #a5b4fc;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.26);
}

.cat-head h1 {
    margin: 0 0 10px;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #f3f6fc;
}

.cat-head p {
    margin: 0;
    max-width: 760px;
    color: #8b97a9;
    font-size: 0.92rem;
    line-height: 1.7;
}

/* ---------- 搜索与筛选 ---------- */
.cat-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.cat-search {
    position: relative;
    flex: 1 1 320px;
    max-width: 460px;
}

.cat-search i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.85rem;
    color: #64748b;
}

.cat-search input {
    width: 100%;
    height: 44px;
    padding: 0 14px 0 38px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(15, 19, 27, 0.9);
    color: #e2e8f0;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.cat-search input::placeholder { color: #64748b; }

.cat-search input:focus {
    border-color: rgba(99, 102, 241, 0.6);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.14);
}

.cat-count {
    margin-left: auto;
    font-size: 0.8rem;
    color: #64748b;
    white-space: nowrap;
}

.cat-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 22px;
}

.cat-chip {
    padding: 6px 13px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    color: #94a3b8;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.18s;
}

.cat-chip:hover { color: #c7d2fe; border-color: rgba(99, 102, 241, 0.4); }

.cat-chip.is-on {
    color: #fff;
    background: linear-gradient(135deg, #4f46e5, #0ea5e9);
    border-color: transparent;
}

/* ---------- 工具矩阵 ---------- */
.cat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.cat-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(15, 19, 27, 0.82);
    text-decoration: none;
    transition: transform 0.18s, border-color 0.18s, background 0.18s;
}

.cat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(99, 102, 241, 0.4);
    background: rgba(22, 27, 39, 0.95);
}

.cat-card__icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: none;
    border-radius: 10px;
    color: #fff;
    font-size: 0.95rem;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.cat-card__body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.cat-card__body strong {
    font-size: 0.88rem;
    font-weight: 700;
    color: #f1f5f9;
    line-height: 1.3;
}

.cat-card__body em {
    font-style: normal;
    font-size: 0.72rem;
    line-height: 1.5;
    color: #7c8798;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cat-card__meta {
    align-self: flex-start;
    margin-top: 2px;
    padding: 2px 8px;
    border-radius: 5px;
    font-size: 0.66rem;
    font-weight: 600;
    color: #6ee7b7;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.cat-card__meta.is-paid {
    color: #fcd34d;
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.22);
}

.cat-empty {
    padding: 60px 0;
    text-align: center;
    color: #64748b;
    font-size: 0.9rem;
}

/* ---------- 浅色主题 ---------- */
html[data-theme="light"] body.cat-page {
    background:
        radial-gradient(60% 40% at 50% -10%, rgba(79, 70, 229, 0.1), transparent 70%),
        #eef2f8;
    color: #0f172a;
}

html[data-theme="light"] .cat-crumb a { color: #64748b; }
html[data-theme="light"] .cat-crumb span { color: #0f172a; }
html[data-theme="light"] .cat-eyebrow {
    color: #4338ca;
    background: rgba(79, 70, 229, 0.08);
    border-color: rgba(79, 70, 229, 0.22);
}
html[data-theme="light"] .cat-head h1 { color: #0f172a; }
html[data-theme="light"] .cat-head p { color: #475569; }

html[data-theme="light"] .cat-search input {
    background: #fff;
    border-color: rgba(15, 23, 42, 0.12);
    color: #0f172a;
}
html[data-theme="light"] .cat-count { color: #64748b; }

html[data-theme="light"] .cat-chip {
    background: #fff;
    border-color: rgba(15, 23, 42, 0.1);
    color: #475569;
}
html[data-theme="light"] .cat-chip:hover {
    color: #4338ca;
    border-color: rgba(79, 70, 229, 0.35);
    background: rgba(79, 70, 229, 0.06);
}
html[data-theme="light"] .cat-chip.is-on,
html[data-theme="light"] .cat-chip.is-on:hover {
    color: #fff;
    background: linear-gradient(135deg, #4f46e5, #0ea5e9);
    border-color: transparent;
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.26);
}

html[data-theme="light"] .cat-card {
    background: #fff;
    border-color: rgba(15, 23, 42, 0.08);
}
html[data-theme="light"] .cat-card:hover {
    background: #fff;
    border-color: rgba(79, 70, 229, 0.35);
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
}
html[data-theme="light"] .cat-card__body strong { color: #0f172a; }
html[data-theme="light"] .cat-card__body em { color: #64748b; }
html[data-theme="light"] .cat-card__meta { color: #047857; }
html[data-theme="light"] .cat-card__meta.is-paid { color: #b45309; }

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
    .cat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
    .cat-wrap { padding-top: 88px; }
    .cat-head h1 { font-size: 1.6rem; }
    .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cat-count { width: 100%; margin-left: 0; }
}

@media (max-width: 520px) {
    .cat-grid { grid-template-columns: 1fr; }
    .cat-head h1 { font-size: 1.4rem; }
}
