/* 
 * 自定义样式补充
 * 用于适配模板系统的特殊需求
 */

/* 用户登录注册入口样式 */
.nav-right {
    float: right;
    margin-top: 20px;
}

.nav-right li {
    display: inline-block;
    margin-left: 10px;
}

.nav-right a {
    display: inline-block;
    padding: 8px 20px;
    color: #333;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.nav-right .btn-login,
.nav-right .btn-register {
    background: #0060ed;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
}

.nav-right .btn-login:hover,
.nav-right .btn-register:hover {
    background: #0050d0;
    color: #fff;
}

.nav-right .logout-link {
    color: #666;
    background: #f0f0f0;
}

.nav-right .logout-link:hover {
    background: #e0e0e0;
    color: #333;
}

.nav-right .user-link {
    color: #333;
}

.nav-right .user-link:hover {
    color: #0060ed;
}

.nav-right .user-link .iconfont {
    margin-right: 5px;
    font-size: 16px;
}

/* 桌面端：侧栏内登录区不显示（与横向 .nav-right 重复） */
@media (min-width: 901px) {
    .hua-navbar .nav-list > li.nav-drawer-auth {
        display: none !important;
    }
}

/* 移动端抽屉：侧栏底部登录/注册；顶栏 .nav-right 隐藏避免与侧栏重复 */
@media (max-width: 900px) {
    .nav-right {
        display: none;
    }
    .hua-navbar .nav-list > li.nav-drawer-auth {
        margin-top: 12px;
        padding-top: 16px;
        border-top: 1px solid #e5e5e5;
        background-color: #fff !important;
    }
    .nav-drawer-user-row {
        display: flex;
        flex-direction: column;
        gap: 10px;
        padding: 4px 0 8px;
    }
    .nav-drawer-user-row .btn-login,
    .nav-drawer-user-row .btn-register {
        display: block;
        text-align: center;
        padding: 10px 16px;
        font-size: 15px;
        font-weight: 500;
        border-radius: 4px;
        color: #fff;
        background: #0060ed;
    }
    .nav-drawer-user-row .btn-login:hover,
    .nav-drawer-user-row .btn-register:hover {
        background: #0050d0;
        color: #fff;
    }
    .nav-drawer-user-row .user-link {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        padding: 10px 16px;
        background: #f7f7f7;
        color: #333;
        border-radius: 4px;
        font-size: 15px;
    }
    .nav-drawer-user-row .user-link:hover {
        color: #0060ed;
    }
    .nav-drawer-user-row .logout-link {
        display: block;
        text-align: center;
        padding: 10px 16px;
        background: #f0f0f0;
        color: #666;
        border-radius: 4px;
        font-size: 15px;
    }
    .nav-drawer-user-row .logout-link:hover {
        background: #e5e5e5;
        color: #333;
    }
}

/* 作者链接样式 */
.author-link {
    color: inherit;
    text-decoration: underline;
    transition: color 0.3s;
}

.author-link:hover {
    color: #0060ed !important;
}

/* 作者主页样式 */
.author-header {
    background: #f9f9f9;
    padding: 30px;
    margin-bottom: 20px;
    border-radius: 5px;
}

.author-info {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.author-info .avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-right: 20px;
    object-fit: cover;
}

.author-details h2 {
    font-size: 24px;
    margin-bottom: 10px;
    color: #333;
}

.author-details .email {
    color: #666;
    font-size: 14px;
}

.author-stats {
    display: flex;
    gap: 40px;
    padding: 20px 0;
    border-top: 1px solid #e0e0e0;
}

.stat-item {
    text-align: center;
}

.stat-item strong {
    display: block;
    font-size: 28px;
    color: #0060ed;
    margin-bottom: 5px;
}

.stat-item span {
    color: #666;
    font-size: 14px;
}

/* 文章列表样式 */
.author-articles h3 {
    font-size: 20px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #0060ed;
    color: #333;
}

.author-articles .article-item {
    padding: 20px 0;
    border-bottom: 1px solid #e0e0e0;
}

.author-articles .article-item h4 {
    font-size: 18px;
    margin-bottom: 10px;
}

.author-articles .article-item h4 a {
    color: #333;
    font-weight: 600;
    transition: color 0.3s;
}

.author-articles .article-item h4 a:hover {
    color: #0060ed;
}

.article-meta {
    color: #999;
    font-size: 13px;
    margin-bottom: 10px;
}

.article-meta span {
    margin-right: 20px;
}

.article-meta .iconfont {
    margin-right: 5px;
}

.article-desc {
    color: #666;
    line-height: 1.6;
    font-size: 14px;
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: 60px 0;
    color: #999;
}

.empty-state p {
    font-size: 16px;
}

/* 分页样式 */
#pagination-container {
    margin: 30px 0;
}

.pagination {
    text-align: center;
}

.pagination ul {
    display: inline-block;
    list-style: none;
    padding: 0;
}

.pagination li {
    display: inline-block;
    margin: 0 5px;
}

.pagination a,
.pagination span {
    display: block;
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 3px;
    background: #fff;
    color: #333;
    transition: all 0.3s;
}

.pagination a:hover {
    background: #0060ed;
    color: #fff;
    border-color: #0060ed;
}

.pagination .active span {
    background: #0060ed;
    color: #fff;
    border-color: #0060ed;
}

/* 上下篇导航 */
.nextinfo {
    margin-top: 30px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 5px;
}

.nextinfo p {
    margin: 10px 0;
    font-size: 14px;
    color: #666;
}

.nextinfo a {
    color: #0060ed;
    transition: color 0.3s;
}

.nextinfo a:hover {
    color: #0050d0;
}

/* 侧栏打开时锁定背景滚动，避免穿透（由 common.js 添加/移除） */
html.nav-drawer-scroll-lock,
body.nav-drawer-scroll-lock {
    overflow: hidden;
}
body.nav-drawer-scroll-lock {
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
}

/* 移动端：显示主题自带的「菜单」按钮，配合 common.js 拉出侧栏栏目（.nav-list） */
@media only screen and (max-width: 900px) {
    .hua-navbar .menu-btn {
        display: block !important;
        float: right;
        margin-top: 16px;
        margin-right: 4px;
        position: relative;
        /* 必须低于侧栏 .nav-list(99999)，否则会盖住侧栏内的关闭按钮，导致无法关闭 */
        z-index: 99990;
    }
    /* 抽屉打开时隐藏汉堡，避免与关闭钮重叠；关闭后由 JS 去掉 .nav-drawer-open */
    .hua-navbar.nav-drawer-open .menu-btn {
        visibility: hidden;
        pointer-events: none;
    }
    /* 遮罩需高于页面一般浮层，否则点暗色区域实际点到正文，菜单关不掉 */
    .hua-navbar .hua-overlay {
        z-index: 99980 !important;
    }
}

/* 响应式适配 */
@media (max-width: 768px) {
    .author-info {
        flex-direction: column;
        text-align: center;
    }
    
    .author-info .avatar {
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .author-stats {
        justify-content: center;
    }
    
}
