* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.header {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    text-align: center;
    padding: 40px 20px;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 300;
}

.header p {
    font-size: 1.1em;
    opacity: 0.9;
}

.resources {
    padding: 40px;
}

.resource-item {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.resource-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.resource-title {
    font-size: 1.3em;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
}

.resource-desc {
    color: #7f8c8d;
    font-size: 0.95em;
    margin-bottom: 15px;
}

.resource-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9em;
}

.resource-size {
    color: #3498db;
    font-weight: 500;
}

.resource-date {
    color: #95a5a6;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    margin: 10% auto;
    padding: 0;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
    padding: 25px;
    text-align: center;
    border-radius: 20px 20px 0 0;
}

.modal-header h3 {
    font-size: 1.4em;
    font-weight: 500;
}

.modal-body {
    padding: 30px;
    text-align: center;
}

.password-input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e1e8ed;
    border-radius: 10px;
    font-size: 1.2em;
    text-align: center;
    margin-bottom: 20px;
    transition: border-color 0.3s ease;
    letter-spacing: 3px;
}

.password-input:focus {
    outline: none;
    border-color: #4facfe;
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
}

.modal-buttons {
    display: flex;
    gap: 15px;
}

.btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-primary {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(79, 172, 254, 0.3);
}

.btn-secondary {
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.btn-secondary:hover {
    background: #e9ecef;
}

.error-message {
    color: #e74c3c;
    font-size: 0.9em;
    margin-top: 10px;
    display: none;
}

.success-page {
    display: block; /* Should be none by default, controlled by JS */
    text-align: center;
    padding: 40px;
}

.success-icon {
    font-size: 4em;
    color: #27ae60;
    margin-bottom: 20px;
}

.download-links {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
}

.download-link {
    display: block;
    background: white;
    color: #2c3e50;
    text-decoration: none;
    padding: 15px 20px;
    margin: 10px 0;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
}

.download-link:hover {
    background: #4facfe;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(79, 172, 254, 0.3);
}

.footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 20px;
    font-size: 0.9em;
    opacity: 0.8;
}

/* 留言板样式 */
.message-board {
    background: #f8f9fa;
    margin: 0 40px 40px 40px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.message-header {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    padding: 30px;
    text-align: center;
    color: #2c3e50;
}

.message-header h2 {
    font-size: 1.8em;
    margin-bottom: 10px;
    font-weight: 600;
}

.message-header p {
    font-size: 1em;
    opacity: 0.8;
}

.message-form {
    padding: 30px;
    background: white;
}

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

.form-input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e1e8ed;
    border-radius: 10px;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: #4facfe;
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
}

.form-textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e1e8ed;
    border-radius: 10px;
    font-size: 1em;
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.form-textarea:focus {
    outline: none;
    border-color: #4facfe;
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
}

.btn-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    width: 100%;
}

.btn-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.btn-gradient span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.messages-list {
    padding: 30px;
    background: #f8f9fa;
}

.messages-list h3 {
    color: #2c3e50;
    margin-bottom: 25px;
    font-size: 1.3em;
    font-weight: 600;
}

#firebase-messages-list p { /* Style for "加载中..." and "还没有留言..." */
    color: #7f8c8d;
    text-align: center;
    padding: 20px 0;
}


.message-item {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border-left: 4px solid #4facfe;
    transition: transform 0.2s ease;
}

.message-item:hover {
    transform: translateX(5px);
}

.message-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.9em;
}

.message-author {
    font-weight: 600;
    color: #4facfe;
}

.message-time {
    color: #95a5a6;
}

.message-content {
    color: #2c3e50;
    line-height: 1.6;
    margin-bottom: 10px; /* Removed as per original for user messages, can be re-added if spacing is off */
}

.admin-reply { /* This style will remain for now, but won't be used by new Firebase messages */
    background: #e8f5e8;
    border-radius: 8px;
    padding: 12px;
    margin-top: 10px;
    border-left: 3px solid #27ae60;
}

.admin-tag { /* This style will remain for now */
    background: #27ae60;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 500;
    margin-right: 8px;
}

.reply-content { /* This style will remain for now */
    color: #2c3e50;
    font-size: 0.9em;
}

/* Removed .success-notification and its @keyframes slideDown as it's not used with Firebase simple alert */