/* 1. 全局变量和基础样式 */
:root {
    --primary1: #000000;      /* 黑色 */
    --secondary: #ff0000;    /* 红色 */
    --background-start: #ffffff;  /* 白色 */
    --background-end: #e0f7fa;    /* 青色 */
    --text-primary1: #000000; /* 黑色文字 */
    --text-secondary: #333333; /* 深灰色文字 */
    --border-color: #ff0000; /* 红色边框/分割线 */
    --light-gray: #f5f5f5;
    --transition-speed: 0.2s;
}

/* 2. 主内容区样式 */
.main-content {
    flex: 1;
    padding: 0;
    transition: margin-left var(--transition-speed) ease;
    height: 100vh;
    overflow-y: auto;
    background: linear-gradient(to bottom, var(--background-start), var(--background-end));
    position: relative;
}

.info-box {
    display: none;
}
.info-title, .info-content {
    /* 仅占位，无额外样式，保持默认 */
}


/* 3. 博客列表容器 */
.blog-list-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    height: auto;
    overflow-y: visible;
}

/* 4. 文章条目样式 - 平面化设计 */
.blog-article-item {
    display: flex;
    align-items: flex-start;
    padding: 2rem 0;
    border-bottom: 2px solid var(--border-color);
    transition: all var(--transition-speed) ease;
    cursor: pointer;
    background: transparent;
    position: relative;
    min-height: 200px;
}

.blog-article-item:last-child {
    border-bottom: none;
}

.blog-article-item:hover {
    background: rgba(0, 0, 0, 0.02);
}

/* 5. 封面图区域 */
.article-cover {
    flex: 0 0 280px;
    height: 180px;
    position: relative;
    margin-right: 2rem;
}

.cover-image {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    object-fit: cover;
    display: block;
}

.cover-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #000000;
    color: #ff0000;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    z-index: 2;
}

/* 6. 文章内容区域 */
.article-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 180px;
}

.article-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary1);
    margin: 0 0 1rem 0;
    line-height: 1.3;
}

.article-summary {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0 0 1.5rem 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

/* 7. 文章元信息区域 */
.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

/* 左侧：作者信息 */
.author-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.author-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.author-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.author-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary1);
}

.publish-time {
    font-size: 0.8rem;
    color: #666;
}

/* 右侧：统计信息 */
.article-stats {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.stat-item i {
    font-size: 1rem;
    color: var(--primary1);
}

/* 8. 加载状态 */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
    font-size: 1rem;
}

.no-articles {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
    font-size: 1rem;
}

.load-more {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* 9. 搜索组件样式 */
.search-group {
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    background: white;
    color: var(--text-primary1);
    transition: border-color var(--transition-speed);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary1);
}

.search-btn {
    padding: 0.6rem 1.2rem;
    background-color: var(--primary1);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color var(--transition-speed);
    white-space: nowrap;
}

.search-btn:hover {
    background-color: #333;
}

/* 10. 浮动发布按钮 */
.floating-publish-btn {
    /* 1. 右下角固定定位（位置可调：修改下面两个变量即可） */
    position: fixed;
    --btn-bottom: 130px; /* 距离底部距离（可调） */
    --btn-right: 30px;  /* 距离右侧距离（可调） */
    bottom: var(--btn-bottom);
    right: var(--btn-right);

    /* 2. 镂空透明样式（边框可见+背景透明） */
    background: transparent;
    border: 2px solid #fff; /* 白色边框实现镂空感，可改颜色 */
    border-radius: 50%; /* 圆形按钮（如需方形可改0或其他值） */
    padding: 12px; /* 内边距控制按钮大小，可调整 */
    box-shadow: 0 2px 8px rgba(0,0,0,0.2); /* 轻微阴影增强层次感 */
    cursor: pointer; /* 鼠标悬浮显示指针，提示可点击 */

    /* 3. 放大过渡：确保放大/还原时平滑无卡顿 */
    transition: transform 0.3s ease;
    z-index: 999; /* 层级置顶，避免被其他元素遮挡 */
}

/* 4. 放大交互：鼠标悬浮时放大（可改scale值调整放大比例） */
.floating-publish-btn:hover {
    transform: scale(1.2); /* 放大1.2倍，1.1=10%放大，1.3=30%放大 */
    border-color: #409eff; /* hover时边框变色，增强交互反馈（可选） */
}

/* 图标样式：适配按钮大小，避免拉伸 */
.btn-icon {
    width: 42px; /* 图标宽度（可调，配合按钮内边距） */
    height: 42px;
    object-fit: contain; 
    vertical-align: middle;
}


.floating-publish-btn:hover {
    background-color: var(--primary-light);
    transform: scale(1.05);
}

.floating-publish-btn i {
    font-size: 1.5rem;
}

/* 11. 模态弹窗样式 - 平面化 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 0;
    width: 90%;
    max-width: 900px;
    max-height: 80vh;
    border-radius: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
}

.modal-header {
    background: var(--primary1);
    color: white;
    padding: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.close {
    color: white;
    font-size: 28px;
    font-weight: normal;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    float: right;
    line-height: 1;
}

.close:hover {
    opacity: 0.8;
}

/* 12. 平面列表样式（用于弹窗） */
.flat-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.flat-item {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    transition: background var(--transition-speed);
    cursor: pointer;
}

.flat-item:last-child {
    border-bottom: none;
}

.flat-item:hover {
    background: var(--light-gray);
}

.flat-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.flat-item-title {
    font-weight: 600;
    color: var(--text-primary1);
    font-size: 1rem;
    max-width: 70%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.flat-item-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.flat-item-content {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* 13. 选项卡样式 */
.modal-tabs-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.modal-tabs {
    display: flex;
    background: var(--light-gray);
    border-bottom: 2px solid var(--border-color);
}

.modal-tab {
    flex: 1;
    padding: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-secondary);
    transition: all var(--transition-speed);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.modal-tab:hover {
    background: #e8e8e8;
}

.modal-tab.active {
    color: var(--primary1);
    font-weight: 600;
    background: white;
}

.tab-indicator {
    position: absolute;
    bottom: -2px;
    height: 2px;
    background: var(--border-color);
    transition: transform var(--transition-speed);
    width: 33.33%;
}

.modal-tab-content {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.tab-pane {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
    overflow-y: auto;
}

.tab-pane.active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: all;
}

.tab-scroll-container {
    height: 100%;
    padding: 1rem;
}

/* 14. 空状态 */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
    color: #ccc;
}
/* 15. 响应式设计 - 进一步优化移动端 */
@media (max-width: 768px) {
    /* 主内容区容器 - 进一步减少内边距 */
    .blog-list-container {
        padding: 0.25rem;
        max-width: 100%;
    }
    
    /* 文章条目 - 进一步缩小高度和间距 */
    .blog-article-item {
        flex-direction: row;
        padding: 0.75rem 0.25rem;
        min-height: 130px;
        gap: 0.75rem;
        align-items: flex-start;
    }
    
    /* 封面图区域 - 进一步缩小 */
    .article-cover {
        flex: 0 0 100px;
        height: 100px;
        margin: 0;
    }
    
    .cover-image {
        border-radius: 6px;
    }
    
    .cover-badge {
        top: 3px;
        left: 3px;
        padding: 1px 6px;
        font-size: 0.65rem;
        border-radius: 2px;
    }
    
    /* 内容区域 - 缩小整体高度 */
    .article-content {
        flex: 1;
        height: 100px;
        min-height: auto;
        justify-content: space-between;
        padding-right: 0.25rem;
    }
    
    /* 标题 - 进一步缩小 */
    .article-title {
        font-size: 1rem;
        margin-bottom: 0.4rem;
        line-height: 1.25;
        -webkit-line-clamp: 2;
        font-weight: 600;
    }
    
    /* 摘要 - 缩小字体和间距 */
    .article-summary {
        font-size: 0.8rem;
        line-height: 1.35;
        margin-bottom: 0.6rem;
        -webkit-line-clamp: 2;
        color: #555;
    }
    
    /* 元信息区域 - 缩小间距 */
    .article-meta {
        flex-direction: row;
        align-items: center;
        gap: 0.4rem;
        margin-top: 0;
        padding-top: 0.4rem;
        border-top: 0.5px solid #e0e0e0;
    }
    
    /* 作者信息 - 进一步缩小 */
    .author-info {
        gap: 0.4rem;
        flex: 1;
        min-width: 0;
    }
    
    .author-avatar {
        width: 24px;
        height: 24px;
        flex-shrink: 0;
        border: 1px solid #eee;
    }
    
    .author-details {
        min-width: 0;
        gap: 0.1rem;
    }
    
    .author-name {
        font-size: 0.75rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        color: #333;
    }
    
    .publish-time {
        font-size: 0.7rem;
        white-space: nowrap;
        color: #777;
    }
    
    /* 统计信息 - 进一步缩小 */
    .article-stats {
        flex: none;
        gap: 0.6rem;
        justify-content: flex-end;
    }
    
    .stat-item {
        flex: none;
        font-size: 0.7rem;
        gap: 0.2rem;
        color: #555;
        min-width: auto;
    }
    
    .stat-item i {
        font-size: 0.75rem;
        color: #333;
    }
    
    /* 模态弹窗 - 优化移动显示 */
    .modal {
        padding: 0;
    }
    
    .modal-content {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        margin: 0;
        border-radius: 0;
    }
    
    .modal-header {
        padding: 0.8rem 1rem;
        border-bottom: 1px solid var(--border-color);
    }
    
    .modal-header h2 {
        font-size: 1.1rem;
    }
    
    .close {
        font-size: 24px;
        width: 24px;
        height: 24px;
    }
    
    /* 选项卡 - 进一步缩小 */
    .modal-tabs {
        padding: 0;
    }
    
    .modal-tab {
        padding: 0.7rem 0.2rem;
        font-size: 0.75rem;
        flex: 1;
        min-width: 0;
    }
    
    .modal-tab i {
        font-size: 0.8rem;
        margin-right: 0.2rem;
        display: inline-block;
    }
    
    .tab-indicator {
        height: 1px;
    }
    
    .tab-scroll-container {
        padding: 0.6rem;
    }
    
    /* 平面列表项 - 进一步缩小 */
    .flat-item {
        padding: 0.6rem 0.4rem;
        border-bottom: 0.5px solid #eee;
    }
    
    .flat-item-header {
        margin-bottom: 0.3rem;
    }
    
    .flat-item-title {
        font-size: 0.85rem;
        max-width: 55%;
        font-weight: 500;
    }
    
    .flat-item-stats {
        gap: 0.4rem;
        font-size: 0.7rem;
    }
    
    .flat-item-content {
        font-size: 0.75rem;
        line-height: 1.4;
        color: #555;
    }
    
    /* 空状态 - 缩小 */
    .empty-state {
        padding: 2rem 0.5rem;
    }
    
    .empty-state i {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }
    
    .empty-state p {
        font-size: 0.9rem;
    }
    
  
}

/* 16. 电脑端模态弹窗优化 - 修复显示问题 */
@media (min-width: 769px) {
    /* 用户内容管理模态弹窗 - 电脑端优化 */
    #user-articles-modal .modal-content {
        width: 800px;
        height: 600px;
        max-height: 600px;
        margin: 5% auto;
        border-radius: 12px;
        overflow: hidden;
    }
    
}

/* 17. 超大屏幕优化 */
@media (min-width: 1200px) {
    #user-articles-modal .modal-content {
        width: 900px;
        height: 650px;
        max-height: 650px;
    }
    
    .tab-scroll-container {
        height: 450px;
    }
    
    #admin-modal .modal-content {
        width: 1000px;
        height: 550px;
    }
}