* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

body {
    display: flex;
    flex-direction: column;
}

header {
    background-color: #333;
    color: #fff;
    padding: 1rem 0;
    text-align: center;
}

header h1 {
    margin-bottom: 1rem;
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

nav ul li {
    margin: 0 0.5rem;
}

nav ul li a {
    color: #fff;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

nav ul li a:hover {
    background-color: #555;
}

main {
    flex: 1;
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    width: 100%;
}

h2 {
    margin-bottom: 1.5rem;
    color: #333;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.photo-item {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.photo-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.photo-item a {
    text-decoration: none;
    color: #333;
    display: block;
}

.photo-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s;
}

.photo-item:hover img {
    transform: scale(1.05);
}

.photo-info {
    padding: 1rem;
}

.photo-info h3 {
    margin-bottom: 0.5rem;
    color: #555;
}

.photo-info p {
    margin-bottom: 1rem;
    color: #666;
    font-size: 0.9rem;
}

.photo-info span {
    font-size: 0.8rem;
    color: #999;
}

.photo-detail {
    background-color: #fff;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    margin: 0 auto;
}

.photo-detail img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 1.5rem;
}

.photo-meta {
    margin-bottom: 1.5rem;
}

.photo-meta h2 {
    margin-bottom: 0.5rem;
}

.photo-description {
    margin-bottom: 2rem;
    padding: 1rem;
    background-color: #f9f9f9;
    border-radius: 4px;
}

.photo-description h3 {
    margin-bottom: 0.5rem;
    color: #555;
}

.comments {
    margin-top: 2rem;
}

.comment {
    background-color: #f9f9f9;
    border-radius: 4px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.comment-name {
    font-weight: bold;
    color: #333;
}

.comment-time {
    font-size: 0.8rem;
    color: #999;
}

.comment-form {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: #f9f9f9;
    border-radius: 4px;
}

.comment-form h4 {
    margin-bottom: 1rem;
    color: #333;
}

form {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #555;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group textarea {
    resize: vertical;
}

button {
    background-color: #333;
    color: #fff;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #555;
}

footer {
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 1rem 0;
    margin-top: auto;
    width: 100%;
}

@media (max-width: 768px) {
    header {
        padding: 0.8rem 0;
    }
    
    header h1 {
        font-size: 1.5rem;
        margin-bottom: 0.8rem;
    }
    
    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }
    
    nav ul {
        flex-direction: column;
        align-items: center;
    }
    
    nav ul li {
        margin: 0.3rem 0;
    }
    
    nav ul li a {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
    
    main {
        margin: 1rem auto;
        padding: 0 0.8rem;
    }
    
    h2 {
        font-size: 1.3rem;
        margin-bottom: 1rem;
    }
    
    .photo-detail {
        padding: 1rem;
    }
    
    .photo-item img {
        height: 180px;
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 0.7rem;
        font-size: 0.9rem;
    }
    
    button {
        padding: 0.7rem 1.2rem;
        font-size: 0.9rem;
    }
    
    .comment {
        padding: 0.8rem;
    }
    
    .comment-form {
        padding: 1.2rem;
    }
}