/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: #2196f3;
    color: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 1.5em;
}

header nav a {
    color: white;
    text-decoration: none;
    margin-left: 15px;
}

header nav a:hover {
    text-decoration: underline;
}

/* 表单样式 */
.form-section {
    background: white;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.form-section h2 {
    margin-bottom: 15px;
    color: #333;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* 按钮样式 */
.btn {
    padding: 10px 20px;
    background: #2196f3;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.btn:hover {
    background: #1976d2;
}

.success {
    background: #d4edda;
    color: #155724;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    border: 1px solid #c3e6cb;
}

.error {
    background: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    border: 1px solid #f5c6cb;
}

/* 留言卡片样式 */
.messages-section {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.messages-section h2 {
    margin-bottom: 20px;
    color: #333;
}

.no-messages {
    text-align: center;
    padding: 40px;
    color: #999;
}

.message-card {
    background: #fafafa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid #eee;
}

.message-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
}

.message-header .name {
    font-size: 1.1em;
    font-weight: bold;
    color: #333;
}

.message-header .email {
    color: #666;
    font-size: 0.9em;
}

.message-header .time {
    color: #999;
    font-size: 0.85em;
    margin-left: auto;
}

.message-header .ip {
    color: #aaa;
    font-size: 0.8em;
}

.message-header .status-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.status-visible {
    background: #4caf50;
    color: white;
}

.status-hidden {
    background: #f44336;
    color: white;
}

.content {
    white-space: pre-wrap;
    word-wrap: break-word;
    color: #444;
    line-height: 1.6;
}

.reply {
    background: #e3f2fd;
    padding: 10px 15px;
    margin-top: 10px;
    border-radius: 4px;
    border-left: 3px solid #2196f3;
}

.reply strong {
    color: #1565c0;
}

.actions {
    margin-top: 15px;
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

.pagination a {
    padding: 8px 16px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
}

.pagination a:hover {
    background: #f5f5f5;
}

.pagination span {
    color: #666;
}

/* 登录页面 */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.login-form .form-group {
    margin-bottom: 15px;
}

.login-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.login-form input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

/* 后台管理 */
.admin-nav {
    margin-bottom: 20px;
    padding: 10px;
    background: #fff;
    border-radius: 4px;
}

.admin-nav a {
    color: #2196f3;
    text-decoration: none;
    margin-right: 15px;
}

/* 响应式 */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 10px;
    }
    
    header h1 {
        text-align: center;
    }
    
    .message-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .message-header .time {
        margin-left: 0;
        margin-top: 5px;
    }
}