/* ------------------------------------
 * mulu - 极简资源导航风格主题
 * 
 * @author Lao Er & Gemini
 * @link https://laoer.hk
 * @update  2026-04-01
 * --------------------------------- */

:root {
    --green: #22ac38;
    --bg: #f0f3f8;
    --border: #eef0f2;
    --white: #ffffff;
    /* 专门存放你刚挖到的那个“灵魂阴影色” */
    --shadow-color: rgba(0, 0, 0, 0.35); 
}

* { box-sizing: border-box; }
body {
    margin: 0;
    padding: 0;
    background: var(--bg) !important;
    /* 这里的顺序就是大厂通用的字体调用逻辑 */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    -webkit-font-smoothing: antialiased; /* 让字体在 Mac/Chrome 上更平滑 */
    -moz-osx-font-smoothing: grayscale;
    color: #333;
    line-height: 1.6;
}

/* --- 严格 300x38 胶囊搜索框 --- */
.mulu-search-bar {
    background: #f0f3f8; 
    /* 保持你原始的 6px 上下内边距，确保高度为 38px */
    padding: 6px 20px;  
    border-radius: 19px; /* 38px的一半，保持完美圆周 */
    
    display: flex; 
    align-items: center;
    border: 1px solid transparent;
    transition: all 0.3s;
    
    /* 严格锁定宽度 300px */
    width: 300px; 
    flex-shrink: 0; 
    position: relative; 
}

/* 焦点激活状态 */
.mulu-search-bar:focus-within {
    background: #fff;
    border-color: var(--green);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.mulu-search-bar input {
    border: none;
    background: none;
    outline: none;
    font-size: 14px; 
    width: 100%;
    color: #444;
    /* 保持你原始的 24px 内容高度 */
    height: 24px; 
    line-height: 24px;
    padding-right: 25px; /* 给右侧图标留位 */
}

.mulu-search-bar button {
    border: none;
    background: none;
    cursor: pointer;
    color: #999;
    padding: 0;
    display: flex;
    align-items: center;
    
    /* 绝对定位到右侧内部 */
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    transition: color 0.2s;
}

.mulu-search-bar button i {
    font-size: 16px; 
}

/* 悬停变绿 */
.mulu-search-bar button:hover {
    color: var(--green) !important;
}

/* 移动端兼容 */
@media (max-width: 1000px) {
    .mulu-search-bar {
        width: 200px;
    }
}

/* --- 最终还原：对标源码的深色下沉阴影 --- */
#main-header {
    /* 增加过渡属性，确保阴影出现时丝滑不生硬 */
    transition: box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* 适配你看到的 768px 以上的逻辑 */
@media (min-width: 768px) {
    .header-scrolled {
        /* 1. 严格守住这 1px 边框，确保 header 里的“首页/登录”文字绝不跳动 */
        border-bottom: 1px solid #eee !important; 

        /* 2. 核心：直接调用你 :root 里定义的 0.35 浓度的变量 */
        /* 数值严格按照你截图源码中的 0 2px 6px */
        box-shadow: 0 2px 6px var(--shadow-color) !important;
    }
}

/* 兼容移动端：确保手机端下拉也有这个味儿 */
@media (max-width: 767px) {
    .header-scrolled {
        border-bottom: 1px solid #eee !important;
        box-shadow: 0 2px 6px var(--shadow-color) !important;
    }
}

.mulu-container { max-width: 1200px; margin: 0 auto; width: 98%; }
.mulu-wrapper { padding-top: 80px; }

/* --- 三栏核心布局 --- */
.main-layout { 
    display: flex !important; 
    flex-direction: row !important;
    gap: 15px; 
    align-items: flex-start; 
}

/* 一. 左侧导航 */
.mulu-sidebar { width: 170px !important; flex-shrink: 0; }
.publish-btn { 
    display: block; background: var(--green); color: #fff !important; 
    text-align: center; padding: 8px; border-radius: 6px; 
    font-weight: bold; margin-bottom: 20px; text-decoration: none;
}
.nav-list { list-style: none !important; padding: 0; margin: 0; }
.nav-list li a { 
    display: flex; align-items: center; gap: 10px; padding: 10px;
    color: #555; text-decoration: none; border-radius: 6px; font-size: 14px;
}
.nav-list li.active a { background: #fff; color: var(--green); font-weight: 600; }

/* 二. 中间内容区 - 核心等高逻辑 */
.mulu-content { flex: 1 !important; min-width: 0; }
.content-toolbar { background: #fff; padding: 12px 20px; border: 1px solid var(--border); border-radius: 8px 8px 0 0; }
.post-feed { background: #fff; border: 1px solid var(--border); border-top: none; border-radius: 0 0 8px 8px; }

.post-row { 
    display: flex !important; 
    gap: 15px; 
    padding: 20px; 
    border-bottom: 1px solid #f8f9fa; 
    align-items: flex-start !important; 
    /* 每一个卡片基础高度设定，确保即使没内容也保持一致 */
    min-height: 160px; 
}

.post-left { padding-top: 3px; } 
.post-left img { width: 42px; height: 42px; border-radius: 50%; border: 1px solid #eee; }

.post-body { flex: 1; min-width: 0; }

/* 标题定高：防止标题一行或两行导致卡片错位，这里固定为 1.4倍行高 */
.post-title { 
    margin: 0 0 5px 0; 
    font-size: 18px; 
    font-weight: 600; 
    line-height: 1.4;
    height: 1.4em; /* 固定为一行高度 */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.post-title a { color: #000 !important; text-decoration: none; }

/* 1. 基础元信息样式：设置颜色和字体大小，默认不加粗 */
.post-meta { 
    font-size: 12px; 
    color: #373837; 
    margin-bottom: 8px; 
    display: flex;
    align-items: center;
    gap: 5px; /* 统一间距 */
}

/* 2. 这里的间隔圆点颜色可以稍微浅一点，更有层次 */
.post-meta .dot {
    color: #ccc;
    font-weight: normal;
}

/* 3. 核心：仅给分类名和作者名加粗 */
.meta-category, 
.meta-author {
    font-weight: bold;
}

/* 4. 显式声明日期不加粗（其实默认就是 normal，这样写更保险） */
.meta-date {
    font-weight: normal;
    color: #888; /* 日期通常建议比作者名稍微浅一点点，视觉更有主次 */
}

/* 5. 精准打击：去掉分类名和作者名里的链接样式 */
.post-meta a {
    color: inherit !important;         /* 强制继承父级颜色 #373837，不再变蓝变紫，增加 !important，确保彻底杀掉链接的蓝色/紫色 */
    text-decoration: none;            /* 平时隐藏下划线 */
    font-weight: bold;               /* 确保链接文字依然保持加粗 */              
    transition: all 0.2s;           /* 增加一点平滑过渡感 */
}

/* 6. 核心修改：仅在鼠标悬停时显示下划线 */
.post-meta a:hover {
    text-decoration: underline !important; /* 悬停时强制出现下划线 */
}

/* 摘要定高核心：强制留出 3 行空间 */
.post-summary { 
    font-size: 15px; 
    color: #373837; 
    line-height: 1.7; /* 设定行高 */
    letter-spacing: 0.02em; /* 增加极其微小的字间距 */
    height: 5.1em;   /* 1.7(行高) * 3(行数) = 5.1em */
    display: -webkit-box; 
    -webkit-line-clamp: 3; /* 限制显示3行 */
    -webkit-box-orient: vertical; 
    overflow: hidden; 
    text-overflow: ellipsis;
}

/* 封面图保持在右侧居中 */
.post-right-thumb { 
    width: 150px; 
    height: 100px; 
    flex-shrink: 0; 
    align-self: center; 
    margin-left: 10px;  /* 稍微加大左间距，避免图片贴着文字太近 */ 
}
.post-right-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; }

/* --- 全卡片点击逻辑 --- */

.post-row {
    position: relative; /* 必须加这一行，作为点击层的参考坐标 */
    transition: background 0.2s ease; /* 顺便加个背景微变，给用户点击反馈 */
}

/* 鼠标悬停在卡片任何位置，背景稍微变深一点点，暗示可点 */
.post-row:hover {
    background-color: #fafafa; 
}

.post-title .main-link::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    z-index: 1; /* 铺在最上层 */
    pointer-events: auto; /* 确保捕获点击 */
}

/* 关键：防止卡片内的其他链接（如作者、分类）被挡住 */
.post-meta a, 
.post-right-thumb a {
    position: relative;
    z-index: 2; /* 让分类、标签等小链接的层级高于透明层，保证它们还能单独点 */
}

/* 鼠标经过卡片时，让标题颜色产生联动变化 */
.post-row:hover .post-title a {
    color: var(--green) !important;
}

/* 1. 卡片整体：改为纵向堆叠 */
.post-row {
    display: flex !important;
    flex-direction: column !important; /* 强制上下排版 */
    padding: 0 !important; /* 清空边距，由子元素控制 */
    border-bottom: 1px solid #f2f2f2;
}

/* 2. 核心内容区：恢复横向排版 */
.post-main {
    display: flex;
    width: 100%;
    padding: 20px; /* 间距给到这里 */
    gap: 15px;
    align-items: flex-start;
}

/* 3. 工具栏：微博风 */
.post-actions {
    display: flex;
    width: 100%;
    border-top: 1px solid #f8f8f8; /* 浅浅的顶部分割线 */
    background: #fff;
}

.action-item {
    flex: 1; /* 平分空间 */
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: #808080;
    position: relative;
    transition: background 0.2s;
}

/* 竖向小分割线 */
.action-item:not(:last-child)::after {
    content: "";
    position: absolute;
    right: 0;
    top: 30%;
    height: 40%;
    width: 1px;
    background-color: #eee;
}

.action-item:hover {
    background-color: #fafafa;
    color: var(--green);
}

/* 三. 右侧广告栏 */
.mulu-right-sidebar { width: 240px !important; flex-shrink: 0; }
.sidebar-block { background: #fff; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin-bottom: 15px; }
.block-title { padding: 10px 15px; background: #fafafa; border-bottom: 1px solid var(--border); font-size: 13px; font-weight: bold; display: flex; justify-content: space-between; }

.sponsor-list { padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.sponsor-item { display: block; width: 100%; aspect-ratio: 24/10; border-radius: 4px; overflow: hidden; border: 1px solid #eee; position: relative; }
.sponsor-item img { width: 100%; height: 100%; object-fit: cover; }
.brand-ad { background: var(--green); color: #fff; border: none; }
.ad-placeholder { height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; font-size: 12px; text-align: center; }

/* 分页 */
.mulu-pagination { padding: 30px 0; text-align: center; }
.mulu-pagination a, .mulu-pagination span { padding: 8px 16px; background: #fff; border: 1px solid var(--border); margin: 0 3px; border-radius: 4px; text-decoration: none; color: #666; }

/* 移动端 */
@media (max-width: 1024px) {
    .mulu-sidebar, .mulu-right-sidebar { display: none !important; } /* 移动端隐藏两侧 */
    .mulu-container { width: 100%; }
    .post-main { padding: 15px; }
    .post-right-thumb { width: 100px; height: 70px; } /* 缩小缩略图 */
}

/* --- 文章详情页专用样式 --- */
.post-article-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 20px;
}

.article-header { margin-bottom: 30px; border-bottom: 1px solid #f8f9fa; padding-bottom: 20px; }
.article-meta-top { font-size: 13px; color: #999; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.article-title { font-size: 28px; font-weight: 700; color: #222; line-height: 1.3; margin: 10px 0 20px; }

.article-author-info { display: flex; align-items: center; gap: 12px; }
.article-author-info img { border-radius: 50%; border: 1px solid #eee; }
.author-text { display: flex; flex-direction: column; }
.author-name { font-weight: bold; font-size: 14px; color: #333; }
.author-intro { font-size: 12px; color: #999; }

/* 正文排版优化 */
.article-content { 
    font-size: 16px; 
    line-height: 1.8; 
    color: #333; 
    word-wrap: break-word; 
}
.article-content p { margin-bottom: 1.5em; }
.article-content img { 
    max-width: 100%; 
    height: auto; 
    border-radius: 8px; 
    display: block; 
    margin: 20px auto; 
}
.article-content h2, .article-content h3 { margin-top: 30px; color: #000; }

/* 文章页页脚 */
.article-footer { margin-top: 40px; padding: 20px 0; border-top: 1px dashed #eee; }
.article-tags { margin-bottom: 15px; font-size: 13px; color: #666; }
.article-tags a { background: #f5f5f5; padding: 3px 10px; border-radius: 4px; margin-right: 5px; color: #888; }
.article-copyright { font-size: 12px; color: #bbb; background: #f0f3f8; padding: 10px; border-radius: 4px; }

/* 详情页特有的交互栏边框修正 */
.post-actions.border-top { border-top: 1px solid #eee; margin-top: 20px; }