/* 数字花园 - 简洁博客样式 */

:root {
    --primary: #2d5a27;
    --secondary: #4a7c59;
    --accent: #8fbc8f;
    --bg: #faf9f7;
    --text: #333;
    --text-light: #666;
    --border: #e0e0e0;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    line-height: 1.8;
    color: var(--text);
    background: var(--bg);
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 页头 */
header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 40px 0;
    margin-bottom: 40px;
}

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

header .subtitle {
    opacity: 0.9;
    margin-bottom: 20px;
}

nav {
    display: flex;
    gap: 20px;
}

nav a {
    color: white;
    text-decoration: none;
    padding: 5px 15px;
    border-radius: 20px;
    transition: background 0.3s;
}

nav a:hover, nav a.active {
    background: rgba(255,255,255,0.2);
}

/* 主内容 */
main {
    min-height: 60vh;
}

h2 {
    color: var(--primary);
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent);
}

/* 文章卡片 */
.post-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}

.post-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.post-card h3 {
    margin-bottom: 15px;
}

.post-card h3 a {
    color: var(--primary);
    text-decoration: none;
}

.post-card h3 a:hover {
    color: var(--secondary);
}

.post-meta {
    font-size: 0.9em;
    color: var(--text-light);
    margin-bottom: 15px;
    display: flex;
    gap: 15px;
}

.post-excerpt {
    color: var(--text-light);
    margin-bottom: 15px;
}

.read-more {
    color: var(--secondary);
    text-decoration: none;
    font-weight: 500;
}

.read-more:hover {
    color: var(--primary);
}

.loading, .empty {
    text-align: center;
    color: var(--text-light);
    padding: 40px;
}

/* 文章页 */
.post-content {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.post-content h1 {
    color: var(--primary);
    margin-bottom: 20px;
}

.post-content .post-header {
    border-bottom: 1px solid var(--border);
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.post-content .post-body {
    line-height: 2;
}

.post-content .post-body p {
    margin-bottom: 20px;
}

.post-content .post-body img {
    max-width: 100%;
    border-radius: 8px;
    margin: 20px 0;
}

.post-content .post-body code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
}

.post-content .post-body pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 20px 0;
}

.back-link {
    display: inline-block;
    margin-top: 30px;
    color: var(--secondary);
    text-decoration: none;
}

/* 关于页面 */
.about-content {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.about-content h2 {
    border-bottom: none;
    margin-bottom: 30px;
}

/* 页脚 */
footer {
    text-align: center;
    padding: 40px 0;
    color: var(--text-light);
    border-top: 1px solid var(--border);
    margin-top: 60px;
}

.footer-note {
    font-size: 0.85em;
    margin-top: 10px;
    color: #999;
}

/* 响应式 */
@media (max-width: 600px) {
    header h1 { font-size: 1.8em; }
    .post-card { padding: 20px; }
    .post-content { padding: 25px; }
}

/* 管理登录 */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 40px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.login-container h2 {
    text-align: center;
    border-bottom: none;
    margin-bottom: 30px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1em;
}

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

.btn {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: background 0.3s;
}

.btn:hover {
    background: var(--secondary);
}

.error {
    color: #d32f2f;
    margin-bottom: 20px;
    text-align: center;
}

.success {
    color: var(--primary);
    margin-bottom: 20px;
    text-align: center;
}
