:root {
    --grad-1: #2b1a55;
    --grad-2: #432a8e;
    --grad-3: #12072e; /* 原 #1c1138 -> 更纯深紫 */
    --accent: #a987ff;
    --accent-soft: #c9b8ff;
    --accent-strong: #8d63ff;
    --accent-glow: 0 0 6px #b998ff, 0 0 14px #b998ff;
    --radius-btn: 14px;
    --parallaxX: 0;
    --parallaxY: 0;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Source Sans 3', 'Arial', sans-serif;
    color: #eceaff;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    background: radial-gradient(circle at 25% 32%, #342460 0%, #120a25 65%) fixed;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: linear-gradient(130deg, var(--grad-1), var(--grad-2), var(--grad-3));
    background-size: 180% 180%;
    animation: bgMove 18s ease-in-out infinite;
    mix-blend-mode: screen;
    opacity: .52;
    pointer-events: none;
}

@keyframes bgMove {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    background: repeating-linear-gradient(to bottom, rgba(255, 255, 255, .04) 0 2px, transparent 2px 4px);
    mix-blend-mode: overlay;
    animation: scan 9s linear infinite;
    pointer-events: none;
}

@keyframes scan {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(4px);
    }
}

#moonLayer {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

#moonLayer::before {
    content: "";
    position: absolute;
    /*inset: -4%;*/
    inset: -15% !important;
    background: radial-gradient(circle at 62% 30%, rgba(255, 255, 255, .18), rgba(255, 255, 255, 0) 60%), url("https://cdn.orbitmoonalpha.com/moon.webp") center/cover no-repeat;
    /*filter: brightness(1.05) contrast(1.07) saturate(1.18);*/
    opacity: .8;
    /*mix-blend-mode: screen;*/
    transform: translate3d(calc(var(--parallaxX) * 1.25px),
    calc(var(--parallaxY) * 1.25px),
    0) scale(1.12) !important;
    will-change: transform;
    transition: opacity .6s ease;
}

#particles {
    position: fixed;
    inset: 0;
    z-index: 1;
}

.container {
    position: fixed;
    top: clamp(56px, 14vh, 140px); /* 依据窗口高度自适应的上边距，可按需改成固定值例如 120px */
    left: 50%;
    /*transform: translateX(-50%); !* 只水平居中 *!*/
    margin: 0; /* 移除原 margin 影响 */
    width: min(92%, 570px);
    margin-left: calc(min(92%, 570px) / -2);
    display: flex;
    z-index: 2;
    padding: 52px 46px 60px;
    border-radius: 28px;
    background: rgba(70, 50, 115, 0.18);
    box-shadow: 0 4px 22px -4px rgba(0, 0, 0, .65),
    0 0 0 1px rgba(200, 180, 255, .10),
    0 0 36px -6px rgba(165, 130, 255, .45);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
}

.content-body {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    gap: 34px;
}

.local-footer {
    margin: 10px 0 0;
    text-align: center;
    font-size: .88rem;
    letter-spacing: .14em;
    color: #9d8fc2;
    padding-top: 12px;
    border-top: 1px solid rgba(200, 180, 255, .16);
}

.local-footer a {
    color: #ceb8ff;
    text-decoration: none;
}

.local-footer a:hover {
    text-decoration: underline;
}

h1 {
    font-family: 'Orbitron', 'Source Sans 3', sans-serif;
    margin: 0 0 26px;
    font-size: clamp(2rem, 4.3vw, 3rem);
    letter-spacing: .065em;
    display: inline-flex;
    align-items: center;
    background: linear-gradient(95deg, #e0d2ff 0%, #ffffff 30%, #c3adff 55%, #9d7bff 78%);
    -webkit-background-clip: text;
    color: transparent;
    text-shadow: 0 0 22px rgba(185, 152, 255, .35);
    position: relative;
}

h1.dynamic-light {
    --mx: 50%;
    --my: 50%;
    background: radial-gradient(circle at var(--mx) var(--my), rgba(255, 255, 255, .95) 0%, #f4efff 10%, #e7dbff 22%, #d2c3ff 34%, #b69eff 46%, rgba(157, 123, 255, .55) 59%, rgba(157, 123, 255, .15) 70%, rgba(157, 123, 255, 0) 78%), linear-gradient(95deg, #e0d2ff 0%, #ffffff 30%, #c3adff 55%, #9d7bff 78%);
    -webkit-background-clip: text;
    color: transparent;
    filter: drop-shadow(0 0 7px rgba(170, 135, 255, .38)) drop-shadow(0 0 18px rgba(155, 120, 255, .28));
    transition: background-position .15s, filter .35s;
}

h1.dynamic-light.is-idle {
    filter: drop-shadow(0 0 5px rgba(150, 110, 255, .28));
}

.title-icon {
    width: 48px;
    height: 48px;
    object-fit: contain;
    margin-left: 16px;
    opacity: .62 !important;
    filter: drop-shadow(0 0 6px rgba(155, 120, 255, .55));
    transition: transform .9s cubic-bezier(.55, .2, .2, 1), filter .5s;
}

h1:hover .title-icon {
    transform: none;
}

.typewriter {
    min-height: 54px;
    font-size: clamp(0.95rem, 1rem + .35vw, 1.1rem);
    line-height: 1.55;
    letter-spacing: .045em;
    position: relative;
}

.cursor {
    display: inline-block;
    width: 10px;
    margin-left: 4px;
    background: var(--accent);
    animation: blink 1s steps(2, start) infinite;
    height: 1.15em;
    transform: translateY(2px);
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

.btn-row {
    justify-content: center;
    margin-top: 44px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

/* 优化后的按钮样式 */
a.btn {
    position: relative;
    isolation: isolate;
    font-family: inherit;
    font-weight: 600;
    letter-spacing: .09em;
    font-size: clamp(.92rem, .85rem + .35vw, 1.78rem);
    padding: 15px 56px;
    min-width: 240px;
    border-radius: var(--radius-btn);
    border: 1px solid rgba(190, 160, 255, .55);
    /* 修改背景，降低白色成分，整体更深邃 */
    background: linear-gradient(180deg, rgba(175, 140, 255, 0.25), rgba(55, 35, 95, 0.75)),
    radial-gradient(circle at 30% 18%, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0) 70%);
    background-blend-mode: overlay;
    color: #efe9ff;
    text-decoration: none;
    cursor: pointer;
    /* 调整内外阴影，使按钮更具立体感 */
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.10),
    0 0 0 0 rgba(165, 130, 255, 0.4),
    0 10px 30px -12px rgba(0, 0, 0, 0.70);
    transition: transform 0.45s cubic-bezier(.4, .14, .13, 1), box-shadow 0.45s;
    overflow: hidden;
}

/* 使用 ::before 作为高光层 */
a.btn::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.30) 0, rgba(255, 255, 255, 0) 70%);
    mix-blend-mode: overlay;
    opacity: 0;
    transition: opacity 0.3s;
}

a.btn:hover {
    transform: translateY(-4px);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15),
    0 8px 20px -2px rgba(138, 43, 226, 0.60),
    0 12px 28px -4px rgba(0, 0, 0, 0.8);
}

a.btn:hover::before {
    opacity: 0.4;
}

a.btn:active {
    transform: translateY(0);
    transition: transform 0.12s;
}

footer {
    position: relative;
    z-index: 2;
    text-align: center;
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    color: #9d8fc2;
    margin-bottom: 38px;
}

footer a {
    color: #ceb8ff;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

.btn-ripple {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    mix-blend-mode: screen;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 70%);
    animation: ripple 0.9s ease-out forwards;
    will-change: transform, opacity;
}

@keyframes ripple {
    0% {
        transform: scale(0.15);
        opacity: 0.95;
    }
    55% {
        transform: scale(1);
        opacity: 0.45;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

[data-aos] {
    will-change: transform, opacity;
}

@media (prefers-reduced-motion: reduce) {
    body::before, body::after {
        animation: none;
    }

    .cursor {
        animation: none;
        background: transparent;
    }

    h1.dynamic-light {
        background: linear-gradient(95deg, #e0d2ff, #ffffff, #c3adff, #9d7bff) !important;
    }

    #moonLayer::before {
        transform: none !important;
    }
}

@media (max-width: 560px) {
    .container {
        padding: 44px 30px 56px;
    }

    .btn-row {
        flex-direction: column;
    }

    a.btn {
        width: 100%;
        text-align: center;
    }
}

html, body {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
}

html {
    background: radial-gradient(circle at 25% 32%, #342460 0%, #120a25 65%) fixed;
}

body {
    background: transparent;
}

/* 低高度设备（如横屏手机 / 小窗口）回退为可滚动避免裁切 */
@media (max-height: 650px) {
    html, body {
        overflow: auto;
    }

    .container {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        margin: clamp(40px, 10vh, 140px) auto 48px !important;
    }

    .content-body {
        min-height: 0;
    }
}

body, h1, h2, h3, h4, h5, h6, .btn, .local-footer, .typewriter {
    font-family: 'Source Sans 3', 'Arial', sans-serif !important;
}

body.modal-open {
    overflow: hidden;
}

.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 10, 25, .55);
    backdrop-filter: blur(14px) saturate(150%);
    -webkit-backdrop-filter: blur(14px) saturate(150%);
    opacity: 0;
    pointer-events: none;
    transition: opacity .35s ease;
    z-index: 1100;
}

.modal.is-open {
    opacity: 1;
    pointer-events: auto;
}

.modal-dialog {
    width: min(92%, 680px);
    max-height: min(86vh, 760px);
    background: linear-gradient(155deg, rgba(70, 50, 115, .55), rgba(40, 25, 70, .65));
    border: 1px solid rgba(200, 180, 255, .18);
    border-radius: 28px;
    padding: 42px 48px 36px;
    box-shadow: 0 12px 48px -10px rgba(0, 0, 0, .75),
    0 0 0 1px rgba(170, 140, 255, .10),
    0 0 40px -8px rgba(150, 110, 255, .45);
    position: relative;
    color: #e9e4ff;
    transform: translateY(28px);
    animation: modalIn .55s cubic-bezier(.55, .2, .2, 1) forwards;
}

@keyframes modalIn {
    to {
        transform: translateY(0);
    }
}

.modal-dialog h2 {
    margin: 0 0 20px;
    font-size: clamp(1.4rem, 1.1rem + .9vw, 2rem);
    letter-spacing: .08em;
    background: linear-gradient(95deg, #f5f2ff, #d9caff 55%, #b08aff 85%);
    -webkit-background-clip: text;
    color: transparent;
    text-shadow: 0 0 20px rgba(185, 152, 255, .35);
}

.modal-scroll {
    max-height: calc(70vh - 140px);
    overflow: auto;
    padding-right: 6px;
    line-height: 1.6;
    font-size: .95rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(185, 160, 255, .35) transparent;
}

.modal-scroll::-webkit-scrollbar {
    width: 8px;
}

.modal-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.modal-scroll::-webkit-scrollbar-thumb {
    background: linear-gradient(var(--grad-1), var(--grad-2));
    border-radius: 20px;
    opacity: .6;
}

.modal-scroll p {
    margin: 0 0 1em;
}

.modal-scroll p:last-child {
    margin-bottom: 0;
}

.modal-actions {
    margin-top: 30px;
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    flex-wrap: wrap;
}

.modal-ok, .modal-close {
    font: inherit;
    cursor: pointer;
    border: 1px solid rgba(190, 160, 255, .55);
    background: linear-gradient(180deg, rgba(175, 140, 255, .25), rgba(55, 35, 95, .75));
    color: #f0eaff;
    letter-spacing: .06em;
    padding: 12px 28px;
    border-radius: var(--radius-btn, 16px);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .10),
    0 8px 22px -10px rgba(0, 0, 0, .65);
    transition: transform .35s, box-shadow .35s;
}

.modal-ok:hover, .modal-close:hover {
    transform: translateY(-3px);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14),
    0 10px 26px -8px rgba(140, 60, 225, .55),
    0 14px 32px -6px rgba(0, 0, 0, .75);
}

.modal-ok:active, .modal-close:active {
    transform: none;
    transition: transform .15s;
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    width: 40px;
    height: 40px;
    padding: 0;
    font-size: 1.4rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, rgba(175, 140, 255, .18), rgba(55, 35, 95, .65));
}

@media (max-width: 560px) {
    .modal-dialog {
        padding: 34px 30px 30px;
    }

    .modal-close {
        top: 10px;
        right: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .modal-dialog {
        animation: none;
        transform: none;
    }
}