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

body {
    font-family: 'Noto Sans SC', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 头部样式 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid #eaeaea;
    margin-bottom: 30px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo i {
    font-size: 2.5rem;
    color: #4a6fa5;
}

.logo h1 {
    font-size: 1.8rem;
    color: #2c3e50;
}

.nav {
    display: flex;
    gap: 25px;
}

.nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #555;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.3s;
}

.nav-link:hover {
    background-color: #f0f0f0;
    color: #4a6fa5;
}

.nav-link i {
    font-size: 1.1rem;
}

.dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-radius: 8px;
    padding: 10px 0;
    min-width: 180px;
    z-index: 100;
}

.nav-link:hover .dropdown {
    display: block;
}

.dropdown a {
    display: block;
    padding: 10px 20px;
    text-decoration: none;
    color: #555;
    transition: background 0.3s;
}

.dropdown a:hover {
    background-color: #f5f5f5;
    color: #4a6fa5;
}

/* 主要内容区域 */
.main-content {
    flex: 1;
    padding-bottom: 40px;
}

/* 英雄区域 */
.hero {
    background: linear-gradient(135deg, #4a6fa5 0%, #6c91bf 100%);
    color: white;
    border-radius: 12px;
    padding: 40px;
    margin-bottom: 40px;
    text-align: center;
}

.hero h2 {
    font-size: 2.2rem;
    margin-bottom: 15px;
}

.hero p {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 25px;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 30px;
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* 笔记部分 */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.section-header h3 {
    font-size: 1.5rem;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
}

.view-all {
    color: #4a6fa5;
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: gap 0.3s;
}

.view-all:hover {
    gap: 10px;
}

/* 笔记网格 */
.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 50px;
}

.note-card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

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

.note-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.note-category {
    background-color: #eef5ff;
    color: #4a6fa5;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.note-date {
    color: #777;
    font-size: 0.9rem;
}

.note-title {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: #2c3e50;
}

.note-description {
    color: #666;
    margin-bottom: 20px;
    flex: 1;
}

.note-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.read-more {
    color: #4a6fa5;
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: gap 0.3s;
}

.read-more:hover {
    gap: 10px;
}

.note-actions {
    display: flex;
    gap: 10px;
}

.icon-btn {
    background: none;
    border: none;
    color: #777;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 5px;
    transition: color 0.3s, background 0.3s;
}

.icon-btn:hover {
    color: #4a6fa5;
    background-color: #f0f0f0;
}

/* 分类部分 */
.categories-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
}

.category-card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s;
}

.category-card:hover {
    transform: translateY(-5px);
}

.category-card i {
    font-size: 2.5rem;
    color: #4a6fa5;
    margin-bottom: 15px;
}

.category-card h4 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: #2c3e50;
}

.category-card p {
    color: #666;
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.category-count {
    display: inline-block;
    background-color: #f8f9fa;
    color: #777;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
}

/* 笔记页面样式 */
.note-page {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #4a6fa5;
    text-decoration: none;
    margin-bottom: 25px;
    font-weight: 500;
}

.note-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.note-title {
    font-size: 2.2rem;
    color: #2c3e50;
    margin-bottom: 20px;
    line-height: 1.3;
}

.note-tags {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.tag {
    background-color: #f0f7ff;
    color: #4a6fa5;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
}

.note-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #444;
    margin-bottom: 40px;
}

.note-content h2, .note-content h3 {
    color: #2c3e50;
    margin-top: 30px;
    margin-bottom: 15px;
}

.note-content h2 {
    font-size: 1.8rem;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

.note-content h3 {
    font-size: 1.4rem;
}

.note-content p {
    margin-bottom: 20px;
}

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

.note-content li {
    margin-bottom: 8px;
}

.note-content pre {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 20px 0;
    border-left: 4px solid #4a6fa5;
}

.note-content code {
    font-family: 'Courier New', monospace;
    background-color: #f8f9fa;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.95rem;
}

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

.note-content th, .note-content td {
    border: 1px solid #ddd;
    padding: 12px 15px;
    text-align: left;
}

.note-content th {
    background-color: #f8f9fa;
    font-weight: 600;
}

.note-content tr:nth-child(even) {
    background-color: #f9f9f9;
}

.note-actions-panel {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
    padding-top: 30px;
    border-top: 1px solid #eee;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f0f7ff;
    color: #4a6fa5;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.action-btn:hover {
    background: #4a6fa5;
    color: white;
}

.note-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 25px;
    background: #f8f9fa;
    border-radius: 8px;
    text-decoration: none;
    color: #555;
    transition: all 0.3s;
}

.nav-btn:hover {
    background: #4a6fa5;
    color: white;
}

/* 页脚 */
.footer {
    text-align: center;
    padding: 30px 0;
    border-top: 1px solid #eaeaea;
    margin-top: 40px;
    color: #666;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
}

.footer-links a {
    color: #666;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: #4a6fa5;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    .notes-grid {
        grid-template-columns: 1fr;
    }

    .categories-list {
        grid-template-columns: 1fr;
    }

    .stats {
        flex-direction: column;
        gap: 20px;
    }

    .hero {
        padding: 30px 20px;
    }

    .note-page {
        padding: 25px;
    }

    .note-title {
        font-size: 1.8rem;
    }

    .note-actions-panel {
        flex-wrap: wrap;
    }


    /* 分类页面样式 */
.category-page {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}

.category-header {
    margin-bottom: 40px;
    text-align: center;
}

.category-title {
    font-size: 2.2rem;
    color: #2c3e50;
    margin-bottom: 10px;
}

.category-count {
    color: #666;
    font-size: 1.1rem;
}

.empty-category {
    text-align: center;
    padding: 60px 20px;
}

.empty-category i {
    font-size: 4rem;
    color: #ddd;
    margin-bottom: 20px;
}

.empty-category h3 {
    font-size: 1.8rem;
    color: #666;
    margin-bottom: 15px;
}

.empty-category p {
    color: #888;
    margin-bottom: 25px;
}

.btn-primary {
    display: inline-block;
    background: #4a6fa5;
    color: white;
    padding: 12px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.3s;
}

.btn-primary:hover {
    background: #3a5a8a;
}

/* 笔记ID显示 */
.note-id {
    background-color: #f0f0f0;
    color: #666;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* 首页导航按钮 */
.home-btn {
    background-color: #f8f9fa;
    color: #555;
}

.home-btn:hover {
    background-color: #4a6fa5;
    color: white;
}

/* 夜间模式相关 */
.dark-mode {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

.dark-mode .note-page,
.dark-mode .category-page {
    background-color: #2d2d2d;
    color: #e0e0e0;
}

.dark-mode .note-content h2,
.dark-mode .note-content h3,
.dark-mode .category-title {
    color: #e0e0e0;
}

.dark-mode .note-content p,
.dark-mode .note-content li,
.dark-mode .category-count {
    color: #b0b0b0;
}

.dark-mode pre {
    background-color: #1a1a1a;
    border-left: 4px solid #4a6fa5;
}

.dark-mode code {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

.dark-mode table {
    border-color: #444;
}

.dark-mode th {
    background-color: #333;
}

.dark-mode tr:nth-child(even) {
    background-color: #2a2a2a;
}


.code-wrapper {
        display: flex;
        background: #f8f9fa;
        border-radius: 8px;
        overflow: hidden;
        margin: 20px 0;
        border-left: 4px solid #4a6fa5;
    }

    .dark-mode .code-wrapper {
        background: #1a1a1a;
        border-left-color: #4a6fa5;
    }

    .line-numbers {
        padding: 15px 10px;
        background-color: #f1f1f1;
        color: #888;
        text-align: right;
        user-select: none;
        border-right: 1px solid #ddd;
        font-family: 'Courier New', monospace;
        font-size: 0.9em;
        line-height: 1.5;
        min-width: 40px;
        display: flex;
        flex-direction: column;
    }

    .dark-mode .line-numbers {
        background-color: #2a2a2a;
        color: #aaa;
        border-right-color: #444;
    }

    .line-number {
        height: 1.5em;
        line-height: 1.5;
    }

    .code-content {
        flex: 1;
        overflow-x: auto;
        padding: 15px;
    }

    .code-content code {
        font-family: 'Courier New', monospace;
        font-size: 0.95em;
        line-height: 1.5;
        white-space: pre;
        display: block;
        color: #333;
    }

    .dark-mode .code-content code {
        color: #e0e0e0;
    }

    /* 确保pre标签内的内容正确显示 */
    pre {
        background: #f8f9fa;
        padding: 15px;
        border-radius: 8px;
        overflow-x: auto;
        margin: 20px 0;
        border-left: 4px solid #4a6fa5;
    }

    pre code {
        font-family: 'Courier New', monospace;
        font-size: 0.95em;
        line-height: 1.5;
        color: #333;
        white-space: pre;
        display: block;
    }

    .dark-mode pre {
        background: #1a1a1a;
    }

    .dark-mode pre code {
        color: #e0e0e0;
    }


}
