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

:root {
    --bg-color: #f4f1ea;
    --text-color: #1a1a1a;
    --sidebar-bg: rgba(255, 255, 255, 0.95);
    --content-bg: rgba(255, 255, 255, 0.95);
    --border-color: #d3c5b0;
    --heading-color: #2d1810;
    --title-color: #2d1810; 
    --title-shadow: 2px 2px 4px rgba(209, 191, 132, 0.7);
    --link-color: #4a3427;
    --pattern-color: #d3c5b0;
    --switch-bg: #d3c5b0;
    --switch-circle: #fff;
}

[data-theme="dark"] {
    --bg-color: #1f1f1f;
    --text-color: #e4e4e4;
    --sidebar-bg: rgba(35, 35, 35, 0.95);
    --content-bg: rgba(35, 35, 35, 0.95);
    --border-color: #444;
    --heading-color: #d4c5b5;
    --title-color: #d1bf84; 
    --title-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    --link-color: #d4c5b5;
    --pattern-color: #333;
    --switch-bg: #2d1810;
    --switch-circle: #d4c5b5;
}

body {
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-transform: none;
}

.theme-switch-wrapper {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
}

.theme-switch {
    display: inline-block;
    height: 34px;
    position: relative;
    width: 60px;
}

.theme-switch input {
    display: none;
}

.slider {
    background-color: var(--switch-bg);
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: .4s;
    border: 1px solid var(--border-color);
}

.slider:before {
    background-color: var(--switch-circle);
    bottom: 4px;
    content: "";
    height: 24px;
    left: 4px;
    position: absolute;
    transition: .4s;
    width: 24px;
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.slider .sun,
.slider .moon {
    color: var(--switch-circle);
    position: absolute;
    top: 7px;
    transition: .4s;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 20px;
    width: 20px;
}

.slider .sun {
    left: 6px;
}

.slider .moon {
    right: 6px;
}

.container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background-color: var(--sidebar-bg);
    padding: 2rem;
    padding-top: 4rem;
    position: fixed;
    height: 100vh;
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar h2 {
    margin-bottom: 1.5rem;
    color: var(--title-color);
    font-family: 'IM Fell English', serif;
    text-align: center;
    position: relative;
    text-shadow: var(--title-shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.title-top {
    font-size: 1rem;
    letter-spacing: 2px;
    display: flex;
    //align-items: center;
    align-items: center;
    width: 100%;
    margin-bottom: 0.3rem;
    white-space: nowrap;
    font-family: 'Cinzel', serif;
}

.title-bottom {
    font-size: 2.2rem;
    align-items: center;
    letter-spacing: 3px;
    line-height: 1;
    font-weight: 600;
    font-family: 'Cinzel', serif;
}

.line-l {
    content: '';
    display: block;
    height: 2px;
    background: linear-gradient(to right, transparent, var(--title-color) 30%);
    width: 100%;
    margin: 0 10px 0 0;
    opacity: 0.8;
}

.line-r {
    content: '';
    display: block;
    height: 2px;
    background: linear-gradient(to left, transparent, var(--title-color) 30%);
    width: 100%;
    margin: 0 0 0 10px;
    opacity: 0.8;
}

.sidebar h2::after {
    content: '';
    display: block;
    width: 100%;
    height: 2px;
    background: linear-gradient(to right, transparent, var(--title-color) 10%, var(--title-color) 90%, transparent);
    margin-top: 0.5rem;
    opacity: 0.8;
}

.subtitle {
    text-align: center;
    color: var(--text-color);
    font-style: italic;
    margin-bottom: 2rem;
    font-size: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.menu {
    list-style: none;
}

.menu li {
    margin-bottom: 0.4rem;
}

.menu a {
    color: var(--link-color);
    text-decoration: none;
    font-size: 18px;
    font-family: 'IM Fell English', serif;
    line-height: 1.4;
    transition: all 0.3s ease;
    display: block;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid transparent;
}

.menu a:hover {
    color: var(--heading-color);
    background-color: rgba(211, 197, 176, 0.2);
    transform: translateX(5px);
    border: 1px solid var(--border-color);
}

.menu a.active {
    color: var(--heading-color);
    background-color: rgba(211, 197, 176, 0.3);
    font-weight: 600;
    border: 1px solid var(--border-color);
}

.content {
    margin-left: 280px;
    padding: 3rem;
    max-width: 800px;
    font-size: 21px;
    line-height: 1.8;
    letter-spacing: 0.02em;
    word-spacing: 0.05em;
    background-color: var(--content-bg);
    min-height: 100vh;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    text-rendering: optimizeLegibility;
}

.content h1 {
    font-size: 2.2rem;
    margin: 2rem 0;
    letter-spacing: -0.015em;
    font-weight: 500;
    color: var(--heading-color);
    font-family: 'IM Fell English', serif;
}

.content h2 {
    font-size: 1.8rem;
    margin: 1.5rem 0;
    letter-spacing: -0.012em;
    color: var(--heading-color);
}

.content p {
    margin: 2rem 0;
    font-size: 16px;
    color: var(--text-color);
    font-family: 'Merriweather', serif;
}

.content > p:first-of-type::first-letter {
    float: left;
    font-family: 'Cinzel', serif;
    font-size: 3.7em;
    padding: 0.1em 0.1em 0 0;
    color: var(--heading-color);
    line-height: 0.8;
    margin-right: 0.05em;
}

.content img {
    max-width: 100%;
    height: auto;
    margin: 2rem 0;
}

.content blockquote {
    border-left: 3px solid var(--heading-color);
    padding: 1rem 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: var(--text-color);
    background-color: rgba(211, 197, 176, 0.2);
    border-radius: 0 4px 4px 0;
}

.content blockquote p {
    margin: 1rem 0;
}

.content code {
    background-color: var(--bg-color);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: monospace;
}

.content pre code {
    display: block;
    padding: 1rem;
    overflow-x: auto;
}

.adventure-note {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-color);
    opacity: 0.8;
    font-style: italic;
    font-family: 'Merriweather', serif;
}

.adventure-note a {
    color: var(--link-color);
    text-decoration: none;
    border-bottom: 1px dotted var(--link-color);
}

.adventure-note a:hover {
    border-bottom-style: solid;
}

.disclaimer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.disclaimer-content {
    background-color: var(--bg-color);
    padding: 2rem;
    border-radius: 8px;
    max-width: 500px;
    text-align: left;
    border: 1px solid var(--border-color);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
}

.disclaimer-content h3 {
    color: var(--heading-color);
    font-size: 2rem;
    margin-bottom: 1rem;
}

.disclaimer-content p {
    margin: 1rem 0;
    font-size: 18px;
    color: var(--text-color);
}

.disclaimer-content button {
    background-color: var(--heading-color);
    color: var(--bg-color);
    border: none;
    padding: 0.8rem 2rem;
    font-size: 1.1rem;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 1rem;
    font-family: 'IM Fell English', serif;
    transition: background-color 0.3s ease;
}

.disclaimer-content button:hover {
    background-color: var(--text-color);
}

.menu-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1001;
    background: var(--sidebar-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 0;
    font-size: 1.5rem;
    cursor: pointer;
    border-radius: 4px;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 280px;
        height: 100vh;
        position: fixed;
        left: -280px;
        transition: left 0.3s ease;
        z-index: 999;
        background-color: var(--sidebar-bg);
        padding-top: 5rem;
    }
    
    .sidebar.active {
        left: 0;
    }
    
    .content {
        margin-left: 0;
        padding: 2rem;
        width: 100%;
    }

    .theme-switch-wrapper {
        right: 1rem;
    }
}

@media (max-width: 480px) {
    .content {
        padding: 1rem;
        font-size: 18px;
    }

    .menu a {
        font-size: 16px;
    }
}
