:root {
    --c-main: #165DFF;
    --c-link: #165DFF;
    --c-dark: #333;
    --c-white: #fff;
    --c-bg: #f5f5f5;
    --c-tint: #fafafa;
    --c-line: #eee;
    --c-gray: #999;
    --c-text: #444;
    --c-header-bg: #fff;
    --c-header-text: #666;
    --c-header-link: #666;
    --c-header-hover: #165DFF;
    --c-footer-bg: #fff;
    --c-footer-text: #999;
    --c-btn: #165DFF;
    --c-btn-hover: #0e42d2;
    --c-tag-bg: #f0f5ff;
    --c-tag-color: #165DFF;
    --font: -apple-system, BlinkMacSystemFont, "Microsoft Yahei", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14px/1.6 var(--font); color: var(--c-text); background: var(--c-bg); }
a { color: var(--c-link); text-decoration: none; transition: color .2s; }
a:hover { color: #0e42d2; }
img { display: block; max-width: 100%; height: auto; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
p { margin: 0 0 10px; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 15px; }
.main-wrap { display: flex; gap: 24px; margin-top: 20px; }
.main-content { flex: 1; min-width: 0; }
.sidebar { width: 300px; flex-shrink: 0; }

/* ── Header ── */
.site-header { background: var(--c-header-bg); border-bottom: 1px solid var(--c-line); }
.header-top { display: flex; justify-content: space-between; align-items: center; height: 50px; border-bottom: 1px solid var(--c-line); }
.header-top .site-logo { display: flex; align-items: center; }
.header-top .site-logo img { height: 36px; width: auto; display: block; }
.header-top .site-logo span { font-size: 20px; font-weight: 700; color: var(--c-dark); }
.header-user { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.header-user a { color: var(--c-header-text); }
.header-user a:hover { color: var(--c-header-hover); }
.header-user .sep { color: #ddd; }

.header-bottom { display: flex; justify-content: space-between; align-items: center; height: 44px; }
.main-nav ul { display: flex; gap: 0; }
.main-nav li { position: relative; }
.main-nav a { display: block; padding: 0 18px; line-height: 44px; font-size: 14px; color: var(--c-header-text); }
.main-nav a:hover, .main-nav .current-menu-item a, .main-nav .current_page_item a { color: var(--c-header-hover); }

.header-search { display: flex; align-items: center; }
.header-search form { display: flex; align-items: center; }
.header-search input { width: 200px; height: 32px; padding: 0 10px; border: 1px solid var(--c-line); border-right: none; border-radius: 4px 0 0 4px; background: var(--c-tint); color: var(--c-text); font-size: 13px; outline: none; }
.header-search input:focus { border-color: var(--c-main); }
.header-search input::placeholder { color: var(--c-gray); }
.header-search button { height: 32px; padding: 0 14px; border: 1px solid var(--c-line); border-left: none; border-radius: 0 4px 4px 0; background: var(--c-tint); color: var(--c-gray); cursor: pointer; font-size: 14px; }
.header-search button:hover { background: var(--c-main); border-color: var(--c-main); color: #fff; }

/* ── Mobile Nav ── */
.mobile-toggle, .mobile-mask, .mobile-nav { display: none; }

/* ── Breadcrumb ── */
.breadcrumb { padding: 12px 0; font-size: 13px; color: var(--c-gray); }
.breadcrumb a { color: var(--c-gray); }
.breadcrumb a:hover { color: var(--c-main); }
.breadcrumb .sep { margin: 0 6px; color: #ccc; }

/* ── Post List ── */
.post-list { background: #fff; border-radius: 4px; }
.post-item { padding: 20px 24px; border-bottom: 1px solid var(--c-line); }
.post-item:last-child { border-bottom: none; }
.post-item:hover { background: var(--c-tint); }
.post-title { font-size: 18px; font-weight: 600; line-height: 1.5; margin-bottom: 8px; }
.post-title a { color: var(--c-dark); }
.post-title a:hover { color: var(--c-main); }
.post-excerpt { font-size: 14px; color: var(--c-gray); line-height: 1.7; margin-bottom: 8px; }
.post-excerpt .label { color: var(--c-main); font-weight: 600; }
.post-trial { font-size: 13px; color: #888; line-height: 1.7; margin-bottom: 10px; padding: 10px 14px; background: var(--c-tint); border-radius: 4px; border-left: 3px solid var(--c-main); }
.post-trial .trial-label { color: var(--c-main); font-weight: 600; }
.post-meta { display: flex; align-items: center; gap: 16px; font-size: 13px; color: var(--c-gray); flex-wrap: wrap; }
.post-meta .meta-info { color: var(--c-gray); }
.post-meta .meta-status { padding: 1px 8px; border-radius: 3px; font-size: 12px; font-weight: 600; }
.is-complete { background: #e8f5e9; color: #2e7d32; }
.is-serial { background: #fff3e0; color: #e65100; }
.post-meta .like-btn { cursor: pointer; color: var(--c-gray); user-select: none; }
.post-meta .like-btn:hover { color: #e74c3c; }
.post-meta .like-btn.liked { color: #e74c3c; }

/* ── Pagination ── */
.pagination { text-align: center; padding: 24px 0; }
.pagination a, .pagination span { display: inline-block; padding: 8px 14px; margin: 0 3px; background: #fff; border-radius: 4px; font-size: 14px; color: var(--c-gray); border: 1px solid var(--c-line); }
.pagination a:hover { color: var(--c-main); border-color: var(--c-main); }
.pagination .current { background: var(--c-main); color: #fff; border-color: var(--c-main); }

/* ── Single ── */
.article-detail { background: #fff; border-radius: 4px; padding: 24px; }
.book-head { display: flex; gap: 24px; margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--c-line); }
.book-cover { flex-shrink: 0; }
.book-cover img { width: 130px; height: 180px; object-fit: cover; border-radius: 4px; box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.book-info { flex: 1; min-width: 0; }
.book-info h1 { font-size: 22px; font-weight: 700; color: var(--c-dark); margin-bottom: 12px; line-height: 1.4; }
.book-info .book-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 14px; color: var(--c-gray); margin-bottom: 14px; }
.book-info .book-meta span { display: inline-flex; align-items: center; gap: 4px; }
.book-info .book-meta .label { color: var(--c-text); font-weight: 600; }
.btn-read { display: inline-block; padding: 10px 28px; background: var(--c-btn); color: #fff; border-radius: 4px; font-size: 15px; font-weight: 600; transition: background .2s; }
.btn-read:hover { background: var(--c-btn-hover); color: #fff; }
.btn-read-online { display: inline-block; padding: 10px 28px; background: #07c160; color: #fff; border-radius: 4px; font-size: 15px; font-weight: 600; transition: background .2s; margin-top: 12px; }
.btn-read-online:hover { background: #06ad56; color: #fff; }

.article-intro { margin-bottom: 20px; }
.article-intro h3 { font-size: 16px; font-weight: 600; margin-bottom: 10px; color: var(--c-dark); padding-left: 12px; border-left: 3px solid var(--c-main); }
.intro-content { font-size: 14px; line-height: 1.8; color: var(--c-text); }

.chapter-list { background: #fff; border-radius: 4px; padding: 24px; margin-top: 16px; }
.chapter-list h3 { font-size: 16px; font-weight: 600; margin-bottom: 14px; color: var(--c-dark); padding-left: 12px; border-left: 3px solid var(--c-main); }
.chapter-items { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.chapter-items a { display: block; padding: 8px 12px; font-size: 14px; color: var(--c-text); background: var(--c-tint); border-radius: 4px; border: 1px solid var(--c-line); text-align: center; }
.chapter-items a:hover { color: var(--c-main); border-color: var(--c-main); background: var(--c-tag-bg); }

.article-nav { display: flex; justify-content: space-between; margin-top: 16px; gap: 12px; }
.article-nav a { font-size: 14px; color: var(--c-text); display: block; padding: 8px 14px; background: #fff; border-radius: 4px; border: 1px solid var(--c-line); max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.article-nav a:hover { color: var(--c-main); border-color: var(--c-main); }
.article-nav .nav-next { text-align: right; }

.article-nav .nav-prev, .article-nav .nav-next { display: flex; flex-direction: column; gap: 4px; }
.article-nav .nav-label { font-size: 12px; color: var(--c-gray); }

/* ── Related ── */
.related-posts { background: #fff; border-radius: 4px; padding: 24px; margin-top: 16px; }
.related-posts h3 { font-size: 16px; font-weight: 600; margin-bottom: 14px; color: var(--c-dark); padding-left: 12px; border-left: 3px solid var(--c-main); }
.related-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 24px; }
.related-grid a { display: block; padding: 8px 0; font-size: 14px; color: var(--c-gray); border-bottom: 1px dashed var(--c-line); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.related-grid a:hover { color: var(--c-main); padding-left: 4px; }

/* ── Comments ── */
.comments-area { background: #fff; border-radius: 4px; padding: 24px; margin-top: 16px; }
.comments-area h3 { font-size: 16px; font-weight: 600; margin-bottom: 14px; color: var(--c-dark); padding-left: 12px; border-left: 3px solid var(--c-main); }
.comment-form { margin-top: 14px; }
.comment-form textarea { width: 100%; height: 80px; padding: 10px 12px; border: 1px solid var(--c-line); border-radius: 4px; font-size: 14px; font-family: var(--font); resize: vertical; outline: none; }
.comment-form textarea:focus { border-color: var(--c-main); }
.comment-form .form-fields { display: flex; gap: 12px; margin-top: 10px; }
.comment-form .form-fields input { flex: 1; height: 36px; padding: 0 10px; border: 1px solid var(--c-line); border-radius: 4px; font-size: 13px; outline: none; }
.comment-form .form-fields input:focus { border-color: var(--c-main); }
.comment-form .form-submit { margin-top: 10px; }
.comment-form .form-submit input { padding: 8px 24px; background: var(--c-btn); color: #fff; border: none; border-radius: 4px; font-size: 14px; cursor: pointer; }
.comment-form .form-submit input:hover { background: var(--c-btn-hover); }
.comment-list { margin-top: 16px; }
.comment-list li { padding: 12px 0; border-bottom: 1px solid var(--c-line); }
.comment-list .comment-author { font-weight: 600; color: var(--c-dark); font-size: 13px; }
.comment-list .comment-time { font-size: 12px; color: var(--c-gray); margin-left: 10px; }
.comment-list .comment-text { margin-top: 6px; font-size: 14px; line-height: 1.7; }

/* ── Sidebar ── */
.sidebar-inner { position: sticky; top: 76px; }
.widget { background: #fff; border-radius: 4px; padding: 20px; margin-bottom: 16px; }
.widget:last-child { margin-bottom: 0; }
.widget-title { font-size: 15px; font-weight: 600; margin-bottom: 14px; padding-left: 12px; border-left: 3px solid var(--c-main); color: var(--c-dark); }
.hot-posts a { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--c-line); font-size: 14px; color: var(--c-text); }
.hot-posts li:last-child a { border-bottom: none; }
.hot-posts .text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.hot-posts .muted { font-size: 12px; color: var(--c-gray); flex-shrink: 0; }
.hot-posts a:hover { color: var(--c-main); }

.tagcloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tagcloud a { display: inline-block; padding: 3px 10px; font-size: 13px !important; color: var(--c-text); background: var(--c-tint); border: 1px solid var(--c-line); border-radius: 3px; transition: all .2s; }
.tagcloud a:hover { color: var(--c-main); border-color: var(--c-main); background: var(--c-tag-bg); }

/* ── Footer ── */
.site-footer { background: var(--c-footer-bg); border-top: 1px solid var(--c-line); padding: 24px 0; text-align: center; font-size: 13px; color: var(--c-footer-text); margin-top: 24px; }
.site-footer a { color: var(--c-footer-text); }
.site-footer a:hover { color: var(--c-dark); }
.footer-links { display: flex; justify-content: center; gap: 16px; margin-top: 10px; flex-wrap: wrap; }
.footer-links span { color: var(--c-footer-text); }
.footer-links .sep { color: #ddd; }
.site-footer .icp-number a { color: var(--c-footer-text); }

/* ── Sitemap ── */
.sitemap-content { display: none; margin-top: 20px; padding-top: 20px; border-top: 1px dashed var(--c-line); }
.sitemap-content.active { display: block; }
.sitemap-content { display: none; grid-template-columns: repeat(3, 1fr); gap: 24px; text-align: left; }
.sitemap-content.show { display: grid; }
.sitemap-section h4 { font-size: 14px; font-weight: 600; color: var(--c-dark); margin-bottom: 12px; padding-left: 8px; border-left: 2px solid var(--c-main); }
.sitemap-section ul { padding: 0; margin: 0; list-style: none; }
.sitemap-section li { margin-bottom: 8px; }
.sitemap-section a { display: block; font-size: 13px; color: var(--c-gray); padding: 4px 0; }
.sitemap-section a:hover { color: var(--c-main); padding-left: 4px; }

/* ── Back Top ── */
.back-top { position: fixed; right: 16px; bottom: 40px; width: 40px; height: 40px; line-height: 40px; text-align: center; background: #fff; border-radius: 50%; box-shadow: 0 2px 8px rgba(0,0,0,.1); cursor: pointer; display: none; z-index: 99; transition: color .2s; font-size: 16px; color: var(--c-gray); }
.back-top:hover { color: var(--c-main); }
.back-top.show { display: block; }

/* ── No Content ── */
.no-content { background: #fff; border-radius: 4px; padding: 60px 30px; text-align: center; }
.no-content h2 { font-size: 20px; margin-bottom: 10px; }
.no-content p { color: var(--c-gray); }

/* ── Mobile ── */
@media (max-width: 768px) {
    .main-wrap { flex-direction: column; }
    .sidebar { width: 100%; }
    
    .header-top { height: 44px; }
    .header-bottom { display: none; }
    .header-user { display: none; }
    .header-search { display: none; }
    
    .mobile-toggle { display: block; position: fixed; top: 10px; right: 14px; z-index: 1001; font-size: 22px; color: var(--c-dark); cursor: pointer; }
    .mobile-mask { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,.5); z-index: 1002; }
    .mobile-nav { display: none; position: fixed; top: 0; right: -260px; width: 260px; height: 100%; background: #fff; z-index: 1003; overflow-y: auto; transition: right .3s; padding-top: 50px; box-shadow: -2px 0 10px rgba(0,0,0,.1); }
    .nav-open .mobile-nav { right: 0; }
    .nav-open .mobile-mask { display: block; }
    .mobile-nav ul { padding: 0; }
    .mobile-nav li { border-bottom: 1px solid var(--c-line); }
    .mobile-nav a { display: block; padding: 12px 20px; font-size: 15px; color: var(--c-dark); }
    .mobile-nav a:hover { background: var(--c-tint); color: var(--c-main); }
    .mobile-nav .mobile-user { padding: 12px 20px; border-bottom: 1px solid var(--c-line); font-size: 13px; color: var(--c-gray); }
    .mobile-nav .mobile-user a { display: inline; padding: 0; color: var(--c-main); }
    .mobile-nav .mobile-search { padding: 12px 20px; }
    .mobile-nav .mobile-search form { display: flex; }
    .mobile-nav .mobile-search input { flex: 1; height: 36px; padding: 0 10px; border: 1px solid var(--c-line); border-radius: 4px 0 0 4px; font-size: 13px; outline: none; }
    .mobile-nav .mobile-search button { height: 36px; padding: 0 14px; border: 1px solid var(--c-line); border-left: none; border-radius: 0 4px 4px 0; background: var(--c-main); color: #fff; cursor: pointer; }

    .book-head { flex-direction: column; align-items: center; text-align: center; }
    .book-cover img { width: 110px; height: 150px; }
    .book-meta { justify-content: center; }
    .article-detail { padding: 16px; }
    .post-item { padding: 16px 18px; }
    .post-title { font-size: 16px; }
    .chapter-items { grid-template-columns: 1fr; }
    .related-grid { grid-template-columns: 1fr; }
    .comment-form .form-fields { flex-direction: column; }
    .container { padding: 0 12px; }
}

@media (max-width: 600px) {
    .article-nav { flex-direction: column; }
    .article-nav .nav-next { text-align: left; }
}
