/* =========================================================
   轻舟CMS · 门户主题高级美化版 (Menhu Theme 2.0)
========================================================= */

:root {
    /* 主题核心色 */
    --primary: #d32f2f;        /* 经典红 */
    --primary-dark: #b71c1c;
    --primary-light: #ef5350;
    --blue: #004499;           /* 辅助蓝 */
    
    /* 文字颜色 */
    --text: #111827;           /* 主标题（深黑） */
    --text-regular: #374151;   /* 正文（深灰） */
    --text-light: #6b7280;     /* 辅助文字 */
    --muted: #9ca3af;          /* 占位/次要文字 */
    
    /* 背景与边框 */
    --bg-body: #f5f7fa;        /* 全局背景底色（微灰，用来衬托卡片） */
    --bg-white: #ffffff;       /* 卡片纯白底色 */
    --bg-soft: #f9fafb;        /* 局部的极浅灰 */
    --border: #e5e7eb;         /* 边框线（极浅灰） */
    
    /* 圆角与阴影 */
    --radius: 12px;            /* 全局大圆角 */
    --radius-sm: 6px;          /* 小圆角 */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 10px 25px rgba(0, 0, 0, 0.08);
    
    /* 字体 */
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body { 
    font-family: var(--font-family); 
    color: var(--text-regular); 
    background: var(--bg-body); /* 若你执意要纯白背景，将这里改为 #ffffff 即可 */
    line-height: 1.6; 
    font-size: 14px; 
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; transition: color 0.2s ease; }
a:hover { color: var(--primary); }
img { max-width: 100%; height: auto; display: block; border: none; }
.container { max-width: 1240px; margin: 0 auto; padding: 0 20px; }

/* ==================== 1. 顶部与头部 ==================== */
.menhu-topbar { 
    background: var(--bg-white); 
    border-bottom: 1px solid var(--border); 
    font-size: 13px; 
    color: var(--text-light); 
    height: 40px; 
    line-height: 40px; 
}
.menhu-topbar-inner { display: flex; justify-content: space-between; }
.menhu-links a { margin-left: 20px; color: var(--text-light); }
.menhu-links a:hover { color: var(--primary); }

.menhu-header { 
    background: var(--bg-white); 
    padding: 24px 0; 
    box-shadow: var(--shadow-sm); 
    position: relative; 
    z-index: 10;
}
.menhu-header-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 20px; }
.menhu-logo a { 
    font-size: 36px; 
    font-weight: 900; 
    color: var(--primary); 
    letter-spacing: -1px; 
    text-shadow: 1px 1px 0 rgba(211,47,47,0.15);
}

/* 现代感搜索框 */
.menhu-search form { 
    display: flex; 
    border: 2px solid var(--primary); 
    border-radius: 99px; /* 胶囊圆角 */
    overflow: hidden; 
    width: 380px; 
    background: var(--bg-white);
    box-shadow: 0 2px 10px rgba(211, 47, 47, 0.1);
    transition: box-shadow 0.3s;
}
.menhu-search form:focus-within { box-shadow: 0 4px 15px rgba(211, 47, 47, 0.2); }
.menhu-search input { 
    flex: 1; border: none; padding: 10px 20px; outline: none; font-size: 14px; background: transparent; color: var(--text);
}
.menhu-search button { 
    background: var(--primary); color: #fff; border: none; padding: 0 28px; cursor: pointer; font-size: 15px; font-weight: bold; transition: background 0.2s;
}
.menhu-search button:hover { background: var(--primary-dark); }

/* ==================== 2. 主导航 ==================== */
.menhu-nav { 
    background: linear-gradient(90deg, var(--primary-dark), var(--primary)); 
    height: 50px; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.1); 
    position: sticky;
    top: 0;
    z-index: 99;
}
.menhu-nav-inner { display: flex; justify-content: center; height: 100%; align-items: center; gap: 10px; }
.menhu-nav a { 
    text-decoration: none; font-size: 16px; font-weight: 600; white-space: nowrap; transition: all 0.2s; display: inline-flex; align-items: center; height: 100%; letter-spacing: 0.5px;
}

/* 下拉菜单 */
.nav-dropdown { position: relative; display: inline-flex; align-items: center; height: 100%; }
.nav-drop-menu { 
    display: none; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); 
    background: var(--bg-white); min-width: 180px; box-shadow: var(--shadow-hover); border-radius: var(--radius-sm); padding: 8px 0; 
    z-index: 1000; border: 1px solid var(--border); margin-top: 0; opacity: 0; transition: opacity 0.2s;
}
.nav-drop-menu::before { content: ""; position: absolute; top: -10px; left: 0; width: 100%; height: 10px; }
.nav-dropdown:hover .nav-drop-menu { display: block; opacity: 1; }
.nav-drop-menu a { display: block; padding: 12px 20px; color: var(--text-regular); font-size: 14px; white-space: nowrap; width: 100%; height: auto; font-weight: normal; }
.nav-drop-menu a:hover { background: var(--bg-soft); color: var(--primary); }

/* 导航样式变体 */
.nav-style-1 > a, .nav-style-1 .nav-drop-toggle { color: #fff; padding: 0 24px; border-radius: var(--radius-sm); }
.nav-style-1 > a:hover, .nav-style-1 .nav-drop-toggle:hover { background: rgba(255,255,255,0.15); color: #fff; }
.nav-style-1 > a.active, .nav-style-1 .nav-drop-toggle.active { background: rgba(0,0,0,0.15); color: #fff; }

.nav-style-2 > a, .nav-style-2 .nav-drop-toggle { color: #fff; padding: 0 20px; margin: 0 4px; border-radius: 99px; height: 34px; }
.nav-style-2 > a:hover, .nav-style-2 .nav-drop-toggle:hover { background: rgba(255,255,255,0.2); color: #fff; }
.nav-style-2 > a.active, .nav-style-2 .nav-drop-toggle.active { background: #fff; color: var(--primary); font-weight: bold; }

.nav-style-3 > a, .nav-style-3 .nav-drop-toggle { color: #fff; padding: 0 20px; border-left: 4px solid transparent; height: 100%; }
.nav-style-3 > a:hover, .nav-style-3 .nav-drop-toggle:hover { border-left-color: #fff; background: rgba(255,255,255,0.1); color: #fff; }
.nav-style-3 > a.active, .nav-style-3 .nav-drop-toggle.active { border-left-color: #fff; background: rgba(255,255,255,0.15); color: #fff; }

/* ==================== 3. 通用区块与卡片 ==================== */
.menhu-main { padding: 24px 15px; }
.menhu-block { 
    background: var(--bg-white); 
    border: 1px solid var(--border); 
    border-radius: var(--radius); 
    margin-bottom: 24px; 
    box-shadow: var(--shadow-sm); 
    overflow: hidden; 
    display: flex; 
    flex-direction: column; 
    transition: box-shadow 0.3s;
}
.menhu-block:hover {
    box-shadow: var(--shadow-md);
}
.menhu-block-header { 
    border-bottom: 1px solid var(--border); 
    padding: 16px 20px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    background: var(--bg-white); 
}

/* ★ 核心修复：标题及其内部 SVG 图标 */
.menhu-block-title { 
    font-size: 18px; 
    font-weight: 800; 
    color: var(--text); 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    white-space: nowrap; /* 强制不换行 */
}
.menhu-block-title::before { 
    content: ""; 
    display: block; 
    width: 4px; 
    height: 18px; 
    background: var(--primary); 
    border-radius: 4px; 
    box-shadow: 0 0 8px rgba(211,47,47,0.4);
    flex-shrink: 0;
}
.menhu-block-title svg,
.menhu-community-title svg,
.menhu-daily-title svg {
    width: 20px !important;
    height: 20px !important;
    flex-shrink: 0 !important; /* 防止图标被压缩变形 */
    display: inline-block;
    vertical-align: middle;
}

.menhu-block-more { font-size: 13px; color: var(--text-light); display: flex; align-items: center; gap: 4px; }
.menhu-block-more:hover { color: var(--primary); }
.menhu-block-body { padding: 20px; flex: 1; }

/* ==================== 4. 首屏三栏布局 ==================== */
.menhu-hero-grid { display: grid; grid-template-columns: 2fr 1.3fr 1fr; gap: 24px; height: 400px; margin-bottom: 24px; }
@media (max-width: 1200px) { .menhu-hero-grid { grid-template-columns: 1fr 1fr; height: auto; } .menhu-hero-grid .menhu-right-rank { display: none; } }
@media (max-width: 768px) { .menhu-hero-grid { grid-template-columns: 1fr; } }

/* 幻灯片 */
.menhu-slider { position: relative; width: 100%; height: 100%; background: #000; border-radius: var(--radius); overflow: hidden; min-height: 280px; box-shadow: var(--shadow-md); }
.menhu-slide-item { position: absolute; inset: 0; opacity: 0; transition: opacity 0.5s ease; z-index: 1; }
.menhu-slide-item.active { opacity: 1; z-index: 2; }
.menhu-slide-item img { width: 100%; height: 100%; object-fit: cover; }
.menhu-slide-title { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(transparent, rgba(0,0,0,0.9)); color: #fff; padding: 60px 24px 24px; font-size: 22px; font-weight: bold; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menhu-slider-dots { position: absolute; bottom: 20px; right: 24px; z-index: 10; display: flex; gap: 10px; }
.menhu-slider-dots span { width: 12px; height: 12px; border-radius: 50%; background: rgba(255,255,255,0.4); cursor: pointer; transition: 0.3s; }
.menhu-slider-dots span.active { background: var(--primary); transform: scale(1.2); }

/* 中间区域：头条与推荐 */
.menhu-headline-container { display: flex; flex-direction: column; height: 100%; background: var(--bg-white); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.menhu-headline-top { padding: 24px; background: linear-gradient(180deg, var(--bg-white) 0%, var(--bg-soft) 100%); border-bottom: 1px solid var(--border); flex: 1; display: flex; flex-direction: column; justify-content: center; }
.menhu-headline-tag { display: inline-block; background: var(--primary); color: #fff; font-size: 12px; padding: 3px 10px; border-radius: 4px; margin-bottom: 12px; font-weight: bold; width: fit-content; box-shadow: 0 2px 6px rgba(211,47,47,0.3); }
.menhu-headline-title-box h3 { font-size: 20px; font-weight: 800; line-height: 1.4; margin-bottom: 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--text); }
.menhu-headline-title-box p { font-size: 14px; color: var(--text-light); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.menhu-recommend-list { padding: 16px 24px; flex: 1; }
.menhu-recommend-title { font-size: 15px; font-weight: bold; border-left: 4px solid var(--primary); padding-left: 10px; margin-bottom: 14px; color: var(--text); }
.menhu-recommend-list ul { list-style: none; }
.menhu-recommend-list li { padding: 8px 0; }
.menhu-recommend-list li a { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-regular); }
.menhu-recommend-list li a:hover { color: var(--primary); }
.menhu-recommend-list li .dot { width: 4px; height: 4px; background: var(--border); border-radius: 50%; flex-shrink: 0; }
.menhu-recommend-list li .text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.menhu-recommend-list li .author { flex-shrink: 0; font-size: 12px; color: var(--muted); }

/* 每日一文侧边栏 */
.menhu-daily-block { height: 100%; margin-bottom: 0; border: none; box-shadow: var(--shadow-sm); }
.menhu-daily-block .menhu-block-header { border-bottom: none; background: transparent; padding: 20px 20px 0; }
.menhu-daily-block .menhu-block-body { display: flex; flex-direction: column; justify-content: space-between; padding: 20px; }
.menhu-daily-tag { font-size: 12px; color: var(--primary); background: rgba(211, 47, 47, 0.08); padding: 4px 10px; border-radius: 4px; width: fit-content; margin-bottom: 12px; font-weight: 600; }
.menhu-daily-title { font-size: 18px; font-weight: 800; line-height: 1.45; color: var(--text); margin-bottom: 12px; display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.menhu-daily-title a { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; color: inherit; transition: color 0.2s; word-break: break-all; }
.menhu-daily-title a:hover { color: var(--primary); }
.menhu-daily-author { font-size: 13px; font-weight: normal; color: var(--text-light); white-space: nowrap; }
.menhu-daily-summary { font-size: 14px; color: var(--text-light); line-height: 1.7; margin-bottom: 20px; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; flex: 1; word-break: break-all; }
.menhu-daily-btn { display: block; width: 100%; text-align: center; background: var(--primary); color: #fff; padding: 12px 0; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; transition: 0.2s; box-shadow: 0 4px 12px rgba(211,47,47,0.2); }
.menhu-daily-btn:hover { color: #fff; background: var(--primary-dark); box-shadow: 0 6px 16px rgba(211,47,47,0.3); transform: translateY(-1px); }
.menhu-daily-empty { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--muted); font-size: 14px; }

/* ==================== 5. 瀑布流网格 ==================== */
.menhu-grid-10 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 960px) { .menhu-grid-10 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .menhu-grid-10 { grid-template-columns: 1fr; } }
.menhu-grid-10 .menhu-block { margin-bottom: 0; }

/* 列表内的图文排版 */
.menhu-cat-item { display: flex; gap: 16px; margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px dashed var(--border); }
.menhu-cat-item:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.menhu-cat-img { flex: 0 0 120px; height: 80px; border-radius: var(--radius-sm); overflow: hidden; background: var(--bg-soft); }
.menhu-cat-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.menhu-cat-item:hover .menhu-cat-img img { transform: scale(1.08); }
.menhu-cat-info { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.menhu-cat-info h4 { font-size: 16px; font-weight: bold; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--text); }
.menhu-cat-info h4 a:hover { color: var(--primary); }
.menhu-cat-info p { font-size: 13px; color: var(--text-light); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 6px; }

/* 纯文字列表 */
.menhu-text-list { list-style: none; }
.menhu-text-list li { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--border); font-size: 14px; transition: 0.2s; }
.menhu-text-list li::before { content: ""; display: inline-block; width: 4px; height: 4px; background: var(--primary); border-radius: 50%; margin-right: 12px; flex-shrink: 0; }
.menhu-text-list li:last-child { border-bottom: none; }
.menhu-text-list li a { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-regular); }
.menhu-text-list li a:hover { color: var(--primary); }
.menhu-text-list li .author { flex-shrink: 0; font-size: 12px; color: var(--muted); margin-left: 12px; }

/* 占位区块 */
.menhu-placeholder { padding: 30px; text-align: center; color: var(--muted); font-size: 14px; background: var(--bg-soft); border: 1px dashed var(--border); border-radius: var(--radius-sm); display: flex; flex-direction: column; justify-content: center; align-items: center; height: 100%; min-height: 200px; }
.menhu-placeholder svg { width: 48px; height: 48px; margin-bottom: 12px; fill: #d1d5db; }

/* ==================== 6. 小说与古籍卡片 ==================== */
.menhu-novel-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 20px; }
@media (max-width: 1100px) { .menhu-novel-grid { grid-template-columns: repeat(5, 1fr); } }
@media (max-width: 850px) { .menhu-novel-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 640px) { .menhu-novel-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; } }
@media (max-width: 480px) { .menhu-novel-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; } }

.novel-card { display: flex; flex-direction: column; text-decoration: none; transition: transform 0.3s; }
.novel-card:hover { transform: translateY(-6px); }
.novel-card-cover { width: 100%; aspect-ratio: 3 / 4; border-radius: var(--radius-sm); overflow: hidden; background: var(--bg-soft); box-shadow: 0 4px 12px rgba(0,0,0,0.08); margin-bottom: 12px; position: relative; }
.novel-card-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.novel-card:hover .novel-card-cover img { transform: scale(1.05); }
.novel-card-cover .no-img { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #d1d5db; }
.novel-card-title { font-size: 14px; font-weight: 700; color: var(--text); line-height: 1.4; margin-bottom: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.novel-card:hover .novel-card-title { color: var(--primary); }
.novel-card-author { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ==================== 7. 社区看板 (论坛入口) ==================== */
.menhu-community-board { margin-top: 24px; background: var(--bg-white); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.menhu-community-header { display: flex; justify-content: space-between; align-items: center; padding: 18px 24px; background: var(--bg-soft); border-bottom: 1px solid var(--border); }
.menhu-community-title { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: bold; color: var(--blue); white-space: nowrap; }
.menhu-community-more { font-size: 13px; color: var(--blue); transition: 0.2s; }
.menhu-community-more:hover { color: var(--primary); }
.menhu-community-grid { display: grid; grid-template-columns: repeat(3, 1fr); padding: 0; }
.menhu-community-col { padding: 20px 24px; border-right: 1px solid var(--border); }
.menhu-community-col:last-child { border-right: none; }
.menhu-community-subtitle { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: bold; color: var(--text); margin-bottom: 16px; white-space: nowrap; }
.menhu-community-subtitle .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.community-list { list-style: none; padding: 0; margin: 0; }
.community-list li { border-bottom: 1px dashed var(--border); }
.community-list li:last-child { border-bottom: none; }
.community-list a { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; text-decoration: none; color: var(--text-regular); transition: 0.2s; }
.community-list a:hover { transform: translateX(4px); }
.community-list a:hover .title { color: var(--blue); }
.community-list .title { font-size: 14px; color: var(--text-regular); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.community-list .author { font-size: 12px; color: var(--muted); margin-left: 12px; }
.community-list .views { font-size: 12px; color: #f59e0b; margin-left: 12px; }
.reply-avatar { width: 28px; height: 28px; border-radius: 6px; background: #eff6ff; color: var(--blue); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: bold; flex-shrink: 0; margin-right: 12px; }
.reply-info { flex: 1; overflow: hidden; }
.reply-author { font-size: 13px; font-weight: 600; color: var(--text); }
.reply-target { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 960px) { .menhu-community-grid { grid-template-columns: 1fr; } .menhu-community-col { border-right: none; border-bottom: 1px dashed var(--border); } .menhu-community-col:last-child { border-bottom: none; } }

/* ==================== 8. 详情页与用户中心侧边 ==================== */
.menhu-layout { display: grid; grid-template-columns: 1fr 300px; gap: 24px; align-items: start; }
@media (max-width: 960px) { .menhu-layout { grid-template-columns: 1fr; } }

.menhu-detail-content { font-size: 16px; line-height: 1.9; color: var(--text-regular); }
.menhu-detail-content h1 { font-size: 28px; font-weight: 800; margin-bottom: 20px; line-height: 1.3; color: var(--text); }
.menhu-detail-meta { color: var(--muted); font-size: 13px; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--border); display: flex; gap: 16px; }
.menhu-detail-content p { margin-bottom: 20px; }

.menhu-sidebar-link { 
    display: flex; justify-content: space-between; align-items: center; 
    padding: 12px 20px; color: var(--text-regular); 
    border-bottom: 1px dashed var(--border); text-decoration: none; transition: .2s; font-size: 14px; font-weight: 500;
}
.menhu-sidebar-link:hover { background: var(--bg-soft); color: var(--primary); padding-left: 24px; }
.menhu-sidebar-link:last-child { border-bottom: none; }

/* ==================== 9. 页脚 ==================== */
.menhu-footer { background: #111827; color: #9ca3af; padding: 36px 0; font-size: 13px; text-align: center; margin-top: 40px; }

/* 排行榜徽章 */
.menhu-rank-num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; flex-shrink: 0;
    border-radius: 4px;
    background: var(--bg-soft); color: var(--muted);
    font-size: 12px; font-weight: 700;
    font-family: ui-monospace, Menlo, Consolas, monospace;
    line-height: 1;
}
.menhu-rank-num.top-1 { background: linear-gradient(135deg, #fbbf24, #d97706); color: #fff; box-shadow: 0 2px 6px rgba(217,119,6,.35); }
.menhu-rank-num.top-2 { background: linear-gradient(135deg, #e5e7eb, #9ca3af); color: #fff; box-shadow: 0 2px 6px rgba(156,163,175,.35); }
.menhu-rank-num.top-3 { background: linear-gradient(135deg, #fdba74, #c2410c); color: #fff; box-shadow: 0 2px 6px rgba(194,65,12,.35); }

/* 补漏：--text-2 别名，兼容已有视图里的 var(--text-2) 引用 */
:root { --text-2: var(--text-regular); }