:root {
    --page-bg: #130f14;
    --brand-pink: #ff5c70;
    --brand-pink-soft: #ff7c8b;
    --brand-purple: #6c37f4;
    --brand-purple-light: #ab55ff;
    --brand-gold: #ffcf70;
    --panel-border: rgba(228, 171, 255, 0.34);
    --panel-bg: linear-gradient(145deg, rgba(38, 23, 62, 0.92), rgba(84, 52, 117, 0.82));
    --modal-bg: rgba(7, 4, 11, 0.76);
    --text-main: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.82);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    overflow-x: hidden;
    background: var(--page-bg);
    color: var(--text-main);
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    position: relative;
}

body::before,
body::after {
    content: "";
    position: fixed;
    inset: auto;
    z-index: -1;
    pointer-events: none;
    filter: blur(60px);
}

body::before {
    top: 7%;
    left: 50%;
    width: 290px;
    height: 160px;
    background: rgba(255, 96, 125, 0.25);
    transform: translateX(-50%);
}

body::after {
    right: -40px;
    bottom: 90px;
    width: 180px;
    height: 180px;
    background: rgba(115, 73, 255, 0.18);
}

.page-shell {
    min-height: 100vh;
}

.main-image-section {
    position: fixed;
    inset: 0;
    z-index: -2;
    overflow: hidden;
}

.main-image-section::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(13, 9, 17, 0.18) 0%, rgba(13, 9, 17, 0.4) 34%, rgba(13, 9, 17, 0.72) 100%),
        radial-gradient(circle at 50% 18%, rgba(255, 113, 141, 0.2), transparent 30%);
}

.scrolling-images {
    height: 160%;
    animation: backgroundScroll 38s linear infinite;
}

.scrolling-image {
    height: 50%;
    background-image: url("/static/x/assets/myloveday/changtu-mobile.jpg");
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    will-change: transform;
}

@keyframes backgroundScroll {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(-50%);
    }
}

/* 首屏文案保持手机落地页的聚焦感，避免在窄屏上压住主图。 */
.hero-copy {
    position: fixed;
    top: 12px;
    left: 50%;
    z-index: 2;
    width: min(100vw, 414px);
    transform: translateX(-50%);
    padding: 0 14px;
}

.hero-copy::after {
    content: "";
    position: absolute;
    top: -8px;
    left: 18px;
    right: 18px;
    height: 136px;
    border-radius: 30px;
    background: linear-gradient(180deg, rgba(20, 12, 22, 0.2), rgba(20, 12, 22, 0));
    pointer-events: none;
    z-index: -1;
}

.title-text {
    margin-left: 12px;
    color: #fff;
    font-size: clamp(34px, 11vw, 52px);
    font-style: italic;
    font-weight: 900;
    line-height: 0.96;
    letter-spacing: 0.2px;
    background: linear-gradient(180deg, #ff98a5 0%, #ff5c70 55%, #ffb35c 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 14px 30px rgba(0, 0, 0, 0.38);
}

.left-image-text-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    padding: 10px 12px 10px 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 22px;
    background:
        linear-gradient(135deg, rgba(49, 20, 28, 0.72), rgba(75, 38, 44, 0.5)),
        rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(10px);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
}

.left-image {
    width: 58px;
    height: 58px;
    border: 2px solid rgba(255, 255, 255, 0.28);
    border-radius: 18px;
    overflow: hidden;
    flex: 0 0 auto;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.22);
}

.left-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.text-label {
    font-size: clamp(16px, 4.3vw, 18px);
    font-weight: 700;
    font-style: italic;
    line-height: 1.3;
    color: var(--text-main);
    text-shadow: 0 3px 10px rgba(0, 0, 0, 0.52);
}

.thumbnails {
    position: fixed;
    left: 0;
    bottom: 98px;
    z-index: 2;
    width: 100%;
    overflow: hidden;
    mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.thumbnails-container {
    display: flex;
    gap: 12px;
    width: max-content;
    padding: 0 12px;
    animation: thumbnailScroll 26s linear infinite;
}

@keyframes thumbnailScroll {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-50%);
    }
}

.thumbnail {
    width: clamp(108px, 30vw, 126px);
    height: clamp(176px, 49vw, 206px);
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 24px;
    object-fit: cover;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.38);
    opacity: 0.94;
}

.deferred-thumbnail {
    opacity: 0.01;
    transition: opacity 0.35s ease;
}

.deferred-thumbnail.thumbnail-ready {
    opacity: 0.94;
}

.thumbnail:nth-child(odd) {
    transform: translateY(-8px);
}

.thumbnail:nth-child(even) {
    transform: translateY(8px);
}

.download-button {
    position: fixed;
    left: 50%;
    bottom: 12px;
    z-index: 3;
    width: min(calc(100vw - 24px), 378px);
    height: 72px;
    transform: translateX(-50%);
    border: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    background: linear-gradient(135deg, #ff667b 0%, #ff7188 42%, #ff8758 100%);
    color: #fff;
    font-size: clamp(22px, 6vw, 27px);
    font-weight: 900;
    cursor: pointer;
    letter-spacing: 0.3px;
    box-shadow: 0 18px 44px rgba(255, 90, 112, 0.34);
    animation: buttonPulse 2s ease-in-out infinite;
}

@keyframes buttonPulse {
    0%, 100% {
        transform: translateX(-50%) scale(1);
    }
    50% {
        transform: translateX(-50%) scale(1.04);
    }
}

.custom-toast {
    position: fixed;
    top: 16px;
    left: 50%;
    z-index: 8;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 280px;
    max-width: calc(100vw - 32px);
    padding: 12px 18px;
    border-radius: 12px;
    background: rgba(255, 87, 87, 0.94);
    color: #fff;
    transform: translateX(-50%) translateY(-120px);
    transition: transform 0.28s ease;
}

.custom-toast.show {
    transform: translateX(-50%) translateY(0);
}

.toast-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, 0.9);
    font-size: 12px;
    font-weight: 900;
}

.main-container,
.modal-overlay,
.loading-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--modal-bg);
    z-index: 6;
}

.main-container__content {
    width: min(100%, 520px);
}

.text-info {
    margin-bottom: 24px;
    text-align: center;
}

.text-info h2 {
    font-size: 26px;
    font-weight: 700;
    line-height: 1.28;
    text-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.text-info p {
    margin-top: 10px;
    font-size: 19px;
    color: var(--text-muted);
}

.login-box,
.modal-card,
.loading-card {
    border: 2px solid var(--panel-border);
    border-radius: 22px;
    background: var(--panel-bg);
    backdrop-filter: blur(10px);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
}

.login-box {
    padding: 28px 18px 18px;
}

.login-box.error-shake {
    animation: shakeCard 0.4s ease-in-out;
    border-color: rgba(255, 77, 77, 0.95);
}

@keyframes shakeCard {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-8px);
    }
    50% {
        transform: translateX(8px);
    }
    75% {
        transform: translateX(-4px);
    }
}

.input-label {
    display: block;
    margin-bottom: 16px;
    text-align: center;
    font-size: 20px;
    font-weight: 800;
}

.iti {
    width: 100%;
}

.iti__flag-container {
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px 0 0 10px;
}

.iti__selected-flag {
    background: transparent !important;
}

.iti__country-list {
    background: #1f1828 !important;
    border: 1px solid rgba(191, 149, 247, 0.45) !important;
    border-radius: 12px !important;
}

.phone-input {
    width: 100%;
    height: 56px;
    border: 2px solid rgba(191, 149, 247, 0.32);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font-size: 17px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.phone-input:focus {
    border-color: rgba(255, 207, 112, 0.66);
    box-shadow: 0 0 0 4px rgba(255, 207, 112, 0.12);
}

.continue-btn,
.copy-btn,
.retry-btn {
    display: block;
    width: min(100%, 560px);
    margin-top: 20px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--brand-purple), var(--brand-purple-light));
    color: #fff;
    font-size: 20px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 16px 34px rgba(118, 52, 234, 0.28);
}

.continue-btn {
    height: 58px;
}

.modal-card {
    position: relative;
    width: min(100%, 560px);
    padding: 28px 20px;
    text-align: center;
}

.modal-card h3 {
    font-size: 30px;
    margin-bottom: 16px;
}

.modal-subtext,
.modal-card p {
    color: var(--text-muted);
    line-height: 1.5;
}

.code-display-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 22px 0;
}

.code-char {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 56px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(191, 149, 247, 0.45);
    font-size: 26px;
    font-weight: 900;
}

.copy-btn,
.retry-btn {
    height: 50px;
    margin-top: 18px;
}

.tip-box {
    margin-top: 16px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.06);
    text-align: left;
}

.modal-close-btn {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 24px;
    cursor: pointer;
}

.success-card {
    padding-top: 34px;
}

.success-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 88px;
    height: 88px;
    margin: 18px auto;
    border-radius: 999px;
    background: rgba(88, 211, 113, 0.18);
    border: 2px solid rgba(88, 211, 113, 0.45);
    color: #58d371;
    font-size: 46px;
    font-weight: 900;
}

.loading-card {
    width: min(100%, 320px);
    padding: 32px 20px;
    text-align: center;
}

.spinner {
    width: 42px;
    height: 42px;
    margin: 0 auto 16px;
    border: 4px solid rgba(255, 255, 255, 0.16);
    border-top-color: #fff;
    border-radius: 999px;
    animation: rotate 0.9s linear infinite;
}

@keyframes rotate {
    to {
        transform: rotate(360deg);
    }
}

@media (min-width: 768px) {
    body {
        display: flex;
        justify-content: center;
    }

    .main-image-section,
    .hero-copy,
    .thumbnails {
        width: 400px;
        left: 50%;
        transform: translateX(-50%);
    }

    .download-button {
        width: 360px;
        height: 76px;
    }

    .title-text {
        font-size: 50px;
        margin-left: 20px;
    }

    .text-label {
        font-size: 16px;
    }

    .thumbnails {
        bottom: 84px;
    }

    .left-image-text-container {
        margin-top: 14px;
    }
}

@media (max-width: 480px) {
    .hero-copy {
        top: 10px;
    }

    .left-image-text-container {
        align-items: flex-start;
    }

    .text-label {
        max-width: 230px;
    }

    .thumbnail {
        width: 104px;
        height: 170px;
        border-radius: 22px;
    }

    .download-button {
        bottom: max(10px, env(safe-area-inset-bottom));
        height: 68px;
        border-radius: 22px;
    }
}
