/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    transition: background-color 0.3s ease;
}

:root {
    /* Light Mode Variables */
    --primary-color: #2563eb;           /* Indigo-600 */
    --primary-color-light: #dbeafe;     /* Indigo-100 */
    --primary-color-dark: #1e40af;      /* Indigo-800 */
    --secondary-color: #64748b;         /* Slate-500 */
    --link-color: #2563eb;
    --link-hover-color: #1e40af;
    --primary-link-color: #2563eb;
    
    --body-bg: #f9fafb;                 /* Slate-50 */
    --header-bg: #ffffff;
    --header-text: #1e40af;
    --nav-text: #1f2937;                /* Slate-800 */
    --nav-hover-bg: rgba(37, 99, 235, 0.08);
    --footer-bg: #f1f5f9;               /* Slate-100 */
    --footer-text: #475569;             /* Slate-600 */
    
    --card-bg: #ffffff;
    --card-bg-light: #f8fafc;           /* Slate-50 */
    --code-bg: #f1f5f9;
    --table-header-bg: #f1f5f9;
    
    --text-color: #111827;              /* Slate-900 */
    --muted-text: #475569;              /* Slate-600 */
    --light-text: #64748b;              /* Slate-500 */
    
    --border-color: #e2e8f0;            /* Slate-200 */
    --light-border: #e5e7eb;
    
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --hover-box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    
    --bg-color: #fff;
    --sidebar-border: #e6e6e6;
    --h1-border: #e6e6e6;
    --light-muted: #777;
    --pre-border: #e6e6e6;
    --table-border: #ddd;
    --mobile-menu-bg: #fff;
    --mobile-menu-text: #333;
    --card-bg-light: #f9f9f9;
}

body {
    font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    padding-top: 60px; /* 为固定导航栏留出空间 */
}

a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    text-decoration: none;
    color: var(--link-hover-color);
}

/* Layout */
.container {
    display: flex;
    max-width: 1140px;
    margin: 0 auto;
    background-color: var(--bg-color);
    min-height: calc(100vh - 120px);
    align-items: flex-start;
    border-radius: 0 0 5px 5px;
    /* overflow: hidden; */ /* Removed to allow container to grow with content */
}

/* Header - 蓝色背景设计 */
header {
    background: #2563eb !important; /* 纯蓝色背景 */
    color: #ffffff;
    padding: 0;
    border-bottom: none !important;
    box-shadow: none !important;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    width: 100%;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px; /* 固定高度 */
}

.logo {
    display: flex;
    align-items: center;
    margin-right: 20px;
    margin-left: 0;
}

.logo .logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: opacity 0.2s;
    color: #ffffff;
}

.logo .logo-link:hover {
    opacity: 0.85;
    color: #ffffff;
}

.logo .site-logo-img {
    height: 32px;
    width: auto;
    margin-right: 12px;
    display: block;
}

.logo h1 {
    font-size: 1.4rem;
    margin: 0;
    font-weight: 700;
    white-space: nowrap;
    color: #ffffff;
}

/* 顶部导航样式 - OSCHINA Style */
.top-nav {
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: center;
    height: 60px;
}

.top-nav ul {
    display: flex;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 0;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.top-nav li {
    margin: 0;
    white-space: nowrap;
    flex-shrink: 0;
    height: 100%;
    display: inline-block !important;
    align-items: center;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.top-nav a {
    color: #ffffff !important;
    text-decoration: none !important;
    padding: 0 15px !important;
    font-weight: 400 !important;
    transition: none !important;
    display: inline !important;
    align-items: center;
    height: auto !important;
    font-size: 14px !important;
    border: none !important;
    border-bottom: none !important;
    text-shadow: none !important;
    letter-spacing: normal !important;
    background: transparent !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    margin: 0 !important;
    line-height: 60px !important;
}

.top-nav a:hover,
.top-nav a:focus,
.top-nav a:active {
    color: #ffffff !important;
    text-decoration: none !important;
    border: none !important;
    border-bottom: none !important;
    background: transparent !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    transform: none !important;
    outline: none !important;
}

.top-nav a i {
    margin-right: 6px;
    font-size: 13px;
}

/* 强制移除所有按钮样式 */
.top-nav li,
.top-nav li *,
.top-nav a,
.top-nav a * {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    outline: none !important;
    text-shadow: none !important;
}

.top-nav li:hover,
.top-nav li:focus,
.top-nav li:active,
.top-nav a:hover,
.top-nav a:focus,
.top-nav a:active {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    outline: none !important;
    text-shadow: none !important;
}

/* 导航栏右侧区域 - OSCHINA Style */
.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
    margin-right: 0;
}

/* 导航栏搜索框样式 - OSCHINA Style */
.navbar-search {
    margin-left: 0;
    min-width: 250px;
}

.navbar-search-form {
    display: flex;
    align-items: center;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    overflow: hidden;
    background-color: rgba(255,255,255,0.1);
    transition: all 0.3s ease;
    height: 36px;
}

.navbar-search-form:focus-within { /* Style when the form or its elements have focus */
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 120, 215, 0.15);
}

.navbar-search-form .form-control {
    height: 34px;
    padding: 0 12px;
    font-size: 14px;
    border: none;
    background: transparent;
    color: #ffffff;
    transition: none;
    flex-grow: 1;
    min-width: 150px;
    box-shadow: none;
}

.navbar-search-form .form-control::placeholder {
    color: rgba(255,255,255,0.6);
}

.navbar-search-form .form-control:focus {
    box-shadow: none;
    color: #ffffff;
}

.navbar-search-form .btn-search {
    border: none;
    background-color: transparent;
    color: rgba(255,255,255,0.8);
    border-radius: 0;
    padding: 0 12px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.navbar-search-form .btn-search:hover {
    color: #ffffff;
    background-color: rgba(255,255,255,0.1);
}

/* 深色模式下的导航栏搜索框 */

/* 移动设备导航栏适配 */
@media (max-width: 991px) {
    .header-content {
        padding: 0.8rem;
    }
    
    .top-nav {
        position: fixed;
        top: 0;
        left: -280px;
        height: 100%;
        width: 280px;
        background: linear-gradient(180deg, #1a252f 0%, #2c3e50 50%, #34495e 100%);
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem;
        transition: left 0.3s ease;
        z-index: 1030;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
        overflow-y: auto;
        border-right: 2px solid #3498db;
    }
    
    .top-nav.active {
        left: 0;
    }
    
    .top-nav ul {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        margin-top: 1rem;
    }
    
    .top-nav li {
        width: 100%;
    }
    
    .top-nav a {
        padding: 0.8rem 1rem;
        color: #f8f9fa;
        font-weight: 700;
        font-size: 16px;
        text-shadow: 0 2px 4px rgba(0,0,0,0.8);
        letter-spacing: 0.5px;
        border-left: 3px solid transparent;
        transition: all 0.3s ease;
    }
    
    .top-nav a:hover {
        /* 简化移动端悬停效果，只保留左侧边框 */
        border-left-color: #74b9ff;
    }
    
    .navbar-search {
        margin: 1rem 0 0;
        width: 100%;
    }
    
    .navbar-search-form .form-control {
        width: 100%;
    }
    
    .navbar-search-form .form-control:focus {
        width: 100%;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
}

/* Sidebar */
.sidebar {
    width: 140px; /* 极小宽度 */
    padding: 10px 5px; /* 极小内边距 */
    background-color: #ffffff !important;
    border-right: 1px solid var(--border-color);
    box-shadow: none;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    scrollbar-width: none; /* Firefox 隐藏滚动条 */
    -ms-overflow-style: none; /* IE 和 Edge 隐藏滚动条 */
}

/* 完全隐藏侧边栏滚动条 */
.sidebar::-webkit-scrollbar {
    width: 0;
    background: transparent; 
    display: none;
}

.sidebar::-webkit-scrollbar-track,
.sidebar::-webkit-scrollbar-thumb {
    display: none;
}

.side-nav ul {
    list-style: none;
    margin-bottom: 15px;
}

.side-nav li {
    margin-bottom: 1px; /* 最小项目间距 */
    line-height: 1.4; /* 缩小行高 */
}

.side-nav h3 {
    color: var(--header-color);
    font-size: 0.95rem; /* 更小标题 */
    font-weight: 600;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--light-border);
}

.side-nav a {
    display: block;
    padding: 4px 5px; /* 极小内边距 */
    color: var(--link-color); /* Ensure links are blue */
    font-size: 0.85rem; /* 更小字体 */
    text-decoration: none; /* Explicitly remove underline */
}

.side-nav a:hover {
    color: var(--link-hover-color); /* Keep hover color consistent */
    text-decoration: none;
}

.side-nav .active a {
    color: var(--link-color); /* Keep active link blue */
    font-weight: bold;
}

.side-nav li ul {
    margin-left: 15px;
    margin-top: 5px;
    margin-bottom: 5px;
}

.side-nav li ul li {
    margin-bottom: 5px;
}

/* Content area */
.content {
    flex: 1;
    padding: 20px 12px 20px 8px; /* 更小内边距 */
    min-width: 0;
}

.content h1 {
    font-size: 26px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--h1-border);
    color: var(--text-color);
}

.content h2 {
    font-size: 22px;
    margin: 25px 0 15px;
    color: var(--text-color);
}

.content h3 {
    font-size: 18px;
    margin: 20px 0 10px;
    color: var(--text-color);
}

.content p {
    margin-bottom: 15px;
    line-height: 1.8;
}

.content ul, .content ol {
    margin-left: 20px;
    margin-bottom: 15px;
}

.content li {
    margin-bottom: 5px;
    line-height: 1.8;
}

.content pre {
    background-color: var(--code-bg);
    padding: 15px;
    border-radius: 4px;
    overflow-x: auto;
    margin: 15px 0;
    border: 1px solid var(--pre-border);
}

.content code {
    font-family: Consolas, Monaco, 'Andale Mono', monospace;
    background-color: var(--code-bg);
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 0.9em;
}

/* Article navigation */
.article-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--h1-border);
    font-size: 14px;
}

/* Footer */
footer {
    background-color: #ffffff;
    color: #333333;
    padding: 1rem;
    text-align: center;
    border-top: 1px solid #e5e5e5;
}

.footer-content {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-content p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: #333333;
}

.footer-link {
    color: #333333;
    text-decoration: none;
    margin: 0 10px;
    /* 移除悬停效果 */
    display: inline-block;
}

.footer-link:hover {
    /* 移除悬停时的颜色变化和动画 */
    color: #333333;
    text-decoration: none;
}

.beian-link {
    color: #333333;
    text-decoration: none;
    margin: 0 10px;
    /* 移除悬停效果 */
}

.beian-link:hover {
    /* 移除悬停时的颜色变化和动画 */
    color: #333333;
    text-decoration: none;
}
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s;
    font-size: 13px;
}

/* 移动端页脚响应式样式 */
@media (max-width: 768px) {
    footer {
        padding: 0.8rem;
    }
    
    .footer-content p {
        font-size: 12px;
    }
    
    .footer-link,
    .beian-link {
        margin: 0 8px;
    }
}

@media (max-width: 480px) {
    .footer-content p {
        font-size: 11px;
        line-height: 1.8;
    }
    
    .footer-link,
    .beian-link {
        margin: 0 5px;
        display: inline-block;
    }
}

/* 移除重复的备案链接悬停效果 */

/* Category cards on home page */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.category-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.category-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.category-card h2 {
    font-size: 20px;
    margin-top: 0;
    margin-bottom: 10px;
}

.category-link {
    display: inline-block;
    margin-top: 15px;
    font-weight: bold;
    font-size: 14px;
}

/* Features section */
.feature-section {
    margin: 40px 0;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.feature {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 15px;
}

.feature h3 {
    color: var(--link-color);
    margin-bottom: 10px;
    font-size: 16px;
}

/* Get started section */
.get-started {
    background-color: var(--card-bg);
    border-radius: 4px;
    padding: 25px;
    margin: 30px 0;
    text-align: center;
    border: 1px solid var(--border-color);
}

.start-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    background-color: var(--link-color);
    color: #fff;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.2s;
    font-size: 14px;
}

.btn:hover {
    background-color: var(--link-hover-color);
    text-decoration: none;
    color: #fff;
}

/* Breadcrumb navigation */
.breadcrumb {
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--light-muted);
}

.breadcrumb a {
    color: var(--link-color);
}

/* Table of contents */
.toc {
    background-color: var(--card-bg);
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
}

.toc li {
    margin-bottom: 8px;
}

.toc a {
    color: var(--text-color);
}

.toc .description {
    font-size: 13px;
    color: var(--muted-text);
    margin: 5px 0 10px 20px;
}

/* Article styles */
.article-content {
    line-height: 1.8;
}

.article-content p {
    margin-bottom: 1em;
}

.article-content h2 {
    margin-top: 1.5em;
}

.article-content h3 {
    margin-top: 1.2em;
}

.article-content ul, .article-content ol {
    margin-left: 1.5em;
    margin-bottom: 1em;
}

.article-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 20px auto;
    border: 1px solid var(--border-color);
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.article-content th, .article-content td {
    border: 1px solid var(--table-border);
    padding: 8px 12px;
    text-align: left;
}

.article-content th {
    background-color: var(--table-header-bg);
}

/* About page */
.about-section {
    max-width: 800px;
}

.category-info {
    margin: 20px 0;
    padding: 15px;
    background-color: var(--card-bg);
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

/* Mobile menu toggle for responsive design */
.mobile-menu-toggle {
    display: none;
    background-color: var(--mobile-menu-bg);
    color: var(--mobile-menu-text);
    padding: 10px;
    text-align: center;
    cursor: pointer;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 5;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
        border-radius: 0;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .sidebar {
        width: 100%;
        border-right: none;
        box-shadow: 0 2px 5px -2px rgba(0, 0, 0, 0.1);
        border-bottom: none;
        display: none;
        padding: 15px;
        position: static;
        height: auto;
        max-height: 70vh;
    }
    
    
    
    .sidebar.visible {
        display: block;
    }
    
    .content {
        margin-left: 0;
    }
    
    .top-nav ul {
        flex-wrap: wrap;
    }
}

/* Additional category page styles */
.author-info {
    margin-bottom: 15px;
    color: var(--muted-text);
    font-size: 14px;
}

.category-intro {
    margin-bottom: 30px;
    line-height: 1.8;
}

.content-outline {
    margin: 30px 0;
}

/* Expand/collapse for sidebar */
.side-nav li.expanded > ul {
    display: block;
}

.side-nav li > ul {
    display: none;
}

/* Article meta */
.article-meta {
    color: var(--light-muted);
    font-size: 14px;
    margin-bottom: 25px;
}

/* Comments section */
.comments-section {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--h1-border);
}

.comments-section h3 {
    margin-bottom: 15px;
}

.no-comments {
    color: var(--light-muted);
    font-style: italic;
    margin-bottom: 15px;
}

.add-comment {
    font-size: 14px;
}

/* Subcategory styles */
.subcategory-intro {
    margin-bottom: 30px;
}

.article-list {
    list-style-type: none;
    margin-left: 0;
}

.article-list li {
    margin-bottom: 20px;
    border-bottom: 1px solid var(--light-border);
    padding-bottom: 15px;
}

.article-list li:last-child {
    border-bottom: none;
}

.article-description {
    color: var(--muted-text);
    font-size: 13px;
    margin-top: 5px;
    margin-bottom: 0;
}

.back-link {
    display: inline-block;
    margin-top: 20px;
    color: var(--link-color);
    font-size: 14px;
}

/* 修改夜间模式下导航栏链接的悬停效果 */

/* 确保导航栏中的按钮也具有一致的样式 */

/* 修改夜间模式下侧边栏的字体颜色 */

/* 确保夜间模式下卡片和内容区域有更好的区分度 */

/* 代码块在暗色背景上的样式优化 */

/* 首页样式 */
.homepage-hero {
    text-align: center;
    padding: 3rem 1.5rem; /* Increased padding */
    margin-bottom: 2.5rem;
    /* New Gradient */
    background-color: #e0f7fa; /* Fallback */
    background-image: 
        /* Subtle dot pattern */
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3E%3Ccircle cx='4' cy='4' r='1' fill='rgba(0,0,0,0.05)'/%3E%3C/svg%3E"),
        /* Main gradient */
        linear-gradient(120deg, #e0f7fa 0%, #b2ebf2 50%, #80deea 100%);
    border-radius: 16px; /* Slightly more rounded */
    position: relative; 
    overflow: hidden; 
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05); /* Subtle inner top shadow */
}

.homepage-hero h1 {
    font-size: 2.8rem; /* Slightly larger */
    font-weight: 700;
    margin-bottom: 0.5rem; /* Reduced margin */
    /* Keep gradient from previous step */
    background: linear-gradient(45deg, #0078d7, #64b5f6);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.homepage-hero .subtitle {
    font-size: 1.15rem; /* Slightly larger */
    color: var(--muted-text);
    max-width: 600px;
    margin: 0 auto 1.5rem auto; /* Added bottom margin */
}

/* Container for the search within the hero */
.hero-search-container {
    max-width: 650px; /* Maintain max width */
    margin-left: auto;
    margin-right: auto;
    /* Removed top/bottom margin from my-4 as hero padding handles it */
}

/* New Search Bar Styles (within hero) */
.homepage-hero .homepage-hero-search-form {
    display: flex;
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 30px; /* Fully rounded ends */
    overflow: hidden; /* Important for rounded corners on children */
    background-color: var(--card-bg-light); /* Use a light card background */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05); /* Subtle shadow */
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.homepage-hero .homepage-hero-search-form:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 3px 8px rgba(0, 120, 215, 0.1);
}

.homepage-hero .homepage-hero-search-form .form-control {
    flex-grow: 1;
    border: none; 
    background: transparent; 
    padding: 0.75rem 1.5rem; 
    font-size: 1rem; 
    box-shadow: none; 
    border-radius: 30px 0 0 30px; 
    color: var(--text-color);
}

.homepage-hero .homepage-hero-search-form .form-control:focus {
    box-shadow: none; 
}

.homepage-hero .homepage-hero-search-form .btn-search {
    border: none; 
    background-color: var(--primary-color); 
    color: white;
    padding: 0.75rem 1.5rem; 
    border-radius: 0 30px 30px 0; 
    cursor: pointer;
    transition: background-color 0.2s ease;
    flex-shrink: 0; 
    display: flex;
    align-items: center;
    gap: 0.5rem; 
}

.homepage-hero .homepage-hero-search-form .btn-search:hover {
    background-color: var(--link-hover-color); 
    color: white;
}

.homepage-hero .homepage-hero-search-form .btn-search i {
   line-height: 1; 
}

/* Dark Mode Styles for Hero and Search within Hero */

.homepage-sections {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 30px;
}

.homepage-section {
    flex: 1;
    min-width: 250px;
}

.section-title {
    font-size: 20px;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--light-border);
    color: var(--primary-color);
    font-weight: 500;
}

/* 廖雪峰风格的简洁教程展示 */
.tutorials-showcase {
    margin: 20px 0;
}

.tutorial-intro {
    margin-bottom: 15px;
}

.tutorial-intro p {
    font-size: 14px;
    line-height: 1.5;
    color: var(--muted-text);
}

/* 三栏固定教程布局 */
.tutorials-fixed-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.tutorial-fixed-card {
    background-color: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.tutorial-card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

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

.tutorial-fixed-image {
    height: 180px;
    overflow: hidden;
}

.tutorial-fixed-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.tutorial-fixed-card:hover .tutorial-fixed-image img {
    transform: scale(1.05);
}

.tutorial-fixed-content {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.tutorial-fixed-content h3 {
    font-size: 18px;
    margin-top: 0;
    margin-bottom: 10px;
    color: var(--text-color);
    line-height: 1.4;
    font-weight: 600;
}

.tutorial-fixed-description {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-top: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.tutorial-card-link:hover {
    text-decoration: none;
}

/* 响应式调整 */
@media screen and (max-width: 768px) {
    .tutorials-fixed-grid {
        grid-template-columns: 1fr;
    }
    
    .tutorial-fixed-image {
        height: 180px;
    }
    
    .homepage-hero h1 {
        font-size: 24px;
    }
    
    .homepage-hero .subtitle {
        font-size: 14px;
        max-width: 100%;
    }
    
    .tutorial-intro p {
        font-size: 13px;
    }
}

/* 平板电脑布局调整 */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    .tutorials-fixed-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 最新教程和博客文章列表 */
.latest-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.latest-list-item {
    padding: 8px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px dashed var(--light-border);
}

.latest-list-item:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.latest-list-item a {
    font-size: 14px;
    color: var(--link-color);
    text-decoration: none;
    flex: 1;
    margin-right: 10px;
}

.latest-list-item a:hover {
    color: var(--link-hover-color);
}

.latest-list-item .date {
    font-size: 12px;
    color: var(--muted-text);
    white-space: nowrap;
}

@media (max-width: 768px) {
    .latest-list-item {
        padding: 10px 0;
    }
    
    .latest-list-item a {
        font-size: 13px;
    }
    
    .latest-list-item .date {
        font-size: 11px;
    }
}

/* 搜索页样式 */
.search-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.search-form {
    display: flex;
    margin-bottom: 30px;
    gap: 10px;
}

.search-form input[type="text"] {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.search-form button {
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.search-form button:hover {
    background-color: var(--secondary-color);
}

.search-section {
    margin-bottom: 40px;
}

.search-section h3 {
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.search-results {
    list-style: none;
    padding: 0;
}

.search-results li {
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid #eee;
}

.search-results li:last-child {
    border-bottom: none;
}

.search-results h4 {
    margin-bottom: 10px;
    font-size: 18px;
}

.search-results .excerpt {
    color: #555;
    margin-bottom: 10px;
    line-height: 1.5;
}

.search-results .meta {
    font-size: 14px;
    color: #888;
}

.no-results {
    padding: 30px;
    background-color: #f9f9f9;
    border-radius: 4px;
    text-align: center;
    color: #555;
}

.search-intro {
    padding: 30px;
    background-color: #f5f5f5;
    border-radius: 4px;
    text-align: center;
    color: #555;
}

/* 搜索图标样式 */
.search-icon {
    display: inline-flex;
    align-items: center;
    background-color: rgba(0, 120, 215, 0.1);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    transition: background-color 0.3s;
}

.search-icon:hover {
    background-color: rgba(0, 120, 215, 0.2);
}

.search-icon span {
    display: flex;
    align-items: center;
    font-size: 14px;
}

.search-icon i {
    margin-right: 5px;
}

/* 教程展示样式 - 更加紧凑整齐 */
.tutorials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.tutorial-card {
    border: 1px solid #eaeaea;
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.25s ease;
    background-color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.tutorial-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
}

.tutorial-image {
    height: 160px;
    overflow: hidden;
}

.tutorial-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.tutorial-card:hover .tutorial-image img {
    transform: scale(1.03);
}

.tutorial-content {
    padding: 15px;
}

.tutorial-content h3 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--primary-color);
}

.tutorial-content h3 a {
    color: inherit;
    text-decoration: none;
}

.tutorial-description {
    color: #666;
    margin-bottom: 12px;
    font-size: 13px;
    line-height: 1.5;
}

.tutorial-link {
    display: inline-block;
    color: var(--primary-color);
    font-weight: 500;
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s;
}

.tutorial-link:hover {
    color: var(--secondary-color);
}

/* 确保夜间模式的教程页面样式正常 */

/* 个人资料卡片 - 全新简约设计 */
.profile-card {
    background-color: #fff;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.profile-avatar {
    text-align: center;
    margin-bottom: 12px;
}

.profile-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #f1f1f1;
}

.profile-info h3 {
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: #333;
}

.profile-motto {
    text-align: center;
    font-style: italic;
    font-size: 13px;
    color: #666;
    margin: 0 0 12px 0;
    line-height: 1.4;
}

/* 重新设计个人简介样式 */
.profile-intro {
    font-size: 14px;
    color: #444;
    line-height: 1.6;
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 6px;
    margin: 12px 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    position: relative;
    border-left: 3px solid #0078d7;
}

.profile-intro::before {
    content: "关于我";
    position: absolute;
    top: -10px;
    left: 10px;
    font-size: 12px;
    background-color: white;
    padding: 0 8px;
    color: #0078d7;
    font-weight: 500;
}

.profile-links {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 15px;
}

/* 确保社交图标正确显示 */
.profile-links .profile-icon {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background-color: #f5f5f5;
    color: #333 !important;
    text-decoration: none;
    transition: transform 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

.profile-links .profile-icon:hover {
    transform: scale(1.1);
}

.profile-icon .icon {
    font-style: normal;
    font-weight: bold;
    font-size: 14px;
}

.profile-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 移除冲突样式 */
.sidebar-profile,
.profile-avatar-top,
.profile-name-area,
.profile-social,
.github-icon,
.csdn-icon,
.zhihu-icon,
.weibo-icon,
.site-icon {
    display: none !important;
}

@media (max-width: 767px) {
    .sidebar-profile {
        max-width: none;
        margin: 0 0 20px 0;
    }
}

/* AI工具Logo样式优化 */
.ai-tool-logo {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    background-color: #f8f8f8;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
}

.ai-tool-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.ai-tool-header-logo {
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 25px;
    background-color: #f8f8f8;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.ai-tool-header-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Dark mode footer styles */

/* 侧边栏额外组件样式 */
.sidebar-section {
    margin-bottom: 25px;
    background-color: var(--card-bg-light);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 8px 12px; /* Reduced padding from 12px 15px */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
    transition: transform 0.2s, box-shadow 0.2s;
}

.sidebar-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.06);
}

.sidebar-title {
    font-size: 15px;
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
    display: flex;
    align-items: center;
}

.sidebar-icon {
    margin-right: 6px;
    font-size: 16px;
}

/* 侧边栏额外组件样式 - 覆盖小贴士容器 */
.sidebar-section:has(.daily-tip-widget) { /* Target the widget class */
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin-bottom: 15px;
}

/* 移除小贴士 Widget card-body 的内边距 */
.sidebar-widget.daily-tip-widget .card-body {
    padding: 0 !important; /* Remove default card body padding */
}

/* 每日小贴士样式 - 优化显示效果 */
.daily-tip {
    background-color: #f9f9f9;
    border-radius: 6px;
    padding: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.tip-title {
    font-size: 14px;
    color: #333;
    margin-bottom: 6px;
    line-height: 1.3;
}

.tip-content {
    position: relative;
    font-size: 13px;
    line-height: 1.5;
    text-align: left;
}

.tip-text {
    color: #555;
    font-size: 13px;
    line-height: 1.4;
}

.tip-content code {
    background-color: #f0f7ff;
    color: #0078d7;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: Consolas, monospace;
    font-size: 12px;
    border: 1px solid rgba(0, 120, 215, 0.2);
}

.tip-source {
   display: none;
}

/* 小贴士 Widget 的主标题样式 */
.sidebar-widget.daily-tip-widget .card-header {
    background-color: #fff;
    border-bottom: 1px solid #eaeaea;
    padding: 8px 10px;
    text-align: center;
}

.sidebar-widget.daily-tip-widget .card-header .widget-title {
    font-size: 14px;
    color: #333;
    font-weight: 600;
}

.sidebar-widget.daily-tip-widget .card-header i.fas.fa-lightbulb {
    color: #f7d44c;
    font-size: 14px;
}

.sidebar-widget.daily-tip-widget .card-body {
    padding: 8px !important;
}

/* Hide the icon specifically in the daily tip widget header */
.sidebar-widget.daily-tip-widget .card-header > i.fas.fa-lightbulb {
    display: none !important;
}

/* 暗黑模式覆盖 */

/* 技术资源链接样式 */
.resource-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.resource-list li {
    margin-bottom: 8px;
    position: relative;
    padding-left: 12px;
    font-size: 13px;
}

.resource-list li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--link-color);
}

.resource-list li:last-child {
    margin-bottom: 0;
}

.resource-list a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.2s;
}

.resource-list a:hover {
    color: var(--link-hover-color);
    text-decoration: underline;
}

/* 网站公告样式 */
.updates-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.updates-list li {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--light-border);
}

.updates-list li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.update-date {
    font-size: 11px;
    color: var(--muted-text);
    display: block;
    margin-bottom: 3px;
}

.update-content {
    font-size: 13px;
    line-height: 1.5;
}

/* 暗黑模式样式 */

/* 网站公告样式 */
.announcements-widget .card-header.bg-primary {
    background-color: var(--primary-color) !important;
}

.announcement-item {
    position: relative;
    transition: all 0.3s ease;
}

.announcement-item:hover {
    background-color: var(--card-bg-light);
}

.announcement-title {
    color: var(--text-color);
    font-weight: 600;
}

.announcement-body {
    color: var(--muted-text);
}

.announcement-expand-btn {
    color: var(--primary-color);
    text-decoration: none;
    padding: 0;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.announcement-expand-btn:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

.announcement-full-content {
    padding: 0.5rem;
    background-color: rgba(0, 0, 0, 0.03);
    border-radius: 0.25rem;
}

/* 新公告高亮样式 */
.announcement-item--new {
    border-left: 3px solid var(--primary-color);
    animation: pulseHighlight 2s infinite alternate;
}

@keyframes pulseHighlight {
    0% {
        border-left-color: var(--primary-color);
    }
    100% {
        border-left-color: transparent;
    }
}

@keyframes pulseHighlightDark {
    0% {
        border-left-color: #4299e1;
    }
    100% {
        border-left-color: transparent;
    }
}

/* 公告展开动画 */
.collapse {
    transition: height 0.35s ease;
}

.collapse:not(.show) {
    display: none;
}

.collapsing {
    height: 0;
    overflow: hidden;
    transition: height 0.35s ease;
}

/* 新标签样式 */
.announcement-badge .badge.bg-danger {
    animation: pulse 1.5s infinite;
}

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

/* 修改公告查看全部按钮样式 */
.announcements-widget .btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
    transition: all 0.3s ease;
}

.announcements-widget .btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* 教程页面全局样式 - 白天模式 */

/* 全局白天模式样式增强 - 提高对比度 */

/* 高优先级强制规则 - 确保夜间模式下所有内容使用纯白色文本 */
html

html

/* 针对Python页面的特殊规则 */
html

/* 确保Python页面的介绍文本永远是纯白色 */
html

/* 确保目录中的描述文本具有足够高的优先级 */
html

/* 确保基础元素在夜间模式下正确显示 */
html

html

/* 标题样式 */
html

/* 链接样式 */
html

html

/* 修复卡片、面板和容器 */
html

/* 增强Python页面的可读性 */
html

html

/* 修复特定元素 */
html

/* 正确的内联样式覆盖 - 只在夜间模式下 */
html

/* 修复夜间模式下底部学习提示框的背景色 */
html

html

/* 优化夜间模式下底部提示框中的按钮 */
html

html

/* 通用规则 - 处理所有白色背景的元素 */
html

html

/* 直接针对get-started类的最高优先级规则 */
body

body

body

body

/* 强制白色背景元素在深色模式下使用深色背景 */

/* 强制使用最高级别选择器确保所有白底黑字元素反转 */

/* 网站域名样式 */
.site-domain {
    font-size: 14px;
    font-weight: normal;
    margin-left: 8px;
    opacity: 0.8;
    vertical-align: middle;
}

.site-domain a {
    color: var(--header-text);
    text-decoration: none;
    opacity: 0.85;
    transition: opacity 0.2s;
}

.site-domain a:hover {
    opacity: 1;
    text-decoration: none;
}

/* 确保夜间模式下网站域名样式正确 */

/* 确保所有导航链接悬停时没有下划线 */
.side-nav a:hover,
.breadcrumb a:hover,
.toc a:hover,
.article-nav a:hover,
.content a:hover,
.footer-content a:hover,
.article-list li a:hover {
    text-decoration: none;
}

/* 确保夜间模式下导航链接悬停时没有下划线 */

/* 全局链接悬停效果 - 移除下划线 */
a:hover, 
a:hover:not(.btn),
html a:hover,
body a:hover {
    text-decoration: none !important;
}

/* 确保高优先级规则中的链接悬停不显示下划线 */
html

/* 白天模式下的链接悬停样式 */

/* 更新引用块和提示样式 */

/* 确保Python页面内容在淡蓝色背景下清晰 */
html

/* 夜间模式全局文本显示增强 */
html

/* 确保夜间模式下的所有文本元素可读性 */
html

/* 夜间模式下的侧边栏阴影 */

/* 公安备案图标样式 */
.beian-icon {
    display: inline-block;
    width: 14px;
    height: 14px;
    background-image: url("https://www.beian.gov.cn/img/new/gongan.png");
    background-repeat: no-repeat;
    background-size: contain;
    margin-right: 5px;
    position: relative;
    top: 2px;
}

/* 夜间模式下的备案图标 */

/* 百度搜索框样式 - 官方版本 */
.baidu-search-widget {
    margin-top: 20px;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.baidu-search-widget h3 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 1.1em;
    color: #333;
    font-weight: 600;
}

.baidu-search-box {
    display: flex;
    flex-direction: column;
}

.search-input-wrapper {
    display: flex;
    width: 100%;
}

.baidu-search-form {
    width: 100%;
    margin-bottom: 8px;
}

.baidu-search-input {
    padding: 8px 12px;
    border: 1px solid #4e6ef2;
    border-right: none;
    border-radius: 4px 0 0 4px;
    flex-grow: 1;
    font-size: 0.9em;
    outline: none;
    min-width: 0;
}

.baidu-search-input:focus {
    border-color: #4e6ef2;
    box-shadow: 0 0 0 1px rgba(78,110,242,0.2);
}

.baidu-search-button {
    padding: 8px 15px;
    background-color: #4e6ef2;
    color: white;
    border: 1px solid #4e6ef2;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.baidu-search-button:hover {
    background-color: #4662D9;
}

.baidu-branding {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-top: 8px;
    font-size: 0.75em;
    color: #666;
}

.baidu-branding img {
    margin: 0 4px;
    position: relative;
    top: -1px;
}

/* 全局百度搜索栏样式 */
.global-search-bar {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4edf9 100%);
    padding: 12px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    text-align: center;
    border-bottom: 1px solid #d1e1ff;
}

.global-search-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 0 10px;
}

.global-search-input-wrapper {
    display: flex;
    align-items: center;
    width: 100%;
    background-color: #fff;
    border-radius: 30px;
    padding: 4px 6px 4px 12px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
    border: 2px solid #4e6ef2;
    transition: all 0.3s ease;
}

.global-search-input-wrapper:hover, 
.global-search-input-wrapper:focus-within {
    box-shadow: 0 4px 12px rgba(78, 110, 242, 0.2);
    border-color: #4e6ef2;
    transform: translateY(-1px);
}

.search-logo {
    margin-right: 6px;
    display: flex;
    align-items: center;
}

.global-baidu-search-input {
    flex: 1;
    border: none;
    padding: 8px 10px;
    font-size: 16px;
    outline: none;
    background: transparent;
    color: #333;
}

.global-baidu-search-button {
    background-color: #4e6ef2;
    color: white;
    border: none;
    border-radius: 24px;
    padding: 8px 16px;
    font-size: 15px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 5px;
}

.global-baidu-search-button:hover {
    background-color: #4662D9;
}

/* 深色模式样式 */

/* 移动端响应式设计 */
@media (max-width: 768px) {
    .global-search-input-wrapper {
        flex-direction: row;
        border-radius: 24px;
        padding: 5px 7px;
    }
    
    .search-logo {
        margin-right: 5px;
    }
    
    .search-logo img {
        height: 24px;
    }
    
    .global-baidu-search-input {
        padding: 8px 5px;
    }
    
    .global-baidu-search-button {
        padding: 6px 12px;
        font-size: 14px;
    }
}

/* 搜索引擎选择器样式 - 竖向排列 */
.search-engines-container {
    margin-top: 12px;
}

.search-engines-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(4, auto);
    gap: 12px;
    max-width: 100%;
}

.search-engine-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    font-size: 12px;
    transition: all 0.2s ease;
    border: 1px solid #e6e6e6;
    padding: 10px 4px;
    text-align: center;
}

.search-engine-box img {
    width: 24px;
    height: 24px;
    margin-bottom: 6px;
    transition: transform 0.2s;
}

.search-engine-box span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    font-size: 13px;
}

.search-engine-box:hover {
    background-color: #e9f2ff;
    border-color: #4e6ef2;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.search-engine-box:hover img {
    transform: scale(1.1);
}

/* 深色模式下的搜索引擎选择器 */

/* 移动端响应式适配 */
@media (max-width: 768px) {
    .search-engines-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(4, auto);
        gap: 10px;
    }
    
    .search-engine-box {
        padding: 8px 3px;
    }
    
    .search-engine-box img {
        width: 20px;
        height: 20px;
    }
    
    .search-engine-box span {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .search-engines-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
}

/* 侧边栏搜索框样式 */
.sidebar .baidu-search-form {
    margin-bottom: 12px;
}

.sidebar .search-input-wrapper {
    display: flex;
    width: 100%;
    border: 1px solid #4e6ef2;
    border-radius: 4px;
    overflow: hidden;
}

.sidebar .baidu-search-input {
    flex: 1;
    padding: 8px 10px;
    border: none;
    font-size: 14px;
    outline: none;
    background: transparent;
    color: #333;
}

.sidebar .baidu-search-button {
    padding: 8px 12px;
    background-color: #4e6ef2;
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

.sidebar .baidu-search-button:hover {
    background-color: #4662D9;
}

/* 侧边栏搜索引擎样式 */
.sidebar-search-engines {
    margin-top: 5px;
}

.sidebar-search-engines-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-left: 0; /* 移除默认内边距 */
    margin-left: 0; /* 移除默认外边距 */
}

.sidebar-search-engine-item {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    background-color: #f8f9fa;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    font-size: 13px;
    transition: all 0.2s ease;
    border: 1px solid #e6e6e6;
    text-align: left; /* 文本左对齐 */
    justify-content: flex-start; /* 内容左对齐 */
    width: 100%; /* 占满可用宽度 */
    position: relative; /* 添加相对定位 */
}

.sidebar-search-engine-item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background-color: #4e6ef2;
    transform: scaleY(0);
    transition: transform 0.2s ease;
    border-radius: 2px 0 0 2px;
}

.sidebar-search-engine-item img {
    width: 16px;
    height: 16px;
    margin-right: 8px;
}

.sidebar-search-engine-item:hover {
    background-color: #e9f2ff;
    border-color: #4e6ef2;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.sidebar-search-engine-item:hover::before {
    transform: scaleY(1);
}

/* 深色模式适配 */

/* 三列布局样式 */
.three-column-container {
    display: flex;
    flex-wrap: wrap;
    margin: 0 auto;
    gap: 0px; /* 完全移除间距 */
    max-width: 1400px; /* 调整最大宽度，增加左右空白 */
    padding: 0 20px; /* 添加左右内边距，确保在小屏幕上也有空白 */
}

.container {
    flex: 1;
    display: flex;
    max-width: calc(100% - 160px); /* 调整为新的侧边栏宽度，留出更多空间 */
    margin: 0 auto; /* 居中显示 */
}

/* 右侧功能区域样式 */
.right-features-area {
    width: 140px; /* 与侧边栏同宽 */
    margin-left: 5px; /* 最小间距 */
}

/* 功能边栏样式 - 原左侧边栏移至右侧 */
.features-sidebar {
    width: 100%;
}

.features-sidebar-content {
    position: sticky;
    top: 20px;
}

.left-sidebar-widget {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 16px;
    transition: box-shadow 0.2s ease;
}

.left-sidebar-widget:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* 适应深色模式 */

/* 响应式调整 */
@media (max-width: 1200px) {
    .three-column-container {
        flex-direction: column;
    }
    
    .container {
        flex: 1;
        max-width: 100%;
        margin-bottom: 30px;
    }
    
    .right-features-area {
        width: 100%;
        margin-left: 0;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
    }
    
    .features-sidebar {
        width: calc(100% - 170px);
        order: 1;
    }
    
    .right-sidebar {
        width: 150px;
        position: static;
        order: 2;
    }
}

@media (max-width: 768px) {
    .three-column-container {
        padding: 0 10px;
    }
    
    .right-features-area {
        flex-direction: column;
    }
    
    .features-sidebar,
    .right-sidebar {
        width: 100%;
        margin: 0 0 20px 0;
    }
}

/* 教程页面全宽显示样式 */
.full-width {
    max-width: 100% !important;
}

.wide-content {
    max-width: none; /* 移除最大宽度限制 */
    width: 100%;
    padding-left: 5px; /* 最小左侧内边距 */
    padding-right: 10px;
}

/* 教程侧边栏样式 */
.tutorial-sidebar {
    width: 140px; /* 与sidebar保持一致 */
    padding: 10px 5px; /* 极小内边距 */
    background-color: #ffffff !important;
    border-right: 1px solid var(--border-color);
    position: sticky;
    top: 100px;
    height: calc(100vh - 100px);
    overflow-y: auto;
    scrollbar-width: thin;
    z-index: 10;
}

.tutorial-toc {
    padding: 0 20px;
}

.toc-title {
    font-size: 18px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e0e0e0;
    color: #333;
    font-weight: 600;
}

.toc-content {
    margin-bottom: 20px;
}

/* 教程目录导航列表样式 */
.tutorial-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tutorial-nav-list li {
    margin-bottom: 2px;
}

.tutorial-nav-list a {
    display: block;
    padding: 8px 10px;
    color: #444;
    text-decoration: none;
    border-radius: 4px;
    font-size: 15px;
    transition: all 0.2s ease;
    border-left: 2px solid transparent;
    margin-left: -2px;
}

.tutorial-nav-list a:hover {
    background-color: #eef5ff;
    color: #0078d7;
}

.tutorial-nav-list a.active {
    background-color: #e1f0ff;
    color: #0078d7;
    font-weight: 500;
}

/* 子菜单样式 */
.tutorial-nav-list ul {
    list-style: none;
    margin: 0;
    padding-left: 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.tutorial-nav-list li.expanded > ul {
    max-height: 1000px;
}

.tutorial-nav-list ul li {
    margin-bottom: 1px;
}

.tutorial-nav-list ul a {
    padding: 6px 10px;
    font-size: 14px;
}

/* 展开/折叠指示器 */
.tutorial-nav-list li.has-children > a {
    position: relative;
}

.tutorial-nav-list li.has-children > a:after {
    content: '\25BC';
    font-size: 10px;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.2s ease;
}

.tutorial-nav-list li.has-children.expanded > a:after {
    transform: translateY(-50%) rotate(180deg);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .tutorial-sidebar {
        width: 100%;
        height: auto;
        max-height: 300px;
        padding: 15px;
        position: static;
        border-right: none;
        border-bottom: 1px solid #eaeaea;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    }
    
    
    
    .tutorial-toc {
        padding: 0;
    }
    
    .toc-title {
        font-size: 16px;
        margin-bottom: 12px;
        padding-bottom: 8px;
    }
    
    .tutorial-nav-list a {
        padding: 6px 8px;
        font-size: 14px;
    }
    
    .tutorial-nav-list ul a {
        padding: 5px 8px;
        font-size: 13px;
    }
}

/* 教程内容区域样式 */
.tutorial-content {
    max-width: 860px;
    margin: 0 auto;
    padding: 20px 30px;
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* Right Sidebar - Simple List Styling (Matching Left Sidebar) */
.right-sidebar .widget-content.simple-list ul {
    list-style: none;
    padding: 0;
    margin: 0; /* Reset margin */
}

.right-sidebar .widget-content.simple-list li {
    margin-bottom: 8px; /* Match left sidebar li margin */
    line-height: 1.5; /* Match left sidebar li line-height */
}

.right-sidebar .widget-content.simple-list a {
    display: block;
    padding: 3px 0; /* Match left sidebar a padding */
    color: var(--link-color);
    font-size: 14px; /* Match left sidebar a font-size */
    text-decoration: none;
    transition: color 0.3s ease;
}

.right-sidebar .widget-content.simple-list a:hover {
    color: var(--link-hover-color);
    text-decoration: none;
}

.right-sidebar .widget-content.simple-list a i {
    margin-right: 5px; /* Space between icon and text */
    width: 1em; /* Ensure consistent icon width */
    text-align: center;
}

/* Daily Term Summary Specific Styling */
.right-sidebar .daily-term-summary {
    font-size: 14px; /* Match general list font size */
    padding: 10px 15px; /* Add some padding */
    line-height: 1.6;
}

.right-sidebar .daily-term-summary strong {
    color: var(--text-color);
    font-weight: 600;
}

.right-sidebar .daily-term-summary p {
    margin: 5px 0;
    color: var(--muted-text);
}

.right-sidebar .daily-term-summary a {
    display: inline; /* Allow link to flow with text */
    padding: 0;
    font-size: 13px; /* Slightly smaller for 'details' link */
}

/* --- Styling for Sidebar Item List Pages --- */

/* General container and header */
.knowledge-list-page .page-title {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    border-bottom: 2px solid var(--light-border);
    padding-bottom: 0.5rem;
}

.knowledge-list-page .page-description {
    color: var(--muted-text);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

/* Env Config List Specific Styles */
.env-config-list .list-group-item {
    background-color: var(--card-bg-light);
    border-color: var(--light-border);
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.env-config-list .list-group-item:hover {
    background-color: var(--bg-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.env-config-list .list-group-item h5 {
    color: var(--primary-color);
}

.env-config-list .code-block {
    max-height: 300px; /* Allow slightly more height */
    font-size: 1.1em; /* 添加字体大小设置 */
}

/* Tech Book List Specific Styles */
.tech-book-list .book-card {
    background-color: var(--card-bg-light);
    border-color: var(--light-border);
}

.tech-book-list .book-card .card-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.tech-book-list .book-card .card-subtitle {
    font-size: 0.9rem;
}

.tech-book-list .book-card .btn {
    font-size: 0.85rem;
}

/* Programming Term & Bug Fix List Accordion Styles */
.terms-list .accordion-item, 
.bug-fix-list .accordion-item {
    background-color: var(--card-bg-light);
    border: 1px solid var(--light-border);
    margin-bottom: 0.5rem;
    border-radius: 0.375rem; /* Bootstrap default */
}

.terms-list .accordion-button, 
.bug-fix-list .accordion-button {
    font-weight: 500;
}

.terms-list .accordion-body, 
.bug-fix-list .accordion-body {
    background-color: var(--bg-color);
}

.terms-list .term-example, 
.bug-fix-list .error-section, 
.bug-fix-list .solution-section {
    margin-top: 1rem;
}

.bug-fix-list .error-section pre code {
    font-size: 1.1em; /* 从0.9em增大到1.1em */
}

.bug-fix-list .solution-section pre code {
    font-size: 1.1em; /* 从0.9em增大到1.1em */
}

/* Pagination styling */
.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.pagination .page-link {
    color: var(--primary-color);
}

.pagination .page-item.disabled .page-link {
    color: #6c757d; 
}

/* Dark mode adjustments */

/* Adjustments for copy button in dark mode if needed */

/* --- Dark Mode Specific Styles --- */

/* Hide light logo in dark mode */

/* Show dark logo in dark mode */

/* Redesigned Announcement Block Styles */
.announcement-block {
    padding: 0; /* Reset padding */
    margin: 0; /* Reset margin */
    border-left: none; /* Ensure no border */
}

.announcement-header {
    /* Styles for the container of title and date if needed */
}

.announcement-title-text {
    font-weight: 600; /* Make title slightly bolder */
    color: var(--text-color);
}

.announcement-date {
    /* Styles for date if needed */
}

.announcement-content-text {
    font-size: 14px; /* Adjust content font size */
    line-height: 1.6;
    color: var(--muted-text);
    padding-left: 0 !important; /* Crucial: Remove left padding */
    border-left: none !important; /* Crucial: Ensure no left border */
}

/* Dark Mode for Redesigned Announcements */

/* Override dark mode background for specific sidebar elements */

/* Homepage Search Bar Styling - Enhanced */
.homepage-search-bar {
    max-width: 650px; /* Slightly narrower */
    margin-left: auto;
    margin-right: auto;
    /* my-4 class provides top/bottom margin */
}

.homepage-search-bar form {
    display: flex;
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 30px; /* Fully rounded ends */
    overflow: hidden; /* Important for rounded corners on children */
    background-color: var(--card-bg-light); /* Use a light card background */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05); /* Subtle shadow */
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.homepage-search-bar form:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 3px 8px rgba(0, 120, 215, 0.1);
}

.homepage-search-bar .form-control {
    flex-grow: 1;
    border: none; /* Remove default border */
    background: transparent; /* Inherit background */
    padding: 0.75rem 1.5rem; /* Adjust padding */
    font-size: 1rem; /* Adjust font size */
    box-shadow: none; /* Remove default focus shadow */
    border-radius: 30px 0 0 30px; /* Rounded left side */
    color: var(--text-color);
}

.homepage-search-bar .form-control:focus {
    box-shadow: none; /* Ensure no shadow on focus */
    /* Focus state handled by form:focus-within */
}

.homepage-search-bar .btn {
    border: none; /* Remove default border */
    background-color: var(--primary-color); /* Use primary color */
    color: white;
    padding: 0.75rem 1.5rem; /* Match input padding */
    border-radius: 0 30px 30px 0; /* Rounded right side */
    cursor: pointer;
    transition: background-color 0.2s ease;
    flex-shrink: 0; /* Prevent button from shrinking */
    display: flex;
    align-items: center;
    gap: 0.5rem; /* Space between icon and text */
}

.homepage-search-bar .btn:hover {
    background-color: var(--link-hover-color); /* Darker on hover */
    color: white;
}

.homepage-search-bar .btn i {
   line-height: 1; /* Align icon better */
}

/* Dark Mode Search Bar */

/* Basic Mega Menu Styling */
.mega-menu {
    width: 380px; /* 增加宽度以适应更好的布局 */
    padding: 1.25rem !important; 
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    margin-top: 8px;
    backdrop-filter: blur(10px);
}

/* 下拉菜单项样式优化 */
.mega-menu .dropdown-item {
    white-space: normal;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-color);
    margin-bottom: 4px;
    border: 1px solid transparent;
}

/* 图标样式优化 */
.mega-menu .dropdown-item i {
    font-size: 1.1rem;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    border-radius: 4px;
    background: linear-gradient(135deg, var(--primary-color-light), rgba(37, 99, 235, 0.1));
    color: var(--primary-color);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

/* 悬停效果优化 */
.mega-menu .dropdown-item:hover {
    background: linear-gradient(135deg, var(--primary-color-light), rgba(37, 99, 235, 0.08));
    border-color: var(--primary-color-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
    color: var(--primary-color-dark);
}

.mega-menu .dropdown-item:hover i {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-color-dark));
    color: white;
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

/* 特定编程语言图标颜色 */
.mega-menu .dropdown-item:hover .fa-python {
    background: linear-gradient(135deg, #3776ab, #ffd43b);
}

.mega-menu .dropdown-item:hover .fa-java {
    background: linear-gradient(135deg, #f89820, #ed8b00);
}

.mega-menu .dropdown-item:hover .fa-html5 {
    background: linear-gradient(135deg, #e34f26, #f06529);
}

.mega-menu .dropdown-item:hover .fa-js {
    background: linear-gradient(135deg, #f7df1e, #f0db4f);
    color: #323330;
}

.mega-menu .dropdown-item:hover .fa-css3-alt {
    background: linear-gradient(135deg, #1572b6, #33a9dc);
}

.mega-menu .dropdown-item:hover .fa-git-alt {
    background: linear-gradient(135deg, #f05032, #f14e32);
}

.mega-menu .dropdown-item:hover .fa-database {
    background: linear-gradient(135deg, #4479a1, #00758f);
}

.mega-menu .dropdown-item:hover .fa-php {
    background: linear-gradient(135deg, #777bb4, #8892bf);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .mega-menu {
        width: 100%;
        margin: 0;
        border-radius: 0;
        box-shadow: none;
        border: none;
        border-top: 1px solid var(--border-color);
    }
    
    .mega-menu .dropdown-item {
        padding: 0.6rem 0.8rem;
        font-size: 0.9rem;
    }
    
    .mega-menu .dropdown-item i {
        width: 20px;
        height: 20px;
        font-size: 1rem;
        margin-right: 10px;
    }
}

/* Dark mode adjustments for mega menu */

/* --- Homepage Carousel Styles --- */
#homePageCarousel .carousel-inner {
    border-radius: 8px; /* Add rounded corners */
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); /* Add subtle shadow */
}

#homePageCarousel .carousel-item .carousel-image {
    object-fit: cover; /* Ensure image covers the area */
    max-height: 500px; /* 增加高度 */
    width: 100%;
}

#homePageCarousel .carousel-caption {
    background-color: transparent; /* Make background fully transparent */
    border-radius: 6px;
    padding: 1rem 1.5rem; 
    bottom: 1.5rem; 
}

/* 浮在轮播上方的内容 */
.hero-overlay-content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    z-index: 10;
    background: rgba(0, 0, 0, 0.3); /* 半透明背景 */
    text-align: center;
}

.hero-overlay-content h1 {
    font-size: 3rem;
    font-weight: 700;
    color: white;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-overlay-content .subtitle {
    font-size: 1.8rem;
    color: rgba(255, 255, 255, 1);
    max-width: 800px;
    margin: 2rem auto;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    font-weight: 600;
    line-height: 1.4;
}

/* 搜索框样式优化 */
.hero-overlay-content .hero-search-container {
    width: 100%;
    max-width: 650px;
    margin: 0 auto;
}

.hero-overlay-content .homepage-hero-search-form {
    background-color: white;
    border-radius: 50px;
    padding: 0.6rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
    border: none;
    display: flex;
    align-items: center;
}

.hero-overlay-content .homepage-hero-search-form .form-control {
    border: none;
    padding: 0.9rem 1.5rem;
    font-size: 1.15rem;
    border-radius: 50px;
    background: transparent;
    flex-grow: 1;
    box-shadow: none;
    }

.hero-overlay-content .homepage-hero-search-form .form-control:focus {
    outline: none;
    box-shadow: none;
    }

.hero-overlay-content .homepage-hero-search-form .btn {
    padding: 1rem 1.8rem;
    border-radius: 50px;
    font-size: 1.15rem;
    font-weight: 500;
    background: linear-gradient(to right, #4a6cf7, #7966ff);
    border: none;
    box-shadow: 0 4px 15px rgba(122, 102, 255, 0.3);
    margin-left: 8px;
    transition: all 0.3s ease;
}

.hero-overlay-content .homepage-hero-search-form .btn:hover {
    background: linear-gradient(to right, #3a5ce5, #6855ee);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(122, 102, 255, 0.4);
}

/* 快捷搜索标签 */
.quick-search-tags {
    margin-top: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    width: 100%;
}

.quick-search-tags .tag {
    background-color: rgba(255, 255, 255, 0.25);
    color: white;
    padding: 0.6rem 1.5rem;
    border-radius: 50px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    text-decoration: none;
    font-weight: 500;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    text-align: center;
}

.quick-search-tags .tag:hover {
    background-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* 移动设备响应式调整 */
@media (max-width: 768px) {
    .hero-overlay-content h1 {
        font-size: 2rem;
    }
    
    .hero-overlay-content .subtitle {
        font-size: 1.4rem;
        margin: 1.5rem auto;
}
    
    .hero-overlay-content .homepage-hero-search-form .form-control {
        font-size: 0.9rem;
        padding: 0.6rem 1rem;
}

    .hero-overlay-content .homepage-hero-search-form .btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
    
    .quick-search-tags .tag {
        padding: 0.5rem 1.2rem;
        font-size: 1rem;
}

    #homePageCarousel .carousel-item .carousel-image {
        max-height: 400px;
    }
}

/* 小尺寸移动设备 */
@media (max-width: 480px) {
    .hero-overlay-content {
        padding: 1.5rem;
    }
    
    .hero-overlay-content h1 {
        font-size: 1.5rem;
    }
    
    .hero-overlay-content .subtitle {
        font-size: 1.2rem;
        margin: 1rem auto;
    }
    
    .quick-search-tags {
        gap: 0.8rem;
    }
    
    .quick-search-tags .tag {
        padding: 0.4rem 1rem;
        font-size: 0.9rem;
}

    #homePageCarousel .carousel-item .carousel-image {
        max-height: 350px;
    }
}

/* 暗黑模式调整 */

/* 移动设备响应式调整 */
@media (max-width: 768px) {
    .hero-overlay-content .homepage-hero-search-form .form-control {
        font-size: 1rem;
        padding: 0.8rem 1.2rem;
    }
    
    .hero-overlay-content .homepage-hero-search-form .btn {
        padding: 0.8rem 1.2rem;
        font-size: 1rem;
}

    #homePageCarousel .carousel-item .carousel-image {
        max-height: 400px;
    }
}

/* 小尺寸移动设备 */
@media (max-width: 480px) {
    .hero-overlay-content {
        padding: 1.5rem;
}

    .hero-overlay-content .homepage-hero-search-form {
        padding: 0.4rem;
    }
    
    .hero-overlay-content .homepage-hero-search-form .form-control {
        font-size: 0.9rem;
        padding: 0.7rem 1rem;
    }
    
    .hero-overlay-content .homepage-hero-search-form .btn {
        padding: 0.7rem 1rem;
        font-size: 0.9rem;
}

    #homePageCarousel .carousel-item .carousel-image {
        max-height: 350px;
    }
}

    #homePageCarousel .carousel-caption h5 {
    font-weight: 600; 
    margin-bottom: 0.5rem;
    color: #ffffff !important; /* Force white text */
    }

    #homePageCarousel .carousel-caption p {
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    color: #ffffff !important; /* Force white text */
}

/* --- 优化目录导航栏 --- */
.content-outline, 
.toc,
.table-of-contents,
.tutorial-toc {
    border-left: 2px solid var(--primary-color-light);
    padding: 0.5rem 0 0.5rem 1rem;
    margin: 1.5rem 0;
    font-size: 0.95rem;
    background-color: rgba(247, 250, 252, 0.7);
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* 目录标题样式 */
.toc-title,
.content-outline-title {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

/* 目录列表样式 */
.toc ul,
.content-outline ul.toc,
.table-of-contents ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc li,
.content-outline ul.toc li,
.table-of-contents li {
        margin-bottom: 0.5rem;
    padding-left: 0;
    position: relative;
    }

/* 一级目录样式 */
.toc a,
.content-outline ul.toc li a,
.table-of-contents a {
    color: var(--text-color);
    text-decoration: none;
    display: block;
    padding: 0.35rem 0.75rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    border-left: 2px solid transparent;
    margin-left: -2px;
}

.toc a:hover,
.content-outline ul.toc li a:hover,
.table-of-contents a:hover {
    color: var(--primary-color);
    background-color: rgba(0, 120, 215, 0.08);
    border-left-color: var(--primary-color);
}

/* 二级目录样式 */
.toc ul ul,
.content-outline ul.toc li ul,
.table-of-contents ul ul {
    margin-top: 0.5rem;
    margin-left: 1rem;
}

.toc ul ul li,
.content-outline ul.toc li ul li,
.table-of-contents ul ul li {
    margin-bottom: 0.35rem;
}

.toc ul ul a,
.content-outline ul.toc li ul li a,
.table-of-contents ul ul a {
    font-size: 0.9rem;
    padding: 0.25rem 0.6rem;
    color: var(--muted-text);
}

/* 当前位置指示 */
.toc .active > a,
.content-outline ul.toc li.active > a,
.table-of-contents .active > a {
    color: var(--primary-color);
    font-weight: 500;
    background-color: rgba(0, 120, 215, 0.08);
    border-left-color: var(--primary-color);
}

/* 暗黑模式 */

/* 为教程页面在旁边固定目录 */
.tutorial-page .tutorial-toc {
    position: sticky;
    top: 2rem;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
    padding-right: 1rem;
    /* Hide scrollbar for Chrome, Safari and Opera */
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.tutorial-page .tutorial-toc::-webkit-scrollbar {
    width: 4px;
}

.tutorial-page .tutorial-toc::-webkit-scrollbar-track {
    background: transparent;
}

.tutorial-page .tutorial-toc::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 4px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .tutorial-page .tutorial-toc {
        position: static;
        max-height: none;
        padding: 0.75rem;
    }
}

/* 修改教程左侧导航为纯白色背景 */
.tutorial-sidebar,
.side-nav,
.sidebar {
    background-color: #ffffff !important; /* 纯白色背景 */
    border-right: 1px solid var(--border-color);
}

/* 暗色模式下的左侧导航栏 */

/* 继续优化侧边栏导航项 */
.side-nav a {
    padding: 5px 6px; /* 更小的内边距 */
    font-size: 0.9rem; /* 更小的字体 */
}

/* 优化侧边栏标题 */
.side-nav h3 {
    color: var(--header-color);
    font-size: 0.95rem; /* 更小标题 */
    font-weight: 600;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--light-border);
}

/* 技术资讯滑动区域 */
.tech-news-section {
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.tech-news-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background-color: #f8f9fa;
    border-bottom: 1px solid var(--border-color);
}

.tech-news-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tech-news-title i {
    color: var(--primary-color);
}

.tech-news-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tech-news-toggle {
    background: none;
    border: none;
    color: var(--muted-text);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
}

.tech-news-toggle:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--primary-color);
}

.tech-news-toggle i {
    transition: transform 0.3s ease;
}

.tech-news-toggle.expanded i {
    transform: rotate(180deg);
}

/* 调整技术资讯容器高度以显示10条 */
.tech-news-container {
    max-height: 500px; /* 增加默认高度从300px到500px */
    overflow-y: auto;
    transition: max-height 0.3s ease;
    padding: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.tech-news-container.expanded {
    max-height: 800px; /* 增加展开高度从600px到800px */
}

.tech-news-container::-webkit-scrollbar {
    width: 6px;
}

.tech-news-container::-webkit-scrollbar-track {
    background: transparent;
}

.tech-news-container::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 3px;
}

.tech-news-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tech-news-item {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}

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

.tech-news-item:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.tech-news-link {
    display: flex;
    justify-content: space-between;
    text-decoration: none;
    color: var(--text-color);
}

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

.tech-news-content {
    flex: 1;
}

.tech-news-name {
    font-weight: 500;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tech-news-desc {
    font-size: 0.85rem;
    color: var(--muted-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tech-news-date {
    font-size: 0.8rem;
    color: var(--muted-text);
    white-space: nowrap;
    margin-left: 15px;
}

.tech-news-empty {
    padding: 20px;
    text-align: center;
    color: var(--muted-text);
}

/* 暗色模式适配 */

/* 响应式调整 */
@media (max-width: 768px) {
    .tech-news-container {
        max-height: 400px;
    }
    
    .tech-news-container.expanded {
        max-height: 500px;
    }
    
    .tech-news-date {
        display: none;
}
}

/* 左侧边栏技术书籍轮播组件样式 */
.sidebar .book-cover-container {
    height: 120px;
    margin: 0 auto 10px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.sidebar .book-cover-img {
    max-height: 120px;
    max-width: 90%;
    object-fit: contain;
    box-shadow: 0 3px 6px rgba(0,0,0,0.16);
    border-radius: 4px;
}

.sidebar .book-title-compact {
    font-size: 0.85rem;
    line-height: 1.3;
    margin: 0 auto 8px;
    max-width: 90%;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    color: #333;
    height: 2.6em;
}

.sidebar .book-view-details {
    font-size: 0.75rem;
    color: #3b82f6;
    text-decoration: none;
    display: inline-block;
}

.sidebar .book-view-details:hover {
    text-decoration: underline;
}

.sidebar .book-no-cover {
    width: 80px;
    height: 110px;
    background-color: #f7f9fc;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 4px;
    margin: 0 auto;
    color: #ccc;
    font-size: 24px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.sidebar .book-slide {
    text-align: center;
    padding: 0 15px;
    margin-bottom: 5px;
}

/* 轮播控制样式 */
.sidebar .carousel-control-prev,
.sidebar .carousel-control-next {
    width: 24px;
    background-color: rgba(0,0,0,0.1);
    border-radius: 50%;
    height: 24px;
    top: 50%;
    transform: translateY(-50%);
    margin: 0 5px;
    opacity: 0.7;
}

.sidebar .carousel-control-prev-icon,
.sidebar .carousel-control-next-icon {
    width: 14px;
    height: 14px;
}

/* 调整轮播容器内边距 */
.sidebar .tech-books-section .card-body {
    padding: 0.75rem 0.5rem !important;
}

/* 移除书籍卡片的悬停效果 */
.sidebar .book-slide:hover {
    background-color: transparent !important;
    transform: none !important;
    box-shadow: none !important;
}

.sidebar .book-cover-img:hover {
    transform: none !important;
    box-shadow: 0 3px 6px rgba(0,0,0,0.16) !important;
}

.sidebar .book-title-compact:hover {
    color: #333 !important;
}

/* 修复导航栏按钮样式问题 */
.top-nav a:focus {
  outline: none !important;
  box-shadow: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  animation: none !important;
  border: none !important;
  background-color: transparent !important;
}

.top-nav a,
.top-nav a:active,
.top-nav a:focus-visible,
button:focus,
button:focus-visible,
button::-moz-focus-inner,
:focus {
  outline: 0 !important;
  box-shadow: none !important;
  animation: none !important;
}

.top-nav a {
  transition: color 0.2s !important;
  border-radius: 0 !important;
}

.top-nav a:hover {
  background-color: transparent !important;
  text-decoration: none;
  color: var(--primary-color);
}

/* 移除导航项周围的边框和背景 */
.top-nav li {
  border: none !important;
  background: none !important;
}

.top-nav li a {
  border: none !important;
  background-color: transparent !important;
}

/* 覆盖可能的Bootstrap焦点样式 */
.btn:focus, 
.btn.focus, 
a:focus, 
button:focus {
  outline: 0 !important;
  box-shadow: none !important;
}
