:root {
    --primary-color: #1a1a1a;
    --secondary-color: #2563eb;
    --accent-color: #f97316;
    --text-color: #333;
    --text-secondary: #666;
    --text-muted: #999;
    --border-color: #e5e5e5;
    --bg-white: #ffffff;
    --bg-light: #fafafa;
    --bg-gray: #f5f5f5;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --transition: all 0.2s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "微软雅黑", "黑体", "Consolas";
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--bg-light);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.app-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-container {
    display: flex;
    flex: 1;
    max-width: 1560px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    align-items: flex-start;
}

.logo-image {
    width: 40px;
    height: 40px;
    margin-right: 8px;
    border-radius: 15%;
}

.sidebar-left {
    width: 220px;
    flex-shrink: 0;
    padding: 24px 16px 24px 0;
    position: relative;
}

.sidebar-right {
    min-width: 260px;
    max-width: 320px;
    flex-shrink: 0;
    padding: 24px 0 24px 16px;
    position: sticky;
    top: 64px;
}

.sidebar-right:empty {
    display: none;
}

.sidebar-inner {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.sidebar-section {
    margin-bottom: 24px;
}

.sidebar-section:last-child {
    margin-bottom: 0;
}

.sidebar-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 6px;
}

.author-card {
    text-align: center;
    padding: 16px 8px;
}

.author-avatar {
    width: 80px;
    height: 80px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary-color), #3b82f6);
    display: flex;
    align-items: center;
    justify-content: center;
}

.author-avatar i {
    font-size: 40px;
    color: white;
}

.author-info h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.author-info p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li {
    margin-bottom: 4px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-size: 14px;
}

.sidebar-menu a:hover {
    background-color: var(--bg-gray);
    color: var(--secondary-color);
}

.sidebar-menu a i {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.friend-links {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.8;
}

.friend-links a {
    color: var(--secondary-color);
    text-decoration: none;
}

.friend-links a:hover {
    text-decoration: underline;
}

.main-content {
    flex: 1;
    padding: 24px 12px 12px 12px;
    min-width: 0;
}

.app-header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1560px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    height: 64px;
    gap: 32px;
}

.header-left {
    flex-shrink: 0;
}

.blog-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--primary-color);
    font-size: 20px;
    font-weight: 700;
}

.blog-logo i {
    font-size: 24px;
    color: var(--secondary-color);
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
}

.nav-item:hover {
    background-color: var(--bg-gray);
    color: var(--primary-color);
}

.nav-item.active {
    background-color: rgba(37, 99, 235, 0.1);
    color: var(--secondary-color);
}

.nav-item i {
    font-size: 16px;
}

.nav-item .dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
    background: none;
    border: none;
    padding: 8px 14px;
}

.nav-item .dropdown-toggle:hover {
    background-color: var(--bg-gray);
    color: var(--primary-color);
}

.nav-item .dropdown-toggle::after {
    display: none;
}

.nav-item .dropdown-toggle i:last-child {
    font-size: 10px;
    margin-left: 2px;
    opacity: 0.6;
}

.header-right {
    flex-shrink: 0;
}

.search-form {
    position: relative;
    display: flex;
    align-items: center;
}

.search-form i {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    font-size: 14px;
    pointer-events: none;
}

.search-form input {
    width: 260px;
    padding: 8px 12px 8px 36px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 14px;
    background: var(--bg-gray);
    transition: var(--transition);
}

.search-form input:focus {
    outline: none;
    border-color: var(--secondary-color);
    background: var(--bg-white);
    width: 300px;
}

.search-form input::placeholder {
    color: var(--text-muted);
}

.content-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    margin-bottom: 20px;
}

.page-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.page-header h1 {
    font-size: 24px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.page-header .subtitle {
    color: var(--text-secondary);
    font-size: 14px;
}

.note-item {
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.note-item h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.note-item h3 a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.note-item h3 a:hover {
    color: var(--secondary-color);
}

.note-meta {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.note-meta a {
    color: var(--secondary-color);
    text-decoration: none;
}

.note-meta a:hover {
    text-decoration: underline;
}

.note-excerpt {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.7;
    margin: 0;
}

.note-detail {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 32px;
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
}

.note-detail header {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.note-detail h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.4;
    margin-bottom: 16px;
}

.note-detail .note-meta {
    font-size: 14px;
}

.note-content {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-color);
}

.note-content h2 {
    font-size: 22px;
    font-weight: 600;
    color: var(--primary-color);
    margin: 32px 0 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.note-content h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-color);
    margin: 24px 0 12px;
}

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

.note-content a {
    color: var(--secondary-color);
    text-decoration: none;
}

.note-content a:hover {
    text-decoration: underline;
}

.note-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    margin: 16px 0;
}

.note-content code {
    font-size: 0.9em;
    font-family: "NutonMono", "Maple Mono", "JetBrains Mono", "Consolas", "Liberation Mono", "Menlo", monospace;
    background-color: #f6f8fa;
}

/* .note-content pre {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 16px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    font-size: 14px;
    line-height: 1.5;
    margin: 16px 0;
}

.note-content code {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.9em;
}

.note-content p code {
    background: var(--bg-gray);
    color: #c7254e;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
}

.note-content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
} */

.note-content blockquote {
    border-left: 4px solid var(--secondary-color);
    background: var(--bg-gray);
    padding: 12px 16px;
    margin: 16px 0;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-secondary);
}

.note-content ul,
.note-content ol {
    padding-left: 24px;
    margin-bottom: 16px;
}

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

.note-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 14px;
}

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

.note-content table th {
    background: var(--bg-gray);
    font-weight: 600;
}

.note-content table tr:hover {
    background: var(--bg-gray);
}

.badge {
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
}

.badge.bg-secondary {
    background: var(--bg-gray) !important;
    color: var(--text-secondary);
}

.badge.bg-secondary:hover {
    background: #e5e5e5 !important;
}

.btn {
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 14px;
    transition: var(--transition);
}

.btn-primary {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-primary:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-outline-primary {
    color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-outline-primary:hover {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
}

.pagination {
    margin-top: 32px;
    gap: 8px;
}

.page-link {
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    font-size: 14px;
    transition: var(--transition);
}

.page-link:hover {
    color: var(--secondary-color);
    border-color: var(--secondary-color);
    background: rgba(37, 99, 235, 0.05);
}

.page-item.active .page-link {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
}

.list-group {
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.list-group-item {
    padding: 14px 20px;
    border: none;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-white);
    transition: var(--transition);
}

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

.list-group-item:hover {
    background: var(--bg-gray);
}

.list-group-item.active {
    background: rgba(37, 99, 235, 0.1);
    color: var(--secondary-color);
    border-color: transparent;
}

.alert {
    border: none;
    border-radius: var(--radius-md);
    padding: 16px 20px;
}

.alert-info {
    background: #eff6ff;
    color: #1e40af;
}

footer {
    background: var(--bg-white);
    border-top: 1px solid var(--border-color);
    padding: 24px 0;
    margin-top: auto;
}

footer .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: var(--text-secondary);
}

footer a {
    color: var(--secondary-color);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

.dropdown-menu {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 8px;
    min-width: 140px;
}

.dropdown-item {
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-secondary);
    transition: var(--transition);
}

.dropdown-item:hover {
    background: var(--bg-gray);
    color: var(--secondary-color);
}

.text-center {
    text-align: center;
}

.mb-4 {
    margin-bottom: 24px;
}

.mt-4 {
    margin-top: 24px;
}

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

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
}

@media (max-width: 1200px) {
    .sidebar-right {
        display: none;
    }
}

@media (max-width: 992px) {
    .sidebar-left {
        display: none;
    }

    .header-container {
        gap: 16px;
    }

    .header-nav {
        display: none;
    }

    .search-form input {
        width: 160px;
    }

    .search-form input:focus {
        width: 200px;
    }
}

@media (max-width: 768px) {
    .header-container {
        padding: 0 16px;
    }

    .app-container {
        padding: 0 16px;
    }

    .note-detail {
        padding: 20px;
    }

    .note-detail h1 {
        font-size: 22px;
    }

    .note-content {
        font-size: 15px;
    }

    footer .container {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}

.note-toc:empty {
    display: none;
}

.toc-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 6px;
}

.toc-title i {
    font-size: 14px;
}

.toc-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
    padding-left: 16px;
}

.toc-list li {
    margin: 0;
}

.toc-link {
    display: block;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.toc-link:hover {
    color: var(--secondary-color);
    background: rgba(37, 99, 235, 0.08);
}

.toc-link.active {
    color: var(--secondary-color);
    background: rgba(37, 99, 235, 0.12);
    font-weight: 500;
    border-left: 2px solid var(--secondary-color);
}

.toc-level-2>li>.toc-link {
    font-weight: 500;
}

.toc-level-3>li>.toc-link {
    font-size: 12px;
}