:root {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --text-primary: #7794b4;
    --accent-blue: #2f81f7;
    --accent-green: #3fb950;
    --accent-red: #f85149;
    --accent-purple: #a371f7;
    --border-color: #30363d;
    --border-light: #484f58;
}

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

html,
body {
    height: 100%;
    overflow: hidden;
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    line-height: 1.4;
    padding: 6px;
    height: 100vh;
    height: 100dvh;
}

.app-container {
    height: 100%;
    display: flex;
    gap: 6px;
}

.sidebar-column {
    width: 200px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}

.header {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 6px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-blue);
    font-family: "Monaco", "Menlo", monospace;
}

.tagline {
    font-size: 10px;
    color: var(--text-primary);
    opacity: 0.8;
}

.sidebar {
    flex: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.sidebar-header {
    padding: 6px 10px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.sidebar-title {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.sidebar-title i {
    font-size: 9px;
}

.notes-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px 0;
}

.note-item {
    padding: 5px 10px;
    font-size: 10px;
    cursor: pointer;
    border-left: 2px solid transparent;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
}

.note-item:hover {
    background: var(--bg-tertiary);
}

.note-item:hover .note-actions {
    opacity: 1;
}

.note-item.active {
    background: var(--bg-tertiary);
    border-left-color: var(--accent-blue);
}

.note-icon {
    font-size: 9px;
    color: var(--text-primary);
    opacity: 0.7;
}

.note-content {
    flex: 1;
    min-width: 0;
}

.note-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 10px;
}

.note-date {
    font-size: 8px;
    color: var(--text-primary);
    opacity: 0.6;
    margin-top: 1px;
}

.note-actions {
    position: absolute;
    right: 8px;
    opacity: 0;
    transition: opacity 0.15s ease;
    display: flex;
    gap: 4px;
}

.note-delete {
    color: var(--accent-red);
    font-size: 8px;
    padding: 2px 4px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.note-delete:hover {
    background: var(--accent-red);
    color: white;
}

.editor-panel {
    flex: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.editor-toolbar {
    padding: 6px 10px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    background: var(--bg-tertiary);
    flex-shrink: 0;
}

.note-name-input {
    flex: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 10px;
    color: var(--text-primary);
    font-family: "Monaco", "Menlo", monospace;
    outline: none;
}

.note-name-input::placeholder {
    color: var(--text-primary);
    opacity: 0.6;
}

.toolbar-actions {
    display: flex;
    gap: 4px;
    align-items: center;
}

.status {
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 8px;
    background: rgba(47, 129, 247, 0.15);
    color: var(--accent-blue);
    border: 1px solid rgba(47, 129, 247, 0.3);
    margin-right: 4px;
}

.status.saved {
    background: rgba(63, 185, 80, 0.15);
    color: var(--accent-green);
    border-color: rgba(63, 185, 80, 0.3);
}

.btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.btn:hover {
    filter: brightness(1.1);
}

.btn i {
    font-size: 9px;
}

.btn-primary {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
}

.btn-success {
    background: var(--accent-green);
    border-color: var(--accent-green);
    color: white;
}

.btn-danger {
    background: var(--accent-red);
    border-color: var(--accent-red);
    color: white;
}

.hint {
    font-size: 9px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.keyboard-shortcut {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    padding: 1px 4px;
    font-size: 8px;
    font-family: "Monaco", "Menlo", monospace;
    color: var(--text-primary);
}

.content-area {
    flex: 1;
    padding: 10px;
    overflow: auto;
    min-height: 0;
}

textarea {
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: "Monaco", "Menlo", "Cascadia Code", monospace;
    font-size: 11px;
    line-height: 1.4;
    resize: none;
    outline: none;
}

.content-area::-webkit-scrollbar,
.notes-list::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

.content-area::-webkit-scrollbar-track,
.notes-list::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

.content-area::-webkit-scrollbar-thumb,
.notes-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

.content-area::-webkit-scrollbar-thumb:hover,
.notes-list::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}

textarea::placeholder {
    color: var(--text-primary);
    opacity: 1;
    font-size: 11px;
    line-height: 1.4;
    white-space: pre-wrap;
}

@media (max-width: 768px) {
    body {
        padding: 4px;
    }

    .app-container {
        flex-direction: column;
        gap: 4px;
    }

    .sidebar-column {
        width: 100%;
        order: 1;
    }

    .header {
        padding: 4px 8px;
    }

    .sidebar {
        height: 120px;
    }

    .editor-panel {
        order: 2;
    }

    .editor-toolbar {
        padding: 4px 8px;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
    }

    .toolbar-actions {
        width: 100%;
        justify-content: space-between;
    }

    .btn span {
        display: none;
    }

    .btn {
        padding: 4px 6px;
        flex: 1;
        justify-content: center;
    }

    .hint {
        justify-content: center;
        font-size: 8px;
    }

    .content-area {
        padding: 8px;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.panel {
    animation: fadeIn 0.2s ease-out;
}