/* Legal Pages Variables */
.legal-page {
    --text-spacing: 1.6;
    --section-spacing: 60px;
    --content-width: 800px;
    --header-height: 80px;
    --toc-offset: 120px;
}

/* Hero Section */
.legal-page .legal-hero {
    position: relative;
    background: linear-gradient(135deg, var(--bg-dark) 0%, #0d1b2a 100%);
    padding: 8rem 0 6rem;
    color: white;
    text-align: center;
    overflow: hidden;
}

.legal-page .legal-badge {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(255, 107, 74, 0.1);
    border: 1px solid rgba(255, 107, 74, 0.3);
    border-radius: 25px;
    color: var(--primary-color);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.legal-page .legal-hero h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    font-family: Cardo, serif;
}

.legal-page .last-updated {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Content Layout */
.legal-page .legal-content {
    padding: 60px 0;
    background: #f8f9fa;
    min-height: 100vh;
    position: relative;
}

.legal-page .legal-wrapper {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 60px;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}



/* Mobile TOC Trigger */
.legal-page .mobile-toc-trigger {
    display: none;
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 100;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 12px 24px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.legal-page .mobile-toc-trigger:hover {
    background: var(--primary-color-dark);
}

.legal-page .mobile-toc-trigger .trigger-icon {
    display: flex;
    align-items: center;
}

/* Table of Contents */
.legal-page .legal-toc {
    position: sticky;
    top: 100px;
    height: calc(100vh - 120px);
    background: white;
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    overflow-y: auto;
    align-self: start;
}

.legal-page .toc-wrapper > h2 {
    margin-bottom: 20px;
}

.legal-page .close-toc {
    display: none; /* 默认隐藏关闭按钮 */
}

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

.legal-page .toc-list li {
    margin-bottom: 12px;
}

.legal-page .toc-list a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

.legal-page .toc-list a:hover {
    color: var(--primary-color);
}

/* Main Content */
.legal-page .legal-main {
    background: white;
    border-radius: var(--border-radius);
    padding: 40px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    min-height: 100vh;
}

/* Scrollbar Styles */
.legal-page .legal-toc::-webkit-scrollbar {
    width: 4px;
}

.legal-page .legal-toc::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.legal-page .legal-toc::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 2px;
}

/* Content Sections */
.legal-page .legal-section {
    margin-bottom: var(--section-spacing);
}

.legal-page .legal-section:last-child {
    margin-bottom: 0;
}

.legal-page .legal-section h2 {
    color: var(--secondary-color);
    font-size: 1.8rem;
    margin-bottom: 25px;
    font-family: Cardo, serif;
}

.legal-page .legal-section h3 {
    color: var(--secondary-color);
    font-size: 1.3rem;
    margin: 30px 0 20px;
}

.legal-page .section-intro {
    font-size: 1.1rem;
    color: var(--text-light);
    line-height: var(--text-spacing);
    margin-bottom: 30px;
}

.legal-page .legal-list {
    list-style: none;
    padding-left: 0;
    margin: 20px 0;
}

.legal-page .legal-list li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 12px;
    line-height: var(--text-spacing);
}

.legal-page .legal-list li:before {
    content: "\2022";
    color: var(--primary-color);
    position: absolute;
    left: 0;
}

/* Usage Grid */
.legal-page .usage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin: 30px 0;
}

.legal-page .usage-item {
    background: #f8f9fa;
    padding: 25px;
    border-radius: var(--border-radius);
}

.legal-page .usage-item h4 {
    color: var(--secondary-color);
    margin-bottom: 10px;
}

/* Contact Info */
.legal-page .contact-info {
    background: #f8f9fa;
    padding: 25px;
    border-radius: var(--border-radius);
    margin-top: 20px;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .legal-page .legal-wrapper {
        grid-template-columns: 240px 1fr;
        gap: 40px;
    }
}

@media (max-width: 992px) {
    .legal-page .mobile-toc-trigger {
        display: flex;
    }

    .legal-page .legal-wrapper {
        grid-template-columns: 1fr;
    }

    .legal-page .legal-toc {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1000;
        margin: 0;
        padding: 0;
    }

    .legal-page .toc-wrapper {
        position: fixed;
        right: 0;
        top: 0;
        bottom: 0;
        width: 85%;
        max-width: 360px;
        background: white;
        padding: 20px;
        overflow-y: auto;
        transform: translateX(100%);
        transition: transform 0.3s ease;
    }

    .legal-page .legal-toc.active {
        display: block;
    }

    .legal-page .legal-toc.active .toc-wrapper {
        transform: translateX(0);
    }

    .legal-page .toc-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 20px;
        padding-bottom: 15px;
        border-bottom: 1px solid #eee;
    }

    .legal-page .close-toc {
        display: flex; /* 移动端才显示关闭按钮 */
        align-items: center;
        justify-content: center;
        background: none;
        border: none;
        padding: 8px;
        cursor: pointer;
        color: var(--text-color);
        transition: color 0.3s ease;
    }

    .legal-page .close-toc:hover {
        color: var(--primary-color);
    }

    .legal-page .close-toc:hover {
        color: var(--primary-color);
    }

    .legal-page .toc-wrapper > h2 {
        display: none;
    }

    /* 当目录打开时禁止背景滚动 */
    body.toc-open {
        overflow: hidden;
    }
}

@media (max-width: 768px) {
    .legal-page .legal-hero {
        padding: 120px 0 60px; /* 增加顶部内边距以避免被导航栏遮挡 */
    }

    .legal-page .legal-hero h1 {
        font-size: 2rem;
    }

    .legal-page .legal-badge {
        margin-top: 20px; /* 可选：增加徽章顶部间距 */
    }

    .legal-page .legal-main {
        padding: 25px;
    }
}
/* 更小屏幕的额外调整 */
@media (max-width: 480px) {
    .legal-page .legal-hero {
        padding: 100px 0 50px; /* 根据需要微调内边距 */
    }
}