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

body {
    font-family: 'Roboto', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background: #ffffff;
    color: #000000;
    line-height: 1.5;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

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

.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-links {
    margin-bottom: 10px;
}

.header-links .header-link {
    font-size: 12px;
    color: #666;
    text-decoration: underline;
    font-family: 'Roboto', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

h1 {
    font-size: 28px;
    font-weight: normal;
    margin-bottom: 10px;
    font-family: 'Roboto', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

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

.editor-form {
    margin-bottom: 50px;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-family: 'Roboto', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

input[type="text"],
input[type="number"] {
    width: 100%;
    padding: 10px;
    font-size: 16px;
    font-family: 'Roboto', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    border: 1px solid #000;
    background: #ffffff;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 10px;
    border: 1px solid #000;
    border-bottom: none;
    background: #f5f5f5;
}

.toolbar button {
    padding: 8px 12px;
    font-size: 14px;
    font-family: 'Roboto', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    border: 1px solid #000;
    background: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toolbar button .material-icons {
    font-size: 18px;
}

.toolbar button[data-tooltip] {
    position: relative;
}

.toolbar button[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #000;
    color: #fff;
    padding: 5px 10px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    pointer-events: none;
    margin-bottom: 5px;
    font-family: 'Roboto', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.toolbar button[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
}

.toolbar button:hover {
    background: #e0e0e0;
}

.toolbar button.active {
    background: #000;
    color: #ffffff;
}

#editor {
    width: 100%;
    min-height: 400px;
    padding: 15px;
    font-size: 16px;
    font-family: 'Merriweather', serif;
    border: 1px solid #000;
    background: #ffffff;
    line-height: 1.6;
}

#editor:focus {
    outline: none;
}

#editor h1, #editor h2, #editor h3 {
    font-family: 'Roboto', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: normal;
}

.input-panel {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 10px;
    border: 1px solid #000;
    border-bottom: none;
    background: #f5f5f5;
}

.input-panel input[type="text"],
.input-panel input[type="number"] {
    flex: 1;
    padding: 6px 10px;
    font-size: 14px;
    font-family: 'Roboto', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    border: 1px solid #000;
    background: #ffffff;
}

.input-panel #image-width-input,
.input-panel #image-height-input {
    flex: 0 0 120px;
}

.input-panel button {
    padding: 6px 10px;
    border: 1px solid #000;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    font-family: 'Roboto', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.input-panel button.panel-confirm {
    background: #000;
    color: #fff;
}

.input-panel button.panel-confirm:hover {
    background: #333;
}

.input-panel button.panel-cancel:hover {
    background: #e0e0e0;
}

.input-panel button.panel-btn {
    padding: 4px 10px;
    border: 1px solid #000;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    font-size: 12px;
    font-family: 'Roboto', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    width: 120px;
}

.input-panel button.panel-btn:hover {
    background: #e0e0e0;
}

.symbol-link {
    margin-left: 10px;
    font-size: 12px;
    text-decoration: none;
    color: #000000;
    padding: 4px 10px;
    cursor: pointer;
    font-family: 'Roboto', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.symbol-link:hover {
    text-decoration: underline;
}

.input-panel button .material-icons {
    font-size: 18px;
}

.color-presets {
    display: flex;
    gap: 5px;
    flex: 1;
}

.color-preset {
    width: 30px;
    height: 30px;
    border: 1px solid #000;
    cursor: pointer;
    border-radius: 0;
}

.color-preset:hover {
    transform: scale(1.1);
}

.symbol-presets {
    display: flex;
    gap: 5px;
    flex: 1;
}

.symbol-preset {
    width: 30px;
    height: 30px;
    border: 1px solid #000;
    cursor: pointer;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.symbol-preset:hover {
    transform: scale(1.1);
}

.color-preset[data-color="#000000"] {
    background: #000000;
}

#editor .material-icons {
    margin: 0;
    padding: 0;
    display: inline-block;
    user-select: all;
}

#editor .material-icons:only-child {
    margin: 0;
    padding: 0;
}

button.submit-btn {
    padding: 12px 30px;
    font-size: 16px;
    font-family: 'Roboto', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    border: 1px solid #000;
    background: #000;
    color: #ffffff;
    cursor: pointer;
    margin-top: 10px;
}

button.submit-btn:hover {
    background: #333;
}

.tos-text {
    font-size: 12px;
    color: #666;
    margin-top: 10px;
    text-align: left;
    font-family: 'Roboto', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.tos-text a {
    color: #666;
    text-decoration: underline;
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    /* Отключаем hover эффекты на мобильных */
    .lang-switcher a:hover,
    .header-links .header-link:hover,
    .tos-text a:hover,
    button:hover,
    .toolbar button:hover {
        color: inherit;
        text-decoration: inherit;
        background: inherit;
    }
    
    .toolbar {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding: 10px;
        gap: 8px;
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
    
    .toolbar::-webkit-scrollbar {
        display: none;
    }
    
    .toolbar button {
        padding: 10px;
        min-width: 44px;
        flex-shrink: 0;
    }
    
    .toolbar button .material-icons {
        font-size: 20px;
    }
    
    button.submit-btn {
        width: 100%;
        padding: 15px;
    }
    
    #editor {
        min-height: 300px;
        padding: 12px;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    .input-panel #image-width-input,
    .input-panel #image-height-input {
        flex: 0 0 80px;
    }
    
    .toolbar button[data-tooltip]::after {
        display: none;
    }
}

@media (prefers-color-scheme: dark) {
    body {
        background: #1a1a1a;
        color: #ffffff;
    }
    
    header {
        border-bottom: 1px solid #ffffff;
        background: #1a1a1a;
    }
    
    .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-links .header-link {
        color: #999;
        text-decoration: underline;
    }
    
    input[type="text"],
    input[type="number"] {
        background: #2a2a2a;
        border: 1px solid #ffffff;
        color: #ffffff;
    }
    
    .toolbar {
        background: #2a2a2a;
        border: 1px solid #ffffff;
        border-bottom: none;
    }
    
    .toolbar button {
        background: #2a2a2a;
        border: 1px solid #ffffff;
        color: #ffffff;
    }
    
    .toolbar button:hover {
        background: #3a3a3a;
    }
    
    .toolbar button.active {
        background: #ffffff;
        color: #000000;
    }
    
    .toolbar span[style*="border-left"] {
        border-left: 1px solid #ffffff !important;
    }
    
    .toolbar button[data-tooltip]::after {
        background: #fff;
        color: #000;
    }
    
    #editor {
        background: #1a1a1a;
        border: 1px solid #ffffff;
        color: #ffffff;
    }
    
    .input-panel {
        background: #2a2a2a;
        border: 1px solid #ffffff;
        border-bottom: none;
    }
    
    .input-panel input[type="text"],
    .input-panel input[type="number"] {
        background: #1a1a1a;
        border: 1px solid #ffffff;
        color: #ffffff;
    }
    
    .input-panel button {
        background: #2a2a2a;
        border: 1px solid #ffffff;
        color: #ffffff;
    }
    
    .input-panel button.panel-confirm {
        background: #ffffff;
        color: #000000;
    }
    
    .input-panel button.panel-cancel:hover {
        background: #3a3a3a;
    }
    
    .input-panel button.panel-btn {
        background: #2a2a2a;
        border: 1px solid #ffffff;
        color: #ffffff;
    }
    
    .input-panel button.panel-btn:hover {
        background: #3a3a3a;
    }
    
    .symbol-link {
        color: #ffffff;
    }
    
    .color-preset {
        border: 1px solid #ffffff;
    }
    
    .color-preset[data-color="#000000"] {
        background: #ffffff !important;
    }
    
    .symbol-preset {
        border: 1px solid #ffffff;
    }
    
    button.submit-btn {
        background: #ffffff;
        color: #000000;
        border: 1px solid #ffffff;
    }
    
    button.submit-btn:hover {
        background: #e0e0e0;
    }
}
