:root {
    --legal-ink: #1d1d1f;
    --legal-muted: #6e6e73;
    --legal-blue: #0071e3;
    --legal-blue-soft: #e8f2ff;
    --legal-surface: #ffffff;
    --legal-soft: #f5f5f7;
    --legal-line: rgba(29, 29, 31, 0.12);
    --legal-content-width: 1120px;
    --legal-card-radius: 8px;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    scroll-behavior: smooth;
    scroll-padding-top: 104px;
    background: var(--legal-surface);
}

body {
    margin: 0;
    overflow-x: hidden;
    color: var(--legal-ink);
    background: var(--legal-surface);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: 0;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
}

.skip-link {
    position: fixed;
    z-index: 1000;
    top: 10px;
    left: 10px;
    padding: 10px 14px;
    color: #fff;
    background: #000;
    border-radius: 8px;
    transform: translateY(-160%);
}

.skip-link:focus {
    transform: translateY(0);
}

:focus-visible {
    outline: 3px solid rgba(0, 113, 227, 0.72);
    outline-offset: 3px;
}

.legal-header {
    position: fixed;
    z-index: 100;
    top: max(12px, env(safe-area-inset-top));
    right: 0;
    left: 0;
    pointer-events: none;
}

.legal-nav-shell {
    width: min(var(--legal-content-width), calc(100% - 32px));
    min-height: 58px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 24px;
    margin: 0 auto;
    padding: 8px 10px 8px 12px;
    color: var(--legal-ink);
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.76);
    border-radius: 18px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.07);
    backdrop-filter: blur(22px) saturate(165%);
    -webkit-backdrop-filter: blur(22px) saturate(165%);
    pointer-events: auto;
    transition: background-color 320ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 320ms ease, border-color 320ms ease;
}

.legal-header.is-scrolled .legal-nav-shell {
    background: rgba(255, 255, 255, 0.88);
    border-color: rgba(255, 255, 255, 0.94);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.1);
}

.legal-brand {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-self: start;
    gap: 10px;
    font-size: 15px;
    font-weight: 650;
    white-space: nowrap;
}

.legal-brand img {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    object-fit: cover;
    border-radius: 9px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

.legal-brand span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.legal-header-title {
    color: var(--legal-muted);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.legal-header-actions {
    display: flex;
    align-items: center;
    justify-self: end;
    gap: 8px;
}

.legal-header-action {
    min-width: 48px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 13px;
    color: var(--legal-ink);
    background: rgba(118, 118, 128, 0.1);
    border-radius: 12px;
    font-size: 13px;
    font-weight: 620;
}

.legal-header-action:hover {
    background: rgba(118, 118, 128, 0.16);
}

.legal-hero {
    padding: 146px 0 44px;
    overflow: hidden;
    background: var(--legal-soft);
    border-bottom: 1px solid rgba(29, 29, 31, 0.06);
}

.legal-hero-inner,
.legal-doc-tabs,
.legal-layout,
.legal-footer-shell {
    width: min(var(--legal-content-width), calc(100% - 40px));
    margin-right: auto;
    margin-left: auto;
}

.legal-hero-inner {
    max-width: 1120px;
}

.legal-kicker {
    margin: 0 0 14px;
    color: var(--legal-blue);
    font-size: 15px;
    font-weight: 650;
}

.legal-hero h1 {
    max-width: 820px;
    margin: 0;
    font-size: 58px;
    font-weight: 720;
    line-height: 1.1;
    letter-spacing: 0;
    text-wrap: balance;
}

.legal-description {
    max-width: 760px;
    margin: 22px 0 0;
    color: var(--legal-muted);
    font-size: 18px;
    line-height: 1.7;
}

.legal-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 28px;
    color: #86868b;
    font-size: 13px;
    font-weight: 520;
}

.legal-meta i {
    width: 3px;
    height: 3px;
    background: currentColor;
    border-radius: 50%;
}

.legal-doc-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 42px;
    padding: 4px;
    overflow-x: auto;
    background: rgba(118, 118, 128, 0.12);
    border-radius: 15px;
    scrollbar-width: none;
}

.legal-doc-tabs::-webkit-scrollbar {
    display: none;
}

.legal-doc-tabs a {
    min-width: 0;
    min-height: 42px;
    display: inline-flex;
    flex: 1 0 auto;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    color: var(--legal-muted);
    border-radius: 11px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.legal-doc-tabs a:hover {
    color: var(--legal-ink);
}

.legal-doc-tabs a.is-active {
    color: var(--legal-ink);
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.legal-main-shell {
    padding: 76px 0 110px;
    background: var(--legal-surface);
}

.legal-layout {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    align-items: start;
    gap: 72px;
}

.legal-toc {
    position: sticky;
    top: 96px;
    max-height: calc(100vh - 116px);
    padding: 20px;
    overflow: auto;
    background: var(--legal-soft);
    border: 1px solid rgba(29, 29, 31, 0.06);
    border-radius: var(--legal-card-radius);
    scrollbar-width: thin;
}

.legal-toc > p {
    margin: 0 0 12px;
    color: #86868b;
    font-size: 12px;
    font-weight: 650;
}

.legal-toc nav {
    display: grid;
    gap: 2px;
}

.legal-toc a {
    display: block;
    padding: 8px 10px;
    color: var(--legal-muted);
    border-radius: 7px;
    font-size: 13px;
    line-height: 1.45;
}

.legal-toc a:hover,
.legal-toc a.is-current {
    color: var(--legal-blue);
    background: var(--legal-blue-soft);
}

.legal-paper {
    min-width: 0;
    max-width: 780px;
}

.legal-section {
    scroll-margin-top: 108px;
}

.legal-section + .legal-section {
    margin-top: 44px;
    padding-top: 42px;
    border-top: 1px solid var(--legal-line);
}

.legal-section h2 {
    margin: 0 0 18px;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: 0;
    text-wrap: balance;
}

.legal-section h3 {
    margin: 30px 0 10px;
    font-size: 19px;
    font-weight: 680;
    line-height: 1.5;
    letter-spacing: 0;
}

.legal-section p,
.legal-section li {
    color: #3a3a3c;
    font-size: 17px;
    line-height: 1.95;
    overflow-wrap: anywhere;
}

.legal-section p {
    margin: 14px 0 0;
}

.legal-section ul {
    margin: 16px 0 0;
    padding: 0 0 0 24px;
}

.legal-section li + li {
    margin-top: 8px;
}

.legal-footer {
    padding: 46px 0 max(46px, env(safe-area-inset-bottom));
    color: #a1a1a6;
    background: #101114;
}

.legal-footer-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 26px;
    font-size: 13px;
}

.legal-footer-brand {
    display: inline-flex;
    align-items: center;
    justify-self: start;
    gap: 10px;
    color: #f5f5f7;
    font-size: 14px;
    font-weight: 620;
}

.legal-footer-brand img {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 8px;
}

.legal-footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px 22px;
}

.legal-footer-links a:hover {
    color: #fff;
}

.legal-footer-shell > p {
    grid-column: 1 / -1;
    margin: 2px 0 0;
    padding-top: 22px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.pressable {
    transform: scale(1);
    transform-origin: center;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: color 320ms cubic-bezier(0.22, 1, 0.36, 1), background-color 320ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 320ms ease, transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.pressable.is-pressed,
.pressable:active {
    transform: scale(0.97);
    transition-duration: 90ms;
    transition-timing-function: ease-out;
}

.motion-ready .reveal {
    opacity: 0;
    transform: translate3d(0, 20px, 0);
    transition: opacity 600ms ease, transform 600ms cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
}

.motion-ready .reveal.is-visible {
    opacity: 1;
    transform: translate3d(0, 0, 0);
    will-change: auto;
}

@media (max-width: 920px) {
    .legal-layout {
        grid-template-columns: 210px minmax(0, 1fr);
        gap: 42px;
    }

    .legal-hero h1 {
        font-size: 50px;
    }
}

@media (max-width: 720px) {
    html {
        scroll-padding-top: 88px;
    }

    .legal-header-title {
        display: none;
    }

    .legal-nav-shell {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .legal-hero {
        padding-top: 120px;
    }

    .legal-hero h1 {
        font-size: 44px;
    }

    .legal-layout {
        grid-template-columns: 1fr;
        gap: 42px;
    }

    .legal-toc {
        position: static;
        max-height: none;
        padding: 16px;
        overflow: hidden;
    }

    .legal-toc nav {
        display: flex;
        gap: 6px;
        margin-right: -16px;
        padding-right: 16px;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        scroll-snap-type: inline proximity;
        scrollbar-width: none;
    }

    .legal-toc nav::-webkit-scrollbar {
        display: none;
    }

    .legal-toc a {
        flex: 0 0 auto;
        max-width: 240px;
        padding: 9px 12px;
        background: #fff;
        scroll-snap-align: start;
    }

    .legal-paper {
        max-width: none;
    }
}

@media (max-width: 560px) {
    .legal-header {
        top: max(8px, env(safe-area-inset-top));
    }

    .legal-nav-shell {
        width: calc(100% - 20px);
        min-height: 54px;
        gap: 10px;
        padding: 7px 8px;
        border-radius: 16px;
    }

    .legal-brand {
        gap: 8px;
        font-size: 14px;
    }

    .legal-brand img {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
        border-radius: 8px;
    }

    .legal-header-actions {
        gap: 6px;
    }

    .legal-header-action {
        min-width: 42px;
        min-height: 38px;
        padding: 0 10px;
    }

    .legal-hero {
        padding: 106px 0 34px;
    }

    .legal-hero-inner,
    .legal-doc-tabs,
    .legal-layout,
    .legal-footer-shell {
        width: calc(100% - 32px);
    }

    .legal-kicker {
        margin-bottom: 12px;
        font-size: 14px;
    }

    .legal-hero h1 {
        font-size: 38px;
        line-height: 1.14;
    }

    .legal-description {
        margin-top: 18px;
        font-size: 16px;
        line-height: 1.72;
    }

    .legal-meta {
        align-items: flex-start;
        margin-top: 22px;
        line-height: 1.6;
    }

    .legal-doc-tabs {
        margin-top: 30px;
    }

    .legal-doc-tabs a {
        min-height: 40px;
        padding: 0 14px;
        font-size: 13px;
    }

    .legal-main-shell {
        padding: 48px 0 78px;
    }

    .legal-layout {
        gap: 34px;
    }

    .legal-section {
        scroll-margin-top: 88px;
    }

    .legal-section + .legal-section {
        margin-top: 36px;
        padding-top: 34px;
    }

    .legal-section h2 {
        font-size: 24px;
    }

    .legal-section h3 {
        margin-top: 26px;
        font-size: 18px;
    }

    .legal-section p,
    .legal-section li {
        font-size: 16px;
        line-height: 1.9;
    }

    .legal-footer-shell {
        grid-template-columns: 1fr;
    }

    .legal-footer-links {
        justify-content: flex-start;
    }
}

@media (max-width: 380px) {
    .legal-brand span {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        transition-delay: 0ms !important;
    }

    .reveal,
    .motion-ready .reveal,
    .motion-ready .reveal.is-visible {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-transparency: reduce) {
    .legal-nav-shell,
    .legal-header.is-scrolled .legal-nav-shell {
        background: #fff;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
}

@media (prefers-contrast: more) {
    .legal-nav-shell,
    .legal-toc,
    .legal-doc-tabs a.is-active {
        border: 1px solid currentColor;
    }

    .legal-section p,
    .legal-section li {
        color: var(--legal-ink);
    }
}
