* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
       background: #f5f6f7; color: #333; font-size: 14px; line-height: 1.8; }
a { text-decoration: none; color: inherit; }

/* ===== 顶部导航 ===== */
.topbar { background: #fff; border-bottom: 1px solid #e4e4e4; height: 56px;
          position: sticky; top: 0; z-index: 100; }
.topbar-inner { max-width: 1400px; margin: 0 auto; height: 100%;
               display: flex; align-items: center; padding: 0 24px; gap: 32px; }
.logo { font-size: 22px; font-weight: 700; color: #c81623; }
.logo span { color: #333; }
.search-box { flex: 1; max-width: 400px; position: relative; }
.search-box input { width: 100%; height: 34px; border: 1px solid #ddd; border-radius: 17px;
                    padding: 0 40px 0 16px; font-size: 13px; outline: none; background: #f5f6f7; }
.search-box input:focus { border-color: #c81623; background: #fff; }
.search-box button { position: absolute; right: 4px; top: 3px; width: 28px; height: 28px;
                     border: none; background: none; cursor: pointer; color: #999; font-size: 16px; }
.topnav { display: flex; gap: 24px; margin-left: auto; }
.topnav a { font-size: 14px; color: #555; padding: 4px 0; }
.topnav a:hover, .topnav a.active { color: #c81623; }
.topnav a.write-btn { background: #c81623; color: #fff; padding: 6px 16px; border-radius: 4px; }

/* ===== 主体三栏布局 ===== */
.layout { max-width: 1400px; margin: 20px auto; padding: 0 24px;
          display: grid; grid-template-columns: 240px 1fr 280px; gap: 20px; align-items: start; }

/* ===== 左栏：博主信息 ===== */
.profile-card { background: #fff; border-radius: 8px; padding: 24px 20px; text-align: center;
                position: sticky; top: 76px; }
.profile-card .avatar { width: 80px; height: 80px; border-radius: 50%; margin: 0 auto 12px;
                        background: linear-gradient(135deg, #667eea, #764ba2);
                        display: flex; align-items: center; justify-content: center;
                        font-size: 32px; color: #fff; font-weight: 700; }
.profile-card h3 { font-size: 16px; margin-bottom: 4px; }
.profile-card .bio { font-size: 12px; color: #999; margin-bottom: 16px; }
.profile-stats { display: flex; justify-content: center; gap: 24px; margin-bottom: 16px;
                 padding: 12px 0; border-top: 1px solid #f0f0f0; border-bottom: 1px solid #f0f0f0; }
.profile-stats div { text-align: center; }
.profile-stats .num { font-size: 16px; font-weight: 600; color: #333; display: block; }
.profile-stats .label { font-size: 11px; color: #999; }
.follow-btn { width: 100%; height: 36px; border: 1px solid #c81623; color: #c81623;
              background: #fff; border-radius: 4px; cursor: pointer; font-size: 14px; }
.follow-btn:hover { background: #c81623; color: #fff; }

/* ===== 中栏：文章列表/正文 ===== */
.main-col { min-width: 0; }
.post-list { display: flex; flex-direction: column; gap: 16px; }
.post-item { background: #fff; border-radius: 8px; padding: 20px 24px; display: flex; gap: 16px; }
.post-item .thumb { width: 120px; height: 80px; border-radius: 6px; background: #eee; flex-shrink: 0;
                     display: flex; align-items: center; justify-content: center; font-size: 28px; }
.post-item .content { flex: 1; min-width: 0; }
.post-item h2 { font-size: 17px; margin-bottom: 8px; }
.post-item h2 a:hover { color: #c81623; }
.post-item .excerpt { font-size: 13px; color: #888; margin-bottom: 10px;
                      display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-item .meta { font-size: 12px; color: #bbb; display: flex; gap: 16px; align-items: center; }
.post-item .meta .tag { background: #fff0f0; color: #c81623; padding: 1px 8px; border-radius: 3px; font-size: 11px; }

/* ===== 文章详情页 ===== */
.article-card { background: #fff; border-radius: 8px; padding: 32px 40px; }
.article-card h1 { font-size: 26px; font-weight: 700; margin-bottom: 16px; line-height: 1.4; }
.article-meta { font-size: 12px; color: #999; display: flex; gap: 20px; align-items: center;
                padding-bottom: 16px; border-bottom: 1px solid #f0f0f0; margin-bottom: 24px; }
.article-meta .orig { background: #c81623; color: #fff; padding: 1px 6px; border-radius: 3px; font-size: 11px; }
.article-body { font-size: 15px; line-height: 1.9; color: #333; }
.article-body h2 { font-size: 20px; margin: 32px 0 16px; padding-left: 12px; border-left: 4px solid #c81623; }
.article-body h3 { font-size: 17px; margin: 24px 0 12px; }
.article-body p { margin-bottom: 16px; }
.article-body code { background: #f5f5f5; padding: 2px 6px; border-radius: 3px; font-family: Consolas, monospace;
                     font-size: 13px; color: #c7254e; }
.article-body pre { background: #2d2d2d; color: #ccc; padding: 16px; border-radius: 6px;
                    overflow-x: auto; margin-bottom: 16px; font-size: 13px; line-height: 1.6; }
.article-body pre code { background: none; color: #ccc; padding: 0; }
.article-body blockquote { border-left: 4px solid #ddd; padding-left: 16px; color: #888;
                           margin-bottom: 16px; background: #fafafa; padding: 12px 16px; }
.article-body table { width: 100%; border-collapse: collapse; margin-bottom: 16px; font-size: 13px; }
.article-body th, .article-body td { border: 1px solid #e4e4e4; padding: 8px 12px; text-align: left; }
.article-body th { background: #f5f6f7; font-weight: 600; }
.article-body img { max-width: 100%; border-radius: 6px; margin: 12px 0; }
.article-body ul, .article-body ol { padding-left: 24px; margin-bottom: 16px; }
.article-body li { margin-bottom: 6px; }
.copyright-box { margin-top: 32px; padding: 16px; background: #f9f9f9; border: 1px solid #eee;
                 border-radius: 6px; font-size: 12px; color: #888; line-height: 1.7; }

/* ===== 右栏：目录 ===== */
.toc-card { background: #fff; border-radius: 8px; padding: 16px 20px; position: sticky; top: 76px; }
.toc-card h4 { font-size: 14px; margin-bottom: 12px; color: #333; padding-bottom: 8px;
               border-bottom: 1px solid #f0f0f0; }
.toc-card ul { list-style: none; }
.toc-card li { margin-bottom: 2px; }
.toc-card a { display: block; font-size: 13px; color: #666; padding: 5px 8px; border-radius: 4px;
              white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toc-card a:hover { color: #c81623; background: #fff5f5; }
.toc-card a.l2 { padding-left: 24px; font-size: 12px; }
.toc-card a.l3 { padding-left: 40px; font-size: 12px; color: #999; }

/* ===== footer ===== */
.footer { background: #fff; border-top: 1px solid #e4e4e4; margin-top: 40px; padding: 32px 0;
          text-align: center; font-size: 12px; color: #999; }
.footer a { color: #666; margin: 0 8px; }

/* 响应式 */
@media (max-width: 1100px) { .layout { grid-template-columns: 1fr 280px; } .profile-card { display: none; } }
@media (max-width: 800px) { .layout { grid-template-columns: 1fr; } .toc-card { display: none; } }
