/* 页面基础样式 */
body {
    margin: 20px; /* 添加页边距 */
    margin-top: 80px; /* 预留固定头部空间，防止内容被遮挡 */
    min-height: calc(100vh - 120px); /* 减去头部高度和上下边距 */
}

/* Header布局 */
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed; /* 固定定位 */
    top: 0; /* 固定在顶部 */
    left: 20px; /* 与页面左边距对齐 */
    right: 20px; /* 与页面右边距对齐 */
    background-color: white; /* 添加背景色，确保内容可读性 */
    z-index: 1000; /* 确保在其他内容之上 */
}

/* 头部左侧容器（包含logo和h1） */
.header-left {
    display: flex;
    align-items: center;
    gap: 15px; /* logo和标题之间的间距 */
}

/* h1标题样式 */
header h1 {
    font-size: 1.6em; /* 减小字体大小 */
    font-weight: 800; /* 减轻字体粗细 */
    margin: 0; /* 移除默认外边距 */
}

/* Logo样式 */
header img {
    width: 50px;           /* 控制logo宽度 */
    height: 50px;          /* 控制logo高度 */
    object-fit: contain;    /* 保持logo比例 */
    border-radius: 8px;     /* 圆角效果 */
}

/* 登录注册链接 */
header div:last-child a {
    color: #333; /* 设置文本颜色为深灰色 */
    text-decoration: none;
}

header div:last-child a:active {
    color: #0084ff9a; /* 点击时文字颜色变为蓝色 */
}

/* 分类导航栏样式 */
.category-nav {
    width: 100%;
    background-color: #ffffff;
    border-radius: 8px;
    padding: 10px 0;
    margin: 20px 0;
    display: flex;
    justify-content: center;
    box-shadow: 0 2px 4px -2px rgba(0,0,0,0.1);
}

/* 导航列表样式 */
.nav-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    padding: 0;
    margin: 0;
}

/* 导航项样式 */
.nav-list li {
    margin: 0 15px;
}

/* 导航链接样式 */
.nav-list a {
    color: #333;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: block;
}

/* 导航链接悬停效果 */
.nav-list a:hover {
    background-color: white;
    color: #0084ff9a;
}

/* 导航链接激活状态 */
.nav-list a:active {
    background-color: white;
    color: #0084ff;
}

/* 响应式设计 - 平板设备 */
@media (max-width: 768px) {
    .nav-list li {
        margin: 0 10px;
    }
    
    .nav-list a {
        padding: 6px 12px;
        font-size: 14px;
    }
}

/* 关于部分样式 */
#about.articles-section {
    width: 100%;
    margin: 0;
    padding: 80px 0 120px;
    text-align: center;
    display: none;
}

.about-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.about-avatar {
    width: 150px;
    height: 150px;
    margin: 0 auto 30px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.1);
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.about-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: contain;
}

.about-name {
    font-size: 2.2em;
    font-weight: bold;
    margin-bottom: 20px;
    color: #333;
}

.about-intro {
    margin-bottom: 40px;
    line-height: 1.6;
}

.about-intro p {
    margin: 0;
    color: #666;
}

.about-skills {
    margin-bottom: 40px;
}

.skills-title {
    font-size: 1.5em;
    font-weight: bold;
    margin-bottom: 20px;
    color: #333;
}

.skills-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.skill-tag {
    background-color: rgba(0, 0, 0, 0.1);
    color: #333;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9em;
    transition: all 0.3s ease;
}

.skill-tag:hover {
    background-color: rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.about-contact {
    margin-top: 40px;
}

.contact-title {
    font-size: 1.5em;
    font-weight: bold;
    margin-bottom: 20px;
    color: #333;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.contact-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background-color: rgba(0, 0, 0, 0.1);
    color: #333;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.contact-btn:hover {
    background-color: rgba(0, 0, 0, 0.2);
    transform: translateY(-5px);
}

.contact-icon {
    font-size: 2em;
    margin-bottom: 5px;
    font-weight: bold;
}

.contact-text {
    font-size: 0.9em;
}

.gitee-btn .contact-icon {
    color: #ff6b6b;
}

.email-btn .contact-icon {
    color: #4ecdc4;
}

/* 响应式设计 - 关于部分 */
@media (max-width: 768px) {
    #about.articles-section {
        padding: 60px 0 80px;
    }
    
    .about-avatar {
        width: 120px;
        height: 120px;
        margin-bottom: 20px;
    }
    
    .about-name {
        font-size: 1.8em;
    }
    
    .skills-title,
    .contact-title {
        font-size: 1.3em;
    }
    
    .skills-list {
        gap: 8px;
    }
    
    .skill-tag {
        padding: 6px 12px;
        font-size: 0.8em;
    }
    
    .contact-links {
        gap: 15px;
    }
    
    .contact-btn {
        width: 70px;
        height: 70px;
    }
    
    .contact-icon {
        font-size: 1.8em;
    }
}

@media (max-width: 480px) {
    #about.articles-section {
        padding: 40px 0 60px;
    }
    
    .about-avatar {
        width: 100px;
        height: 100px;
    }
    
    .about-name {
        font-size: 1.5em;
    }
    
    .about-intro {
        font-size: 0.9em;
        line-height: 1.5;
    }
    
    .skills-list {
        gap: 6px;
    }
    
    .skill-tag {
        padding: 5px 10px;
        font-size: 0.7em;
    }
    
    .contact-links {
        gap: 10px;
    }
    
    .contact-btn {
        width: 60px;
        height: 60px;
    }
    
    .contact-icon {
        font-size: 1.5em;
    }
    
    .contact-text {
        font-size: 0.8em;
    }
}

/* 响应式设计 - 手机设备 */
@media (max-width: 480px) {
    .category-nav {
        padding: 8px 0;
    }
    
    .nav-list {
        flex-direction: column;
        align-items: center;
    }
    
    .nav-list li {
        margin: 5px 0;
        width: 100%;
        text-align: center;
    }
    
    .nav-list a {
        padding: 10px 15px;
        width: 80%;
        margin: 0 auto;
    }
}



/* 搜索容器样式 */
.search-container {
    width: 100%;
    /* height: calc(100vh - 180px); 减去头部高度和上下边距 */
    height: auto; /* 自动高度，只到内容结束 */
    display: flex;
    flex-direction: column; /* 垂直排列子元素 */
    justify-content: flex-start; /* 从顶部开始排列 */
    align-items: center; /* 水平居中 */
    /* padding-top: 80px; 添加顶部内边距，使内容向下移动 */
    padding: 80px 0 120px; 
    position: relative;
}


/* 搜索输入框包装器 */
.search-input-wrapper {
    display: flex;
    align-items: center;
    width: 45%; /* 宽度为45% */
    min-width: 350px; /* 设置最小宽度 */
    border: 2px solid #ddd;
    border-radius: 25px;
    background-color: white;
    position: relative;
}

/* 搜索引擎选择器 */
.search-engine-selector {
    border: none;
    border-right: 1px solid #ddd;
    height: 36px;
    padding: 0 10px;
    font-size: 14px;
    background-color: transparent;
}

/* 搜索结果样式 */
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: #666666;
    color: white;
    border-radius: 20px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    z-index: 999;
    display: none;
    max-height: 400px;
    overflow-y: auto;
}

/* 搜索结果项样式 */
.search-result-item {
    padding: 10px 15px;
    border-bottom: 1px solid #555555;
    transition: background-color 0.3s ease;
}

.search-result-item:last-child {
    border-bottom: none;
    border-radius: 0 0 20px 20px;
}

.search-result-item:hover {
    background-color: #555;
}

/* 搜索结果链接样式 */
.search-result-item a {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

/* 搜索结果图标样式 */
.search-icon {
    width: 16px;
    height: 16px;
    margin-top: 3px;
    object-fit: contain;
    flex-shrink: 0;
}

/* 搜索结果内容样式 */
.search-result-content {
    flex: 1;
    min-width: 0;
}

/* 搜索结果标题样式 */
.search-result-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 搜索结果描述样式 */
.search-result-description {
    font-size: 12px;
    color: #aaa;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 搜索结果类型样式 */
.search-result-type {
    font-size: 11px;
    color: #888;
}

/* 响应式设计 - 搜索结果 */
@media (max-width: 768px) {
    .search-results {
        width: 80%;
        min-width: 280px;
    }
}

/* 搜索框样式 */
.search-input {
    border: none;
    font-size: 14px;
    width: 100%; /* 宽度100%填充容器 */
    height: 40px; /* 固定高度为40px */
    line-height: 40px; /* 行高与高度相同，使文本垂直居中 */       
    padding: 0 15px;
    text-align: left; /* 文本左对齐 */
    transition: border-color 0.3s ease;
    background-color: transparent; /* 背景透明 */
    outline: none; /* 移除默认的焦点边框 */
    flex: 1; /* 占据剩余空间 */
    box-sizing: border-box; /* 确保padding和border包含在宽度内 */       
}

/* 文章区域样式 */
.articles-section {
    width: 80%;
    margin: 0 auto;
    padding: 20px 0;
}

/* h2标题样式 */
.articles-section h2 {
    position: relative;
    padding-left: 10px;
    padding-bottom: 5px;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
    border-left: 3px solid #0084ff;
    font-size: 1.5em;
    color: #333;
}

/* 文章容器样式 */
.articles-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    padding: 10px 0;
}

/* 软件容器样式，覆盖文章容器的Grid布局 */
#software-container.articles-container {
    display: flex;
    flex-direction: column;
}

/* 网址容器样式，覆盖文章容器的Grid布局 */
#urls-container.articles-container {
    display: flex;
    flex-direction: column;
}

/* 项目容器样式，覆盖文章容器的Grid布局 */
#projects-container.articles-container {
    display: flex;
    flex-direction: column;
}

/* 单个文章卡片样式 */
.article-card {
    background-color: white;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* 文章图片样式 */
.article-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    background-color: #f5f5f5;
}

/* 文章内容样式 */
.article-content {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* 文章标题样式 */
.article-title {
    font-size: 1.1em;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 文章链接样式 */
.article-link {
    display: inline-block;
    margin-top: auto;
    padding: 8px 15px;
    background-color: #f0f0f0;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s ease;
    align-self: flex-start;
}

/* 文章卡片隐藏状态样式 */
.article-card.hidden,
.project-item.hidden {
    display: none;
}

/* 软件卡片链接样式 */
.software-card-link {
    display: flex;
    flex: 1 1 calc(33.33% - 10px); /* 三列布局，减去间距的三分之二 */
    min-width: 180px;
    max-width: calc(33.33% - 10px); /* 确保最大宽度为容器的三分之一减去间距 */
    box-sizing: border-box;
    margin-bottom: 10px;
    text-decoration: none;
    color: inherit;
}

/* 软件卡片水平布局 */
.software-card {
    flex: 1;
    max-width: 100%;
    padding: 14px;
    flex-direction: row;
    align-items: center;
    background-color: #fff;
    border: 1px solid #eee;
    border-radius: 7px;
    padding: 10px;
    box-sizing: border-box;
}

.software-image {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    border-radius: 50%;
    /* background-color: #fff; */
    padding: 5px;
}

.software-content {
    padding: 0 15px;
    flex-grow: 1;
}

.software-title {
    font-size: 1em;
    font-weight: bold;
    /* color: #fff; */
    margin-bottom: 5px;
    line-height: 1.2;
}

.software-description {
    font-size: 0.9em;
    color: #ccc;
    margin-bottom: 0;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    /* 大约10个中文字符的宽度 */
    max-width: 70%;
}

/* 重复的软件卡片链接样式 - 已合并到上方 */

/* 左右布局容器 */
.software-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

/* 左侧分类导航 */
.software-sidebar {
    flex: 1;
    min-width: 120px;
    max-width: 200px;
    background-color: #f8f8f8;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    box-sizing: border-box;
}

/* 右侧内容区域 */
.software-content-area {
    flex: 3;
    min-width: 200px;
    background-color: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    height: 600px; /* 设置固定的纵向高度 */
    overflow-y: auto; /* 添加垂直滚动条 */
    box-sizing: border-box;
    overflow-x: hidden; /* 防止水平溢出 */
}

/* 分类折叠框样式 */
.software-category {
    margin-bottom: 10px;
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* 分类切换按钮样式 */
.category-toggle-btn {
    width: 100%;
    padding: 10px 15px;
    background-color: #f8f8f8;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    transition: background-color 0.3s ease;
    text-align: left;
    border-radius: 4px;
}

.category-toggle-btn:hover {
    background-color: #e8e8e8;
}

/* 切换图标样式 */
.toggle-icon {
    font-size: 0.8em;
    font-weight: bold;
    margin-right: 8px;
    color: #0084ff;
    transition: transform 0.3s ease;
}

/* 分类标题样式 */
.software-category-title {
    font-size: 1em;
    font-weight: bold;
    color: #333;
    margin: 0;
    padding-left: 10px;
    border-left: 3px solid #0084ff;
}

/* 分类内容样式 */
.category-content {
    padding: 10px;
    background-color: white;
}

/* 分类卡片容器样式 */
.software-category-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 10px 0;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden; /* 防止水平溢出 */
}

/* 确保软件卡片在容器中按比例动态调节横向大小 */
.software-category-cards .article-card.software-card {
    display: flex;
    flex-direction: row;
    flex: 1;
    min-width: auto;
    max-width: 100%;
    box-sizing: border-box;
}

/* 隐藏状态样式 */
.category-content.hidden,
.software-category-cards.hidden {
    display: none;
}

/* 整体展开/折叠按钮样式 */
.toggle-articles-btn {
    display: block;
    margin: 20px auto;
    padding: 10px 20px;
    background-color: #f0f0f0;
    color: #333;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

.toggle-articles-btn:hover {
    background-color: #0084ff9a;
    color: white;
}

.article-link:hover {
    background-color: #0084ff9a;
    color: white;
}

/* 加载消息样式 */
.loading-message {
    text-align: center;
    padding: 30px;
    color: #666;
    font-style: italic;
}

/* 空状态样式 */
.empty-message {
    text-align: center;
    padding: 30px;
    color: #666;
}

/* 响应式设计 - 文章区域 */
@media (max-width: 768px) {
    .articles-section {
        width: 95%;
    }
    
    .articles-container {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .articles-container {
        grid-template-columns: 1fr;
    }
}

/* 响应式设计 - 软件卡片 */
@media (max-width: 1024px) {
    .software-card-link {
        flex: 1 1 calc(50% - 7.5px); /* 两列布局 */
        max-width: calc(50% - 7.5px);
    }
    
    .software-card,
    .software-category-cards .article-card.software-card {
        flex: 1;
        max-width: 100%;
    }
}

@media (max-width: 768px) {
        /* 侧边栏最小化 */
    .software-sidebar {
        max-width: 150px;
        min-width: 80px;
        padding: 5px;
    }
    
    /* 侧边栏标题文字缩小 */
    .software-category-title {
        font-size: 0.9em;
        padding-left: 5px;
    }
    
    /* 分类卡片单列布局 */
    .software-card-link {
        flex: 1 1 100%; /* 单列布局 */
        max-width: 100%;
    }
    
    .software-card,
    .software-category-cards .article-card.software-card {
        flex: 1;
        max-width: 100%;
    }
}

/* 项目列表样式 */
.projects-list {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 20px;
}

/* 单个项目项样式 */
.project-item {
    background-color: white;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: box-shadow 0.3s ease;
    flex: 0 1 calc(33.33% - 15px); /* 三列布局，不允许自动扩展 */
    min-width: 300px; /* 设置最小宽度 */
    max-width: calc(33.33% - 15px); /* 设置最大宽度 */
    box-sizing: border-box;
}

.project-item:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* 项目头部样式 */
.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 15px;
}

/* 项目标题样式 */
.project-title {
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
    margin: 0;
}

/* 项目链接样式 */
.project-link {
    color: #0084ff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.project-link:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* 项目统计信息样式 */
.project-stats {
    display: flex;
    gap: 15px;
    align-items: center;
}

/* 单个统计项样式 */
.stat-item {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #666;
    font-size: 0.9em;
}

/* 项目描述样式 */
.project-description {
    font-size: 0.95em;
    color: #555;
    line-height: 1.5;
    margin-bottom: 15px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* 项目底部样式 */
.project-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.85em;
}

/* 项目标签容器样式 */
.project-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

/* 单个标签样式 */
.label {
    background-color: #f0f0f0;
    color: #333;
    padding: 3px 8px;
    border-radius: 4px;
}

/* 无标签状态样式 */
.no-labels {
    color: #999;
    font-style: italic;
}

/* 项目更新时间样式 */
.project-update-time {
    color: #999;
}

/* 中等屏幕处理 */
@media (max-width: 1024px) {
    /* 项目卡片变为两列布局 */
    .project-item {
        flex: 0 1 calc(50% - 15px); /* 两列布局，不允许自动扩展 */
        max-width: calc(50% - 15px); /* 设置最大宽度 */
    }
}

/* 小屏幕处理 */
@media (max-width: 768px) {
    /* 项目卡片变为单列布局 */
    .project-item {
        flex: 0 1 100%; /* 单列布局，不允许自动扩展 */
        max-width: 100%; /* 设置最大宽度 */
    }
}

/* 超小屏幕处理 */
@media (max-width: 600px) {
    /* 软件布局变为垂直排列 */
    .software-layout {
        flex-direction: column;
    }
    
    /* 侧边栏在垂直排列时恢复正常宽度 */
    .software-sidebar {
        width: 100%;
        max-width: 100%;
        min-width: auto;
        margin-bottom: 15px;
        box-sizing: border-box;
    }
    
    /* 右侧内容区域与分类栏宽度保持一致 */
    .software-content-area {
        min-width: auto;
        width: 100%;
        box-sizing: border-box;
    }
    
    /* 分类卡片容器与分类栏宽度保持一致 */
    .software-category-cards {
        width: 100%;
        box-sizing: border-box;
    }
    
    /* 确保卡片链接与分类栏宽度保持一致 */
    .software-card-link {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    /* 确保卡片与分类栏宽度保持一致 */
    .software-card,
    .software-category-cards .article-card.software-card {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    /* 确保卡片内容不会导致溢出 */
    .software-content {
        width: 100%;
        box-sizing: border-box;
    }
    
    /* 确保软件标题不会导致溢出 */
    .software-title {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    /* 确保软件描述超出宽度时显示省略号 */
    .software-description {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }
}

/* 页脚样式 */
.footer {
    background-color: #f8f8f8;
    border-top: 1px solid #eee;
    padding: 30px 0;
    margin-top: 50px;
    text-align: center;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-info {
    margin-bottom: 20px;
    color: #666;
}

.footer-info a {
    color: #333;
    text-decoration: none;
}

.footer-info p {
    margin: 5px 0;
    line-height: 1.5;
}

.footer-contact {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-contact a {
    color: #0084ff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-contact a:hover {
    color: #0066cc;
    text-decoration: underline;
}

/* 页脚响应式设计 */
@media (max-width: 768px) {
    .footer {
        padding: 20px 0;
    }
    
    .footer-contact {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .footer-info p {
        font-size: 0.9em;
    }
    
    .footer-contact a {
        font-size: 0.9em;
    }
}
