/* style.css - 网站样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    padding: 25px 30px;
    text-align: center;
}

.header h1 {
    margin-bottom: 15px;
    font-size: 2.2rem;
}

.nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 15px;
}

.nav a {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 50px;
    background-color: rgba(255, 255, 255, 0.2);
    transition: background-color 0.3s;
}

.nav a:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* 主要内容区域 */
.main-content {
    padding: 30px;
}

/* 欢迎区域 */
.welcome-section {
    background-color: #f0f8ff;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
    border-left: 5px solid #2575fc;
}

.welcome-section h2 {
    color: #2575fc;
    margin-bottom: 10px;
}

/* 日记区域 */
.diaries-section {
    margin-top: 30px;
}

.diaries-section h2 {
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
}

/* 日记卡片 */
.diary-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.diary-card {
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    padding: 20px;
    background-color: white;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.diary-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #eee;
    font-size: 0.9rem;
}

.diary-author {
    color: #2575fc;
    font-weight: bold;
}

.diary-date {
    color: #666;
}

.diary-content {
    line-height: 1.7;
    color: #444;
}

/* 登录/添加日记表单 */
.login-section, .add-diary-section {
    max-width: 600px;
    margin: 0 auto;
}

.login-form, .diary-form {
    background-color: #f9f9f9;
    padding: 25px;
    border-radius: 8px;
    margin-top: 20px;
}

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

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

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2575fc;
    box-shadow: 0 0 0 3px rgba(37, 117, 252, 0.1);
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

.btn-primary {
    background-color: #2575fc;
    color: white;
}

.btn-primary:hover {
    background-color: #1a68e8;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-small {
    padding: 5px 10px;
    font-size: 0.9rem;
}

.action-buttons {
    margin-top: 20px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* 提示信息 */
.alert {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 无日记提示 */
.no-diaries {
    text-align: center;
    padding: 40px 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
    color: #666;
}

/* 表单说明 */
.form-note {
    background-color: #f0f8ff;
    padding: 15px;
    border-radius: 6px;
    margin-top: 25px;
    font-size: 0.9rem;
}

.form-note code {
    background-color: #e9ecef;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
}

/* 页脚 */
.footer {
    text-align: center;
    padding: 20px;
    background-color: #f8f9fa;
    color: #666;
    border-top: 1px solid #eee;
    margin-top: 30px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header h1 {
        font-size: 1.8rem;
    }
    
    .nav {
        flex-direction: column;
        align-items: center;
    }
    
    .diary-header {
        flex-direction: column;
        gap: 5px;
    }
    
    .main-content {
        padding: 20px;
    }
}