/* 页面基础样式 */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    height: 100%;
    height: 100dvh;
}

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

body {
    min-height: 100vh;
    min-height: 100dvh;
    background: #0a0c1a;
    font-family: 'PingFang SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

button,
a {
    cursor: pointer;
}

/* 永久收藏页主容器 */
.bookmark-page {
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow: hidden;
    background-color: #0a0c1a;
}

.bookmark-page__scale-wrap {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    height: 100vh;
    height: 100dvh;
    display: flex;
    justify-content: center;
    overflow: hidden;
}

.bookmark-page__panel {
    --visual-height: calc(100vw * 589 / 375);
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    height: 100vh;
    height: 100dvh;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    background-color: #0a0c1a;
}

.bookmark-page__visual {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: var(--visual-height);
    overflow: hidden;
    background-color: #0a0c1a;
    background-image: url('./images/bookmark-page-bg.png');
    background-repeat: no-repeat;
    background-position: top center;
    background-size: 100% auto;
}

.bookmark-page__visual-fade {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 27.84%;
    background: linear-gradient(180deg, rgba(10, 12, 26, 0) 0%, #0a0c1a 100%);
}

.bookmark-page__hero {
    position: absolute;
    top: calc(var(--visual-height) * 396 / 589);
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.bookmark-page__hero-logo {
    width: 120px;
    height: 44px;
    display: block;
    object-fit: cover;
    filter: drop-shadow(0 0 30px rgba(255, 56, 242, 0.5));
}

.bookmark-page__hero-title {
    margin: 0;
    background: linear-gradient(90deg, #ffffff 0%, #e9d4ff 50%, #bedbff 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.4;
    white-space: nowrap;
}

.bookmark-page__hero-title span {
    background: none;
    background-clip: border-box;
    -webkit-background-clip: border-box;
    -webkit-text-fill-color: #ff7abf;
    color: #ff7abf;
    margin-right: 8px;
}

.bookmark-page__actions {
    position: absolute;
    top: calc(var(--visual-height) * 514 / 589);
    left: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

.bookmark-page__primary {
    width: 63.2%;
    max-width: 237px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 28px;
    background: #ff7abf;
    color: #f7f7f7;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
}

.bookmark-page__primary-icon {
    width: 20px;
    height: 20px;
    position: relative;
}

.bookmark-page__primary-icon::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 4px;
    width: 10px;
    height: 10px;
    border-top: 2px solid #ffffff;
    border-right: 2px solid #ffffff;
    transform: rotate(45deg);
}

.bookmark-page__secondary {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 0;
    padding: 0;
    background: transparent;
    color: #ff7abf;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.2;
    white-space: nowrap;
}

.bookmark-page__secondary-icon {
    width: 14px;
    height: 14px;
    position: relative;
}

.bookmark-page__secondary-icon::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 1px;
    width: 2px;
    height: 7px;
    background: currentColor;
}

.bookmark-page__secondary-icon::after {
    content: '';
    position: absolute;
    left: 2px;
    top: 7px;
    width: 10px;
    height: 4px;
    border: 2px solid currentColor;
    border-top: 0;
    border-radius: 0 0 3px 3px;
}

.bookmark-page__follow {
    position: absolute;
    left: 50%;
    bottom: 3.448%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    width: 77.333%;
    max-width: 290px;
    margin: 0;
}

.bookmark-page__follow-text {
    margin: 0;
    color: #6b7280;
    text-align: center;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.2;
}

.bookmark-page__social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.bookmark-page__social-item {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 12px;
    padding: 10px;
    background: #1a1d30;
    overflow: hidden;
    text-decoration: none;
}

.bookmark-page__social-icon {
    width: 24px;
    height: 24px;
    display: block;
}

.bookmark-page__social-icon img {
    width: 24px;
    height: 24px;
    display: block;
    object-fit: contain;
}

/* 邀请海报弹层样式 */
.poster-overlay {
    position: fixed;
    inset: 0;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
}

.poster-overlay[hidden] {
    display: none;
}

.poster-card {
    width: 331px;
    min-height: 426px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 21px 14px 16px;
    overflow: hidden;
    border: 1px solid rgba(168, 85, 247, 0.4);
    border-radius: 12px;
    box-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
    box-sizing: border-box;
    background: radial-gradient(circle at 0% 0%, rgba(255, 47, 193, 0.2) 0, rgba(255, 47, 193, 0) 42%), #0e0c24;
}

.poster-card__brand {
    width: 100%;
    max-width: 302px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    margin-bottom: 8px;
}

.poster-card__brand span {
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    line-height: 16px;
}

.poster-card__brand-logo {
    width: 88px;
    height: 32px;
    display: block;
    flex-shrink: 0;
    object-fit: cover;
}

.poster-card__image-wrap {
    width: 303px;
    height: 322px;
    flex-shrink: 0;
    display: grid;
    grid-template-rows: 1fr;
    overflow: hidden;
    border-radius: 12px;
}

.poster-card__image {
    grid-row: 1;
    grid-column: 1;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    object-position: center;
}

.poster-card__qr-row {
    grid-row: 1;
    grid-column: 1;
    align-self: end;
    justify-self: center;
    width: 280px;
    height: 90px;
    margin-bottom: 24px;
    display: grid;
    grid-template-columns: 76px 1fr;
    column-gap: 21px;
    align-items: center;
    padding: 8px;
    border-radius: 12px;
    background: rgba(255, 201, 229, 0.24);
    -webkit-backdrop-filter: blur(13.699999809265137px);
    backdrop-filter: blur(13.699999809265137px);
}

.poster-card__qr-row p {
    margin: 0;
    color: #ffffff;
    font-size: 12px;
    font-weight: 500;
    line-height: 17px;
}

.poster-card__qr {
    width: 76px;
    height: 75px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    background: #ffffff;
}

.poster-card__qr-image {
    width: 66px;
    height: 66px;
    display: block;
    object-fit: contain;
}

.poster-card__site {
    width: 100%;
    margin-top: 8px;
    color: #f7f7f7;
    font-size: 12px;
    line-height: 17px;
    text-align: center;
    flex-shrink: 0;
}

/* html2canvas 截图兼容：毛玻璃降级、高度贴合内容 */
.poster-card.is-capturing {
    min-height: auto;
    height: auto;
}

.poster-card.is-capturing .poster-card__qr-row {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(255, 201, 229, 0.38);
}

.poster-save-button {
    border: 0;
    padding: 0;
    font-size: 15px;
    font-weight: 500;
    line-height: 21px;
    width: 145px;
    height: 42px;
    margin-top: 19px;
    border-radius: 8px;
    background: #ff7abf;
    color: #f7f7f7;
}

.poster-save-button:disabled {
    opacity: 0.7;
}

.poster-close-button {
    position: relative;
    width: 20px;
    height: 20px;
    margin-top: 20px;
    border: 0;
    padding: 0;
    background: transparent;
}

.poster-close-button::before,
.poster-close-button::after {
    content: '';
    position: absolute;
    left: 9px;
    top: 0;
    width: 2px;
    height: 20px;
    border-radius: 1px;
    background: #ffffff;
}

.poster-close-button::before {
    transform: rotate(45deg);
}

.poster-close-button::after {
    transform: rotate(-45deg);
}

/* PC 端适配：整体约 600px 居中 */
@media (min-width: 768px) {
    .bookmark-page {
        align-items: center;
        min-height: 100vh;
        padding: 32px 24px;
        overflow-y: auto;
        background-color: #03040c;
    }

    .bookmark-page__scale-wrap {
        width: 600px;
        max-width: 600px;
        height: 1299px;
        min-height: 1299px;
        border-radius: 16px;
        box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
    }

    .bookmark-page__panel {
        width: 375px;
        height: 812px;
        min-height: auto;
        transform: scale(1.6);
        transform-origin: top center;
    }

    .bookmark-page__visual {
        height: 589px;
        background-size: 100% 100%;
    }

    .bookmark-page__visual-fade {
        height: 164px;
    }

    .bookmark-page__hero {
        top: 396px;
    }

    .bookmark-page__actions {
        top: 514px;
    }

    .bookmark-page__primary {
        width: 237px;
        max-width: none;
    }

    .bookmark-page__follow {
        bottom: 28px;
        width: 290px;
        max-width: none;
    }

    .bookmark-page__primary,
    .bookmark-page__secondary,
    .bookmark-page__social-item,
    .poster-save-button,
    .poster-close-button {
        transition: opacity 0.2s ease, transform 0.2s ease;
    }
}

@media (min-width: 768px) and (hover: hover) {
    .bookmark-page__primary:hover {
        background: #ff94cb;
        transform: translateY(-1px);
    }

    .bookmark-page__secondary:hover {
        opacity: 0.85;
    }

    .bookmark-page__social-item:hover {
        background: #252a45;
        transform: translateY(-1px);
    }

    .poster-save-button:hover:not(:disabled) {
        background: #ff94cb;
        transform: translateY(-1px);
    }

    .poster-close-button:hover {
        opacity: 0.8;
    }
}

@media (min-width: 1200px) {
    .bookmark-page {
        padding: 48px 24px;
    }

    .bookmark-page__scale-wrap {
        box-shadow: 0 32px 96px rgba(0, 0, 0, 0.65);
    }
}
