/* =========================================
    1. Design System (SaaS Theme)
    ========================================= */
:root {
    /* 品牌色：Indigo (靛蓝) */
    --brand-primary: #4F46E5; 
    --brand-hover: #4338ca;
    --brand-light: #EEF2FF; 
    
    /* 强调色 */
    --success: #10B981;
    
    /* 中性色 */
    --slate-900: #0f172a; 
    --slate-700: #334155;
    --slate-600: #475569; /* 新增用于描述文本 */
    --slate-500: #64748b; 
    --slate-300: #cbd5e1;
    --slate-200: #e2e8f0; /* 新增用于分割线 */
    --slate-100: #f1f5f9; 
    --white: #ffffff;
    --border: #e2e8f0;
    
    /* 阴影与圆角 */
    --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.08); 
    --radius-lg: 16px; 
    --radius-md: 10px;
    
    /* 布局变量 */
    --content-max-width: 1100px; 
    --sidebar-width: 200px; /* 侧边栏宽度微调 */
}

/* 确保所有元素 box-sizing 正确 */
* { box-sizing: border-box; outline: none; }

body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    background-color: var(--slate-100); 
    color: var(--slate-900);
    min-height: 100vh;
    line-height: 1.6;
}

/* --- 整体布局容器 --- */
.page-layout {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 40px 24px; 
}
.page-header {
    text-align: center; 
    margin-bottom: 40px; 
}
.page-header h1 {
    font-size: 2.2rem; 
    font-weight: 800;
    margin: 0 0 12px 0;
    line-height: 1.2;
}
.page-header p {
    color: var(--slate-500);
    font-size: 1.1rem;
    max-width: 800px; 
    margin: 0 auto;
}

/* --- 搜索和分类区域 --- */
.search-and-filter {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
    align-items: center; 
}
.search-input {
    flex-grow: 1;
    position: relative;
}
.search-input input {
    width: 100%;
    padding: 14px 14px 14px 45px; 
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 1.05rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.search-input input:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 4px var(--brand-light); 
}
.search-input svg {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--slate-500);
    width: 22px;
    height: 22px;
}

/* --- 主工具内容区布局 --- */
.tools-main-area {
    display: grid; 
    grid-template-columns: var(--sidebar-width) 1fr; 
    gap: 40px;
}

/* -----------------------------------------
    2. 侧边栏分类 (Sidebar Filter)
    ----------------------------------------- */
.filter-sidebar {
    width: var(--sidebar-width);
    background: var(--white);
    padding: 16px; 
    border-radius: var(--radius-lg);
    height: fit-content;
    box-shadow: var(--shadow-card);
    position: sticky; 
    top: 100px; 
}
.filter-sidebar h3 {
    font-size: 1.25rem; 
    font-weight: 800;
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--slate-900);
    padding-bottom: 15px;
    border-bottom: 1px solid var(--slate-200); 
}
.filter-link {
    display: flex; 
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    border-radius: var(--radius-md);
    color: var(--slate-700);
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.2s;
    margin-bottom: 8px;
}
.filter-link svg {
    width: 20px;
    height: 20px;
    color: var(--slate-500); 
    transition: color 0.2s;
}
.filter-link:hover {
    background-color: var(--slate-100);
    color: var(--brand-primary);
}
.filter-link:hover svg {
    color: var(--brand-primary);
}
.filter-link.active {
    background-color: var(--brand-light);
    color: var(--brand-primary);
    font-weight: 700;
}
.filter-link.active svg {
    color: var(--brand-primary);
}

/* -----------------------------------------
    3. 工具卡片网格 (Tool Grid)
    ----------------------------------------- */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); 
    gap: 25px; 
}

.tool-card {
    background: var(--white);
    padding: 25px; 
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card); 
    text-align: center;
    text-decoration: none;
    color: var(--slate-900);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); 
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    border: 1px solid transparent; 
}
.tool-card:hover {
    transform: translateY(-5px); 
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.2); 
    border-color: var(--brand-primary); 
}

.tool-icon-wrapper {
    width: 70px; 
    height: 70px;
    background: var(--brand-light);
    border-radius: 50%; 
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px auto;
    transition: background 0.3s;
}
.tool-card:hover .tool-icon-wrapper {
    background: var(--brand-primary); 
}
.tool-icon-wrapper svg {
    color: var(--brand-primary);
    width: 38px; 
    height: 38px;
    transition: color 0.3s;
}
.tool-card:hover .tool-icon-wrapper svg {
    color: var(--white); 
}

.tool-card h4 {
    font-size: 1.25rem; 
    font-weight: 800;
    margin: 0 0 10px 0;
    line-height: 1.3;
}
.tool-card p {
    font-size: 0.95rem; 
    color: var(--slate-600);
    margin: 0 0 15px 0;
    flex-grow: 1; 
}

/* --- 使用次数标签 --- */
.usage-badge {
    display: inline-flex;
    align-items: center;
    background: var(--slate-100);
    color: var(--slate-700);
    padding: 6px 12px;
    border-radius: 99px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: auto; 
    align-self: center; 
    transition: background 0.3s;
}
.tool-card:hover .usage-badge {
    background: var(--brand-light); 
    color: var(--brand-primary);
}
.usage-badge svg {
    width: 16px;
    height: 16px;
    margin-right: 5px;
    color: var(--slate-500);
    transition: color 0.3s;
}
.tool-card:hover .usage-badge svg {
    color: var(--brand-primary);
}

/* --- 导航栏和页脚 (沿用首页样式) --- */
.navbar { background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); height: 70px; position: sticky; top: 0; z-index: 100; }
.nav-container { 
    /* 确保导航栏内容居中且有最大宽度 */
    max-width: var(--content-max-width); 
    margin: 0 auto; /* 居中 */
    height: 100%; 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    padding: 0 24px; 
    width: 100%;
    position: relative; 
}
.nav-main-links { display: flex; gap: 40px; position: absolute; left: 50%; transform: translateX(-50%); }
.nav-item { text-decoration: none; color: var(--slate-700); font-weight: 500; font-size: 0.95rem; transition: all 0.2s ease; padding: 2px 0; position: relative; }
.nav-item:hover { color: var(--brand-primary); }
.nav-item.active { color: var(--slate-900); font-weight: 600; }
.nav-item.active::after { content: ''; position: absolute; bottom: -8px; left: 0; width: 100%; height: 3px; background-color: var(--brand-primary); border-radius: 2px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--slate-900); font-weight: 800; font-size: 1.4rem; letter-spacing: -0.03em; z-index: 1; }
.brand svg { color: var(--brand-primary); width: 32px; height: 32px; }
.btn-login { text-decoration: none; color: var(--slate-900); font-weight: 600; padding: 8px 24px; border-radius: 99px; transition: background 0.2s; z-index: 1; }
.btn-login:hover { background-color: var(--slate-100); }
.btn-signup { display: inline-flex; align-items: center; padding: 12px 25px; background-color: var(--brand-primary); color: var(--white); border-radius: 99px; font-weight: 600; font-size: 1.05rem; text-decoration: none; transition: background-color 0.2s; }
.btn-signup:hover { background-color: var(--brand-hover); }

.site-footer { background-color: var(--slate-900); color: var(--slate-300); padding: 60px 0 20px 0; margin-top: 80px; }
.footer-grid { max-width: var(--content-max-width); margin: 0 auto; padding: 0 32px; width: 100%; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; }
.site-footer .brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--white); font-weight: 900; font-size: 1.8rem; letter-spacing: -0.05em; margin-bottom: 15px; }
.site-footer .brand svg { color: var(--brand-primary); width: 38px; height: 38px; }
.site-footer h4 { color: var(--white); font-size: 1rem; margin-top: 0; margin-bottom: 15px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer ul li { margin-bottom: 8px; }
.site-footer ul li a { color: var(--slate-300); text-decoration: none; font-size: 0.95rem; transition: color 0.2s; }
.site-footer ul li a:hover { color: var(--brand-primary); }
.footer-desc { font-size: 0.95rem; line-height: 1.6; }
.footer-bottom { text-align: center; margin-top: 40px; font-size: 0.8rem; color: var(--slate-500); border-top: 1px solid var(--slate-700); padding-top: 20px; max-width: var(--content-max-width); margin-left: auto; margin-right: auto; }

/* 媒体查询 */
@media (max-width: 1200px) {
    .tools-main-area {
        grid-template-columns: 1fr; 
        gap: 30px;
    }
    .filter-sidebar {
        width: 100%;
        position: static; 
        display: flex;
        flex-wrap: wrap;
        gap: 5px 15px;
        padding: 20px;
        overflow-x: auto; 
    }
    .filter-sidebar h3 {
        flex-shrink: 0;
        margin: 0;
        padding-right: 20px;
        border-bottom: none;
        border-right: 1px solid var(--slate-300);
    }
    .filter-link {
        flex-shrink: 0;
        padding: 8px 15px;
        margin-bottom: 0;
    }
    .filter-link svg {
        display: none; 
    }
}
@media (max-width: 768px) {
    .page-header h1 {
        font-size: 2.5rem;
    }
    .page-header p {
        font-size: 1.05rem;
    }
    .search-and-filter {
        flex-direction: column;
        gap: 15px;
    }
        .filter-sidebar {
        justify-content: flex-start;
        padding: 15px;
    }
    .filter-sidebar h3 {
            font-size: 1.1rem;
    }
    .nav-main-links {
        display: none;
    }
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

.logo {
    width: 40px;
    /* 自定义容器宽度 */
    height: 40px;
    /* 自定义容器高度 */
    display: flex;
    justify-content: center;
    /* 水平居中 */
    align-items: center;
    /* 垂直居中 */
    border: 0px solid #ddd;
    /* 可选：添加边框便于查看 */
}

.logo img {
    max-width: 100%;
    /* 图片宽度最大为容器宽度 */
    max-height: 100%;
    /* 图片高度最大为容器高度 */
    object-fit: contain;
    /* 保持图片比例，完整显示 */
    /* object-fit: cover; */
    /* 可选：覆盖整个容器，可能裁剪图片 */
}
