/* 极简样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
}

/* 登录页面 */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.login-container h1 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #333;
}

.login-container input {
    width: 100%;
    padding: 12px;
    margin: 8px 0;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.login-container button {
    width: 100%;
    padding: 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 1rem;
}

.login-container button:hover {
    background: #5a6fd8;
}

.error {
    color: #e74c3c;
    text-align: center;
    margin-bottom: 1rem;
}

/* 主页面 */
header {
    background: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-info a {
    margin-left: 1rem;
    text-decoration: none;
    color: #667eea;
}

.nav-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.category {
    background: white;
    margin-bottom: 2rem;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.category h2 {
    margin-bottom: 1rem;
    color: #333;
    border-bottom: 2px solid #667eea;
    padding-bottom: 0.5rem;
}

.links {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.nav-link {
    display: block;
    padding: 1rem;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 5px;
    text-decoration: none;
    color: #333;
    text-align: center;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

/* 管理后台 */
.admin-container {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.admin-section {
    background: white;
    margin-bottom: 2rem;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.admin-section h2 {
    margin-bottom: 1rem;
    color: #333;
}

.add-form {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.add-form input, .add-form select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.add-form button {
    padding: 8px 16px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.link-item, .user-item {
    padding: 0.8rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.delete-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
}
/* 错误消息样式 */
.error-message {
    background: #ffeaa7;
    border: 1px solid #fdcb6e;
    color: #e17055;
    padding: 12px;
    border-radius: 5px;
    margin-bottom: 1rem;
    text-align: center;
}

/* 管理后台项目样式 */
.link-item, .user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
    margin-bottom: 8px;
    border-radius: 5px;
}

.link-info, .user-info {
    flex: 1;
}

.user-role {
    color: #667eea;
    font-weight: bold;
}

.current-user {
    background: #667eea;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
    margin-left: 8px;
}

.cannot-delete {
    color: #999;
    font-style: italic;
}

.delete-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
}

.delete-btn:hover {
    background: #c82333;
}

.link-list h3, .user-list h3 {
    margin-bottom: 1rem;
    color: #555;
    border-bottom: 1px solid #ddd;
    padding-bottom: 0.5rem;
}