/* css/style.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    width: 100%;
    margin: 0 auto;
    padding: 20px;
}

/* 搜索框样式 */
.search-box {
    text-align: center;
    margin-bottom: 30px;
}

.search-box form {
    display: inline-flex;
    width: 100%;
    max-width: 600px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-radius: 24px;
    overflow: hidden;
}

.search-box input {
    flex: 1;
    padding: 12px 20px;
    border: none;
    font-size: 16px;
    outline: none;
}

.search-box button {
    padding: 12px 24px;
    background-color: #4e6ef2;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

/* 分类样式 - 改为按钮样式 */
.categories {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 10px;
}

.category {
    padding: 8px 16px;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 20px;
    color: #666;
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    font-size: 14px;
}

.category:hover {
    background-color: #f0f0f0;
    color: #333;
}

.category.active {
    background-color: #4e6ef2;
    color: white;
    border-color: #4e6ef2;
}

/* 分类容器样式 - 每个分类单独一行 */
.categories-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 分类行样式 */
.category-row {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.category-header {
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    background-color: #f8f9fa;
}

.category-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin: 0;
}

.category-content {
    padding: 20px;
}

/* 链接网格样式 */
.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 20px;
}

.link-item {
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s;
    position: relative;
}

.link-item:hover {
    transform: translateY(-3px);
}

.link-url {
    text-decoration: none;
    color: inherit;
    display: block;
}

.link-logo {
    position: relative;
    width: 60px;
    height: 60px;
    margin: 0 auto 10px;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.link-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.default-icon {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #4e6ef2;
    color: white;
    font-weight: bold;
    font-size: 20px;
}

.link-item .actions {
    position: absolute;
    top: -0px;
    right: -16px;
    display: none;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 10;
    pointer-events: none;
}

.link-item:hover .actions {
    display: flex;
}

.actions a, .actions button {
    padding: 5px 8px;
    font-size: 11px;
    border: none;
    background: none;
    cursor: pointer;
    text-decoration: none;
    color: #666;
    white-space: nowrap;
    pointer-events: auto;
}

.link-name {
    font-size: 13px;
    color: #333;
    margin-bottom: 5px;
    word-break: break-word;
}

/* 分类内添加按钮样式 */
.add-in-category .link-logo {
    background-color: #e9ecef;
    color: #6c757d;
    font-size: 24px;
    font-weight: bold;
    border: 2px dashed #ced4da;
}

.add-in-category .link-name {
    color: #6c757d;
    font-weight: 500;
}

.no-links {
    text-align: center;
    padding: 40px;
    color: #999;
}

.no-links-section {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

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

.modal.show {
    display: flex;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

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

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
}

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

.btn-primary, .btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.btn-primary {
    background-color: #4e6ef2;
    color: white;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .links-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 15px;
    }
    
    .categories {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 10px;
    }
    
    .category-title {
        font-size: 16px;
    }
    
    .link-logo {
        width: 50px;
        height: 50px;
    }
    
    .category-header,
    .category-content {
        padding: 15px;
    }
}