@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;600&family=Merriweather:wght@400;700&display=swap');

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

body {
    font-family: 'Merriweather', 'Times New Roman', Times, serif;
    background: #ffffff;
    color: #000000;
    line-height: 1.6;
    padding: 40px 20px;
    max-width: 800px;
    margin: 0 auto;
}

header {
    padding: 15px 0;
    margin-bottom: 15px;
    position: sticky;
    top: 0;
    background: #ffffff;
    z-index: 100;
}

header hr {
    margin: 15px 0 -15px 0;
    border: none;
    border-top: 1px solid #000;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Roboto', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: normal;
    margin: 30px 0 15px 0;
    line-height: 1.3;
}

h1 {
    font-size: 32px;
}

h2 {
    font-size: 28px;
}

h3 {
    font-size: 24px;
}

h4 {
    font-size: 20px;
}

p {
    margin: 15px 0;
    font-size: 18px;
}

.author {
    font-family: 'Roboto', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    color: #666;
    margin-bottom: 30px;
}

a {
    color: #ffffff;
    text-decoration: underline;
    text-decoration-line: underline;
    text-underline-offset: 3px;
}

img {
    max-width: 100%;
    height: auto;
    margin: 20px 0;
}

blockquote {
    border-left: 4px solid #000;
    padding: 15px 20px;
    margin: 20px 0;
    font-style: italic;
    background: #f9f9f9;
    border-radius: 0 4px 4px 0;
}

code {
    font-family: monospace;
    background: #f0f0f0;
    padding: 2px 6px;
}

pre {
    background: #f0f0f0;
    padding: 15px;
    overflow-x: auto;
    margin: 20px 0;
}

pre code {
    background: none;
    padding: 0;
}

ul, ol {
    margin: 15px 0;
    padding-left: 30px;
}

li {
    margin: 8px 0;
}

hr {
    border: none;
    border-top: 1px solid #000;
    margin: 30px 0;
}

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

th, td {
    border: 1px solid #000;
    padding: 10px;
    text-align: left;
}

th {
    background: #f0f0f0;
}

.metagraph-brand {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: #ffffff;
    padding: 10px 15px;
    border: 1px solid #000;
    font-family: 'Roboto', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    z-index: 1000;
    text-decoration: none;
    color: #000000;
}

.lang-switcher {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.lang-switcher a {
    font-size: 12px;
    text-decoration: none;
    color: #666;
    padding: 2px 8px;
    border: 1px solid #ccc;
    border-radius: 0;
    font-family: 'Roboto', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.lang-switcher a:hover {
    color: #000;
    border-color: #000;
}

.lang-switcher a.active {
    color: #000;
    border-color: #000;
    background: #f0f0f0;
}

.header-link {
    text-decoration: none;
    color: #000000;
}

h1 .header-link {
    color: #000000;
}

.beta {
    font-size: 16px;
    vertical-align: super;
    opacity: 0.6;
}

.spacer {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.material-icons {
    font-family: 'Material Icons';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    display: inline-block;
    line-height: 1;
    text-transform: none;
    letter-spacing: normal;
    word-wrap: normal;
    white-space: nowrap;
    direction: ltr;
    vertical-align: middle;
}

.material-icons:empty {
    display: none;
}

#editor .material-icons + br,
#editor .material-icons + :empty {
    display: none;
}

@media (prefers-color-scheme: dark) {
    body {
        background: #1a1a1a;
        color: #ffffff;
    }
    
    header {
        background: #1a1a1a;
    }
    
    header hr {
        border-top: 1px solid #ffffff;
    }
    
    a {
        color: #ffffff;
    }
    
    blockquote {
        border-left: 4px solid #ffffff;
        background: #2a2a2a;
        border-radius: 0 4px 4px 0;
    }
    
    code {
        background: #333;
    }
    
    pre {
        background: #333;
    }
    
    hr {
        border-top: 1px solid #ffffff;
    }
    
    th, td {
        border: 1px solid #ffffff;
    }
    
    th {
        background: #333;
    }
    
    .metagraph-brand {
        background: #1a1a1a;
        border: 1px solid #ffffff;
        color: #ffffff;
    }

    .lang-switcher a {
        color: #999;
        border-color: #555;
    }

    .lang-switcher a:hover {
        color: #ffffff;
        border-color: #ffffff;
    }

    .lang-switcher a.active {
        color: #ffffff;
        border-color: #ffffff;
        background: #333;
    }

    .header-link {
        color: #ffffff;
    }

    h1 .header-link {
        color: #ffffff;
    }
}

@media (max-width: 768px) {
    /* Отключаем hover эффекты на мобильных */
    .lang-switcher a:hover,
    .header-link:hover,
    .metagraph-brand:hover {
        color: inherit;
        text-decoration: inherit;
        background: inherit;
    }
}
