:root {
    --sidebar-width: 260px;
    --accent: #2b8cff;
    --bg: #f6f7fb;
    --card: #fff;
    --muted: #6b7280;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, sans-serif;
    background: var(--bg);
    color: #111827;
}

.app {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    gap: 20px;
    padding: 20px;
    min-height: 100vh;
}

.sidebar {
    background: var(--card);
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    height: calc(100vh - 40px);
    overflow-y: auto;
    position: sticky;
    top: 20px;
    border: 1px solid gray;
}

.toc {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc button {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    padding: 10px 12px;
    font-size: 14px;
    border-radius: 6px;
    cursor: pointer;
    color: #111;
}

.toc button:hover {
    background: rgba(43, 140, 255, 0.08);
}

.toc button.active {
    background: var(--accent);
    color: white;
}

.main {
    padding: 20px;
}

.content-card {
    background: var(--card);
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    padding: 24px;
    max-width: 900px;
    margin: 0 auto;
}

pre {
    background: #0f172a;
    color: #e6eef8;
    padding: 10px;
    border-radius: 8px;
    overflow-x: auto;
}

code {
    background: #f3f4f6;
    padding: 2px 4px;
    border-radius: 4px;
}



.comments-section {
    max-width: 600px;
    margin: 20px auto;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #dee2e6;
}

.comments-section h3 {
    margin-bottom: 15px;
    color: #2c3e50;
    text-align: center;
}

.comment-form {
    margin-bottom: 25px;
}

.comment-form textarea {
    width: 100%;
    height: 80px;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    resize: vertical;
    font-family: inherit;
    font-size: 14px;
}

.comment-form textarea:focus {
    outline: none;
    border-color: #4CAF50;
}

.comment-form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

#char-count {
    font-size: 12px;
    color: #666;
}

.comment-form button {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.comment-form button:hover {
    background: #45a049;
}

.comment-form button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.comments-container {
    max-height: 400px;
    overflow-y: auto;
}

.comment {
    background: white;
    padding: 15px;
    margin: 10px 0;
    border-radius: 8px;
    border-left: 4px solid #4CAF50;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.comment-player {
    font-weight: bold;
    color: #2c3e50;
}

.comment-time {
    font-size: 0.8em;
    color: #7f8c8d;
}

.comment-text {
    color: #34495e;
    line-height: 1.4;
    word-wrap: break-word;
}

.no-comments {
    text-align: center;
    color: #7f8c8d;
    font-style: italic;
    padding: 20px;
}

.loading {
    text-align: center;
    color: #7f8c8d;
    padding: 20px;
}

@media(max-width:900px) {
    .app {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: relative;
        height: auto;
    }

    .main {
        padding: 0;
        padding-top: 10px;
    }

    .app {
        padding: 5px;
    }

    .content-card {
        padding: 5px;
    }
}