:root {
    --bg-color: #fdf6ec;
    --ticket-bg: #fffbf5;
    --text-color: #5c4b3f;
    --accent-color: #d19a6d;
    --separator-color: #d6c4b4;
    --perforation-color: var(--bg-color);
}

body {
    font-family: 'Cormorant Garamond', 'Noto Serif SC', serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    box-sizing: border-box;
}

body.lang-en { font-family: 'Cormorant Garamond', serif; }
body.lang-cn { font-family: 'Noto Serif SC', serif; }

.lang-switcher {
    margin-bottom: 2rem;
    text-align: center;
}

.lang-switcher button {
    font-family: inherit;
    background-color: var(--ticket-bg);
    border: 1px solid var(--separator-color);
    color: var(--text-color);
    padding: 0.5rem 1.2rem;
    margin: 0 0.5rem;
    cursor: pointer;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.lang-switcher button.active {
    background-color: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
}

.ticket {
    max-width: 800px;
    width: 100%;
    display: flex;
    background-color: var(--ticket-bg);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    position: relative;
}

.ticket::before, .ticket::after {
    content: '';
    position: absolute;
    width: 5px;
    height: 100%;
    top: 0;
    background-image: repeating-radial-gradient(circle at 0 0, transparent, transparent 4px, var(--perforation-color) 4px, var(--perforation-color) 5px);
    background-size: 5px 15px;
}
.ticket::before { left: -5px; }
.ticket::after { right: -5px; transform: rotate(180deg); }

.main-part {
    flex: 1;
    padding: 2.5rem 2rem;
    text-align: center;
}

.ticket-title {
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--accent-color);
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--separator-color);
}

.main-info {
    margin: 1rem 0;
    line-height: 1.6;
}
.main-info h3 {
    font-size: 1rem;
    letter-spacing: 1px;
    margin: 1.5rem 0 0.5rem;
    color: var(--text-color);
    opacity: 0.7;
}
.main-info p {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
}

.seating {
    display: flex;
    justify-content: space-around;
    text-align: center;
    margin-top: 1rem;
}

.stub-part {
    flex: 1;
    border-left: 2px dashed var(--separator-color);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: center;
}

.stub-photo img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.stub-names {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 1rem 0;
}

#qrcode-container {
    display: flex; /* 使用 Flexbox */
    justify-content: center; /* 水平居中 */
    align-items: center; /* 垂直居中 */
    margin: 10px 0;
    /* 移除 width: 100%; 因为 Flexbox 会自动调整 */
}

#qrcode-container canvas {
    /* margin: 0 auto; 不再需要，因为 Flexbox 已经处理居中 */
    max-width: 150px;
    max-height: 150px;
}

/* ======== 新增照片墙链接样式 ======== */
.gallery-link-container {
    margin-top: 2.5rem;
    text-align: center;
}
.gallery-link {
    font-family: 'Cormorant Garamond', 'Noto Serif SC', serif;
    display: inline-block;
    background-color: transparent;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    padding: 0.8rem 2rem;
    text-decoration: none;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}
.gallery-link:hover {
    background-color: var(--accent-color);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* 页面文案样式 */
.copy-section {
    max-width: 800px;
    margin: 1.6rem auto 0;
    text-align: center;
    color: var(--text-color);
    font-size: 0.95rem;
    line-height: 1.6;
    padding: 0 1rem;
}
.copy-section .important { font-weight: 700; color: var(--accent-color); }
.copy-section a { color: var(--accent-color); text-decoration: underline; }
.footer-note { margin-top: 0.6rem; font-size: 0.85rem; opacity: 0.85; }

@media (max-width: 768px) {
    body {
        padding: 1rem 0.5rem; /* 调整 body 的内边距 */
    }
    .lang-switcher {
        margin-bottom: 1.5rem; /* 调整语言切换器间距 */
    }
    .lang-switcher button {
        padding: 0.4rem 1rem; /* 调整按钮内边距 */
        font-size: 0.9rem; /* 调整按钮字体大小 */
    }
    .ticket {
        flex-direction: column;
        max-width: 95%; /* 调整票据最大宽度 */
        margin: 0 auto; /* 居中显示 */
    }
    .ticket::before, .ticket::after {
        display: none; /* 手机端隐藏票据两侧的虚线 */
    }
    .main-part {
        padding: 1.5rem 1rem; /* 调整主要部分内边距 */
    }
    .ticket-title {
        font-size: 1.2rem; /* 调整标题字体大小 */
        letter-spacing: 1px;
    }
    .main-info h3 {
        font-size: 0.9rem; /* 调整信息标题字体大小 */
        margin: 1rem 0 0.3rem;
    }
    .main-info p {
        font-size: 1rem; /* 调整信息内容字体大小 */
    }
    .stub-part {
        flex-basis: auto;
        border-left: none;
        border-top: 2px dashed var(--separator-color);
        padding: 1rem; /* 调整存根部分内边距 */
    }
    .stub-names {
        font-size: 1.2rem; /* 调整存根名称字体大小 */
        margin: 0.8rem 0;
    }
    #qrcode-container canvas {
        max-width: 120px; /* 调整二维码最大宽度 */
        max-height: 120px; /* 调整二维码最大高度 */
    }
    .gallery-link-container {
        margin-top: 1.5rem; /* 调整照片墙链接容器间距 */
    }
    .gallery-link {
        padding: 0.6rem 1.5rem; /* 调整照片墙链接内边距 */
        font-size: 1rem; /* 调整照片墙链接字体大小 */
    }
    .copy-section {
        margin: 1rem auto 0;
        font-size: 0.85rem; /* 调整文案字体大小 */
        padding: 0 0.5rem;
    }
    .footer-note {
        margin-top: 0.5rem;
        font-size: 0.75rem; /* 调整页脚字体大小 */
    }
}

@media (max-width: 480px) {
    body {
        padding: 0.8rem 0.3rem;
    }
    .lang-switcher {
        margin-bottom: 1rem;
    }
    .lang-switcher button {
        padding: 0.3rem 0.8rem;
        font-size: 0.8rem;
    }
    .ticket {
        max-width: 98%;
    }
    .main-part {
        padding: 1rem 0.8rem;
    }
    .ticket-title {
        font-size: 1rem;
        letter-spacing: 0.5px;
    }
    .main-info h3 {
        font-size: 0.8rem;
        margin: 0.8rem 0 0.2rem;
    }
    .main-info p {
        font-size: 0.9rem;
    }
    .stub-part {
        padding: 0.8rem;
    }
    .stub-names {
        font-size: 1rem;
        margin: 0.5rem 0;
    }
    #qrcode-container canvas {
        max-width: 100px;
        max-height: 100px;
    }
    .gallery-link-container {
        margin-top: 1rem;
    }
    .gallery-link {
        padding: 0.5rem 1.2rem;
        font-size: 0.9rem;
    }
    .copy-section {
        margin: 0.8rem auto 0;
        font-size: 0.75rem;
        padding: 0 0.3rem;
    }
    .footer-note {
        margin-top: 0.3rem;
        font-size: 0.65rem;
    }
}

/* ======== 新增进入动画 ======== */
@keyframes fadeIn-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    opacity: 0; /* 初始状态 */
}

.fade-in-up.animate {
    animation: fadeIn-up 0.8s ease-out forwards;
}

/* Styles from gallery.php */
body {
    /* font-family: 'Cormorant Garamond', 'Noto Serif SC', serif; */ /* Already defined */
    /* background-color: var(--bg-color); */ /* Already defined */
    /* color: var(--text-color); */ /* Already defined */
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    min-height: 100vh;
    box-sizing: border-box;
    overflow-x: hidden;
}

.gallery-container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 1rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0; /* 初始透明度为0 */
    transform: translateY(20px); /* 初始位置向下偏移 */
    transition: opacity 0.8s ease-out, transform 0.8s ease-out; /* 添加过渡效果 */
}
.gallery-container.loaded {
    opacity: 1; /* 加载完成后完全显示 */
    transform: translateY(0); /* 恢复到原始位置 */
}

.gallery-header {
    text-align: center;
    padding: 2rem 1rem;
    width: 100%;
}

.gallery-header h1 {
    font-size: 2.5rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
}

.back-link {
    font-size: 1rem;
    color: var(--accent-color);
    text-decoration: none;
    border: 1px solid var(--accent-color);
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    transition: all 0.3s ease;
}
.back-link:hover {
    background-color: var(--accent-color);
    color: #fff;
}

/* --- Covers Container Styles --- */
#covers-container {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    padding: 2rem 0;
    opacity: 1;
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
    position: relative;
    z-index: 10;
}
#covers-container.hidden {
    opacity: 0;
    transform: translateY(-50px);
    pointer-events: none;
    position: absolute;
    top: -9999px;
}

.album-cover-item {
    cursor: pointer;
    width: 45%;
    max-width: 400px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    overflow: hidden;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}
.album-cover-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
}
.album-cover-item img {
    width: 100%;
    height: auto;
    display: block;
    border-bottom: 1px solid #eee;
}
.album-cover-item p {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 600;
    padding: 1rem;
    margin: 0;
}

/* --- Album Content Styles (平铺显示) --- */
#album-content {
    display: none;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 0 1rem 2rem 1rem; /* 底部增加填充，防止内容太贴近页面底部 */
    opacity: 0;
    transform: translateY(50px); /* 初始位置向下偏移 */
    transition: opacity 0.8s ease-in, transform 0.8s ease-in; /* 添加过渡效果 */
    box-sizing: border-box;
}
#album-content.visible {
    display: flex;
    opacity: 1;
    transform: translateY(0); /* 恢复到原始位置 */
}

/* 新增：图片容器，用于平铺图片 */
#tiled-images-container {
    width: 100%;
    max-width: 900px; /* 控制图片最大宽度 */
    margin: 2rem 0; /* 适当的上下间距 */
    display: flex;
    flex-direction: column; /* 垂直堆叠 */
    gap: 1.5rem; /* 图片之间的间距 */
    border-radius: 12px;
    background-color: transparent;
    overflow: visible; /* 改为visible以允许阴影完整显示 */
}

.tiled-image-item {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px; /* 更大的圆角 */
    box-shadow: 0 10px 30px rgba(0,0,0,0.15); /* 更柔和的阴影 */
    object-fit: contain; /* 保持图片完整，不裁剪 */
    background-color: #fff; /* 图片背景，防止透明部分 */
    padding: 10px; /* 增加内边距，模拟更宽的边框 */
    box-sizing: border-box; /* 边距和padding不影响尺寸 */
    opacity: 0; /* 初始透明度为0 */
    transform: translateY(20px); /* 初始位置向下偏移 */
    transition: opacity 0.8s ease-out, transform 0.8s ease-out; /* 添加过渡效果 */
}
.tiled-image-item.loaded {
    opacity: 1; /* 加载完成后完全显示 */
    transform: translateY(0); /* 恢复到原始位置 */
}

/* Responsive */
@media (max-width: 768px) {
    .gallery-header h1 { font-size: 2rem; }
    .album-cover-item { width: 90%; max-width: 350px; }
    .album-cover-item p { font-size: 1.2rem; }
    #tiled-images-container { max-width: 100%; margin: 1rem 0; gap: 1rem;}
    .tiled-image-item { padding: 3px; }
}


/* Styles from index.php */
#guest-name {
    font-size: 2rem;
}

.admit-one {
    font-size: 0.9rem;
}

#main-content {
    opacity: 1;
}
