/* ==========================================================
   Flyfy · 服务协议
   居中法律文档、左侧目录、移动端折叠目录与打印样式
   ========================================================== */

body[data-page="agreement"] {
    --agreement-navbar-height: 72px;
    --agreement-toc-width: 224px;
    --agreement-column-gap: 48px;
    --agreement-document-width: 790px;
    --agreement-mobile-toc-space: 102px;
    background: #fff;
}

.agreement-masthead {
    border-bottom: 1px solid var(--stock-border);
    background:
        radial-gradient(680px 360px at 50% -12%, rgba(102, 126, 234, .15), transparent 68%),
        linear-gradient(180deg, #f8f9ff 0%, #fff 100%);
}

.agreement-masthead .agreement-container {
    padding-top: 66px;
    padding-bottom: 46px;
}

.agreement-masthead__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.agreement-kicker {
    color: var(--stock-primary-dark);
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.agreement-print {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    border: 1px solid rgba(102, 126, 234, .22);
    border-radius: 9px;
    color: var(--stock-primary-dark);
    background: rgba(255, 255, 255, .82);
    font-size: .86rem;
    font-weight: 700;
    transition: color .2s ease, background-color .2s ease, border-color .2s ease, transform .2s ease;
}

.agreement-print:hover,
.agreement-print:focus {
    border-color: var(--stock-primary);
    color: #fff;
    background: var(--stock-primary);
}

.agreement-print:active {
    transform: translateY(1px);
}

.agreement-masthead h1 {
    max-width: 790px;
    margin: 0;
    color: #1f263a;
    font-size: clamp(2.55rem, 4.2vw, 4rem);
    font-weight: 900;
    line-height: 1.08;
    letter-spacing: 0;
    overflow-wrap: anywhere;
    word-break: keep-all;
}

html[lang^="en"] .agreement-masthead h1 {
    font-size: clamp(2.45rem, 3.9vw, 3.75rem);
}

.agreement-subtitle {
    max-width: 720px;
    margin: 16px 0 0;
    color: #69738a;
    font-size: 1.03rem;
    line-height: 1.7;
}

.agreement-meta {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    max-width: var(--agreement-document-width);
    margin: 42px 0 0;
    border-top: 1px solid var(--stock-border);
}

.agreement-meta div {
    min-width: 0;
    padding: 19px 18px 4px 0;
    border-right: 1px solid var(--stock-border);
}

.agreement-meta div:not(:first-child) {
    padding-left: 18px;
}

.agreement-meta div:last-child {
    border-right: 0;
}

.agreement-meta dt {
    margin-bottom: 6px;
    color: #7a8499;
    font-size: .69rem;
    font-weight: 800;
    letter-spacing: .07em;
    line-height: 1.4;
    text-transform: uppercase;
}

.agreement-meta dd {
    margin: 0;
    color: #343d52;
    font-size: .86rem;
    font-weight: 650;
    line-height: 1.55;
}

.agreement-body {
    display: grid;
    grid-template-columns: var(--agreement-toc-width) minmax(0, var(--agreement-document-width));
    align-items: start;
    justify-content: space-between;
    column-gap: var(--agreement-column-gap);
    padding-top: 62px;
    padding-bottom: 108px;
}

.agreement-toc {
    grid-column: 1;
    position: sticky;
    top: calc(var(--agreement-navbar-height) + 38px);
    align-self: start;
    width: var(--agreement-toc-width);
    overflow: hidden;
    border: 1px solid #e5e8f3;
    border-radius: 16px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 12px 34px rgba(32, 43, 78, .06);
}

.agreement-toc.is-fixed {
    position: fixed;
    top: calc(var(--agreement-navbar-height) + 38px);
    z-index: 1020;
    box-shadow: 0 20px 48px rgba(32, 43, 78, .14);
}

.agreement-toc__inner {
    display: flex;
    flex-direction: column;
    max-height: calc(100dvh - var(--agreement-navbar-height) - 76px);
    overflow: hidden;
    padding: 16px 10px 12px;
}

.agreement-toc__header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding: 0 7px 13px;
}

.agreement-toc__label {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 8px;
    color: #58627a;
    font-size: .75rem;
    font-weight: 800;
    line-height: 1.3;
}

.agreement-toc__label i {
    color: var(--stock-primary);
    font-size: .92rem;
}

.agreement-toc__count {
    display: inline-flex;
    min-width: 27px;
    height: 24px;
    align-items: center;
    justify-content: center;
    padding: 0 7px;
    border: 1px solid #e6e9f5;
    border-radius: 999px;
    color: #7a8499;
    background: #f8f9fd;
    font-size: .66rem;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
}

.agreement-toc__progress,
.agreement-toc-mobile__progress {
    height: 3px;
    overflow: hidden;
    border-radius: 999px;
    background: #edf0f7;
}

.agreement-toc__progress {
    flex: 0 0 auto;
    margin: 0 7px 10px;
}

.agreement-toc__progress span,
.agreement-toc-mobile__progress span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #667eea, #8b9cf5);
    transition: width .22s ease;
}

.agreement-toc__scroll {
    min-height: 0;
    overflow-y: auto;
    margin: 0 -2px;
    padding: 0 2px 2px;
    scrollbar-width: thin;
    scrollbar-color: #cfd5e5 transparent;
    overscroll-behavior: contain;
}

.agreement-toc__list {
    display: grid;
    margin: 0;
    padding: 0;
    gap: 2px;
    list-style: none;
}

    .agreement-toc__list a {
        display: grid;
        grid-template-columns: 29px minmax(0, 1fr);
        align-items: center;
        min-height: 38px;
        gap: 9px;
        padding: 6px 9px;
        border-radius: 10px;
        color: #687287;
        font-size: .76rem;
        line-height: 1.45;
        transition: color .16s ease, background-color .16s ease, transform .16s ease, box-shadow .16s ease;
        text-decoration: none;
    }

.agreement-toc__list a:hover {
    color: #30394f;
    background: #f6f8ff;
    transform: translateX(2px);
}

.agreement-toc__list a.is-active {
    color: var(--stock-primary);
    background: linear-gradient(90deg, rgba(102, 126, 234, .13), rgba(102, 126, 234, .045));
    box-shadow: inset 3px 0 0 var(--stock-primary);
}

.agreement-toc__list a > span {
    display: inline-flex;
    width: 27px;
    height: 23px;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    color: #7d879c;
    background: #f2f4fa;
    font-size: .6rem;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    transition: color .16s ease, background-color .16s ease, box-shadow .16s ease;
}

.agreement-toc__list a.is-active > span {
    color: #fff;
    background: var(--stock-primary);
    box-shadow: 0 5px 12px rgba(102, 126, 234, .24);
}

.agreement-toc__list strong {
    font-weight: 600;
}

.agreement-toc__list a.is-active strong {
    font-weight: 750;
}

.agreement-toc__list li:hover a strong {
    text-decoration: underline;
    color: var(--stock-primary);
}

.agreement-toc-mobile {
    display: none;
    position: sticky;
    top: var(--agreement-navbar-height);
    z-index: 1020;
    overflow: hidden;
    margin-bottom: 38px;
    border: 1px solid #e4e8f4;
    border-radius: 16px;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 12px 32px rgba(31, 41, 55, .1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: border-color .2s ease, box-shadow .2s ease;
}

.agreement-toc-mobile[open] {
    border-color: rgba(102, 126, 234, .28);
    box-shadow: 0 20px 48px rgba(31, 41, 55, .16);
}

.agreement-toc-mobile.is-fixed {
    position: fixed;
    top: var(--agreement-navbar-height);
    z-index: 1020;
    margin: 0;
}

.agreement-toc-mobile.is-fixed + .agreement-document {
    margin-top: var(--agreement-mobile-toc-space);
}

.agreement-toc-mobile summary {
    display: flex;
    min-height: 60px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 10px 8px 12px;
    color: #2d354a;
    cursor: pointer;
    list-style: none;
    transition: background-color .16s ease;
}

.agreement-toc-mobile summary:hover {
    background: #fafbff;
}

.agreement-toc-mobile summary::-webkit-details-marker {
    display: none;
}

.agreement-toc-mobile__identity {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
}

.agreement-toc-mobile__identity strong {
    overflow: hidden;
    font-size: .88rem;
    font-weight: 800;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.agreement-toc-mobile__icon,
.agreement-toc-mobile__toggle {
    display: inline-grid;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 10px;
}

.agreement-toc-mobile__icon {
    width: 36px;
    height: 36px;
    color: #fff;
    background: linear-gradient(135deg, #667eea, #8370e7);
    box-shadow: 0 7px 16px rgba(102, 126, 234, .22);
    font-size: .94rem;
}

.agreement-toc-mobile__count {
    display: inline-flex;
    min-width: 25px;
    height: 22px;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    border-radius: 999px;
    color: #6d7890;
    background: #f1f3f9;
    font-size: .62rem;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
}

.agreement-toc-mobile__toggle {
    width: 32px;
    height: 32px;
    color: #6c768b;
    background: #f3f5fa;
    font-size: .72rem;
}

.agreement-toc-mobile__toggle i {
    transition: transform .18s ease;
}

.agreement-toc-mobile[open] .agreement-toc-mobile__toggle {
    color: var(--stock-primary-dark);
    background: #edf0ff;
}

.agreement-toc-mobile[open] .agreement-toc-mobile__toggle i {
    transform: rotate(180deg);
}

.agreement-toc-mobile__progress {
    height: 2px;
    margin: 0 12px;
}

.agreement-toc-mobile__body {
    max-height: calc(100dvh - var(--agreement-navbar-height) - 92px);
    overflow-y: auto;
    padding: 9px 8px 10px;
    scrollbar-width: thin;
    scrollbar-color: #cfd5e5 transparent;
    overscroll-behavior: contain;
}

.agreement-toc-mobile .agreement-toc__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3px 8px;
}

.agreement-toc-mobile .agreement-toc__list a {
    min-height: 42px;
    background: #f8f9fd;
}

.agreement-document {
    grid-column: 2;
    min-width: 0;
}

.agreement-section {
    scroll-margin-top: 104px;
}

.agreement-section + .agreement-section {
    margin-top: 54px;
    padding-top: 48px;
    border-top: 1px solid var(--stock-border);
}

.agreement-section h2 {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: start;
    margin: 0 0 22px;
    gap: 12px;
    color: #20283c;
    font-size: 1.66rem;
    font-weight: 850;
    line-height: 1.3;
}

.agreement-section--intro h2 {
    grid-template-columns: 1fr;
}

.agreement-section__number {
    padding-top: 5px;
    color: var(--stock-primary);
    font-size: .65rem;
    font-variant-numeric: tabular-nums;
    font-weight: 850;
    letter-spacing: .04em;
}

.agreement-copy {
    display: grid;
    gap: 14px;
    padding-left: 50px;
}

.agreement-section--intro .agreement-copy {
    padding-left: 0;
}

.agreement-copy p {
    margin: 0;
    color: #4b566e;
    font-size: .98rem;
    line-height: 1.88;
    overflow-wrap: anywhere;
}

.agreement-copy .agreement-lead {
    color: #283248;
    font-size: 1.02rem;
    font-weight: 700;
    line-height: 1.75;
}

.agreement-end {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-top: 68px;
    padding-top: 22px;
    border-top: 1px solid var(--stock-border);
    gap: 28px;
    color: #7b8498;
    font-size: .74rem;
    line-height: 1.6;
}

.agreement-end p {
    max-width: 480px;
    margin: 0;
}

.agreement-end span {
    flex: 0 0 auto;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 1199.98px) {
    .agreement-body {
        display: block;
    }

    .agreement-toc {
        display: none;
    }

    .agreement-toc-mobile {
        display: block;
    }

    .agreement-body {
        padding-top: 44px;
    }

    .agreement-section {
        scroll-margin-top: 148px;
    }
}

@media (min-width: 1200px) {
    body[data-page="agreement"] .site-footer .container {
        padding-left: calc(var(--agreement-toc-width) + var(--agreement-column-gap) + 12px);
    }
}

@media (max-width: 767.98px) {
    body[data-page="agreement"] {
        --agreement-mobile-toc-space: 94px;
    }

    .agreement-masthead .agreement-container {
        padding-top: 46px;
        padding-bottom: 38px;
    }

    .agreement-masthead h1,
    html[lang^="en"] .agreement-masthead h1 {
        font-size: clamp(2.15rem, 9.5vw, 2.85rem);
        line-height: 1.12;
    }

    .agreement-meta {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin-top: 34px;
    }

    .agreement-meta div {
        padding: 15px 14px 15px 0;
        border-bottom: 1px solid var(--stock-border);
    }

    .agreement-meta div:nth-child(2) {
        padding-left: 14px;
        border-right: 0;
    }

    .agreement-meta div:nth-child(3) {
        padding-left: 0;
    }

    .agreement-meta div:nth-child(3),
    .agreement-meta div:nth-child(4) {
        border-bottom: 0;
    }

    .agreement-meta div:nth-child(4) {
        padding-left: 14px;
    }

    .agreement-body {
        padding-top: 34px;
        padding-bottom: 82px;
    }

    .agreement-toc-mobile {
        margin-bottom: 30px;
        border-radius: 16px;
    }

    .agreement-toc-mobile .agreement-toc__list {
        grid-template-columns: 1fr;
    }

    .agreement-section + .agreement-section {
        margin-top: 42px;
        padding-top: 38px;
    }

    .agreement-section h2 {
        grid-template-columns: 31px minmax(0, 1fr);
        margin-bottom: 17px;
        gap: 8px;
        font-size: 1.35rem;
    }

    .agreement-section--intro h2 {
        grid-template-columns: 1fr;
    }

    .agreement-copy {
        padding-left: 39px;
        gap: 12px;
    }

    .agreement-copy p {
        font-size: .94rem;
        line-height: 1.82;
    }

    .agreement-end {
        display: block;
        margin-top: 52px;
    }

    .agreement-end span {
        display: block;
        margin-top: 11px;
    }
}

@media (max-width: 575.98px) {
    .agreement-masthead__top {
        margin-bottom: 18px;
    }

    .agreement-print {
        min-height: 36px;
        padding: 0 11px;
    }

    .agreement-meta {
        grid-template-columns: 1fr;
    }

    .agreement-meta div,
    .agreement-meta div:not(:first-child),
    .agreement-meta div:nth-child(2),
    .agreement-meta div:nth-child(3),
    .agreement-meta div:nth-child(4) {
        padding: 14px 0;
        border-right: 0;
        border-bottom: 1px solid var(--stock-border);
    }

    .agreement-meta div:last-child {
        border-bottom: 0;
    }
}

@media print {
    @page {
        size: Letter;
        margin: 19mm 18mm;
    }

    body[data-page="agreement"] {
        padding-top: 0;
        color: #000;
        background: #fff;
    }

    .stock-navbar,
    .site-footer,
    .back-to-top,
    .agreement-toc,
    .agreement-toc-mobile,
    .agreement-print {
        display: none !important;
    }

    .agreement-container,
    .agreement-body {
        width: 100%;
        max-width: none;
        margin: 0;
    }

    .agreement-masthead {
        border-bottom: 1px solid #bbb;
        background: #fff;
    }

    .agreement-masthead .agreement-container {
        padding: 0 0 8mm;
    }

    .agreement-masthead h1,
    html[lang^="en"] .agreement-masthead h1 {
        font-size: 27pt;
    }

    .agreement-subtitle {
        margin-top: 4mm;
        color: #222;
        font-size: 11pt;
    }

    .agreement-meta {
        grid-template-columns: repeat(4, 1fr);
        margin-top: 8mm;
    }

    .agreement-meta div,
    .agreement-meta div:not(:first-child),
    .agreement-meta div:nth-child(2),
    .agreement-meta div:nth-child(3),
    .agreement-meta div:nth-child(4) {
        padding: 3mm 4mm 3mm 0;
        border-right: 1px solid #bbb;
        border-bottom: 0;
    }

    .agreement-meta div:last-child {
        border-right: 0;
    }

    .agreement-body {
        padding: 9mm 0 0;
    }

    .agreement-section + .agreement-section {
        margin-top: 8mm;
        padding-top: 7mm;
        border-color: #bbb;
    }

    .agreement-section h2 {
        margin-bottom: 4mm;
        font-size: 15pt;
    }

    .agreement-copy {
        gap: 3mm;
    }

    .agreement-copy p,
    .agreement-copy .agreement-lead {
        color: #111;
        font-size: 10.2pt;
        line-height: 1.55;
    }

    .agreement-end {
        margin-top: 9mm;
        padding-top: 4mm;
        border-color: #bbb;
    }

    .agreement-end span {
        display: none;
    }
}
