﻿/* ══════════════════════════════════════
   rules.css · 托格孜胡玛拉克 · 游戏规则页
   与 game.css 共用 header/footer/按钮基础样式，
   这里只负责目录 + 正文排版。
   ══════════════════════════════════════ */

.rules-body {
    background: var(--bg-page);
    align-items: stretch !important; /* 覆盖 game.css 的 align-items:center，让本页内容区能撑满宽度 */
}

.rules-page {
    width: 100%;
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 32px 24px 64px;
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 40px;
    align-items: start;
}

/* ══════════════════════════════════════
   左：目录
   ══════════════════════════════════════ */
.rules-toc {
    position: sticky;
    top: calc(var(--header-h) + 24px);
}

    .rules-toc ol {
        list-style: none;
        display: flex;
        flex-direction: column;
        gap: 4px;
        border-left: 2px solid var(--blue-pale);
    }

        .rules-toc ol li a {
            display: block;
            padding: 6px 14px;
            font-size: 13px;
            color: var(--text-secondary);
            text-decoration: none;
            border-left: 2px solid transparent;
            margin-left: -2px;
            transition: color 0.15s, border-color 0.15s;
        }

            .rules-toc ol li a:hover {
                color: var(--blue-mid);
            }

            .rules-toc ol li a.toc-active {
                color: var(--blue-dark);
                font-weight: 700;
                border-left-color: var(--blue-dark);
            }

/* ══════════════════════════════════════
   右：正文
   ══════════════════════════════════════ */
.rules-content {
    min-width: 0;
}

.rules-hero {
    padding-bottom: 24px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--blue-pale);
}

    .rules-hero h1 {
        font-family: 'Noto Serif SC', Georgia, 'SimSun', serif;
        font-size: 28px;
        color: var(--blue-dark);
    }

    .rules-hero p {
        margin-top: 8px;
        font-size: 13px;
        color: var(--text-muted);
        letter-spacing: 0.5px;
    }

.rules-section {
    padding: 28px 0;
    border-bottom: 1px solid var(--blue-pale);
    scroll-margin-top: calc(var(--header-h) + 16px);
}

    .rules-section:last-of-type {
        border-bottom: none;
    }

    .rules-section h2 {
        font-size: 18px;
        color: var(--blue-dark);
        margin-bottom: 14px;
    }

    .rules-section h3 {
        font-size: 14px;
        color: var(--blue-mid);
        margin: 18px 0 8px;
    }

    .rules-section p {
        font-size: 14px;
        line-height: 1.85;
        color: var(--text-primary);
        margin-bottom: 10px;
    }

    .rules-section ul,
    .rules-section ol {
        margin: 0 0 10px 20px;
    }

        .rules-section ul li,
        .rules-section ol li {
            font-size: 14px;
            line-height: 1.85;
            color: var(--text-primary);
            margin-bottom: 4px;
        }

.rules-note {
    background: var(--bg-panel);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 13px !important;
    color: var(--text-secondary) !important;
}

/* ══════════════════════════════════════
   术语表
   ══════════════════════════════════════ */
.rules-table-wrap {
    overflow-x: auto;
}

.rules-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

    .rules-table th,
    .rules-table td {
        padding: 10px 14px;
        text-align: left;
        border-bottom: 1px solid var(--blue-pale);
    }

    .rules-table th {
        background: var(--bg-panel);
        color: var(--blue-dark);
        font-weight: 700;
    }

    .rules-table td {
        color: var(--text-primary);
    }

    .rules-table tbody tr:hover {
        background: var(--bg-hole);
    }

/* ══════════════════════════════════════
   底部 CTA
   ══════════════════════════════════════ */
.rules-cta {
    margin-top: 32px;
    padding: 28px;
    border-radius: var(--radius-lg);
    background: var(--bg-white);
    box-shadow: var(--shadow-card);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

    .rules-cta span {
        font-size: 14px;
        color: var(--text-primary);
        font-weight: 600;
    }

.rules-cta-actions {
    display: flex;
    gap: 10px;
}

/* ══════════════════════════════════════
   响应式：目录变横向标签条
   ══════════════════════════════════════ */
@media (max-width: 860px) {
    .rules-page {
        grid-template-columns: 1fr;
        padding: 20px 16px 48px;
    }

    .rules-toc {
        position: sticky;
        top: var(--header-h);
        background: var(--bg-page);
        z-index: 10;
        padding: 10px 0;
        margin: 0 -16px;
        padding-left: 16px;
    }

        .rules-toc ol {
            flex-direction: row;
            overflow-x: auto;
            border-left: none;
            gap: 8px;
            padding-bottom: 4px;
        }

            .rules-toc ol li a {
                white-space: nowrap;
                border-left: none;
                border-bottom: 2px solid transparent;
                border-radius: var(--radius-sm);
                background: var(--bg-white);
                margin-left: 0;
            }

                .rules-toc ol li a.toc-active {
                    border-left: none;
                    border-bottom-color: var(--blue-dark);
                }

    .rules-cta {
        flex-direction: column;
        align-items: flex-start;
    }
}
