.gists-layout {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    gap: 1.5rem;
    align-items: start;
}

.gists-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.gists-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.gists-count {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.gists-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.gist-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    transition: all 0.2s;
    cursor: pointer;
}

.gist-card:hover {
    border-color: var(--border-light);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.gist-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.gist-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    flex: 1;
    min-width: 0;
}

.gist-card-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.gist-card-desc {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gist-language-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.5rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-primary);
    background: rgba(255, 107, 53, 0.15);
}

.gist-card-star {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: color 0.2s;
}

.gist-card-star:hover {
    color: var(--warning);
}

.gist-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.gist-author {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.gist-author img {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

.gist-detail-page {
    max-width: 860px;
    margin: 0 auto;
}

.gist-detail {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.gist-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.gist-detail-title {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
}

.gist-detail-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.gist-detail-author a {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.gist-detail-desc {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.gist-code-block {
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.gist-code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

.gist-code-header .gist-language-name {
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.gist-code-header .gist-copy-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius);
    transition: all 0.2s;
}

.gist-code-header .gist-copy-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.gist-code-block pre {
    margin: 0;
    padding: 1rem;
    overflow-x: auto;
    background: #1a1a2e;
    font-size: 0.8125rem;
    line-height: 1.5;
}

.gist-code-block pre code {
    background: none;
    padding: 0;
    font-family: var(--font-mono);
}

.gist-detail-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.gist-star-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.gist-star-btn:hover {
    background: var(--bg-card-hover);
    color: var(--warning);
}

.CodeMirror {
    height: auto;
    min-height: 300px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.8125rem;
}

.CodeMirror-gutters {
    border-right: 1px solid var(--border);
    background: var(--bg-secondary);
}

.CodeMirror-linenumber {
    color: var(--text-muted);
}

@media (max-width: 1024px) {
    .gists-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .gists-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.375rem;
    }

    .gist-card {
        padding: 1rem;
    }

    .gist-card-title {
        font-size: 0.9375rem;
    }

    .gist-detail {
        padding: 1rem;
    }

    .gist-detail-header {
        flex-direction: column;
        gap: 0.5rem;
    }

    .gist-detail-title {
        font-size: 1.25rem;
    }
}
