.rules-page {
    padding-top: 120px;
    padding-bottom: 60px;
    min-height: 100vh;
    background-color: var(--bg-color);
}
.rules-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 40px;
    position: relative;
}
.rules-content {
    background: var(--bg-card);
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
.rules-content h1 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.rules-content h2 {
    color: var(--text-color);
    margin-top: 2em;
    margin-bottom: 1em;
    padding-bottom: 0.5em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    scroll-margin-top: 120px;
}
.rules-content h3 {
    color: var(--accent-color);
    margin-top: 1.5em;
    margin-bottom: 0.8em;
}
.rules-content p, .rules-content li {
    color: var(--text-muted);
    margin-bottom: 1em;
    line-height: 1.8;
}
.rules-content ul, .rules-content ol {
    padding-left: 20px;
    margin-bottom: 1em;
}
.rules-sidebar {
    position: sticky;
    top: 120px;
    height: fit-content;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    background: var(--bg-card);
    padding: 0;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    order: -1;
}
.rules-sidebar::-webkit-scrollbar {
    width: 6px;
}
.rules-sidebar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}
.rules-sidebar::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}
.search-box {
    position: sticky;
    top: 0;
    background: var(--bg-card);
    padding: 20px 20px 10px 20px;
    z-index: 20;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.search-box input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-color);
    font-family: var(--font-main);
    transition: all 0.3s ease;
}
.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}
.rules-toc {
    list-style: none;
    padding: 10px 20px 20px 20px;
}
.rules-toc li {
    margin-bottom: 8px;
}
.rules-toc a {
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s;
    display: block;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.95rem;
}
.rules-toc a.toc-subitem {
    padding-left: 25px;
    font-size: 0.85rem;
    border-left: 2px solid rgba(255, 255, 255, 0.05);
}
.rules-toc a:hover {
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.05);
}
.rules-toc a.active {
    color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
    font-weight: 600;
}
mark {
    background-color: rgba(236, 72, 153, 0.3);
    color: inherit;
    padding: 0 2px;
    border-radius: 2px;
}
@media (max-width: 900px) {
    .rules-layout {
        grid-template-columns: 1fr;
    }
    .rules-sidebar {
        position: static;
        order: -1;
        margin-bottom: 30px;
        max-height: none;
    }
    .search-box {
        position: static;
    }
}
