/* ================= 书屋精选 前台样式 ================= */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
    --main: #1f4e79;
    --main-light: #2e6da4;
    --accent: #e67e22;
    --text: #333;
    --text-sub: #666;
    --text-light: #999;
    --bg: #f5f7fa;
    --border: #e8ecf1;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.7;
}
a { color: var(--text); text-decoration: none; transition: color .2s; }
a:hover { color: var(--main-light); }
.container { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* ---------- 头部 ---------- */
.site-header {
    background: #fff;
    border-bottom: 3px solid var(--main);
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.header-inner { display: flex; align-items: center; height: 64px; gap: 28px; }
.logo {
    font-size: 24px; font-weight: 700; color: var(--main);
    letter-spacing: 1px; white-space: nowrap;
}
.main-nav { display: flex; align-items: center; gap: 4px; flex: 1; overflow-x: auto; }
.nav-link {
    padding: 6px 14px; border-radius: 4px; white-space: nowrap;
    color: var(--text-sub); font-size: 15px;
}
.nav-link:hover { background: #eef3f8; color: var(--main); }
.search-box { display: flex; }
.search-box input {
    width: 200px; height: 36px; padding: 0 12px;
    border: 1px solid var(--border); border-right: none;
    border-radius: 4px 0 0 4px; outline: none; font-size: 14px;
}
.search-box input:focus { border-color: var(--main-light); }
.search-box button {
    height: 36px; padding: 0 18px; border: none; cursor: pointer;
    background: var(--main); color: #fff; border-radius: 0 4px 4px 0; font-size: 14px;
}
.search-box button:hover { background: var(--main-light); }

/* ---------- 布局 ---------- */
.main-wrap { display: block; padding: 20px 16px 40px; }
.page-layout { display: flex; gap: 20px; align-items: flex-start; }
.main-col { flex: 1; min-width: 0; }
.side-col { width: 300px; flex-shrink: 0; }

/* ---------- 区块标题 ---------- */
.section-head { margin-bottom: 14px; }
.section-title {
    font-size: 20px; color: var(--main);
    padding-left: 12px; position: relative;
}
.section-title::before {
    content: ""; position: absolute; left: 0; top: 4px; bottom: 4px;
    width: 4px; border-radius: 2px; background: var(--accent);
}

/* ---------- 文章列表（卡片） ---------- */
.article-list { display: flex; flex-direction: column; gap: 12px; }
.article-item {
    display: flex; gap: 16px; background: #fff;
    border: 1px solid var(--border); border-radius: 8px; padding: 16px;
    transition: box-shadow .2s, transform .2s;
}
.article-item:hover { box-shadow: 0 4px 16px rgba(31,78,121,.12); }
.item-thumb-box { flex-shrink: 0; }
.item-thumb {
    width: 180px; height: 120px; object-fit: cover;
    border-radius: 6px; display: block; background: #eef3f8;
}
.item-thumb-placeholder {
    background: linear-gradient(135deg, #dfe9f3, #c3d5e8);
}
.item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.item-title { font-size: 17px; line-height: 1.5; margin-bottom: 6px; }
.item-title a {
    display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.item-summary {
    color: var(--text-light); font-size: 13px; line-height: 1.7;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; margin-bottom: auto;
}
.item-meta {
    display: flex; align-items: center; gap: 6px;
    font-size: 12px; color: var(--text-light); margin-top: 8px;
    white-space: nowrap;
}
.meta-account { color: var(--main); font-size: 12px; }
.meta-cate { color: var(--accent); font-size: 12px; }
.meta-dot { color: #ccc; }

/* 纯文字列表（公众号页） */
.article-list-plain { gap: 0; background: #fff; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.article-row { padding: 16px; border-bottom: 1px solid var(--border); }
.article-row:last-child { border-bottom: none; }
.row-title { font-size: 16px; font-weight: 500; }
.row-title a { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.article-row:hover { background: #fafcfe; }

/* ---------- 面包屑 ---------- */
.breadcrumb { font-size: 13px; color: var(--text-light); margin-bottom: 14px; }
.breadcrumb em { font-style: normal; color: var(--text-sub); }
.breadcrumb .sep { margin: 0 8px; color: #ccc; }

/* ---------- 文章详情 ---------- */
.article-detail { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 28px 32px; }
.detail-title { font-size: 26px; line-height: 1.5; margin-bottom: 12px; word-break: break-all; }
.detail-meta { font-size: 13px; color: var(--text-light); margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.detail-content { font-size: 16px; }
.detail-content p { margin: 14px 0; }
.detail-content img { max-width: 100%; height: auto; border-radius: 4px; }
.detail-content h2, .detail-content h3 { margin: 20px 0 10px; }
.detail-content a { color: var(--main-light); }
.detail-content blockquote {
    border-left: 4px solid var(--accent); background: #faf6f0;
    padding: 10px 16px; margin: 14px 0; color: var(--text-sub); border-radius: 0 4px 4px 0;
}
.detail-content pre { background: #282c34; color: #abb2bf; padding: 16px; border-radius: 6px; overflow-x: auto; font-size: 14px; }
.detail-tags { margin-top: 20px; padding-top: 16px; border-top: 1px dashed var(--border); font-size: 13px; color: var(--text-light); }

/* 上下篇 */
.prev-next { display: flex; gap: 12px; margin-top: 16px; }
.pn-link {
    flex: 1; background: #fff; border: 1px solid var(--border); border-radius: 8px;
    padding: 14px 18px; font-size: 13px; color: var(--text-light);
}
.pn-link span {
    display: block; margin-top: 4px; font-size: 14px; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pn-next { text-align: right; }
.pn-link:hover { border-color: var(--main-light); }
.pn-disabled { background: #fbfcfd; color: #ccc; }
.pn-disabled span { color: #ccc; }

/* 相关推荐 */
.related-box { margin-top: 16px; border: 1px solid var(--border); border-radius: 8px; background: #fff; padding: 16px 18px; }
.related-list li { padding: 8px 0; border-bottom: 1px dashed var(--border); }
.related-list li:last-child { border-bottom: none; }

/* ---------- 侧栏 ---------- */
.side-box { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 18px; margin-bottom: 16px; }
.side-title {
    font-size: 16px; color: var(--main); margin-bottom: 14px;
    padding-bottom: 10px; border-bottom: 2px solid var(--accent);
    display: inline-block;
}
.account-list li { border-bottom: 1px dashed var(--border); }
.account-list li:last-child { border-bottom: none; }
.account-list a { display: flex; align-items: center; gap: 10px; padding: 9px 0; }
.acc-avatar {
    width: 36px; height: 36px; border-radius: 50%; object-fit: cover;
    flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
}
.acc-avatar-text { background: var(--main); color: #fff; font-size: 15px; }
.acc-name {
    flex: 1; min-width: 0; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis; font-size: 14px;
}
.acc-count { font-size: 12px; color: var(--text-light); flex-shrink: 0; }

.rank-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.rank-num {
    width: 22px; height: 22px; border-radius: 4px; flex-shrink: 0;
    background: #e8ecf1; color: var(--text-light);
    font-size: 12px; display: inline-flex; align-items: center; justify-content: center;
}
.rank-1 { background: #e74c3c; color: #fff; }
.rank-2 { background: #e67e22; color: #fff; }
.rank-3 { background: #f1c40f; color: #fff; }
.rank-title {
    flex: 1; min-width: 0; font-size: 14px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.cate-list li { border-bottom: 1px dashed var(--border); }
.cate-list li:last-child { border-bottom: none; }
.cate-list a { display: block; padding: 9px 0; font-size: 14px; }
.cate-list a.current, .cate-list a:hover { color: var(--main); }

/* ---------- 公众号头部 ---------- */
.account-head {
    display: flex; gap: 18px; background: #fff;
    border: 1px solid var(--border); border-radius: 8px;
    padding: 22px; margin-bottom: 16px; align-items: center;
}
.account-head-avatar {
    width: 72px; height: 72px; border-radius: 12px; object-fit: cover; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
}
.account-head-text { background: var(--main); color: #fff; font-size: 28px; }
.account-head-name { font-size: 22px; margin-bottom: 4px; }
.account-head-wx { font-size: 13px; color: var(--text-light); }
.account-head-intro { font-size: 14px; color: var(--text-sub); margin: 4px 0; }
.account-head-stat { font-size: 13px; color: var(--accent); }

/* ---------- 分页 ---------- */
.pagination { margin-top: 20px; text-align: center; }
.pagination ul { display: inline-flex; gap: 6px; list-style: none; flex-wrap: wrap; justify-content: center; }
.pagination li a, .pagination li span {
    display: inline-block; min-width: 36px; height: 36px; line-height: 36px;
    padding: 0 12px; background: #fff; border: 1px solid var(--border);
    border-radius: 4px; font-size: 14px; color: var(--text-sub);
}
.pagination li a:hover { border-color: var(--main-light); color: var(--main); }
.pagination .active span, .pagination .active a {
    background: var(--main); border-color: var(--main); color: #fff;
}
.pagination .disabled span { color: #ccc; background: #fbfcfd; }

/* ---------- 空提示 ---------- */
.empty-tip {
    background: #fff; border: 1px dashed var(--border); border-radius: 8px;
    padding: 60px 20px; text-align: center; color: var(--text-light);
}

/* ---------- 底部 ---------- */
.site-footer {
    background: #2c3e50; color: #bdc3c7;
    padding: 28px 0; margin-top: 20px; text-align: center; font-size: 13px;
}
.footer-nav { margin-bottom: 10px; }
.footer-nav a { color: #ecf0f1; margin: 0 10px; }
.footer-nav a:hover { color: #fff; }
.icp-line { margin-top: 6px; }
.icp-line a { color: #95a5a6; }
.icp-line a:hover { color: #fff; }

/* ---------- 响应式 ---------- */
@media (max-width: 960px) {
    .page-layout { flex-direction: column; }
    .side-col { width: 100%; }
    .header-inner { flex-wrap: wrap; height: auto; padding: 10px 0; gap: 10px; }
    .main-nav { order: 3; width: 100%; }
    .search-box { margin-left: auto; }
    .search-box input { width: 140px; }
    .article-detail { padding: 20px; }
    .detail-title { font-size: 21px; }
}
@media (max-width: 560px) {
    .article-item { flex-direction: column; }
    .item-thumb, .item-thumb-placeholder { width: 100%; height: 160px; }
    .prev-next { flex-direction: column; }
    .pn-next { text-align: left; }
}
