:root {
    --c-main: #FF5722;
    --c-dark: #333;
    --c-white: #fff;
    --c-bg: #f5f5f5;
    --c-tint: #fafafa;
    --c-line: #eee;
    --c-gray: #999;
    --c-text: #444;
    --font: -apple-system, BlinkMacSystemFont, "Microsoft Yahei", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.dark { --c-dark: #ccc; --c-white: #14181b; --c-bg: #0c0f14; --c-tint: #1d2025; --c-line: #1d2025; --c-gray: #555; --c-text: #bbb; }

*, *::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-dark); text-decoration: none; transition: color .2s; }
a:hover { color: var(--c-main); }
img { display: block; max-width: 100%; height: auto; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4 { margin: 0; }
p { margin: 0 0 10px; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ── Header ── */
.site-header { background: var(--c-white); border-bottom: 1px solid var(--c-line); position: sticky; top: 0; z-index: 999; }
.header-inner { display: flex; justify-content: space-between; align-items: center; height: 56px; }
.header-left { display: flex; align-items: center; gap: 32px; }
.site-logo { font-size: 22px; font-weight: 700; color: var(--c-main); white-space: nowrap; }
.site-logo:hover { color: var(--c-main); }
.main-nav ul { display: flex; gap: 0; }
.main-nav li { position: relative; }
.main-nav a { display: block; padding: 0 14px; font-size: 15px; line-height: 56px; color: var(--c-dark); }
.main-nav a:hover { color: var(--c-main); }
.main-nav .sub-menu { display: none; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); background: var(--c-white); min-width: 140px; box-shadow: 0 4px 12px rgba(0,0,0,.1); border-radius: 6px; padding: 6px 0; z-index: 100; }
.main-nav li:hover > .sub-menu { display: block; }
.main-nav .sub-menu a { line-height: 36px; font-size: 14px; padding: 0 16px; text-align: center; }
.header-right { display: flex; align-items: center; gap: 8px; }
.search-toggle, .dark-toggle { cursor: pointer; width: 36px; height: 36px; line-height: 36px; text-align: center; border-radius: 50%; transition: background .2s; }
.search-toggle:hover, .dark-toggle:hover { background: var(--c-tint); color: var(--c-main); }
.dark-toggle i:last-child { display: none; }
.dark .dark-toggle i:first-child { display: none; }
.dark .dark-toggle i:last-child { display: inline; }

/* ── Search ── */
.search-bar { background: var(--c-white); border-bottom: 1px solid var(--c-line); display: none; padding: 16px 0; }
.search-bar.active { display: block; }
.search-bar form { display: flex; max-width: 600px; margin: 0 auto; }
.search-bar input { flex: 1; height: 42px; padding: 0 14px; border: 1px solid var(--c-line); border-right: none; border-radius: 6px 0 0 6px; font-size: 14px; outline: none; background: var(--c-white); color: var(--c-text); }
.search-bar input:focus { border-color: var(--c-main); }
.search-bar button { width: 60px; height: 42px; border: none; background: var(--c-main); color: #fff; border-radius: 0 6px 6px 0; font-size: 16px; cursor: pointer; }

/* ── Mobile ── */
.mobile-toggle { display: none; position: fixed; top: 0; left: 0; z-index: 99999; width: 56px; height: 56px; line-height: 56px; text-align: center; font-size: 18px; cursor: pointer; }
.mobile-mask { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 99998; }
.mobile-nav { display: none; position: fixed; top: 0; left: -260px; bottom: 0; width: 260px; background: var(--c-white); z-index: 99999; padding-top: 56px; overflow-y: auto; transition: left .3s; }
.mobile-nav a { display: block; padding: 12px 20px; border-bottom: 1px solid var(--c-line); font-size: 15px; }
body.nav-open { overflow: hidden; }
body.nav-open .mobile-nav { left: 0; }
body.nav-open .mobile-mask { display: block; }

@media (max-width: 768px) {
    .main-nav { display: none; }
    .mobile-toggle { display: block; }
    .header-inner { justify-content: center; }
    .header-right { position: absolute; right: 16px; top: 0; }
}

/* ── Layout ── */
.main-wrap { display: flex; gap: 24px; padding: 24px 0; }
.main-content { flex: 1; min-width: 0; }
.sidebar { width: 300px; flex-shrink: 0; }
.sidebar-inner { background: var(--c-white); border-radius: 8px; padding: 20px; position: sticky; top: 80px; }
@media (max-width: 1024px) { .sidebar { display: none; } }

/* ── Post List ── */
.post-item { background: var(--c-white); border-radius: 8px; padding: 24px; margin-bottom: 16px; transition: box-shadow .2s; }
.post-item:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.post-title { font-size: 18px; font-weight: 600; line-height: 1.5; margin-bottom: 10px; }
.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: 12px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-meta { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--c-gray); }
.meta-status { padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.is-complete { background: #e8f5e9; color: #2e7d32; }
.is-serial { background: #fff3e0; color: #e65100; }

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

/* ── Single ── */
.article-detail { background: var(--c-white); border-radius: 8px; padding: 30px; }
.book-head { display: flex; gap: 24px; margin-bottom: 30px; padding-bottom: 24px; border-bottom: 1px solid var(--c-line); }
.book-cover img { width: 140px; height: 190px; object-fit: cover; border-radius: 8px; box-shadow: 0 2px 12px rgba(0,0,0,.1); }
.book-info { flex: 1; }
.book-title { font-size: 22px; font-weight: 700; color: var(--c-dark); margin-bottom: 16px; line-height: 1.4; }
.book-meta p { font-size: 14px; color: var(--c-gray); margin-bottom: 6px; }
.status-tag { font-weight: 600; }
.status-tag.is-complete { color: #2e7d32; }
.status-tag.is-serial { color: #e65100; }
.book-action { margin-top: 16px; }
.btn-read { display: inline-block; padding: 10px 28px; background: var(--c-main); color: #fff; border-radius: 6px; font-size: 14px; font-weight: 600; }
.btn-read:hover { color: #fff; opacity: .9; }

.article-intro h3 { font-size: 18px; font-weight: 600; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--c-line); }
.intro-content { font-size: 15px; line-height: 1.8; color: var(--c-text); }
.intro-content p { margin-bottom: 16px; }

/* ── Read Online ── */
.read-online { text-align: center; padding: 24px; background: var(--c-white); border-radius: 8px; margin-top: 16px; }
.btn-read-online { display: inline-block; padding: 14px 56px; background: var(--c-main); color: #fff; border-radius: 8px; font-size: 18px; font-weight: 700; box-shadow: 0 4px 12px rgba(255,87,34,.3); }
.btn-read-online:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 6px 16px rgba(255,87,34,.4); }

/* ── Nav ── */
.article-nav { display: flex; justify-content: space-between; background: var(--c-white); border-radius: 8px; padding: 20px 24px; margin-top: 16px; gap: 16px; }
.article-nav > div { flex: 1; }
.article-nav span { display: block; font-size: 12px; color: var(--c-gray); margin-bottom: 4px; }
.article-nav a { font-size: 14px; color: var(--c-text); display: block; padding: 8px 12px; background: var(--c-tint); border-radius: 4px; border: 1px solid var(--c-line); }
.article-nav a:hover { color: var(--c-main); border-color: var(--c-main); }
.nav-next { text-align: right; }
@media (max-width: 600px) { .article-nav { flex-direction: column; } .nav-next { text-align: left; } }

/* ── Related ── */
.related-posts { background: var(--c-white); border-radius: 8px; padding: 24px; margin-top: 16px; }
.related-posts h3 { font-size: 18px; font-weight: 600; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 2px solid var(--c-main); display: inline-block; }
.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); }
.related-grid a:hover { color: var(--c-main); padding-left: 4px; }
@media (max-width: 600px) { .related-grid { grid-template-columns: 1fr; } }

/* ── Sidebar ── */
.widget { margin-bottom: 20px; }
.widget:last-child { margin-bottom: 0; }
.widget-title { font-size: 16px; font-weight: 600; margin-bottom: 14px; padding-left: 12px; border-left: 3px solid var(--c-main); }
.hot-posts a { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--c-line); font-size: 14px; }
.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; }

/* ── Footer ── */
.site-footer { background: var(--c-white); border-top: 1px solid var(--c-line); padding: 20px 0; text-align: center; font-size: 13px; color: var(--c-gray); margin-top: 24px; }
.site-footer a { color: var(--c-gray); }
.site-footer a:hover { color: var(--c-main); }
.footer-links { display: flex; justify-content: center; gap: 16px; margin-top: 12px; flex-wrap: wrap; }
.footer-links span { padding: 4px 12px; background: var(--c-tint); border-radius: 4px; }
.footer-links a { font-size: 12px; }

/* ── 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; }

@media (max-width: 768px) {
    .sitemap-content { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .sitemap-content { grid-template-columns: 1fr; }
}

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

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

/* ── Mobile Single ── */
@media (max-width: 600px) {
    .book-head { flex-direction: column; align-items: center; text-align: center; }
    .book-cover img { width: 120px; height: 160px; }
    .book-meta p { text-align: left; }
    .article-detail { padding: 20px 16px; }
    .post-item { padding: 16px; }
    .post-title { font-size: 16px; }
}
