/* =========================================================
   NovelPress v2 - 青蓝主题样式
   默认浅色：页面底 #f4f8f9、卡片 #fff、主色 #0e7490
   导航：琥珀 #b45309；页脚：青蓝 #155e75
   点击右上角月亮图标可切换深色模式（body.dark）
   ========================================================= */
:root {
    color-scheme: light;
    --theme-color: #0e7490;
    --theme-hover: #155e75;
    --on-accent: #fff;
    --theme-bg: #f4f8f9;
    --card-bg: #fff;
    --card-line: #e4ebee;
    --nav-bg: #b45309;
    --header-bg: #155e75;
    --header-text: #fff;
    --header-line: rgba(255, 255, 255, .2);
    --header-hover-bg: rgba(255, 255, 255, .16);
    --nav-accent: #fff;
    --nav-accent-hover: #ffedd5;
    --nav-accent-text: #7c2d12;
    --radius: 14px;
    --pill: 999px;
    --black: #232323;
    --title-color: #1b2530;
    --text-color: #333;
    --desc-color: #7f8f96;
    --meta-color: #92a1a8;
    --line-color: #eaf0f2;
    --line-soft: #f1f6f7;
    --tag-bg: #f2f7f9;
    --danger: #ea580c;
    --success: #2e7d32;
    --success-bg: rgba(46, 125, 50, .1);
    --danger-bg: rgba(234, 88, 12, .1);
    --shadow: 0 0 0 1px #e4ebee, 0 2px 6px rgba(12, 40, 48, .06);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
}
body.dark {
    color-scheme: dark;
    --theme-color: #22d3ee;
    --theme-hover: #67e8f9;
    --on-accent: #052a33;
    --theme-bg: #0b1418;
    --card-bg: #141e23;
    --card-line: rgba(255, 255, 255, .08);
    --black: #e6eef1;
    --title-color: #ecf3f6;
    --text-color: #bac9cf;
    --desc-color: #86999f;
    --meta-color: #748a91;
    --line-color: #203137;
    --line-soft: #1a282d;
    --tag-bg: #1b272c;
    --danger: #fb923c;
    --success: #4ade80;
    --success-bg: rgba(74, 222, 128, .12);
    --danger-bg: rgba(251, 146, 60, .14);
    --shadow: 0 0 0 1px var(--card-line);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font: 14px/1.6 var(--font);
    color: var(--black);
    background: var(--theme-bg);
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; transition: color .2s; }
a:hover { color: var(--theme-hover); }
img { display: block; max-width: 100%; height: auto; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4, h5, p { margin: 0; }
button, input { font-family: inherit; }

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

/* ============ Header ============ */
.header {
    position: sticky;
    top: 0;
    z-index: 999;
    background: var(--nav-bg);
    border-bottom: 1px solid var(--header-line);
}
.header-inner { position: relative; display: flex; align-items: center; height: 64px; }

.logo { flex-shrink: 0; }
h1.logo { margin: 0; font-size: inherit; font-weight: inherit; line-height: inherit; }
.logo a { display: inline-flex; align-items: center; height: 64px; }
.logo-img { max-height: 38px; width: auto; }
.logo-text { font-size: 22px; font-weight: 800; color: var(--header-text); letter-spacing: .5px; }
.logo-text:hover { color: var(--theme-color); }

/* 导航：胶囊按钮式菜单 */
.primary-menu { margin-left: 28px; }
.primary-menu ul { display: flex; align-items: center; }
.primary-menu > ul { gap: 4px; }
.primary-menu li { position: relative; }
.primary-menu > ul > li > a {
    display: block;
    padding: 0 16px;
    height: 36px;
    line-height: 36px;
    font-size: 15px;
    color: var(--header-text);
    border-radius: var(--pill);
    transition: background .2s, color .2s;
}
.primary-menu > ul > li > a:hover { background: var(--header-hover-bg); color: var(--nav-accent); }
.primary-menu > ul > li.current-menu-item > a,
.primary-menu > ul > li.current-post-parent > a,
.primary-menu > ul > li.current-post-ancestor > a {
    background: var(--nav-accent);
    color: var(--nav-accent-text);
    font-weight: 600;
}

.primary-menu .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 150px;
    margin-top: 6px;
    background: var(--card-bg);
    border: 1px solid var(--card-line);
    border-radius: 12px;
    padding: 6px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, .35);
    z-index: 100;
}
.primary-menu li:hover > .sub-menu { display: block; }
.primary-menu .sub-menu a { display: block; padding: 8px 14px; border-radius: 8px; font-size: 14px; color: var(--text-color); white-space: nowrap; }
.primary-menu .sub-menu a:hover { color: var(--theme-color); background: var(--tag-bg); }

.navbar-action { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.action-item {
    display: inline-flex;
    align-items: center; justify-content: center;
    width: 38px; height: 38px;
    border-radius: 50%;
    color: var(--header-text);
    font-size: 16px;
    transition: background .2s, color .2s;
}
.action-item:hover { background: var(--header-hover-bg); color: var(--nav-accent); }
/* 默认浅色：显示月亮图标；深色模式：显示太阳图标 */
.dark-toggle i:last-child { display: none; }
body.dark .dark-toggle i:first-child { display: none; }
body.dark .dark-toggle i:last-child { display: inline; }

/* 下拉搜索框 */
.navbar-search { display: none; }
.navbar-search.active {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    left: 0; right: 0; top: 100%;
    padding: 14px 15px;
    background: var(--nav-bg);
    border-top: 1px solid var(--header-line);
    box-shadow: 0 12px 28px rgba(0, 0, 0, .28);
    z-index: 990;
}
.search-close { font-size: 16px; color: var(--header-text); cursor: pointer; padding: 0 12px; }
.search-close:hover { color: var(--nav-accent); }
.navbar-search-input {
    width: min(720px, calc(100vw - 150px));
    height: 42px;
    padding: 0 16px;
    border: 1px solid var(--header-line);
    border-right: 0;
    border-radius: var(--pill) 0 0 var(--pill);
    outline: none;
    font-size: 14px;
    background: var(--card-bg);
    color: var(--black);
}
.navbar-search-input:focus { border-color: var(--nav-accent); }
.navbar-search-btn {
    height: 42px;
    padding: 0 24px;
    border: 0;
    background: var(--nav-accent);
    color: var(--nav-accent-text);
    font-size: 15px;
    font-weight: 600;
    border-radius: 0 var(--pill) var(--pill) 0;
    cursor: pointer;
}
.navbar-search-btn:hover { background: var(--nav-accent-hover); }

/* ============ Layout ============ */
.wrap { display: flex; gap: 22px; align-items: flex-start; padding: 22px 0 30px; }
.main { flex: 1; min-width: 0; }
.sidebar { width: 300px; flex: none; }

/* ============ Breadcrumb ============ */
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 12px; font-size: 13px; line-height: 1.6; color: var(--meta-color); }
.sec-panel > .breadcrumb { margin-top: 16px; }
.breadcrumb a { color: var(--meta-color); }
.breadcrumb a:hover { color: var(--theme-color); }
.breadcrumb .sep { opacity: .45; }
.breadcrumb .current { color: var(--text-color); }

/* ============ Post List ============ */
.sec-panel {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 6px 24px 12px;
}
.sec-head { padding: 18px 0 4px; }
.page-title { font-size: 21px; font-weight: 700; color: var(--title-color); }
.page-desc { margin-top: 8px; font-size: 14px; color: var(--desc-color); line-height: 1.7; }
.page-count { margin-top: 6px; font-size: 12px; color: var(--meta-color); }

.post-loop { margin: 0; padding: 0; }
.post-loop .item {
    padding: 20px 14px;
    margin: 0 -14px;
    border-bottom: 1px solid var(--line-soft);
    border-radius: 12px;
    transition: background .2s;
}
.post-loop .item:last-child { border-bottom: 0; }
.post-loop .item:hover { background: var(--tag-bg); border-bottom-color: transparent; }
.item-title { font-size: 20px; line-height: 1.5; font-weight: 600; margin-bottom: 9px; }
.item-title a {
    color: var(--title-color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.item-title a:hover { color: var(--theme-color); }
.item-excerpt p {
    font-size: 14px;
    color: var(--desc-color);
    line-height: 1.8;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.item-meta { display: flex; align-items: center; gap: 12px; margin-top: 12px; font-size: 13px; color: var(--meta-color); }
.item-meta-li { color: var(--meta-color); }
.item-meta-li:hover { color: var(--theme-color); }
.item-meta-right { margin-left: auto; display: inline-flex; align-items: center; gap: 18px; font-size: 13px; }
.item-meta-right .views i { font-size: 12px; margin-right: 3px; }

.status-badge { display: inline-block; padding: 1px 10px; border-radius: var(--pill); font-size: 12px; line-height: 1.8; }
.status-badge.is-complete { color: var(--success); background: var(--success-bg); }
.status-badge.is-serial { color: var(--danger); background: var(--danger-bg); }

/* ============ Pagination ============ */
.pagination { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; padding: 24px 0 14px; }
.pagination .page-numbers {
    min-width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    background: var(--tag-bg);
    color: var(--text-color);
    border: 1px solid transparent;
    border-radius: var(--pill);
    font-size: 14px;
}
.pagination .page-numbers:hover { color: var(--theme-color); border-color: var(--theme-color); }
.pagination .page-numbers.current {
    background: var(--theme-color);
    border-color: var(--theme-color);
    color: var(--on-accent);
    font-weight: 600;
}

/* ============ Entry (Single) ============ */
.entry {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 30px 34px;
    margin-bottom: 18px;
}
.entry-head { border-bottom: 1px solid var(--line-color); padding-bottom: 18px; margin-bottom: 24px; }
.entry-title { font-size: 27px; font-weight: 700; line-height: 1.45; color: var(--title-color); margin-bottom: 12px; }
.entry-info { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; font-size: 13px; color: var(--meta-color); }
.entry-info .dot { color: var(--meta-color); }
.entry-cat { color: var(--theme-color); }
.entry-cat:hover { color: var(--theme-hover); }
.entry-info i { margin-right: 3px; font-size: 12px; }

/* 小说信息栏 */
.book-panel { display: flex; gap: 20px; background: var(--tag-bg); border: 1px solid var(--card-line); border-radius: 12px; padding: 20px; margin-bottom: 24px; }
.book-cover { flex: none; }
.book-cover img { width: 108px; height: 148px; object-fit: cover; border-radius: 8px; box-shadow: 0 6px 18px rgba(0, 0, 0, .35); }
.book-panel-main { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 16px; }
.book-fields li { display: flex; align-items: baseline; margin-bottom: 10px; }
.book-fields li:last-child { margin-bottom: 0; }
.book-fields .k { flex: none; width: 48px; color: var(--meta-color); font-size: 13px; }
.book-fields .v { font-size: 14px; color: var(--text-color); line-height: 1.7; word-break: break-all; }
.btn-read-main {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 32px;
    background: var(--theme-color);
    color: var(--on-accent);
    border-radius: var(--pill);
    font-size: 15px;
    font-weight: 600;
}
.btn-read-main:hover { color: var(--on-accent); background: var(--theme-hover); }

/* 正文 */
.entry-content { font-size: 16px; line-height: 1.95; color: var(--text-color); overflow-wrap: break-word; }
.entry-content p { margin-bottom: 18px; }
.entry-content p:last-child { margin-bottom: 0; }
.entry-content ul, .entry-content ol { margin: 0 0 18px; padding-left: 2em; }
.entry-content ul { list-style: disc; }
.entry-content ol { list-style: decimal; }
.entry-content li { margin-bottom: 6px; }
.entry-content h2, .entry-content h3, .entry-content h4 { margin: 22px 0 12px; color: var(--title-color); }
.entry-content h2 { font-size: 22px; }
.entry-content h3 { font-size: 18px; }
.entry-content blockquote { margin: 0 0 18px; padding: 12px 18px; border-left: 3px solid var(--theme-color); border-radius: 0 8px 8px 0; background: var(--tag-bg); color: var(--desc-color); }
.entry-content a { color: var(--theme-color); }
.entry-content a:hover { color: var(--theme-hover); text-decoration: underline; }
.entry-content img { border-radius: 8px; margin: 8px auto; }
.entry-content .wp-caption { max-width: 100%; margin-bottom: 18px; }
.entry-content table { width: 100%; border-collapse: collapse; margin-bottom: 18px; }
.entry-content table th, .entry-content table td { border: 1px solid var(--line-color); padding: 8px 10px; }
.intro-title {
    position: relative;
    padding-left: 14px;
    font-size: 19px;
    font-weight: 700;
    color: var(--title-color);
    margin-bottom: 20px;
}
.intro-title::before {
    content: "";
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 4px;
    border-radius: var(--pill);
    background: var(--theme-color);
}
.page-links { margin-top: 18px; text-align: center; }

/* 阅读按钮 */
.read-cta { margin-top: 30px; padding: 28px 16px; text-align: center; background: var(--tag-bg); border-radius: 12px; }
.read-cta-tip { font-size: 13px; color: var(--meta-color); margin-bottom: 16px; }
.btn-read-big {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 48px;
    background: var(--theme-color);
    color: var(--on-accent);
    border-radius: var(--pill);
    font-size: 17px;
    font-weight: 700;
    box-shadow: 0 6px 20px rgba(14, 116, 144, .25);
}
.btn-read-big:hover { background: var(--theme-hover); color: var(--on-accent); transform: translateY(-1px); }

/* 标签 */
.entry-tag { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line-soft); }
.entry-tag-title { font-size: 13px; color: var(--meta-color); }
.entry-tag a { padding: 4px 14px; background: var(--tag-bg); border-radius: var(--pill); font-size: 13px; color: var(--text-color); transition: background .2s, color .2s; }
.entry-tag a:hover { background: var(--theme-color); color: var(--on-accent); }

/* 上一篇/下一篇 */
.entry-page { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin-top: 18px; }
.entry-page-prev, .entry-page-next { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 20px; }
.entry-page-prev.empty, .entry-page-next.empty { display: none; }
.entry-page-next { text-align: right; }
.ep-label { display: block; font-size: 12px; color: var(--meta-color); margin-bottom: 6px; }
.ep-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 14px;
    line-height: 1.6;
    color: var(--title-color);
}
.entry-page-prev a:hover .ep-title, .entry-page-next a:hover .ep-title { color: var(--theme-color); }

/* 相关推荐 */
.related-posts { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; margin-top: 18px; }
.block-title { font-size: 18px; font-weight: 700; color: var(--title-color); margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line-color); }
.block-title span { position: relative; padding-left: 12px; }
.block-title span::before {
    content: "";
    position: absolute;
    left: 0;
    top: 2px;
    bottom: 2px;
    width: 3px;
    border-radius: var(--pill);
    background: var(--theme-color);
}
.related-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; }
.related-grid a {
    display: block;
    padding: 9px 0;
    font-size: 14px;
    color: var(--text-color);
    border-bottom: 1px dashed var(--line-soft);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.related-grid a:hover { color: var(--theme-color); padding-left: 6px; }

/* ============ Sidebar ============ */
.widget { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 18px; margin-bottom: 16px; }
.widget:last-child { margin-bottom: 0; }
.widget-title { position: relative; padding-left: 12px; margin: 0 0 15px; font-size: 16px; font-weight: 700; color: var(--title-color); }
.widget-title::before { content: ""; position: absolute; left: 0; top: 2px; bottom: 2px; width: 3px; border-radius: var(--pill); background: var(--theme-color); }
.widget ul { list-style: none; }
.widget .tagcloud a {
    display: inline-block;
    margin: 0 6px 8px 0;
    padding: 4px 14px;
    background: var(--tag-bg);
    border-radius: var(--pill);
    font-size: 13px;
    color: var(--text-color);
    transition: background .2s, color .2s;
}
.widget .tagcloud a:hover { background: var(--theme-color); color: var(--on-accent); }
.side-list li { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px dashed var(--line-soft); }
.side-list li:last-child { border-bottom: 0; }
.side-list a { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 14px; color: var(--black); }
.side-list a:hover { color: var(--theme-color); }
.side-list .side-date { flex: none; font-size: 12px; color: var(--meta-color); }
.side-no { flex: none; width: 20px; height: 20px; border-radius: 6px; background: var(--tag-bg); color: var(--meta-color); font-size: 12px; font-style: normal; text-align: center; line-height: 20px; }
.hot-list li:nth-child(-n+3) .side-no { background: var(--theme-color); color: var(--on-accent); font-weight: 700; }

/* 兼容旧版“热门文章”小工具输出 */
.hot-posts li a { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.hot-posts .text { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--black); }
.hot-posts .muted { flex: none; font-size: 12px; color: var(--meta-color); }
.hot-posts li a:hover .text { color: var(--theme-color); }

/* 后台上架的通用小工具兜底样式 */
.widget .widget-title + ul li, .widget ul li { padding: 8px 0; border-bottom: 1px dashed var(--line-soft); font-size: 14px; }
.widget ul li:last-child { border-bottom: 0; }

/* ============ No Content ============ */
.no-content { padding: 60px 20px; text-align: center; }
.no-content h2 { font-size: 20px; margin-bottom: 10px; color: var(--title-color); }
.no-content p { color: var(--meta-color); }

/* ============ Footer ============ */
.footer { background: var(--header-bg); margin-top: 10px; padding: 28px 0 32px; text-align: center; font-size: 13px; color: rgba(255, 255, 255, .6); }
.footer-nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 20px; margin-bottom: 12px; }
.footer-nav > a { color: rgba(255, 255, 255, .78); font-size: 14px; }
.footer-nav > a:hover, .footer-nav a:hover { color: var(--theme-color); }
.footer-menu-links { display: inline-flex; flex-wrap: wrap; gap: 6px 20px; }
.footer-menu-links a { color: rgba(255, 255, 255, .78); font-size: 14px; }
.footer-friend { margin-bottom: 10px; }
.footer-friend a { color: rgba(255, 255, 255, .78); }
.footer-friend a:hover { color: var(--theme-color); }
.copyright { line-height: 1.8; }
.copyright a { color: rgba(255, 255, 255, .78); }
.copyright a:hover { color: var(--theme-color); }
.icp-number { margin-top: 4px; }
.icp-number a { color: rgba(255, 255, 255, .5); }
.icp-number a:hover { color: var(--theme-color); }

/* ============ Back Top ============ */
.back-top {
    position: fixed;
    right: 18px;
    bottom: 40px;
    width: 44px;
    height: 44px;
    display: none;
    align-items: center;
    justify-content: center;
    background: var(--theme-color);
    color: var(--on-accent);
    border-radius: 50%;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
    cursor: pointer;
    z-index: 998;
    font-size: 15px;
}
.back-top:hover { background: var(--theme-hover); }
.back-top.show { display: inline-flex; }

/* ============ Responsive ============ */
@media (max-width: 991px) {
    .sidebar { display: none; }
}
@media (max-width: 767px) {
    .primary-menu { display: none; }
    .header-inner { height: 58px; justify-content: flex-start; }
    .logo a { height: 58px; }
    .logo-text { font-size: 20px; }
    .logo { margin-left: 2px; }
    .navbar-search.active { top: 100%; }
    .wrap { padding: 16px 0 24px; }
    .sec-panel { padding: 4px 16px 8px; }
    .post-loop .item { padding: 16px 10px; margin: 0 -10px; }
    .item-title { font-size: 18px; }
    .item-meta { flex-wrap: wrap; }
    .entry { padding: 20px 16px; }
    .entry-title { font-size: 21px; }
    .book-panel { flex-direction: column; align-items: flex-start; padding: 16px; }
    .book-cover img { width: 96px; height: 132px; }
    .book-panel-actions { width: 100%; }
    .btn-read-main { width: 100%; justify-content: center; }
    .related-grid { grid-template-columns: 1fr; }
    .footer-nav { gap: 4px 14px; }
}
