/* --- 全局与基础样式 --- */
body {
    font-family: 'Noto Sans SC', 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    padding: 40px 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* --- 标题样式 --- */
.main-title {
    font-size: 36px;
    font-weight: 700;
    text-align: center;
    color: #2c3e50;
    margin-bottom: 48px;
}

/* --- 工具网格布局 --- */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); /* 稍微加宽最小宽度以容纳新图标 */
    gap: 24px;
}

/* --- 卡片核心样式 --- */
.tool-card {
    background-color: var(--tool-card-bg);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.tool-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

/* --- 卡片头部 --- */
.card-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px; /* 加大与列表的间距 */
}

.card-header .card-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    margin-right: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 22px; /* 使用图标字体，而非文字 */
}

.card-title {
    font-size: 18px;
    font-weight: 500;
    color: #2c3e50;
}

/* --- 工具列表 (本次更新重点) --- */
.tool-list {
    list-style: none;
    padding: 0;
    margin: 0;
    flex-grow: 1;
}

.tool-list li a {
    text-decoration: none;
    color: #555;
    display: flex;
    align-items: center;
    padding: 4px 0;
}

.tool-list li a:hover .tool-name {
    color: #3498db;
}

.tool-list li .tool-name {
    transition: color 0.3s ease;
}

/* 小图标的背景容器样式 */
.tool-icon-wrapper {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0; /* 防止容器被压缩 */
}

/* 小图标本身的样式 (颜色由下面的分类颜色决定) */
.tool-icon-wrapper i {
    font-size: 16px;
}

/* --- 卡片底部 --- */
.card-footer {
    margin-top: 16px;
}

.view-more-link {
    text-decoration: none;
    color: #888;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.view-more-link:hover {
    color: #3498db;
}

/* 
 --- 3. 全新的颜色系统 (本次更新核心) --- 
 - 为每个分类的卡片定义一个class
 - 使用这个class来控制卡片内所有元素的颜色，包括主图标、小图标、小图标背景
*/

/* 文本处理 */
.category-text .card-icon { background-color: #5dade2; }
.category-text .tool-icon-wrapper { background-color: #eaf5fc; }
.category-text .tool-icon-wrapper i { color: #5dade2; }

/* 家庭教育 */
.category-family .card-icon { background-color: #f5b041; }
.category-family .tool-icon-wrapper { background-color: #fef6e8; }
.category-family .tool-icon-wrapper i { color: #f5b041; }

/* 生活助手 */
.category-life .card-icon { background-color: #bb8fce; }
.category-life .tool-icon-wrapper { background-color: #f7f2fa; }
.category-life .tool-icon-wrapper i { color: #bb8fce; }

/* 职场提效 */
.category-work .card-icon { background-color: #48c9b0; }
.category-work .tool-icon-wrapper { background-color: #e8faf5; }
.category-work .tool-icon-wrapper i { color: #48c9b0; }

/* 趣味游戏 */
.category-game .card-icon { background-color: #e74c3c; }
.category-game .tool-icon-wrapper { background-color: #fdedeb; }
.category-game .tool-icon-wrapper i { color: #e74c3c; }

/* 娱乐休闲 */
.category-fun .card-icon { background-color: #f39c12; }
.category-fun .tool-icon-wrapper { background-color: #fef4e5; }
.category-fun .tool-icon-wrapper i { color: #f39c12; }

/* 节日工具 */
.category-festival .card-icon { background-color: #e85c8a; }
.category-festival .tool-icon-wrapper { background-color: #fdeef3; }
.category-festival .tool-icon-wrapper i { color: #e85c8a; }

/* 教育工具 */
.category-edu .card-icon { background-color: #58d68d; }
.category-edu .tool-icon-wrapper { background-color: #eefbed; }
.category-edu .tool-icon-wrapper i { color: #58d68d; }

/* 健康管理 */
.category-health .card-icon { background-color: #2ecc71; }
.category-health .tool-icon-wrapper { background-color: #eafaf1; }
.category-health .tool-icon-wrapper i { color: #2ecc71; }

/* 考生助手 */
.category-exam .card-icon { background-color: #3498db; }
.category-exam .tool-icon-wrapper { background-color: #e6f3fb; }
.category-exam .tool-icon-wrapper i { color: #3498db; }

/* 图像处理 */
.category-image .card-icon { background-color: #9b59b6; }
.category-image .tool-icon-wrapper { background-color: #f4eef7; }
.category-image .tool-icon-wrapper i { color: #9b59b6; }

/* 追剧助手 */
.category-drama .card-icon { background-color: #e67e22; }
.category-drama .tool-icon-wrapper { background-color: #fcf1e8; }
.category-drama .tool-icon-wrapper i { color: #e67e22; }

/* 实用工具 */
.category-utility .card-icon { background-color: #1abc9c; }
.category-utility .tool-icon-wrapper { background-color: #e8f8f5; }
.category-utility .tool-icon-wrapper i { color: #1abc9c; }

/* 个人成长 */

/* --- 暗色模式下的特定样式 --- */
[data-theme="dark"] .tool-card .card-title {
    color: #e9ecef; /* 使用更亮的特定颜色值 */
}

[data-theme="dark"] .tool-card .tool-list li a {
    color: #ced4da; /* 使用更亮的特定颜色值 */
}

[data-theme="dark"] .tool-card .tool-list li a:hover .tool-name {
    color: var(--primary-hover);
}

[data-theme="dark"] .tool-card .view-more-link {
    color: var(--secondary-color);
}

[data-theme="dark"] .tool-card .view-more-link:hover {
    color: var(--primary-hover);
}
.category-growth .card-icon { background-color: #f1c40f; }
.category-growth .tool-icon-wrapper { background-color: #fef8e4; }
.category-growth .tool-icon-wrapper i { color: #f1c40f; }

/* 女性工具 */
.category-female .card-icon { background-color: #e91e63; }
.category-female .tool-icon-wrapper { background-color: #fde7ee; }
.category-female .tool-icon-wrapper i { color: #e91e63; }

/* 财务管理 */
.category-finance .card-icon { background-color: #2980b9; }
.category-finance .tool-icon-wrapper { background-color: #e9f1f7; }
.category-finance .tool-icon-wrapper i { color: #2980b9; }


/* --- 响应式布局：移动设备 --- */
@media (max-width: 768px) {
    body { padding: 20px 15px; }
    .main-title { font-size: 28px; margin-bottom: 32px; }
    .tools-grid { grid-template-columns: 1fr; gap: 16px; }
}
