body {
    background-color: #f5f5f5;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

h1 {
    color: #333;
    text-align: center;
    margin-bottom: 30px;
}

.tools-list {
    display: grid;
    grid-template-columns: 1fr;  /* 修改为单列布局 */
    gap: 20px;
    margin-bottom: 30px;
    max-width: 900px;  /* 限制最大宽度，使内容更易阅读 */
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

.tool-card {
    border: 1px solid #e0e0e0;
    padding: 25px;  /* 增加内边距 */
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.tool-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.tool-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    margin-right: 15px;
    object-fit: cover;
}

.tool-info h3 {
    margin: 0 0 5px 0;
    color: #333;
}

.tool-version {
    font-size: 0.9em;
    color: #666;
}

.tool-description {
    color: #555;
    margin: 10px 0;
    line-height: 1.5;
}

.tool-author {
    display: flex;
    align-items: center;
    margin: 15px 0;
}

.author-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 10px;
}

.author-name {
    color: #666;
    font-size: 0.9em;
}

.tool-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.btn {
    padding: 8px 15px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.2s;
}

.btn-edit {
    background: #4CAF50;
    color: white;
}

.btn-edit:hover {
    background: #45a049;
}

.btn-delete {
    background: #f44336;
    color: white;
}

.btn-delete:hover {
    background: #da190b;
}

.add-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #4CAF50;
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: transform 0.2s;
}

.add-btn:hover {
    transform: scale(1.1);
}

.tool-form {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(0,0,0,0.2);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.preview {
    margin-top: 10px;
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    overflow: hidden;
}

.preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.form-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.hidden {
    display: none;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: none;
}

.overlay.active {
    display: block;
}

/* 添加搜索框样式 */
.search-container {
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
}

.search-box {
    position: relative;
    width: 100%;
    max-width: 500px;
}

.search-box input {
    width: 100%;
    padding: 12px 45px 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
}

.search-box input:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 5px rgba(76, 175, 80, 0.3);
}

.search-box .search-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    cursor: pointer;
}

/* 添加无结果提示样式 */
.no-results {
    text-align: center;
    padding: 30px;
    color: #666;
    font-size: 1.1em;
    background: white;
    border-radius: 12px;
    margin: 20px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 自定义图标样式 */
.icon-search::before {
    content: '🔍';
    font-size: 16px;
}

.icon-edit::before {
    content: '✏️';
    margin-right: 4px;
}

.icon-delete::before {
    content: '🗑️';
    margin-right: 4px;
}

.icon-add::before {
    content: '+';
    font-size: 24px;
    font-weight: bold;
}

.icon-empty::before {
    content: '🔍';
    font-size: 24px;
    opacity: 0.5;
}

/* 调整图标在按钮中的位置 */
.btn i {
    display: inline-block;
    vertical-align: middle;
}

.form-tip {
    display: block;
    color: #666;
    font-size: 0.9em;
    margin-top: 4px;
}

.form-group input[type="file"] {
    padding: 8px;
    border: 1px dashed #ddd;
    border-radius: 6px;
    width: 100%;
    cursor: pointer;
}

.form-group input[type="file"]:hover {
    border-color: #4CAF50;
}

/* 上传进度条样式 */
.upload-progress {
    margin: 20px 0;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #eee;
}

.progress-text {
    margin-bottom: 10px;
    color: #666;
    font-size: 14px;
}

.progress-bar {
    height: 6px;
    background: #eee;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 5px;
}

.progress-fill {
    height: 100%;
    background: #4CAF50;
    width: 0;
    transition: width 0.3s ease;
}

.progress-percent {
    text-align: right;
    font-size: 12px;
    color: #666;
}

/* 上传时禁用按钮样式 */
button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 返回按钮样式 */
.header-nav {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 20px;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: #f5f5f5;
    border-radius: 20px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: #e0e0e0;
    transform: translateX(-2px);
}

.icon-back::before {
    content: '←';
    margin-right: 8px;
    font-size: 16px;
}

.tool-changelog {
    margin-top: 10px;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 4px;
    position: relative;
}

.tool-changelog h4 {
    margin: 0 0 5px 0;
    font-size: 14px;
    color: #666;
}

.tool-changelog pre {
    margin: 0;
    white-space: pre-wrap;
    font-family: inherit;
    font-size: 13px;
    color: #333;
    max-height: 100px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.tool-changelog.expanded pre {
    max-height: 1000px;
}

.changelog-toggle {
    display: none;
    width: 100%;
    padding: 5px;
    text-align: center;
    background: linear-gradient(to bottom, transparent, #f5f5f5);
    color: #4CAF50;
    border: none;
    cursor: pointer;
    font-size: 12px;
    position: absolute;
    bottom: 0;
    left: 0;
}

.changelog-toggle:hover {
    color: #45a049;
}

.tool-changelog.has-more .changelog-toggle {
    display: block;
}

@media (max-width: 768px) {
    html, body {
        overflow-x: hidden;
        position: relative;
        width: 100%;
    }

    body {
        padding: 10px;
    }

    .container {
        padding: 10px;
        width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    .tools-list {
        padding: 0 10px;
    }

    .tool-card {
        padding: 15px;
        margin: 0;
        width: 100%;
        box-sizing: border-box;
    }

    .tool-changelog pre {
        max-height: 80px;
        font-size: 12px;
    }
}

#changelog {
    min-height: 80px;
    resize: vertical;
}