.legal-page {
    padding: 48px 0 64px;
    background: var(--bg-soft);
    min-height: calc(100vh - 64px);
}

.legal-container {
    max-width: 820px;
    margin: 0 auto;
    padding: 0 24px;
}

.legal-content {
    background: var(--bg);
    padding: 2.5rem 2rem;
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    line-height: 1.8;
}

.legal-header {
    position: relative;
    margin-bottom: 2rem;
    padding: 1.25rem 1.25rem 1.25rem 1.5rem;
    border-radius: 12px;
    background: linear-gradient(160deg, #eef2ff, #fff);
    border: 1px solid var(--border);
}

.legal-header::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: linear-gradient(180deg, var(--primary), var(--accent));
    border-radius: 12px 0 0 12px;
}

.legal-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.35rem;
}

.legal-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
}

.update-date-bottom {
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.875rem;
    text-align: center;
}

.legal-section {
    margin-bottom: 2rem;
}

.legal-section h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 0.75rem;
    padding-top: 0.5rem;
}

.legal-section h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}

.legal-section p {
    color: var(--text-muted);
    margin-bottom: 0.85rem;
}

.legal-section ul,
.legal-section ol {
    margin: 0 0 1rem 1.25rem;
    color: var(--text-muted);
}

.legal-section li {
    margin-bottom: 0.45rem;
}

.legal-section a {
    color: var(--primary);
    text-decoration: none;
}

.legal-section a:hover {
    text-decoration: underline;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--primary);
    text-decoration: none;
    margin-bottom: 1.25rem;
    font-weight: 500;
}

.back-link:hover {
    color: var(--primary-dark);
}

.legal-footer-note {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-muted);
}

/* App 内嵌：?embed=1 或 ?from=app 隐藏头尾 */
.embed .navbar,
.embed .footer,
.embed .back-link {
    display: none !important;
}

.embed .legal-page {
    padding: 20px 0 40px;
    min-height: 100vh;
}

.embed .legal-container {
    padding: 0 14px;
}

.embed .legal-content {
    padding: 1.25rem 1rem;
    border-radius: 12px;
    box-shadow: none;
}

.embed .legal-header {
    margin-bottom: 1.25rem;
    padding: 1rem 1rem 1rem 1.15rem;
}

.embed .legal-header h1 {
    font-size: 1.35rem;
}

.embed .legal-subtitle {
    font-size: 0.9rem;
}

.embed .legal-section {
    margin-bottom: 1.5rem;
}

.embed .legal-section h2 {
    font-size: 1.1rem;
}

@media (max-width: 768px) {
    .legal-content {
        padding: 1.75rem 1.25rem;
    }

    .legal-header h1 {
        font-size: 1.5rem;
    }
}
