:root {
    --c-primary: #FF6600;
    --c-primary-hover: #e55a00;
    --c-primary-light: #fff5f0;
    --c-dark: #222;
    --c-text: #444;
    --c-gray: #999;
    --c-light-gray: #bbb;
    --c-line: #eee;
    --c-bg: #f5f5f5;
    --c-white: #fff;
    --c-tint: #fafafa;
    --c-header-bg: #fff;
    --c-header-border: #eee;
    --c-footer-bg: #2a2a2a;
    --c-footer-text: #aaa;
    --c-tag-bg: #f5f5f5;
    --c-tag-color: #666;
    --c-tag-hover-bg: #FFF0E6;
    --c-tag-hover-color: #FF6600;
    --font: -apple-system, BlinkMacSystemFont, "Microsoft Yahei", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --shadow: 0 1px 3px rgba(0,0,0,.08);
    --radius: 6px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; padding-top: 60px; font: 14px/1.7 var(--font); color: var(--c-text); background: var(--c-bg); }
a { color: var(--c-primary); text-decoration: none; transition: all .25s; }
a:hover { color: var(--c-primary-hover); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.4; }
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: 330px; flex-shrink: 0; }

/* ── Header ── */
.site-header { position: fixed; top: 0; left: 0; width: 100%; height: 60px; background: var(--c-header-bg); border-bottom: 1px solid var(--c-header-border); box-shadow: 0 1px 4px rgba(0,0,0,.06); z-index: 1000; }
.header-inner { display: flex; align-items: center; height: 60px; }
.site-logo { display: flex; align-items: center; flex-shrink: 0; margin-right: 30px; }
.site-logo a { display: flex; align-items: center; color: var(--c-dark); font-size: 20px; font-weight: 700; }
.site-logo a:hover { color: var(--c-primary); }
.site-logo img { height: 36px; width: auto; }

.main-nav { flex: 1; overflow: hidden; }
.main-nav ul { display: flex; gap: 0; }
.main-nav li { position: relative; }
.main-nav a { display: block; padding: 0 16px; line-height: 60px; font-size: 15px; color: var(--c-text); white-space: nowrap; }
.main-nav a:hover, .main-nav .current-menu-item a, .main-nav .current_page_item a { color: var(--c-primary); background: var(--c-primary-light); }

.header-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.header-search form { display: flex; align-items: center; }
.header-search input { width: 180px; height: 34px; padding: 0 12px; 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; transition: border-color .2s; }
.header-search input:focus { border-color: var(--c-primary); background: var(--c-white); }
.header-search input::placeholder { color: var(--c-light-gray); }
.header-search button { height: 34px; padding: 0 14px; border: 1px solid var(--c-line); border-left: none; border-radius: 0 4px 4px 0; background: var(--c-primary); color: var(--c-white); cursor: pointer; font-size: 14px; transition: background .2s; }
.header-search button:hover { background: var(--c-primary-hover); }

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

/* ── Post List - Card Layout ── */
.post-list { display: flex; flex-direction: column; gap: 16px; }
.post-item { display: flex; gap: 20px; background: var(--c-white); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); transition: box-shadow .25s, transform .25s; }
.post-item:hover { box-shadow: 0 2px 12px rgba(0,0,0,.12); transform: translateY(-1px); }
.post-cover { flex-shrink: 0; width: 120px; }
.post-cover a { display: block; border-radius: 4px; overflow: hidden; }
.post-cover img { width: 120px; height: 160px; object-fit: cover; border-radius: 4px; background: var(--c-tint); }
.post-cover .no-cover { width: 120px; height: 160px; display: flex; align-items: center; justify-content: center; background: var(--c-tint); border-radius: 4px; color: var(--c-light-gray); font-size: 13px; }
.post-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.post-title { font-size: 17px; font-weight: 600; line-height: 1.4; margin-bottom: 6px; }
.post-title a { color: var(--c-dark); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.post-title a:hover { color: var(--c-primary); }
.post-excerpt { font-size: 13px; color: var(--c-gray); line-height: 1.7; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; flex: 1; }
.post-meta { display: flex; align-items: center; gap: 14px; font-size: 12px; color: var(--c-light-gray); flex-wrap: wrap; margin-top: auto; }
.post-meta .meta-cat { color: var(--c-primary); font-weight: 500; }
.post-meta .meta-status { padding: 1px 8px; border-radius: 3px; font-size: 11px; font-weight: 600; }
.is-complete { background: #e8f5e9; color: #2e7d32; }
.is-serial { background: #FFF0E6; color: #e55a00; }
.post-meta .meta-likes { cursor: pointer; user-select: none; transition: color .2s; }
.post-meta .meta-likes:hover { color: #e74c3c; }
.post-meta .meta-likes.liked { color: #e74c3c; }

/* ── Pagination ── */
.pagination { text-align: center; padding: 28px 0 20px; }
.pagination a, .pagination span { display: inline-block; padding: 8px 16px; margin: 0 3px; background: var(--c-white); border-radius: 4px; font-size: 14px; color: var(--c-gray); border: 1px solid var(--c-line); transition: all .2s; }
.pagination a:hover { color: var(--c-primary); border-color: var(--c-primary); }
.pagination .current { background: var(--c-primary); color: var(--c-white); border-color: var(--c-primary); }

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

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

/* ── Chapter List ── */
.chapter-list { background: var(--c-white); border-radius: var(--radius); padding: 24px; margin-top: 16px; box-shadow: var(--shadow); }
.chapter-list h3 { font-size: 16px; font-weight: 600; margin-bottom: 14px; color: var(--c-dark); padding-left: 14px; border-left: 3px solid var(--c-primary); }
.chapter-items { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.chapter-items a { display: block; padding: 10px 14px; font-size: 14px; color: var(--c-text); background: var(--c-tint); border-radius: 4px; border: 1px solid var(--c-line); text-align: center; transition: all .2s; }
.chapter-items a:hover { color: var(--c-primary); border-color: var(--c-primary); background: var(--c-primary-light); }

/* ── Article Nav ── */
.article-nav { display: flex; justify-content: space-between; margin-top: 16px; gap: 12px; }
.article-nav .nav-item { flex: 1; min-width: 0; background: var(--c-white); border-radius: var(--radius); padding: 16px 20px; box-shadow: var(--shadow); }
.article-nav .nav-label { font-size: 12px; color: var(--c-gray); margin-bottom: 4px; display: block; }
.article-nav .nav-title { font-size: 14px; color: var(--c-dark); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; transition: color .2s; }
.article-nav a:hover .nav-title { color: var(--c-primary); }
.article-nav .nav-next { text-align: right; }

/* ── Related Posts ── */
.related-posts { background: var(--c-white); border-radius: var(--radius); padding: 24px; margin-top: 16px; box-shadow: var(--shadow); }
.related-posts h3 { font-size: 16px; font-weight: 600; margin-bottom: 14px; color: var(--c-dark); padding-left: 14px; border-left: 3px solid var(--c-primary); }
.related-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 24px; }
.related-grid a { display: block; padding: 9px 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-primary); padding-left: 6px; }

/* ── Sidebar ── */
.sidebar-inner { position: sticky; top: 80px; }
.widget { background: var(--c-white); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.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-primary); color: var(--c-dark); }

/* Hot posts list */
.hot-posts li { }
.hot-posts a { display: block; padding: 9px 0; border-bottom: 1px solid var(--c-line); font-size: 14px; color: var(--c-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hot-posts li:last-child a { border-bottom: none; }
.hot-posts a:hover { color: var(--c-primary); padding-left: 6px; }
.hot-posts .post-date { font-size: 12px; color: var(--c-light-gray); margin-left: 8px; }

/* Tag cloud */
.tagcloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tagcloud a { display: inline-block; padding: 4px 12px; font-size: 13px !important; color: var(--c-tag-color); background: var(--c-tag-bg); border-radius: 4px; transition: all .2s; }
.tagcloud a:hover { color: var(--c-tag-hover-color); background: var(--c-tag-hover-bg); }

/* ── Footer ── */
.site-footer { background: var(--c-footer-bg); padding: 32px 0 28px; margin-top: 30px; }
.footer-inner { text-align: center; }
.footer-copy { font-size: 13px; color: var(--c-footer-text); }
.footer-copy a { color: var(--c-footer-text); }
.footer-copy a:hover { color: var(--c-white); }
.footer-links { display: flex; justify-content: center; gap: 16px; margin-top: 12px; flex-wrap: wrap; font-size: 13px; }
.footer-links a { color: var(--c-footer-text); }
.footer-links a:hover { color: var(--c-white); }
.footer-links .sep { color: #555; }
.footer-icp a { color: var(--c-footer-text); }
.footer-icp a:hover { color: var(--c-white); }

/* ── Back Top ── */
.back-top { position: fixed; right: 20px; bottom: 40px; width: 40px; height: 40px; line-height: 40px; text-align: center; background: var(--c-white); border-radius: 50%; box-shadow: 0 2px 10px rgba(0,0,0,.12); cursor: pointer; display: none; z-index: 99; font-size: 16px; color: var(--c-gray); transition: all .25s; }
.back-top:hover { color: var(--c-primary); box-shadow: 0 2px 16px rgba(0,0,0,.18); transform: translateY(-2px); }
.back-top.show { display: block; }

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

/* ── Section Title ── */
.section-title { font-size: 16px; font-weight: 600; margin-bottom: 14px; color: var(--c-dark); padding-left: 14px; border-left: 3px solid var(--c-primary); }

/* ── Home Tags Section ── */
.home-tags { background: var(--c-white); border-radius: var(--radius); padding: 20px; margin-top: 16px; box-shadow: var(--shadow); }

/* ── Category Header ── */
.category-header { background: var(--c-white); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 16px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 12px; }
.category-header .cat-name { font-size: 16px; font-weight: 600; color: var(--c-dark); }
.category-header .cat-count { font-size: 13px; color: var(--c-gray); }
.category-header .cat-desc { font-size: 13px; color: var(--c-gray); }

/* ── Mobile ── */
@media (max-width: 768px) {
    body { padding-top: 54px; }
    .main-wrap { flex-direction: column; }
    .sidebar { width: 100%; }
    .header-inner { height: 54px; }
    .site-logo { margin-right: 0; }


    .post-item { flex-direction: row; gap: 14px; padding: 14px; }
    .post-cover { width: 80px; }
    .post-cover img { width: 80px; height: 108px; }
    .post-cover .no-cover { width: 80px; height: 108px; }
    .post-title { font-size: 15px; }
    .post-excerpt { -webkit-line-clamp: 2; font-size: 12px; }

    .book-head { flex-direction: column; align-items: center; text-align: center; }
    .book-cover img { width: 120px; height: 165px; }
    .book-meta { justify-content: center; }
    .article-detail { padding: 16px; }
    .chapter-items { grid-template-columns: 1fr; }
    .related-grid { grid-template-columns: 1fr; }
    .article-nav { flex-direction: column; }
    .container { padding: 0 12px; }
}

@media (max-width: 480px) {
    .post-item { gap: 10px; padding: 12px; }
    .post-cover { width: 70px; }
    .post-cover img { width: 70px; height: 95px; }
    .post-cover .no-cover { width: 70px; height: 95px; font-size: 11px; }
    .post-title { font-size: 14px; }
}
