/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

/* Header */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 2rem 1rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Main content */
main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

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

section h2 {
    color: #667eea;
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

/* Intro section */
.intro p {
    font-size: 1.1rem;
    line-height: 1.8;
}

/* Form styles */
.form-group {
    margin-bottom: 1.5rem;
}

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

.form-group input[type="text"],
.form-group input[type="date"],
.form-group input[type="number"],
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group input[type="file"] {
    padding: 0.5rem;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

#photoPreview {
    margin-top: 1rem;
}

#photoPreview img {
    max-width: 300px;
    max-height: 300px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

button:active {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#getLocationBtn {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    padding: 0.6rem 1rem;
}

#submitBtn {
    width: 100%;
    font-size: 1.1rem;
    padding: 1rem;
}

#uploadStatus {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 4px;
    display: none;
}

#uploadStatus.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

#uploadStatus.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

/* Chart section */
#temperatureChart {
    margin-top: 1.5rem;
}

#chartCanvas {
    max-width: 100%;
    height: 300px;
}

#temperatureStats {
    margin-top: 1.5rem;
}

.stat-card {
    background: #f8f9fa;
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 4px;
    border-left: 4px solid #667eea;
}

.stat-card h3 {
    color: #667eea;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

/* Gallery section */
#recordsGallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.record-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.record-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.record-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.record-info {
    padding: 1rem;
}

.record-info p {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.record-info strong {
    color: #667eea;
}

#loadMoreBtn {
    margin-top: 1.5rem;
    width: 100%;
}

/* Footer */
footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 1.5rem;
    margin-top: 2rem;
}

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

footer a:hover {
    text-decoration: underline;
}

/* Responsive design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    header p {
        font-size: 1rem;
    }
    
    section {
        padding: 1.5rem;
    }
    
    section h2 {
        font-size: 1.5rem;
    }
    
    #recordsGallery {
        grid-template-columns: 1fr;
    }
}
