* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; color: #333; background: #f6f7f9; line-height: 1.7; }
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }

.site-header { background: #fff; border-bottom: 1px solid #e5e7eb; position: sticky; top: 0; z-index: 10; }
.site-header .wrap { display: flex; align-items: center; gap: 24px; height: 56px; }
.logo { font-size: 20px; font-weight: 700; color: #111; }
.nav { flex: 1; display: flex; gap: 16px; flex-wrap: wrap; }
.nav a { color: #555; font-size: 15px; }
.search input { padding: 6px 12px; border: 1px solid #d1d5db; border-radius: 16px; width: 160px; font-size: 14px; }

.main { padding: 24px 16px 48px; }

/* 首页视觉区 */
.hero { background: linear-gradient(135deg, #1e3a8a, #2563eb 55%, #38bdf8); border-radius: 12px; padding: 48px 32px; margin-bottom: 24px; color: #fff; }
.hero h1 { font-size: 30px; margin-bottom: 10px; letter-spacing: 1px; }
.hero p { opacity: .88; font-size: 15px; max-width: 560px; }

/* 文章卡片网格:一行 3 个 */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.post-card { background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.06); display: flex; flex-direction: column; transition: transform .18s ease, box-shadow .18s ease; }
.post-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,.09); }
.thumb-link { display: block; }
.thumb { aspect-ratio: 16 / 9; background: #e5e7eb; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease; }
.post-card:hover .thumb img { transform: scale(1.04); }
.thumb-ph { display: flex; align-items: center; justify-content: center; }
.thumb-ph span { color: rgba(255,255,255,.92); font-size: 20px; font-weight: 700; letter-spacing: 4px; text-shadow: 0 1px 4px rgba(0,0,0,.2); }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; flex: 1; }
.post-card h2 { font-size: 16px; line-height: 1.45; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-card h2 a { color: #111; }
.post-card h2 a:hover { color: #2563eb; text-decoration: none; }
.excerpt { color: #6b7280; font-size: 13px; line-height: 1.6; flex: 1; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.meta { color: #9ca3af; font-size: 12px; margin-top: 10px; }
.meta .cat { color: #2563eb; background: #eff6ff; padding: 2px 8px; border-radius: 10px; margin-right: 6px; }

@media (max-width: 900px) {
    .card-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .card-grid { grid-template-columns: 1fr; }
    .hero { padding: 32px 20px; }
    .hero h1 { font-size: 24px; }
}

.archive-title { font-size: 22px; margin-bottom: 20px; padding-left: 10px; border-left: 4px solid #2563eb; }
.archive-desc { color: #6b7280; font-size: 14px; margin: -10px 0 20px; }

.breadcrumb { font-size: 13px; color: #9ca3af; margin-bottom: 16px; }
.breadcrumb a { color: #6b7280; }

.tags { margin-top: 20px; padding-top: 16px; border-top: 1px solid #f3f4f6; font-size: 14px; color: #6b7280; }
.tags a { display: inline-block; background: #f3f4f6; padding: 3px 12px; border-radius: 12px; margin: 0 6px 6px 0; font-size: 13px; color: #555; }

.prev-next { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; font-size: 14px; }
.prev-next a { background: #fff; border-radius: 8px; padding: 12px 16px; flex: 1; max-width: 48%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.prev-next .next { text-align: right; margin-left: auto; }

.related { background: #fff; border-radius: 8px; padding: 20px 24px; margin-top: 16px; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.related h3 { font-size: 17px; margin-bottom: 10px; }
.related ul { margin-left: 20px; }
.related li { margin-bottom: 6px; font-size: 15px; }

.post-full { background: #fff; border-radius: 8px; padding: 32px; }
.post-full h1 { font-size: 26px; margin-bottom: 12px; }
.post-full .content { margin-top: 20px; font-size: 16px; }
.post-full .content h2, .post-full .content h3 { margin: 24px 0 12px; }
.post-full .content p { margin-bottom: 14px; }
.post-full .content img { max-width: 100%; border-radius: 4px; }
.post-full .content pre { background: #1f2937; color: #e5e7eb; padding: 14px; border-radius: 6px; overflow-x: auto; margin-bottom: 14px; }
.post-full .content code { font-family: Consolas, monospace; font-size: 14px; }
.post-full .content p code, .post-full .content li code { background: #f3f4f6; color: #dc2626; padding: 2px 6px; border-radius: 4px; }
.post-full .content ul, .post-full .content ol { margin: 0 0 14px 24px; }

.pager { display: flex; gap: 8px; justify-content: center; margin-top: 24px; }
.pager a, .pager .current { padding: 6px 14px; border-radius: 6px; background: #fff; border: 1px solid #e5e7eb; }
.pager .current { background: #2563eb; color: #fff; border-color: #2563eb; }

.empty { text-align: center; padding: 60px 0; color: #6b7280; }
.empty h1 { font-size: 64px; color: #d1d5db; }

.site-footer { border-top: 1px solid #e5e7eb; padding: 20px 0; text-align: center; color: #9ca3af; font-size: 13px; background: #fff; }

@media (max-width: 640px) {
    .site-header .wrap { flex-wrap: wrap; height: auto; padding: 10px 16px; gap: 10px; }
    .search input { width: 100%; }
    .search { width: 100%; }
    .post-full { padding: 20px 16px; }
}
