@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&display=swap');

/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2b59ff;
    --secondary-color: #7aa2ff;
    --text-color: #1b1e28;
    --text-light: #5b6270;
    --bg-color: #f2f4f8;
    --white: #ffffff;
    --card-bg: #ffffff;
    --shadow-color: rgba(17, 24, 39, 0.12);
}

/* 深色模式 */
@media (prefers-color-scheme: dark) {
    :root {
        --text-color: #f0f0f0;
        --text-light: #b0b0b0;
        --bg-color: #2d2d2d;
        --card-bg: #1e1e1e;
        --shadow-color: rgba(0, 0, 0, 0.5);
    }

    body {
        background: radial-gradient(1200px 700px at 20% 0%, #1e2230 0%, #161a24 60%, #0f121a 100%);
    }

    .top-nav-link {
        background: rgba(255, 255, 255, 0.08);
        border-color: rgba(255, 255, 255, 0.08);
    }
}

body {
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: radial-gradient(1200px 700px at 20% 0%, #ffffff 0%, #f2f4f8 55%, #e8edf3 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--text-color);
}

.top-nav {
    display: flex;
    justify-content: flex-end;
    padding: 1rem 2rem 0;
}

.top-nav-link {
    background: rgba(255, 255, 255, 0.85);
    color: var(--text-color);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid rgba(17, 24, 39, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.top-nav-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(17, 24, 39, 0.12);
    background: rgba(255, 255, 255, 0.95);
}

.shortcuts-nav-btn {
    background: rgba(255, 255, 255, 0.85);
    color: var(--text-color);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid rgba(17, 24, 39, 0.08);
}

.shortcuts-nav-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(17, 24, 39, 0.12);
    background: rgba(255, 255, 255, 0.95);
}

.container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 32px 16px;
    padding-top: 5rem;
}

.card {
    background: var(--card-bg);
    border-radius: 18px;
    padding: 30px 28px;
    box-shadow: 0 18px 50px var(--shadow-color);
    text-align: center;
    max-width: 720px;
    width: min(92vw, 720px);
    animation: fadeInUp 0.8s ease-out;
    border: 1px solid rgba(17, 24, 39, 0.06);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: var(--primary-color);
    margin: 0 auto 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.1rem;
    color: var(--white);
    box-shadow: 0 10px 24px rgba(43, 89, 255, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 16px 32px rgba(43, 89, 255, 0.3);
}

h1 {
    font-size: 1.55rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.tagline {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 0.9rem;
}

.description {
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 0.9rem;
    font-size: 0.95rem;
}

/* 打字机光标效果 */
.typing-cursor {
    display: inline-block;
    width: 2px;
    height: 1.2em;
    background: var(--primary-color);
    margin-left: 2px;
    animation: blink 1s infinite;
    vertical-align: text-bottom;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Skills Section */
.skills {
    margin: 2rem 0;
    text-align: left;
}

.skills-title {
    font-size: 0.9rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
    text-align: center;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.skill-tag {
    padding: 0.4rem 0.8rem;
    background: var(--bg-color);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-color);
    border: 1px solid rgba(17, 24, 39, 0.08);
    transition: all 0.3s ease;
    cursor: default;
}

.skill-tag:hover {
    background: #e9eef5;
    transform: scale(1.05);
}

.skill-tag.highlight {
    background: rgba(43, 89, 255, 0.12);
    border-color: rgba(43, 89, 255, 0.25);
    color: var(--primary-color);
}

/* Projects Section */
.projects {
    margin: 1.5rem 0;
}

.projects-title {
    font-size: 0.9rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

.project-cards {
    display: flex;
    gap: 0.8rem;
    justify-content: center;
    flex-wrap: wrap;
}

.project-card {
    padding: 0.8rem 1.2rem;
    background: var(--bg-color);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-color);
    font-size: 0.85rem;
    border: 1px solid rgba(17, 24, 39, 0.08);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.project-card:hover {
    background: #eef2f8;
    transform: translateY(-2px);
    box-shadow: 0 10px 18px rgba(17, 24, 39, 0.12);
}

.project-card svg {
    width: 16px;
    height: 16px;
}

/* Stats Section */
.stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 1.5rem 0;
    padding: 1rem 0;
    border-top: 1px solid var(--bg-color);
    border-bottom: 1px solid var(--bg-color);
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.social-link {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    color: var(--text-color);
    font-size: 1.2rem;
    border: 1px solid rgba(17, 24, 39, 0.08);
    transition: all 0.2s ease;
}

.social-link:hover {
    background: #eef2f8;
    transform: translateY(-2px);
    box-shadow: 0 10px 18px rgba(17, 24, 39, 0.12);
}

.status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #ecf3ff;
    color: #1f4fd1;
    border-radius: 20px;
    font-size: 0.9rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #2b59ff;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

footer {
    background: transparent;
    border-top: 1px solid rgba(17, 24, 39, 0.08);
    padding: 1.5rem;
    text-align: center;
    color: var(--text-light);
}

footer a {
    color: var(--text-color);
    text-decoration: none;
    transition: opacity 0.3s;
}

footer a:hover {
    opacity: 0.8;
}

.footer-content p {
    margin: 0.3rem 0;
    font-size: 0.85rem;
}

.icp-info {
    opacity: 0.8;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .card {
        padding: 24px 16px;
        margin: 1rem;
    }

    h1 {
        font-size: 1.3rem;
    }

    .avatar {
        width: 80px;
        height: 80px;
        font-size: 1.9rem;
    }

    .skill-tag {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }

    .stats {
        gap: 1rem;
    }

    .stat-number {
        font-size: 1.2rem;
    }
}

/* 搜索面板样式 */
.search-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.search-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.search-container {
    position: absolute;
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 20px 60px var(--shadow-color);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.search-header {
    display: flex;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e1e5e9;
    gap: 1rem;
}

.search-input-wrapper {
    flex: 1;
    position: relative;
}

#search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid transparent;
    border-radius: 8px;
    font-size: 1.1rem;
    background: var(--bg-color);
    color: var(--text-color);
    outline: none;
    transition: border-color 0.2s;
}

#search-input:focus {
    border-color: var(--primary-color);
}

.search-shortcuts {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    color: var(--text-light);
    pointer-events: none;
}

.search-close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.search-close-btn:hover {
    background: var(--bg-color);
}

.search-filters {
    display: flex;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e1e5e9;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-color);
}

.filter-group select {
    padding: 0.25rem 0.5rem;
    border: 1px solid #e1e5e9;
    border-radius: 4px;
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 0.9rem;
}

.tags-filter {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.search-history {
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: 8px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.history-header span {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.clear-history-btn {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.clear-history-btn:hover {
    background: var(--text-light);
    color: var(--card-bg);
}

.history-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    background: var(--card-bg);
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s;
}

.history-item:hover {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

.history-item svg {
    opacity: 0.6;
}

.history-item:hover svg {
    opacity: 1;
}

.tag-filter {
    padding: 0.25rem 0.5rem;
    background: var(--bg-color);
    border: 1px solid #e1e5e9;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.tag-filter:hover {
    background: #e1e5e9;
}

.tag-filter.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.search-results {
    flex: 1;
    overflow-y: auto;
    max-height: 60vh;
}

.search-status {
    padding: 2rem;
    text-align: center;
    color: var(--text-light);
    font-size: 1rem;
}

.search-result {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e1e5e9;
    cursor: pointer;
    transition: background-color 0.2s;
}

.search-result:hover,
.search-result.selected {
    background: var(--bg-color);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.result-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0;
}

.result-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-light);
}

.result-content {
    font-size: 0.9rem;
    color: var(--text-color);
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.result-content mark {
    background: #fff3cd;
    color: #856404;
    padding: 0.1rem 0.2rem;
    border-radius: 2px;
}

.result-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.result-tag {
    font-size: 0.75rem;
    background: #e9ecef;
    color: #495057;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
}

.result-links {
    font-size: 0.8rem;
    color: var(--text-light);
}

.shortcut {
    display: inline-block;
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 3px;
    padding: 0.1rem 0.3rem;
    font-size: 0.7rem;
    font-weight: 500;
    color: #495057;
    margin: 0 0.2rem;
}

/* 深色模式适配 */
@media (prefers-color-scheme: dark) {
    .search-result mark {
        background: #856404;
        color: #fff3cd;
    }

    .result-tag {
        background: #495057;
        color: #e9ecef;
    }

    .shortcut {
        background: #495057;
        border-color: #6c757d;
        color: #e9ecef;
    }
}

/* 移动端适配 */
@media (max-width: 768px) {
    .search-container {
        width: 95%;
        top: 5%;
        max-height: 90vh;
    }

    .search-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        justify-content: space-between;
    }

    .result-header {
        flex-direction: column;
        gap: 0.5rem;
    }

    .result-meta {
        justify-content: space-between;
    }
}

/* Wikilink 样式 */
.wikilink {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.wikilink:hover {
    border-bottom-color: var(--primary-color);
}

/* 深色模式适配 */
@media (prefers-color-scheme: dark) {
    .wikilink {
        color: #4dabf7;
    }

    .wikilink:hover {
        border-bottom-color: #4dabf7;
    }
}

/* 顶部工具栏样式 */
.top-toolbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border-bottom: 1px solid rgba(17, 24, 39, 0.08);
    z-index: 100;
    padding: 0.5rem;
    box-shadow: 0 8px 20px rgba(17, 24, 39, 0.08);
}

.toolbar-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.toolbar-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text-color);
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 0.8rem;
}

.toolbar-btn:hover {
    background: var(--bg-color);
    border-color: rgba(17, 24, 39, 0.08);
}

.toolbar-btn svg {
    width: 20px;
    height: 20px;
}

.toolbar-btn span {
    font-size: 0.7rem;
    font-weight: 500;
}

/* 主要入口区域样式 */
.main-entries {
    margin: 0.9rem 0;
}

.entry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.6rem;
    margin-bottom: 0.9rem;
}

.main-entry {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem;
    background: var(--bg-color);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.2s;
    border: 1px solid transparent;
}

.main-entry:hover {
    background: var(--card-bg);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.entry-icon {
    font-size: 1.45rem;
    width: 2.2rem;
    height: 2.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color);
    color: white;
    border-radius: 8px;
}

.entry-content h3 {
    margin: 0 0 0.25rem 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary-color);
}

.entry-content p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-light);
}

/* 学习系统状态样式 */
.learning-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem 1.2rem;
    margin: 0.9rem 0 0;
    color: var(--text-light);
    font-size: 0.85rem;
}

.learning-stats strong {
    color: var(--primary-color);
    font-weight: 700;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .top-toolbar {
        padding: 0.25rem;
    }

    .toolbar-buttons {
        gap: 0.5rem;
    }

    .toolbar-btn {
        padding: 0.25rem;
        min-width: 60px;
    }

    .toolbar-btn span {
        display: none;
    }

    .entry-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .main-entry {
        padding: 1rem;
        gap: 0.75rem;
    }

    .entry-icon {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1.5rem;
    }

    .entry-content h3 {
        font-size: 1rem;
    }

    .entry-content p {
        font-size: 0.8rem;
    }

    .learning-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .learning-stats .stat-item {
        padding: 0.75rem;
    }

    .learning-stats .stat-number {
        font-size: 1.2rem;
    }

    .container {
        padding-top: 4rem;
    }
}

/* ===== 笔记详情页面样式 ===== */

.note-detail {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 10px 30px var(--shadow-color);
}

.note-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e1e5e9;
}

.back-btn {
    background: var(--bg-color);
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    padding: 0.5rem 1rem;
    color: var(--text-color);
    cursor: pointer;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    transition: all 0.2s;
}

.back-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.note-title {
    font-size: 2.5rem;
    margin: 0 0 1rem 0;
    color: var(--text-color);
    line-height: 1.2;
}

.note-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--text-light);
}

.note-topic {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.note-date {
    color: var(--text-light);
}

.note-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.note-tags .tag {
    background: var(--bg-color);
    color: var(--text-color);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.8rem;
    border: 1px solid #e1e5e9;
}

.note-content {
    line-height: 1.8;
    margin-bottom: 2rem;
    color: var(--text-color);
}

.note-content h1,
.note-content h2,
.note-content h3,
.note-content h4,
.note-content h5,
.note-content h6 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.note-content h1 { font-size: 2rem; }
.note-content h2 { font-size: 1.8rem; }
.note-content h3 { font-size: 1.5rem; }
.note-content h4 { font-size: 1.3rem; }
.note-content h5 { font-size: 1.1rem; }
.note-content h6 { font-size: 1rem; }

.note-content p {
    margin-bottom: 1rem;
}

.note-content code {
    background: var(--bg-color);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
}

.note-content pre {
    background: var(--bg-color);
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1rem 0;
    border: 1px solid #e1e5e9;
}

.note-content pre code {
    background: none;
    padding: 0;
}

.note-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
    margin: 1rem 0;
    color: var(--text-light);
    font-style: italic;
}

.note-content ul,
.note-content ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

.note-content li {
    margin-bottom: 0.5rem;
}

.note-content .task-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.note-content .task-item input[type="checkbox"] {
    margin-top: 0.3rem;
    accent-color: var(--primary-color);
}

.note-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    background: var(--bg-color);
    border-radius: 8px;
    overflow: hidden;
}

.note-content th,
.note-content td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e1e5e9;
}

.note-content th {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
}

.note-content tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.02);
}

/* 反向链接样式 */
.backlinks {
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--bg-color);
    border-radius: 8px;
    border: 1px solid #e1e5e9;
}

.backlinks h3 {
    margin: 0 0 1rem 0;
    color: var(--text-color);
    font-size: 1.2rem;
}

.backlinks ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.backlinks li {
    margin-bottom: 0.5rem;
}

.backlinks a {
    color: var(--primary-color);
    text-decoration: none;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background-color 0.2s;
    display: block;
}

.backlinks a:hover {
    background: rgba(102, 126, 234, 0.1);
}

/* 出链样式 */
.note-links-out {
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--bg-color);
    border-radius: 8px;
    border: 1px solid #e1e5e9;
}

.note-links-out h3 {
    margin: 0 0 1rem 0;
    color: var(--text-color);
    font-size: 1.2rem;
}

.note-links-out ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.note-links-out li {
    margin-bottom: 0.5rem;
}

.note-links-out a {
    color: var(--primary-color);
    text-decoration: none;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background-color 0.2s;
    display: block;
}

.note-links-out a:hover {
    background: rgba(102, 126, 234, 0.1);
}

/* 笔记导航按钮样式 */
.note-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e1e5e9;
}

.note-navigation .nav-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--bg-color);
    color: var(--text-color);
    text-decoration: none;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    max-width: 45%;
}

.note-navigation .nav-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.note-navigation .nav-btn svg {
    width: 18px;
    height: 18px;
}

.note-navigation .nav-btn span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.note-navigation .prev-btn {
    justify-content: flex-start;
}

.note-navigation .next-btn {
    justify-content: flex-end;
}

/* 笔记详情页面移动端适配 */
@media (max-width: 768px) {
    .note-detail {
        margin: 1rem;
        padding: 1rem;
    }

    .note-title {
        font-size: 2rem;
    }

    .note-content h1 { font-size: 1.8rem; }
    .note-content h2 { font-size: 1.6rem; }

    .note-navigation {
        flex-direction: column;
        gap: 0.5rem;
    }

    .note-navigation .nav-btn {
        width: 100%;
        max-width: none;
        justify-content: center;
    }

    .note-navigation .prev-btn span,
    .note-navigation .next-btn span {
        font-size: 0.85rem;
    }

    .note-navigation .prev-btn svg {
        order: -1;
    }

    .note-content h3 { font-size: 1.4rem; }

    .note-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .note-detail {
        margin: 0.5rem;
        padding: 1rem;
    }

    .note-title {
        font-size: 1.8rem;
    }

    .note-content {
        font-size: 0.9rem;
    }
}

/* ===== 增强的 Markdown 内容样式 ===== */
.markdown-content {
    line-height: 1.8;
    color: var(--text-color);
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 600;
    line-height: 1.3;
}

.markdown-content h1 { font-size: 2rem; border-bottom: 2px solid var(--primary-color); padding-bottom: 0.5rem; }
.markdown-content h2 { font-size: 1.75rem; border-bottom: 1px solid #e1e5e9; padding-bottom: 0.3rem; }
.markdown-content h3 { font-size: 1.5rem; }
.markdown-content h4 { font-size: 1.25rem; }
.markdown-content h5 { font-size: 1.1rem; }
.markdown-content h6 { font-size: 1rem; color: var(--text-light); }

.markdown-content p {
    margin-bottom: 1rem;
}

.markdown-content a {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.markdown-content a:hover {
    border-bottom-color: var(--primary-color);
}

.markdown-content strong {
    font-weight: 700;
}

.markdown-content em {
    font-style: italic;
}

.markdown-content del {
    text-decoration: line-through;
    color: var(--text-light);
}

.markdown-content code {
    background: var(--bg-color);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
    font-size: 0.9em;
    color: var(--primary-color);
}

.markdown-content pre {
    background: #1e1e1e;
    padding: 1.5rem;
    border-radius: 12px;
    overflow-x: auto;
    margin: 1.5rem 0;
    border: 1px solid #333;
}

.markdown-content pre code {
    background: none;
    padding: 0;
    color: #d4d4d4;
    font-size: 0.875rem;
    line-height: 1.6;
}

.markdown-content pre code::before {
    content: attr(class) " ";
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    color: #888;
    text-transform: uppercase;
}

.markdown-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    color: var(--text-light);
    font-style: italic;
    background: var(--bg-color);
    padding: 1rem 1.5rem;
    border-radius: 0 8px 8px 0;
}

.markdown-content ul,
.markdown-content ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

.markdown-content ul {
    list-style-type: disc;
}

.markdown-content ol {
    list-style-type: decimal;
}

.markdown-content li {
    margin-bottom: 0.5rem;
}

.markdown-content li::marker {
    color: var(--primary-color);
    font-weight: 600;
}

.markdown-content hr {
    border: none;
    height: 2px;
    background: linear-gradient(to right, transparent, var(--primary-color), transparent);
    margin: 2rem 0;
    opacity: 0.5;
}

.markdown-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
    border: 1px solid #e1e5e9;
}

.markdown-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: var(--bg-color);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e1e5e9;
}

.markdown-content th,
.markdown-content td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e1e5e9;
}

.markdown-content th {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.markdown-content tr:hover {
    background: rgba(102, 126, 234, 0.05);
}

.markdown-content tr:last-child td {
    border-bottom: none;
}

/* 深色模式适配 */
@media (prefers-color-scheme: dark) {
    .markdown-content h1 {
        border-bottom-color: #4dabf7;
    }

    .markdown-content h2 {
        border-bottom-color: #4a4a4a;
    }

    .markdown-content code {
        background: #2d2d2d;
        color: #4dabf7;
    }

    .markdown-content pre {
        background: #0d0d0d;
        border-color: #2d2d2d;
    }

    .markdown-content blockquote {
        background: #2d2d2d;
        border-left-color: #4dabf7;
    }

    .markdown-content table {
        border-color: #2d2d2d;
        background: #1e1e1e;
    }

    .markdown-content th,
    .markdown-content td {
        border-bottom-color: #2d2d2d;
    }

    .markdown-content tr:hover {
        background: rgba(77, 171, 247, 0.05);
    }
}

/* ===== 加载状态样式 ===== */
.note-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    color: var(--text-light);
    text-align: center;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--bg-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.note-loading p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-light);
}

/* 未找到和错误页面样式 */
.note-not-found,
.note-error {
    text-align: center;
    padding: 3rem 1rem;
}

.note-not-found h1,
.note-error h1 {
    font-size: 2rem;
    color: var(--text-color);
    margin-bottom: 1rem;
}

.note-not-found p,
.note-error p {
    color: var(--text-light);
    margin-bottom: 2rem;
}

.note-not-found button,
.note-error button {
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.note-not-found button:hover,
.note-error button:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

/* ===== 快捷键面板样式 ===== */
.shortcuts-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: none;
}

.shortcuts-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.shortcuts-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 25px 60px var(--shadow-color);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.shortcuts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e1e5e9;
}

.shortcuts-header h2 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-color);
}

.shortcuts-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.shortcuts-close:hover {
    background: var(--bg-color);
    color: var(--text-color);
}

.shortcuts-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.shortcuts-section {
    margin-bottom: 1.5rem;
}

.shortcuts-section h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-light);
    margin: 0 0 0.75rem 0;
}

.shortcuts-list {
    display: grid;
    gap: 0.75rem;
}

.shortcut-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
}

.shortcuts-panel kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 28px;
    padding: 0 8px;
    background: var(--bg-color);
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-color);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.shortcut-item span {
    color: var(--text-color);
    font-size: 0.9rem;
}

.shortcuts-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e1e5e9;
    text-align: center;
}

.shortcuts-footer p {
    margin: 0;
    color: var(--text-light);
    font-size: 0.85rem;
}

.shortcuts-footer kbd {
    margin: 0 0.25rem;
}

/* 深色模式适配 */
@media (prefers-color-scheme: dark) {
    .shortcuts-container {
        box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
    }

    .shortcuts-header {
        border-bottom-color: #2d2d2d;
    }

    .shortcuts-panel kbd {
        background: #2d2d2d;
        border-color: #3d3d3d;
        color: var(--text-color);
    }

    .shortcuts-section h3 {
        color: #888;
    }

    .shortcuts-footer {
        border-top-color: #2d2d2d;
    }
}

/* 移动端适配 */
@media (max-width: 768px) {
    .shortcuts-container {
        width: 95%;
        max-height: 85vh;
    }

    .shortcuts-header,
    .shortcuts-content,
    .shortcuts-footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .shortcuts-section h3 {
        font-size: 0.8rem;
    }

    .shortcuts-panel kbd {
        min-width: 28px;
        height: 24px;
        font-size: 0.8rem;
        padding: 0 6px;
    }

    .shortcut-item span {
        font-size: 0.85rem;
    }
}

/* ===== 笔记列表页面样式 ===== */
.notes-page {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.notes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--primary-color);
    gap: 1rem;
    flex-wrap: wrap;
}

.notes-header h1 {
    font-size: 2rem;
    color: var(--text-color);
    margin: 0;
}

.notes-stats {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.notes-stats span {
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: white;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.notes-toolbar {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.notes-toolbar input {
    flex: 1;
    min-width: 200px;
    padding: 0.75rem 1rem;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 1rem;
    background: var(--card-bg);
    color: var(--text-color);
    transition: border-color 0.2s;
}

.notes-toolbar input:focus {
    border-color: var(--primary-color);
    outline: none;
}

.notes-toolbar select {
    padding: 0.75rem 1rem;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 1rem;
    background: var(--card-bg);
    color: var(--text-color);
    cursor: pointer;
}

.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.tag-cloud-item {
    padding: 0.5rem 1rem;
    background: var(--bg-color);
    border: 1px solid #e1e5e9;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.tag-cloud-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.tag-cloud-item.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.note-card {
    background: var(--card-bg);
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 0;
}

.note-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 8px 24px var(--shadow-color);
    transform: translateY(-4px);
}

.note-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 0.75rem;
}

.note-card-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-color);
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
}

.note-card-topic {
    padding: 0.25rem 0.75rem;
    background: var(--secondary-color);
    color: white;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    max-width: 45%;
    text-overflow: ellipsis;
    overflow: hidden;
}

.note-card-excerpt {
    color: var(--text-light);
    line-height: 1.6;
    margin: 0 0 1rem 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
}

.note-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.note-card-date {
    font-size: 0.85rem;
    color: var(--text-light);
}

.note-card-tags {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.mini-tag {
    padding: 0.2rem 0.6rem;
    background: var(--bg-color);
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-light);
}

.notes-empty {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-light);
    font-size: 1.2rem;
    grid-column: 1 / -1;
}

/* ===== 知识图谱页面样式 ===== */
.graph-page {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.graph-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--primary-color);
}

.graph-header h1 {
    font-size: 2rem;
    color: var(--text-color);
    margin: 0;
}

.graph-stats {
    display: flex;
    gap: 1.5rem;
}

.graph-stats span {
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: white;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.graph-controls {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    align-items: center;
}

.graph-controls button {
    width: 36px;
    height: 36px;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text-color);
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.2s;
}

.graph-controls button:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.graph-controls select {
    padding: 0.5rem 1rem;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text-color);
    cursor: pointer;
}

.graph-canvas {
    width: 100%;
    height: 600px;
    background: var(--bg-color);
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    cursor: grab;
}

.graph-canvas:active {
    cursor: grabbing;
}

/* ===== 时间线页面样式 ===== */
.timeline-page {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--primary-color);
}

.timeline-header h1 {
    font-size: 2rem;
    color: var(--text-color);
    margin: 0;
}

.timeline-stats {
    display: flex;
    gap: 1.5rem;
}

.timeline-stats span {
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: white;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.timeline {
    position: relative;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary-color);
}

.timeline-month {
    margin-bottom: 3rem;
    position: relative;
}

.timeline-month-label {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border-radius: 20px;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    position: sticky;
    top: 20px;
    z-index: 10;
}

.timeline-items {
    margin-left: 20px;
}

.timeline-item {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    position: relative;
    cursor: pointer;
    transition: all 0.2s;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -23px;
    top: 0;
    width: 12px;
    height: 12px;
    background: var(--card-bg);
    border: 3px solid var(--primary-color);
    border-radius: 50%;
    z-index: 5;
}

.timeline-item:hover {
    transform: translateX(10px);
}

.timeline-item:hover::before {
    background: var(--primary-color);
}

.timeline-date {
    min-width: 100px;
    padding: 0.75rem 1rem;
    background: var(--bg-color);
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--text-light);
}

.timeline-content {
    flex: 1;
    background: var(--card-bg);
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    padding: 1.5rem;
    transition: box-shadow 0.2s;
}

.timeline-item:hover .timeline-content {
    box-shadow: 0 8px 24px var(--shadow-color);
}

.timeline-content h4 {
    margin: 0 0 0.75rem 0;
    font-size: 1.1rem;
    color: var(--text-color);
}

.timeline-content p {
    margin: 0 0 0.75rem 0;
    color: var(--text-light);
    line-height: 1.6;
}

.timeline-tags {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

/* ===== 时间线页面样式 ===== */
.timeline-container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--primary-color);
}

.timeline-header h2 {
    margin: 0;
    font-size: 2rem;
    color: var(--text-color);
}

.timeline-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.timeline-controls select,
.timeline-controls input {
    padding: 0.6rem 1rem;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text-color);
    font-size: 0.95rem;
    cursor: pointer;
}

.timeline-content {
    min-height: 300px;
}

.timeline-loading {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-light);
    font-size: 1.2rem;
}

.timeline-empty {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.timeline-empty p {
    color: var(--text-light);
    font-size: 1.1rem;
}

.timeline-group {
    margin-bottom: 2rem;
    position: relative;
}

.timeline-group-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.timeline-marker {
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
}

.timeline-group-info {
    flex: 1;
}

.timeline-group-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
}

.timeline-group-stats {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.stat-badge {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.6rem;
    background: var(--bg-color);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-color);
}

.stat-icon {
    font-size: 1rem;
}

.timeline-items {
    position: relative;
    padding-left: 30px;
}

.timeline-item {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    cursor: pointer;
    transition: all 0.2s;
}

.timeline-item-line {
    position: absolute;
    left: -30px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--primary-color);
}

.line-start::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    height: 100%;
    width: 2px;
    background: var(--primary-color);
}

.line-continue::after {
    content: '';
    position: absolute;
    top: 50%;
    left: -30px;
    transform: translateY(-50%);
    width: 2px;
    height: 50%;
    background: var(--primary-color);
}

.line-end::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: -30px;
    width: 8px;
    height: 8px;
    background: var(--card-bg);
    border: 2px solid var(--primary-color);
    border-radius: 50%;
}

.timeline-item-dot {
    width: 14px;
    height: 14px;
    background: var(--card-bg);
    border: 3px solid var(--primary-color);
    border-radius: 50%;
    margin-top: 6px;
    flex-shrink: 0;
}

.timeline-item-content {
    flex: 1;
}

.timeline-note-link {
    text-decoration: none;
    color: var(--text-color);
    transition: color 0.2s;
}

.timeline-note-link:hover {
    color: var(--primary-color);
}

.timeline-note-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    line-height: 1.4;
}

.timeline-item-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-light);
}

.timeline-item-excerpt {
    color: var(--text-light);
    line-height: 1.6;
    margin: 0;
}

.timeline-item-tags {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.mini-tag.more {
    background: var(--primary-color);
    color: white;
}

/* 移动端适配 - 时间线 */
@media (max-width: 768px) {
    .timeline-container {
        padding: 1rem;
    }

    .timeline-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .timeline-controls {
        width: 100%;
        flex-direction: column;
    }

    .timeline-controls select,
    .timeline-controls input {
        width: 100%;
    }

    .timeline-group {
        margin-bottom: 1.5rem;
    }

    .timeline-item {
        flex-direction: column;
        gap: 0.75rem;
    }

    .timeline-items {
        padding-left: 20px;
    }

    .timeline-item-line {
        left: -20px;
    }
}

/* 深色模式适配 - 新页面 */
@media (prefers-color-scheme: dark) {
    .notes-toolbar input,
    .notes-toolbar select,
    .graph-controls select {
        background: #2d2d2d;
        border-color: #3d3d3d;
        color: #f0f0f0;
    }

    .notes-toolbar input:focus {
        border-color: #4dabf7;
    }

    .tag-cloud-item,
    .mini-tag {
        background: #2d2d2d;
        border-color: #3d3d3d;
        color: #e0e0e0;
    }

    .tag-cloud-item:hover {
        border-color: #4dabf7;
    }

    .tag-cloud-item.active {
        background: #4dabf7;
        color: white;
    }

    .note-card,
    .graph-canvas,
    .timeline-content {
        background: #1e1e1e;
        border-color: #2d2d2d;
    }

    .note-card:hover,
    .timeline-item:hover .timeline-content {
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    }

    .timeline::before,
    .timeline-month-label {
        background: #4dabf7;
    }

    .timeline-item::before {
        background: #1e1e1e;
        border-color: #4dabf7;
    }

    .timeline-item:hover::before {
        background: #4dabf7;
    }

    .timeline-date,
    .note-card-date {
        background: #2d2d2d;
        color: #b0b0b0;
    }
}

/* 移动端适配 - 新页面 */
@media (max-width: 768px) {
    .notes-page,
    .graph-page,
    .timeline-page {
        padding: 1rem;
    }

    .notes-header,
    .graph-header,
    .timeline-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .notes-stats,
    .graph-stats,
    .timeline-stats {
        width: 100%;
        justify-content: space-around;
    }

    .notes-toolbar,
    .graph-controls {
        flex-direction: column;
    }

    .notes-toolbar input {
        width: 100%;
    }

    .notes-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .graph-canvas {
        height: 400px;
    }

    .timeline-month {
        margin-bottom: 2rem;
    }

    .timeline-item {
        flex-direction: column;
        gap: 0.75rem;
    }

    .timeline-date {
        min-width: auto;
        width: fit-content;
    }

    .timeline::before {
        left: 12px;
    }

    .timeline-month-label {
        top: 10px;
    }

    .timeline-items {
        margin-left: 12px;
    }

    .timeline-item::before {
        left: -15px;
        top: 4px;
    }
}

/* 深色模式适配 - 知识图谱和时间线 */
@media (prefers-color-scheme: dark) {
    #graph-canvas {
        background: #1e1e1e;
    }

    .legend-item,
    .graph-legend {
        background: #1e1e1e;
        border-color: #2d2d2d;
    }

    .legend-color {
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    }

    .timeline-year-label {
        background: #4dabf7;
    }
}

/* ===== 高级知识图谱视图样式 ===== */
.graph-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 5rem);
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem;
}

.graph-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: 12px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px var(--shadow-color);
}

.graph-header h2 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-color);
}

.graph-controls {
    display: flex;
    gap: 0.5rem;
}

.graph-controls button {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-color, #e1e5e9);
    background: var(--bg-color);
    color: var(--text-color);
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.2s;
}

.graph-controls button:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.graph-legend {
    display: flex;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--card-bg);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-light);
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

#graph-canvas-container {
    flex: 1;
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px var(--shadow-color);
    position: relative;
}

#graph-canvas {
    width: 100%;
    height: 100%;
    cursor: grab;
}

#graph-canvas:active {
    cursor: grabbing;
}

.graph-tooltip {
    position: fixed;
    padding: 0.5rem 0.75rem;
    background: var(--text-color);
    color: var(--card-bg);
    border-radius: 6px;
    font-size: 0.85rem;
    pointer-events: none;
    z-index: 100;
    opacity: 0.95;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.graph-sidebar {
    position: absolute;
    right: 0;
    top: 0;
    width: 300px;
    height: 100%;
    background: var(--card-bg);
    border-left: 1px solid var(--border-color, #e1e5e9);
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 10;
    display: flex;
    flex-direction: column;
}

.graph-sidebar.open {
    transform: translateX(0);
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color, #e1e5e9);
}

.sidebar-header h3 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-color);
}

.sidebar-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.sidebar-close:hover {
    background: var(--bg-color);
}

#sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.sidebar-info {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color, #e1e5e9);
}

.sidebar-info p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
    color: var(--text-color);
}

.sidebar-info .tag {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    background: var(--bg-color);
    border-radius: 4px;
    font-size: 0.8rem;
    margin-right: 0.25rem;
}

.sidebar-links h4 {
    margin: 0 0 0.75rem 0;
    font-size: 0.9rem;
    color: var(--text-light);
}

.sidebar-links ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-links li {
    margin-bottom: 0.5rem;
}

.sidebar-links a {
    color: var(--primary-color);
    text-decoration: none;
    display: block;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.sidebar-links a:hover {
    background: rgba(43, 89, 255, 0.1);
}

.view-note-btn {
    display: block;
    text-align: center;
    padding: 0.75rem;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    margin-top: 1rem;
    transition: background-color 0.2s;
}

.view-note-btn:hover {
    background: var(--secondary-color);
}

/* ===== 高级时间线视图样式 ===== */
.timeline-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.timeline-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-color);
}

.timeline-controls {
    display: flex;
    gap: 0.75rem;
}

.timeline-controls select,
.timeline-controls input {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color, #e1e5e9);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text-color);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.timeline-controls select:focus,
.timeline-controls input:focus {
    border-color: var(--primary-color);
}

.timeline-controls input {
    width: 200px;
}

.timeline-content {
    position: relative;
    padding-left: 2rem;
}

.timeline-content::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--primary-color), var(--secondary-color));
}

.timeline-group {
    margin-bottom: 2rem;
}

.timeline-group-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.timeline-marker {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary-color);
    box-shadow: 0 0 0 4px var(--card-bg), 0 0 0 6px var(--primary-color);
    flex-shrink: 0;
    margin-top: 0.25rem;
}

.timeline-group-info {
    flex: 1;
}

.timeline-group-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
    color: var(--text-color);
}

.timeline-group-stats {
    display: flex;
    gap: 1rem;
}

.stat-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: var(--bg-color);
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--text-light);
}

.stat-icon {
    font-size: 0.9rem;
}

.timeline-items {
    position: relative;
}

.timeline-item {
    position: relative;
    padding-left: 1.5rem;
    padding-bottom: 1.5rem;
}

.timeline-item-dot {
    position: absolute;
    left: -1.1rem;
    top: 0.35rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary-color);
    border: 3px solid var(--card-bg);
    box-shadow: 0 0 0 2px var(--primary-color);
}

.timeline-item-content {
    padding: 1rem;
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color, #e1e5e9);
    transition: all 0.2s;
}

.timeline-item-content:hover {
    box-shadow: 0 4px 12px var(--shadow-color);
    transform: translateY(-2px);
}

.timeline-note-link {
    text-decoration: none;
}

.timeline-note-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    color: var(--primary-color);
}

.timeline-note-link:hover .timeline-note-title {
    color: var(--secondary-color);
}

.timeline-note-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.8rem;
}

.timeline-topic {
    color: var(--text-light);
}

.timeline-date {
    color: var(--primary-color);
    font-weight: 500;
}

.timeline-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.timeline-tag {
    padding: 0.2rem 0.5rem;
    background: rgba(43, 89, 255, 0.1);
    color: var(--primary-color);
    border-radius: 4px;
    font-size: 0.75rem;
}

.timeline-tag-more {
    padding: 0.2rem 0.5rem;
    color: var(--text-light);
    font-size: 0.75rem;
}

.timeline-note-preview {
    margin: 0;
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.6;
}

.timeline-empty {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-light);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.timeline-loading {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-light);
}

/* 移动端适配 - 新组件 */
@media (max-width: 768px) {
    .graph-container {
        height: calc(100vh - 4rem);
        padding: 0.5rem;
    }

    .graph-header {
        padding: 0.75rem;
        margin-bottom: 0.5rem;
    }

    .graph-header h2 {
        font-size: 1rem;
    }

    .graph-legend {
        display: none;
    }

    .graph-sidebar {
        width: 100%;
    }

    .timeline-container {
        padding: 1rem 0.5rem;
    }

    .timeline-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .timeline-controls {
        width: 100%;
    }

    .timeline-controls input {
        width: auto;
    }

    .timeline-content {
        padding-left: 1.5rem;
    }

    .timeline-group-title {
        font-size: 1rem;
    }

    .timeline-item {
        padding-left: 1.25rem;
    }
}
