@font-face {
            font-family: 'hm';
            /* 给你的字体起一个自定义名字 */
            src: url('../map/font.ttf') format('ttf');
            /* 字体文件的路径 */
            font-weight: normal;
            /* 字体粗细 */
            font-style: normal;
            /* 字体样式 */
            font-display: swap;
            /* 优化加载体验，防止文字长时间不显示 */
        }

:root {
    /* 浅色模式 (Light Mode) 变量 */
    --c-pink: #ffc2d1;
    --c-purple: #c3aed6;
    --c-blue: #b0e0e6;
    --c-mint: #cff2de;
    --bg-color: #fdf6f8;
    --content-bg: #ffffff;
    --text-color: #6c5b7b;
    --text-light: #9b8aae;
    --border-color: #f0eaf3;
    --shadow-color: rgba(108, 91, 123, 0.1);
    --header-shadow: 3px 3px 0px rgba(255, 255, 255, 0.8);
    --code-bg: #f7f3fa;
    --link-color: var(--c-purple);
    --link-hover-color: var(--c-pink);
    --sidebar-bg: rgba(255, 255, 255, 0.5);
    --active-link-bg: var(--c-pink);
    --active-link-color: white;

    /* 字体 */
    --heading-font: 'hm', sans-serif;
    --body-font: 'hm', sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1e1e3f;
        --content-bg: #2a2a52;
        --text-color: #e0ddee;
        --text-light: #a092b7;
        --border-color: #3b3b6e;
        --shadow-color: rgba(0, 0, 0, 0.2);
        --header-shadow: 0 0 15px var(--c-pink);
        --code-bg: #31315c;
        --link-color: var(--c-pink);
        --link-hover-color: white;
        --sidebar-bg: rgba(255, 255, 255, 0.05);
        --active-link-bg: var(--c-purple);
    }
}

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

body {
    font-family: var(--body-font);
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.5s ease, color 0.5s ease;
    overflow-x: hidden;
}

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

.app-header {
    padding: 1rem 2rem;
    background: var(--sidebar-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.app-header h1 {
    font-family: var(--heading-font);
    font-size: 1.5rem;
    text-shadow: var(--header-shadow);
    color: var(--text-color);
}

.back-link {
    background: var(--c-pink);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 99px;
    text-decoration: none;
    font-weight: bold;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.back-link:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 194, 209, 0.5);
}

.main-container {
    display: flex;
    flex-grow: 1;
}

.sidebar {
    width: 280px;
    flex-shrink: 0;
    background: var(--sidebar-bg);
    backdrop-filter: blur(10px);
    border-right: 1px solid var(--border-color);
    padding: 1.5rem 0;
    height: calc(100vh - 65px); /* Full height minus header */
    position: sticky;
    top: 65px;
    overflow-y: auto;
}

.sidebar ul {
    list-style: none;
}

.sidebar a {
    display: block;
    padding: 0.7rem 1.5rem;
    color: var(--text-light);
    text-decoration: none;
    font-weight: bold;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.sidebar a:hover {
    color: var(--text-color);
    background: var(--shadow-color);
}

.sidebar a.active {
    color: var(--active-link-color);
    background: var(--active-link-bg);
    border-left-color: var(--link-hover-color);
}

.sidebar .nav-divider {
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    color: var(--text-light);
    padding: 1.5rem 1.5rem 0.5rem;
    opacity: 0.8;
}

.content-area {
    flex-grow: 1;
    padding: 2.5rem 3rem;
    transition: opacity 0.3s ease;
}

.content-area.loading {
    opacity: 0.5;
}

/* Loader animation */
.loader {
    width: 50px;
    height: 50px;
    border: 5px solid var(--border-color);
    border-top-color: var(--c-pink);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 4rem auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Content Styles */
.content-area h1, .content-area h2 {
    font-family: var(--heading-font);
    color: var(--text-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

.content-area h1 { font-size: 2rem; }
.content-area h2 { font-size: 1.5rem; margin-top: 2.5rem; }

table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: var(--content-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px var(--shadow-color);
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background: var(--c-purple);
    color: white;
    font-weight: bold;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover {
    background-color: var(--shadow-color);
}

code {
    background: var(--code-bg);
    padding: 3px 6px;
    border-radius: 6px;
    font-family: 'SF Mono', Consolas, monospace;
    color: var(--link-color);
}

pre {
    background: var(--code-bg);
    padding: 1rem;
    border-radius: 12px;
    overflow-x: auto;
    border: 1px solid var(--border-color);
    box-shadow: inset 0 2px 4px var(--shadow-color);
}

pre code {
    background: transparent;
    padding: 0;
    color: var(--text-color);
}

.note {
    background: rgba(176, 224, 230, 0.2); /* light blue */
    padding: 1rem;
    border-left: 4px solid var(--c-blue);
    margin: 20px 0;
    border-radius: 0 8px 8px 0;
}
body.dark-mode .note {
    background: rgba(176, 224, 230, 0.1);
}

ul, ol {
    padding-left: 20px;
    margin: 1rem 0;
}

/* Responsive */
@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
        position: static;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    .content-area {
        padding: 1.5rem;
    }
    .app-header {
        padding: 1rem;
    }
    .app-header h1 {
        font-size: 1.2rem;
    }
}