﻿/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 头部样式 */
header {
    background: linear-gradient(135deg, #3498db, #2c3e50);
    color: white;
    padding: 20px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

header h1 {
    text-align: center;
    margin-bottom: 15px;
}

.search-form {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
}

.search-form input {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 3px 0 0 3px;
    font-size: 16px;
}

.search-form button {
    padding: 10px 15px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 0 3px 3px 0;
    cursor: pointer;
}

/* 导航样式 */
nav {
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.categories {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    list-style: none;
}

.categories li {
    margin: 5px;
}

.categories li a {
    display: block;
    padding: 8px 15px;
    background: #ecf0f1;
    color: #333;
    text-decoration: none;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.categories li.active a,
.categories li a:hover {
    background: #3498db;
    color: white;
}

/* 主内容区 */
main {
    padding: 20px 0;
}

.links {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.link-item {
    background: white;
    border-radius: 5px;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.link-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.link-item a {
    text-decoration: none;
    color: inherit;
}

.link-item h3 {
    color: #3498db;
    margin-bottom: 5px;
}

.link-item p {
    color: #7f8c8d;
    font-size: 14px;
    word-break: break-all;
}

.empty {
    text-align: center;
    color: #7f8c8d;
    padding: 20px;
}

/* 页脚样式 */
footer {
    background: #2c3e50;
    color: white;
    padding: 20px 0;
    margin-top: 30px;
}

footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-links a {
    color: #bdc3c7;
    margin-left: 15px;
    text-decoration: none;
}

.footer-links a:hover {
    color: white;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 5px;
    max-width: 600px;
    width: 90%;
    position: relative;
}

.close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .links {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    footer .container {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-links {
        margin-top: 15px;
    }
    
    .footer-links a {
        margin: 0 7px;
    }
}