/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 主要内容区域样式 */
main {
    margin-top: 80px; /* 为固定的导航栏留出空间 */
}

/* CSS 变量定义 */
:root {
    --primary-color: #007bff;
    --primary-dark: #0056b3;
    --primary-light: #e3f2fd;
    --secondary-color: #6c757d;
    --secondary-dark: #545b62;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --text-color: #333;
    --text-secondary: #666;
    --border-color: #ddd;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.1);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --transition: all 0.3s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
        sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-color);
    font-size: 16px;
}

/* 自定义滚动条样式 */
body::-webkit-scrollbar {
    width: 0px;
    height: 0px;
}

body::-webkit-scrollbar-track {
    background: var(--light-color);
    border-radius: 4px;
}

body::-webkit-scrollbar-thumb {
    /* background: var(--border-color); */
    border-radius: 4px;
    transition: var(--transition);
}

body::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

body::-webkit-scrollbar-corner {
    background: var(--light-color);
}

/* 兼容Firefox的滚动条样式 */
html {
    scrollbar-width: none;
    scrollbar-color: var(--border-color) var(--light-color);
}

/* 导航栏样式 */
.navbar {
    background-color: #fff;
    box-shadow: var(--shadow-sm);
    padding: 1rem 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: var(--transition);
}

.navbar .navbar-brand-image{
    width: 150px;
    height: 60px;
}

.navbar-scrolled {
    background-color: #FFFFFF;
    backdrop-filter: blur(5px);
    padding: 0.75rem 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
}

.navbar-brand i {
    margin-right: 0.5rem;
}

.navbar-brand:hover {
    color: var(--primary-dark);
}

.navbar-nav {
    display: flex;
    list-style: none;
    align-items: center;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: flex-start;
}

.nav-item {
    margin-left: 1.5rem;
    position: relative;
}

.nav-item.active .nav-link {
    color: var(--primary-color);
    font-weight: 600;
}

.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
}

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1rem;
    transition: var(--transition);
    padding: 0.5rem 0;
}

.nav-link:hover {
    color: var(--primary-color);
}

.navbar-search {
    position: relative;
    margin-left: 2rem;
}

.search-input {
    padding: 0.5rem 2rem 0.5rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    transition: var(--transition);
}

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

.search-button {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.1rem;
    transition: var(--transition);
}

.search-button:hover {
    color: var(--primary-color);
}

/* 项目源码链接样式 */
.navbar-source-links {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.source-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #f8f9fa;
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.25rem;
    transition: var(--transition);
}

.source-link:hover {
    background-color: var(--primary-light);
    color: var(--primary-color);
    transform: translateY(-2px);
}

/* 响应式导航栏 */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-color);
    cursor: pointer;
    padding: 0.5rem;
}

.navbar-collapse {
    transition: var(--transition);
}

@media (max-width: 992px) {
    .navbar-nav {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: #fff;
        box-shadow: var(--shadow-md);
        padding: 1rem 0;
        z-index: 999;
    }

    .navbar-nav.show {
        display: flex;
        animation: slideDown 0.3s ease;
    }

    .nav-item {
        margin: 0.5rem 0 0.5rem 1.5rem;
    }

    .nav-item.active::after {
        display: none;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .navbar-search {
        display: none;
    }
    
    .navbar-source-links {
        display: none;
    }
}

/* 页脚样式 */
.footer {
    background-color: var(--dark-color);
    color: #fff;
    padding: 3rem 0 1.5rem;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.footer-column {
    flex: 1;
    min-width: 200px;
    margin-bottom: 2rem;
}

.footer-column h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: #fff;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
    display: inline-block;
}

.footer-column ul {
    list-style: none;
}

.footer-column li {
    margin-bottom: 0.75rem;
}

.footer-column a {
    color: #adb5bd;
    text-decoration: none;
    transition: var(--transition);
    display: flex;
    align-items: center;
}

.footer-column a i {
    margin-right: 0.5rem;
    font-size: 0.85rem;
}

.footer-column a:hover {
    color: #fff;
    transform: translateX(5px);
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid #495057;
    color: #adb5bd;
    font-size: 0.9rem;
}

.footer-social {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
    gap: 1rem;
}

.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    text-decoration: none;
    transition: var(--transition);
}

.footer-social a:hover {
    background-color: var(--primary-color);
    transform: translateY(-3px);
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    min-width: 100px;
    outline: none;
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.btn-primary {
    background-color: var(--primary-color);
    color: #fff;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    color: #fff;
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background-color: #6c757d;
    color: #fff;
}

.btn-secondary:hover {
    background-color: #545b62;
    color: #fff;
}

.btn-link {
    background: none;
    border: none;
    color: #007bff;
    padding: 0;
    font-size: 1rem;
}

.btn-link:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* 卡片样式 */
.card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.card-title {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: #333;
}

.card-text {
    color: #666;
    margin-bottom: 1rem;
}

/* 表单样式 */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #007bff;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

.pagination .page-item {
    margin: 0 0.25rem;
}

.pagination .page-link {
    display: block;
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #007bff;
    text-decoration: none;
    transition: all 0.3s ease;
}

.pagination .page-link:hover {
    background-color: #f8f9fa;
    border-color: #007bff;
}

.pagination .page-item.active .page-link {
    background-color: #007bff;
    color: #fff;
    border-color: #007bff;
}

/* 搜索模态框 */
.search-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.search-modal.show {
    opacity: 1;
    visibility: visible;
}

.search-modal-content {
    background-color: #fff;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    padding: 2rem;
    position: relative;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.search-modal.show .search-modal-content {
    transform: translateY(0);
}

.search-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #999;
    cursor: pointer;
    transition: color 0.3s ease;
}

.search-modal-close:hover {
    color: #333;
}

.search-modal-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.search-modal-results {
    max-height: 300px;
    overflow-y: auto;
}

.search-result-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid #eee;
}

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

.search-result-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
}

.search-result-url {
    font-size: 0.9rem;
    color: #007bff;
    margin-bottom: 0.25rem;
}

.search-result-snippet {
    font-size: 0.9rem;
    color: #666;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

.slide-in {
    animation: slideIn 0.5s ease forwards;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .container {
        max-width: 100%;
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

@media (max-width: 768px) {
    body {
        font-size: 15px;
    }
    
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .footer-content {
        flex-direction: column;
    }
    
    .footer-column {
        margin-bottom: 1.5rem;
        min-width: 100%;
    }
    
    .btn {
        min-width: auto;
        width: 100%;
        margin-bottom: 1rem;
    }
}

@media (max-width: 576px) {
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.25rem;
    }
    
    .navbar-brand {
        font-size: 1.25rem;
    }
}