

.vni {
    font-family: wedding-font-vni;
    color: #cc0000;
}

#wrapper {
    width: 80vw;
    max-width: 90%;
    overflow: hidden;
}

.open-book {
    width: 70%;
    height: 70%;
    margin: 0 auto;
    position: relative;
    box-sizing: border-box;
}

.card-welcome-all {
    display: grid;
    grid-template-columns: 1fr 1fr; /* 改为等宽的两列，使用相对单位 */
    position: relative; /* 添加相对定位 */
    width: 100%; /* 确保占满父容器宽度 */
}

.card-welcome,
.card-invite {
    width: 90%;
    height: auto;
    margin: 0;
    position: relative;
    box-sizing: border-box;
    border: 1px solid red; /* 调试边框 */
    left: 50%; /* 类似 .open-book:after 的定位方式 */
    transform: translateX(-50%); /* 水平居中 */
}




img {
    max-width: 100%;
    height: auto;
}

#container {
    float: left;
    padding: 1em;
    width: 100%;
}

/*** OPEN BOOK ***/
.open-book {
    background: #fff;
    box-shadow: rgba(0, 0, 0, 0.5) 0 1em 3em;
    color: #000;
    padding: 2em;
}

/*** MEDIA QUERIES ***/
@media only screen and (min-width: 50em) {
    .open-book {
        margin: 1em;
        position: relative;
    }

    .open-book:before {
        background-color: #8b4513;
        border-radius: 0.25em;
        bottom: -1em;
        content: '';
        left: -1em;
        position: absolute;
        right: -1em;
        top: -1em;
        z-index: -1;
    }

    .open-book:after {
        background: linear-gradient(
                to right,
                transparent 0%,
                rgba(0, 0, 0, 0.2) 46%,
                rgba(0, 0, 0, 0.5) 49%,
                rgba(0, 0, 0, 0.6) 50%,
                rgba(0, 0, 0, 0.5) 51%,
                rgba(0, 0, 0, 0.2) 52%,
                transparent 100%
        );
        bottom: -1em;
        content: '';
        left: 50%;
        position: absolute;
        top: -1em;
        transform: translate(-50%, 0);
        width: 4em;
        z-index: 1;
    }

    .open-book > * {
        column-count: 2;
        column-gap: 6em;
        position: relative;
        z-index: 1;
    }

    /* Header/Footer */
    .open-book header:before,
    .open-book header:after,
    .open-book footer:before,
    .open-book footer:after {
        background: #fff;
        border-radius: 25%;
        content: '';
        height: 2em;
        position: absolute;
        z-index: -1;
        width: calc(50% + 2em);
    }

    .open-book header:before,
    .open-book footer:before,
    .open-book footer:after {
        border-top-left-radius: 0;
    }

    .open-book header:after,
    .open-book footer:before,
    .open-book footer:after {
        border-top-right-radius: 0;
    }

    .open-book header:before,
    .open-book header:after,
    .open-book footer:after {
        border-bottom-right-radius: 0;
    }

    .open-book header:before,
    .open-book header:after,
    .open-book footer:before {
        border-bottom-left-radius: 0;
    }

    .open-book header:before,
    .open-book header:after {
        top: -2.65em;
    }

    .open-book header:before,
    .open-book footer:before {
        right: 50%;
    }

    .open-book header:before {
        transform: rotate(-2deg);
    }

    .open-book header:after,
    .open-book footer:after {
        left: 50%;
    }

    .open-book header:after {
        transform: rotate(2deg);
    }

    .open-book footer:before,
    .open-book footer:after {
        bottom: -2.65em;
    }

    .open-book footer:before {
        transform: rotate(2deg);
    }

    .open-book footer:after {
        transform: rotate(-2deg);
    }

    .open-book header > *:last-child,
    .open-book footer > *:last-child {
        text-align: right;
    }

    .open-book footer #page-numbers {
        display: block;
    }

    /* Chapter Title */

    .open-book .chapter-title:before,
    .open-book .chapter-title:after {
        height: 0.125em;
    }

    .open-book article > ul,
    .open-book article > ol {
        padding-left: 4em;
    }
}

.content.container {
    max-width: 720px;
}

.card-welcome {
    padding: 10%;
    text-align: center;
    border: 1px solid navy;
    color: black;
    position: relative;
    height: auto;
    width: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
}

.card-invite {
    padding: 10%;
    text-align: center;
    border: 1px solid navy;
    color: black;
    position: relative;
    height: auto;
    width: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
}





.card-header-inviter {
    font-size: clamp(1rem, 1.7vw, 1.5rem);
}

.card-header-inviter.name {
    font-size: clamp(1.2rem, 2vw, 1.8rem);
}

.bg-top-right {
    position: absolute;
    top: -4%;
    right: -8%;
    display: block;
    margin-left: auto;
    margin-right: auto;
    width: 50%;
    transform: scale(0.8);
}

.bg-bottom-left {
    position: absolute;
    bottom: -3%;
    left: -8%;
    display: block;
    margin-left: auto;
    margin-right: auto;
    width: 40%;
    transform: rotate(180deg) scale(0.8);
}

.card-wrap {
    position: relative;
    width: 100%;
}

.card-wrap.card-header-invite {
    text-align: center;
}

.card-header-text {
    text-transform: uppercase;
    font-size: clamp(1rem, 1.8vw, 1.5rem);
}

.card-header-name {
    padding-top: 10px;
}

.card-information {
    padding-top: 10px;
}

.card-wrap .card-header-name {
    font-family: wedding-font-vni;
    font-size: clamp(1.2rem, 2vw, 1.8rem);
}

.information-time {
    padding: 10px 0px;
}

.information-time .day {
    background-color: #626ed4;
    border: 1px solid #626ed4;
    color: white;
    border-radius: 3px;
    font-size: clamp(0.9rem, 1.5vw, 1.2rem);
    margin: 0 10px;
}

.information-time .week,
.month {
    border-top: double;
    border-bottom: double;
    padding: 0 10px;
    font-size: clamp(1.2rem, 2vw, 1.8rem);
}

.card-description {
    padding: 10px 0;
}

.address {
    font-size: clamp(0.9rem, 1.6vw, 1.3rem);
}

.card-body.copy {
    display: flex;
    justify-content: space-around;
}

.detail-time {
    font-size: clamp(0.8rem, 1.5vw, 1.2rem);
}

/* 移动端布局 - 将卡片上下排布 */
@media only screen and (max-width: 768px) {
    body {
        margin: 0;
        padding: 0;
        overflow-x: hidden;
        min-height: 100vh; /* 确保body至少有整个视口的高度 */
    }
    
    #wrapper {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 0;
        overflow-x: hidden;
        min-height: 100vh;
    }
    
    .open-book {
        width: 100%;
        padding: 0;
        margin: 0;
        box-shadow: none;
        background: none;
        min-height: 100vh;
    }
    
    .open-book:before,
    .open-book:after {
        display: none; /* 移除书本效果 */
    }
    
    .open-book > * {
        column-count: 1; /* 移除分栏 */
    }
    
    #container {
        padding: 0;
        width: 100%;
        min-height: 100vh;
    }
    
    .card-welcome-all {
        display: grid;
        grid-template-columns: 1fr; /* 改为单列布局 */
        gap: 0; /* 移除间距 */
        width: 100%;
        padding: 0;
        margin: 0;
        min-height: 100vh;
    }
    
    .card-welcome,
    .card-invite {
        width: 100%; /* 在移动端占满宽度 */
        margin: 0; /* 移除边距 */
        left: 0;
        transform: none;
        box-sizing: border-box;
        border: none; /* 移除边框 */
    }
    
    .card-welcome {
        height: 40vh; /* 设置为视口高度的40% */
        min-height: 40vh;
        position: relative;
        overflow: hidden; /* 确保背景图片不会溢出 */
        padding: 0; /* 移除内边距，让背景图片完全填充 */
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .card-welcome::before {
        content: '';
        position: absolute;
        inset: 0;
        background-size: cover;
        background-position: center;
        z-index: -1; /* 确保背景在内容之后 */
    }
    
    /* 调整装饰图片的位置和大小 */
    .card-welcome .bg-top-right {
        position: absolute;
        top: -8%;
        right: -8%;
        width: 30%;
        transform: scale(0.6);
    }
    
    .card-welcome .bg-bottom-left {
        position: absolute;
        bottom: -6%;
        left: -7%;
        width: 25%;
        transform: rotate(180deg) scale(0.6);
    }
    
    .card-invite {
        min-height: 60vh; /* 设置为视口高度的60% */
        height: auto; /* 允许根据内容增长 */
        padding: 4% 3%; /* 减少内边距以增加内容区域 */
    }
    
    /* 调整邀请卡中装饰图片的位置和大小 */
    .card-invite .bg-top-right {
        position: absolute;
        top: 0;
        right: 0;
        width: 18%;
        transform: scale(0.85);
    }
    
    .card-invite .bg-bottom-left {
        position: absolute;
        bottom: 0;
        left: 0;
        width: 14%;
        transform: rotate(180deg) scale(0.85);
    }
    
    /* 确保卡片内容正确显示并优化字体大小 */
    .card-wrap {
        position: relative;
        width: 100%;
        z-index: 1; /* 确保内容在装饰图片之上 */
        padding: 0 2%; /* 减少内边距 */
    }

    /* 移动端下的字体大小优化 */
    @media only screen and (max-width: 768px) {
        .card-header-inviter {
            font-size: clamp(1.2rem, 2.2vw, 1.8rem);
        }

        .card-header-inviter.name {
            font-size: clamp(1.4rem, 2.5vw, 2rem);
        }

        .card-header-text {
            font-size: clamp(1.2rem, 2.2vw, 1.8rem);
        }

        .card-wrap .card-header-name {
            font-size: clamp(1.4rem, 2.5vw, 2rem);
            padding-top: 5px; /* 减少上边距 */
        }

        .information-time .day {
            font-size: clamp(1.1rem, 1.8vw, 1.5rem);
            margin: 0 5px; /* 减少左右边距 */
        }

        .information-time .week,
        .month {
            font-size: clamp(1.4rem, 2.5vw, 2rem);
            padding: 0 5px; /* 减少左右内边距 */
        }

        .address {
            font-size: clamp(1.1rem, 1.9vw, 1.6rem);
        }

        .detail-time {
            font-size: clamp(1rem, 1.8vw, 1.5rem);
        }

        .card-description {
            padding: 5px 0; /* 减少上下内边距 */
        }

        .information-time {
            padding: 5px 0; /* 减少上下内边距 */
        }
    }
}