body {
    font-family: sans-serif;
    margin: 0;
    background-color: #f4f4f4;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 20px 15px;
    box-sizing: border-box;
}

.main-container {
    width: 100%;
    max-width: 1800px;  /* 从1500px增加到1800px */
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 50px;
    background-color: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    margin: 20px auto;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

body {
    margin: 0;
    padding: 0;
    background-image: url('https://img.freepik.com/free-vector/hand-painted-watercolor-pastel-sky-background_23-2148902771.jpg');
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    font-family: 'Arial', sans-serif;
}

.main-container {
    background-color: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    margin: 20px auto;
    padding: 20px;
    max-width: 1200px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}


.search-container {
    text-align: center;
    /* 文本居中 */
    width: 100%;
    /* 宽度占满父元素 */
    margin-bottom: 20px;
    /* 与下方筛选按钮的间距 */
}

.search-box {
    width: 100%;
    /* 宽度占满其容器 .search-container */
    padding: 10px 15px;
    /* 内边距 */
    font-size: 16px;
    /* 字体大小 */
    border: 1px solid #ccc;
    /* 边框样式 */
    border-radius: 20px;
    /* 圆角边框 */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    /* 盒子阴影 */
    outline: none;
    /* 移除默认的焦点轮廓 */
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    /* 过渡效果：边框颜色和盒子阴影 */
    box-sizing: border-box;
    /* 让 padding 和 border 不会增加元素的总宽度 */
    background-color: #fff;
    /* 背景色设为白色 */
}

.search-box.focused {
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.2);
}

/* Placeholder 文本样式 */
.search-box::placeholder {
    color: #aaa;
    /* Placeholder 文本颜色 */
    font-style: italic;
    /* Placeholder 文本样式为斜体 */
}

.filter-buttons-container {
    width: 100%;
    /* 宽度占满父元素 */
    text-align: center;
    /* 按钮组居中 */
    margin-top: 0;
    /* 移除顶部外边距 */
    box-sizing: border-box;
    /* 盒模型设置 */
}

.filter-list {
    display: flex;
    /* 使用 flex 布局以便更好地控制按钮排列 */
    flex-wrap: wrap;
    /* 允许按钮换行 */
    justify-content: center;
    /* 水平居中对齐按钮 */
    gap: 10px;
    /* 按钮之间的间隙 */
    list-style: none;
    /* 移除列表项的默认标记 */
    padding: 0;
    /* 移除默认内边距 */
    margin: 0;
    /* 移除默认外边距 */
}

.filter-list li {
    margin: 0;
    /* 移除列表项的默认外边距 */
    padding: 0;
    /* 移除列表项的默认内边距 */
}

.filter-button {
    padding: 8px 15px;
    /* 内边距 */
    font-size: 14px;
    /* 字体大小 */
    color: #333;
    /* 默认文字颜色 */
    background-color: #fff;
    /* 默认背景颜色 */
    border: 1px solid #ccc;
    /* 边框 */
    border-radius: 20px;
    /* 圆角 */
    cursor: pointer;
    /* 鼠标指针样式 */
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    /* 过渡效果 */
    outline: none;
    /* 移除焦点轮廓 */
}

.filter-button:hover {
    background-color: #e9e9e9;
    /* 鼠标悬停背景色 */
    border-color: #bbb;
    /* 鼠标悬停边框色 */
}

.filter-button.active {
    background-color: #d6774a;
    /* 激活状态背景色 (类似图片中的深灰色) */
    color: #fff;
    /* 激活状态文字颜色 */
    border-color: #6c757d;
    /* 激活状态边框色 */
}

/* 针对小屏幕设备的媒体查询 */
@media (max-width: 768px) {
    .search-container {
        margin-bottom: 15px;
        /* 在小屏幕上减少与筛选按钮的间距 */
    }

    .search-box {
        font-size: 14px;
        /* 在小屏幕上可以适当减小字体大小 */
        padding: 8px 12px;
        /* 在小屏幕上可以适当减小内边距 */
    }

    .filter-list {
        gap: 8px;
        /* 调整小屏幕上按钮之间的间隙 */
    }

    .filter-button {
        padding: 6px 12px;
        /* 调整小屏幕上按钮的内边距 */
        font-size: 13px;
        /* 调整小屏幕上按钮的字体大小 */
    }
}

/* 工具列表样式 */
.tool-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    list-style: none;
    padding: 0;
    margin: 20px 0;
    width: 100%;
    box-sizing: border-box;
}

.tool-item {
    box-sizing: border-box;
    min-width: 0;
}

/* 添加媒体查询，在1000px以下时显示三列 */
@media (max-width: 1000px) {
    .tool-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 平板布局 */
@media (max-width: 768px) {
    .tool-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 手机布局 */
@media (max-width: 480px) {
    .tool-list {
        grid-template-columns: repeat(1, 1fr);
    }
}

.tool-card {
    display: flex;
    align-items: center;
    padding: 15px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s cubic-bezier(.4, 2, .3, 1), box-shadow 0.2s cubic-bezier(.4, 2, .3, 1);
    height: 90px;
    box-sizing: border-box;
    width: 100%;
}

/* 鼠标经过时的动画效果 */
.tool-card:hover {
    transform: translateY(-3px) scale(1.04);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.13);
    z-index: 2;
}

/* 响应式布局 */
@media (max-width: 768px) {
    .tool-item {
        width: calc((100% - 20px) / 2);
        /* 平板上每行两个，考虑间距 */
    }
}

@media (max-width: 480px) {
    .tool-item {
        width: 100%;
        /* 手机上每行一个 */
    }
}

.tool-icon {
    width: 64px;
    height: 64px;
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tool-icon img {
    width: 64px;
    height: 64px;
    object-fit: contain;
}

.tool-info {
    flex: 1;
    min-width: 0;
    /* 防止文本溢出 */
    overflow: hidden;
    /* 隐藏溢出内容 */
}

.tool-title {
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: 500;
    white-space: nowrap;
    /* 标题单行显示 */
    overflow: hidden;
    /* 隐藏溢出内容 */
    text-overflow: ellipsis;
    /* 显示省略号 */
}

.tool-category {
    font-size: 12px;
    color: #666;
}


/* 添加网站按钮样式 */
.add_website {
    padding: 8px 15px;
    font-size: 14px;
    color: #fff;
    background-color: #28a745;
    border: 1px solid #28a745;
    border-radius: 20px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    outline: none;
}

.add_website:hover {
    background-color: #218838;
    border-color: #1e7e34;
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
}

.modal-content h2 {
    margin: 0 0 20px 0;
    color: #333;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #666;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.submit-btn,
.cancel-btn {
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    border: none;
}

.submit-btn {
    background-color: #007bff;
    color: #fff;
}

.cancel-btn {
    background-color: #6c757d;
    color: #fff;
}

.submit-btn:hover {
    background-color: #0056b3;
}

.cancel-btn:hover {
    background-color: #5a6268;
}

/* 占位元素样式 */
.tool-placeholder {
    visibility: hidden;
}
