:root {
    --legal-bg-deep: #101820;
    --legal-bg-mid: #1a2b34;
    --legal-bg-soft: #2e3f37;
    --legal-paper: rgba(244, 234, 214, 0.95);
    --legal-paper-dim: rgba(238, 226, 203, 0.93);
    --legal-line: rgba(200, 184, 150, 0.72);
    --legal-ink: #22303a;
    --legal-ink-soft: #586c7f;
    --legal-link: #2f4f67;
    --legal-link-hover: #3d6280;
    --legal-shadow-main: 0 16px 36px rgba(0, 0, 0, 0.34);
    --legal-shadow-soft: 0 8px 18px rgba(0, 0, 0, 0.2);
}

html,
body {
    margin: 0;
    padding: 0;
}

body.legal-page {
    min-height: 100vh;
    font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
    color: var(--legal-ink);
    background:
        radial-gradient(circle at 20% 0%, rgba(52, 72, 62, 0.7) 0%, transparent 36%),
        radial-gradient(circle at 88% 14%, rgba(58, 47, 38, 0.62) 0%, transparent 40%),
        linear-gradient(140deg, var(--legal-bg-deep) 0%, var(--legal-bg-mid) 52%, var(--legal-bg-soft) 100%);
    background-attachment: fixed;
    overflow-x: hidden;
}

body.legal-page::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: url("../index/bg.png") center center / cover no-repeat;
    opacity: 0.26;
}

.legal-bg-left,
.legal-bg-right {
    position: fixed;
    z-index: 1;
    bottom: 0;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 16px 24px rgba(0, 0, 0, 0.48)) drop-shadow(0 0 18px rgba(166, 213, 245, 0.16));
}

.legal-bg-left {
    left: 0;
    width: clamp(210px, 25vw, 390px);
    max-height: 74vh;
    opacity: 0.78;
}

.legal-bg-right {
    right: 0;
    width: clamp(200px, 24vw, 380px);
    max-height: 74vh;
    opacity: 0.78;
}

.legal-nav-shell {
    position: relative;
    z-index: 4;
    width: min(96%, 1180px);
    margin: 14px auto 12px;
}

.legal-navigation {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) minmax(0, 1.2fr) minmax(120px, 1fr);
    align-items: center;
    column-gap: 14px;
    width: 100%;
    padding: 14px 16px;
    border: 1px solid rgba(200, 184, 150, 0.64);
    border-radius: 22px;
    background: linear-gradient(120deg, rgba(244, 234, 214, 0.84), rgba(232, 220, 197, 0.8));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
    box-sizing: border-box;
}

.legal-nav-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-start;
}

.legal-nav-buttons-right {
    justify-content: flex-end;
}

.legal-status {
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: #2f3a45;
}

.legal-nav-tab {
    min-height: 30px;
    padding: 0 14px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(34, 52, 66, 0.55);
    cursor: pointer;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    color: #e9eef3;
    background: linear-gradient(160deg, #39576d, #253c4c);
    box-shadow: 0 5px 12px rgba(22, 31, 38, 0.2);
    transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.legal-nav-tab:hover,
.legal-nav-tab:focus-visible {
    color: #e9eef3;
    text-decoration: none;
    background: linear-gradient(160deg, #45657d, #2a4558);
    transform: translateY(-1px);
    box-shadow: var(--legal-shadow-soft);
}

.legal-shell {
    position: relative;
    z-index: 3;
    width: min(96%, 1180px);
    margin: 0 auto 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.legal-card {
    border: 1px solid var(--legal-line);
    border-radius: 14px;
    background: linear-gradient(180deg, var(--legal-paper), var(--legal-paper-dim));
    box-shadow: var(--legal-shadow-soft);
    padding: 14px 16px;
    box-sizing: border-box;
}

.legal-hero-card {
    text-align: center;
    box-shadow: var(--legal-shadow-main);
}

.legal-hero-logo-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 6px;
}

.legal-hero-logo {
    width: min(100%, 420px);
    height: auto;
    filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.3)) drop-shadow(0 0 12px rgba(168, 212, 243, 0.2));
}

.legal-title {
    margin: 6px 0 0;
    font-family: "Copperplate", "Times New Roman", serif;
    font-size: 31px;
    line-height: 1.1;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #25303a;
}

.legal-subtitle {
    margin: 10px auto 0;
    max-width: 840px;
    font-size: 15px;
    line-height: 1.45;
    color: #495f73;
}

.legal-anchor-grid {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.legal-anchor {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(34, 52, 66, 0.55);
    background: linear-gradient(160deg, #39576d, #253c4c);
    color: #edf4f9;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    transition: transform 0.14s ease, background 0.14s ease, box-shadow 0.14s ease;
}

.legal-anchor:hover,
.legal-anchor:focus-visible {
    color: #edf4f9;
    text-decoration: none;
    background: linear-gradient(160deg, #466882, #2a4558);
    transform: translateY(-1px);
    box-shadow: var(--legal-shadow-soft);
}

.legal-section-title {
    margin: 0 0 10px;
    font-family: "Copperplate", "Times New Roman", serif;
    font-size: 24px;
    line-height: 1.15;
    letter-spacing: 0.02em;
    color: #283a4a;
}

.legal-subhead {
    margin: 12px 0 6px;
    font-family: "Copperplate", "Times New Roman", serif;
    font-size: 17px;
    letter-spacing: 0.02em;
    color: #2f4b62;
}

.legal-card p {
    margin: 8px 0;
    font-size: 15px;
    line-height: 1.5;
    color: #405769;
}

.legal-list {
    margin: 8px 0 0;
    padding-left: 18px;
}

.legal-list li {
    margin: 6px 0;
    font-size: 15px;
    line-height: 1.45;
    color: #41596c;
}

.legal-list strong {
    color: #274057;
}

.legal-footer {
    position: relative;
    z-index: 3;
    width: min(96%, 1180px);
    margin: 0 auto 18px;
    border: 1px solid var(--legal-line);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(244, 234, 214, 0.9), rgba(235, 222, 198, 0.86));
    box-shadow: var(--legal-shadow-soft);
    padding: 12px 16px;
    text-align: center;
    box-sizing: border-box;
}

.legal-footer-text {
    margin: 0;
    color: #334d62;
    font-size: 14px;
    line-height: 1.4;
}

.legal-footer-muted {
    margin-top: 4px;
    color: #5f7385;
    font-size: 13px;
}

a {
    color: var(--legal-link);
}

a:hover {
    color: var(--legal-link-hover);
}

@media screen and (max-width: 900px) {
    .legal-nav-shell,
    .legal-shell,
    .legal-footer {
        width: calc(100% - 12px);
    }

    .legal-navigation {
        grid-template-columns: 1fr;
        row-gap: 8px;
    }

    .legal-nav-buttons,
    .legal-nav-buttons-right {
        justify-content: center;
    }

    .legal-title {
        font-size: 25px;
    }

    .legal-subtitle,
    .legal-card p,
    .legal-list li {
        font-size: 14px;
    }

    .legal-bg-left,
    .legal-bg-right {
        opacity: 0.52;
        max-height: 56vh;
    }

    .legal-bg-left {
        width: clamp(190px, 38vw, 300px);
    }

    .legal-bg-right {
        width: clamp(185px, 36vw, 290px);
    }
}

@media screen and (max-width: 640px) {
    .legal-nav-shell {
        margin-top: 8px;
        margin-bottom: 8px;
    }

    .legal-navigation {
        padding: 10px;
        border-radius: 16px;
    }

    .legal-shell {
        gap: 8px;
    }

    .legal-card,
    .legal-footer {
        padding: 10px 11px;
        border-radius: 12px;
    }

    .legal-hero-logo {
        width: min(100%, 320px);
    }

    .legal-title {
        font-size: 21px;
    }

    .legal-section-title {
        font-size: 18px;
        margin-bottom: 8px;
    }

    .legal-subhead {
        font-size: 15px;
    }

    .legal-anchor-grid {
        gap: 6px;
    }

    .legal-anchor {
        min-height: 28px;
        padding: 0 10px;
        font-size: 12px;
    }

    .legal-card p,
    .legal-list li {
        font-size: 13px;
        line-height: 1.4;
    }

    .legal-footer-text,
    .legal-footer-muted {
        font-size: 12px;
    }

    .legal-bg-left,
    .legal-bg-right {
        opacity: 0.38;
        max-height: 44vh;
    }

    .legal-bg-left {
        width: clamp(160px, 44vw, 240px);
    }

    .legal-bg-right {
        width: clamp(150px, 41vw, 230px);
    }
}
