/* === 程序员小智 Blog Styles === */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg: #ffffff;
    --bg-card: #ffffff;
    --bg-hover: #f5f7fa;
    --border: #e5e7eb;
    --text: #1f2937;
    --text-muted: #6b7280;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --green: #16a34a;
    --orange: #d97706;
    --red: #dc2626;
    --radius: 8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans SC', sans-serif;
    background: #f3f4f6;
    color: var(--text);
    line-height: 1.7;
    min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* === Layout === */
.container { max-width: 860px; margin: 0 auto; padding: 0 20px; }

header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
    position: sticky; top: 0; z-index: 100;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
header .container { display: flex; justify-content: space-between; align-items: center; }
header .logo { font-size: 1.4rem; font-weight: 700; color: var(--accent); }
header .logo span { color: var(--text-muted); font-size: 0.8rem; margin-left: 8px; }
header nav a { margin-left: 20px; font-size: 0.9rem; }

main { padding: 40px 0; }

footer {
    text-align: center; padding: 24px 0; color: var(--text-muted);
    font-size: 0.85rem; border-top: 1px solid var(--border);
}

/* === Hero === */
.hero {
    text-align: center; padding: 60px 20px; margin-bottom: 40px;
    background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
    border: 1px solid var(--border); border-radius: var(--radius);
}
.hero h1 { font-size: 2.2rem; margin-bottom: 12px; color: #111827; }
.hero p { color: var(--text-muted); font-size: 1.1rem; }

/* === Article List === */
.article-list { display: flex; flex-direction: column; gap: 16px; }
.article-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 24px;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.article-card:hover { border-color: var(--accent); box-shadow: 0 2px 8px rgba(0,0,0,0.06); }

.article-card .meta {
    display: flex; gap: 12px; align-items: center;
    font-size: 0.82rem; color: var(--text-muted); margin-bottom: 8px;
}
.article-card .category {
    background: #dbeafe; color: var(--accent);
    padding: 2px 10px; border-radius: 12px; font-size: 0.75rem;
}
.article-card h2 { font-size: 1.25rem; margin-bottom: 8px; }
.article-card h2 a { color: var(--text); }
.article-card h2 a:hover { color: var(--accent); }
.article-card .summary { color: var(--text-muted); font-size: 0.92rem; }

/* === Article Detail === */
.article-detail { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 40px; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.article-detail .meta { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 24px; }
.article-detail h1 { font-size: 1.8rem; margin-bottom: 16px; color: #111827; }
.article-detail .content { font-size: 1.05rem; line-height: 1.9; }
.article-detail .content p { margin-bottom: 16px; }
.article-detail .content h2 { font-size: 1.3rem; margin: 28px 0 12px; color: var(--accent); }
.article-detail .content h3 { font-size: 1.15rem; margin: 20px 0 10px; }
.article-detail .content ul { margin: 12px 0 16px 24px; }
.article-detail .content li { margin-bottom: 6px; }
.article-detail .content pre {
    background: #f3f4f6; border: 1px solid var(--border); border-radius: var(--radius);
    padding: 16px; overflow-x: auto; margin: 16px 0; font-size: 0.9rem;
}
.article-detail .content code { background: #e5e7eb; padding: 2px 6px; border-radius: 4px; font-size: 0.9em; }
.article-detail .content pre code { background: none; padding: 0; }
.back-link { display: inline-block; margin-top: 24px; font-size: 0.9rem; }

/* === 404 === */
.empty { text-align: center; padding: 80px 20px; color: var(--text-muted); }
.empty h2 { font-size: 4rem; color: var(--accent); margin-bottom: 12px; }

/* === Admin Login === */
.login-box {
    max-width: 400px; margin: 80px auto; background: var(--bg-card);
    border: 1px solid var(--border); border-radius: var(--radius); padding: 40px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.login-box h2 { text-align: center; margin-bottom: 24px; font-size: 1.4rem; }
.login-box .error { color: var(--red); text-align: center; margin-bottom: 16px; font-size: 0.9rem; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 0.9rem; color: var(--text-muted); }
.form-group input, .form-group textarea, .form-group select {
    width: 100%; padding: 10px 14px; background: #f9fafb; border: 1px solid var(--border);
    border-radius: 6px; color: var(--text); font-size: 0.95rem; font-family: inherit;
}
.form-group textarea { min-height: 400px; resize: vertical; font-family: 'SF Mono', 'Fira Code', monospace; line-height: 1.6; }
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    outline: none; border-color: var(--accent); background: #fff;
}
.form-group .checkbox { display: flex; align-items: center; gap: 8px; }
.form-group .checkbox input { width: auto; }

.btn {
    display: inline-block; padding: 10px 24px; border: none; border-radius: 6px;
    font-size: 0.95rem; cursor: pointer; text-decoration: none; font-weight: 500;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #b91c1c; color: #fff; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 6px 14px; font-size: 0.85rem; }

/* === Admin Dashboard === */
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.admin-header h2 { font-size: 1.5rem; }
.actions { display: flex; gap: 8px; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td {
    padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border);
}
.admin-table th { font-size: 0.85rem; color: var(--text-muted); font-weight: 500; }
.admin-table tr:hover { background: var(--bg-hover); }
.status-draft { color: var(--text-muted); }
.status-published { color: var(--green); }

/* === Responsive === */
@media (max-width: 640px) {
    .hero h1 { font-size: 1.6rem; }
    .article-detail { padding: 20px; }
    .article-detail h1 { font-size: 1.4rem; }
    .admin-table { font-size: 0.85rem; }
    .admin-table th, .admin-table td { padding: 8px 10px; }
}
