/* 공통 스타일 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Noto Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

:root {
    touch-action: pan-x pan-y;
}

body {
    background-color: #fffbeb;
    color: #333;
    line-height: 1.5;
    font-size: 14px;
    overflow-x: hidden;
    touch-action: manipulation;
    -webkit-overflow-scrolling: touch;
}

h2, h3 {
    font-family: 'Noto Serif KR', serif;
}

input, textarea, button {
    -webkit-appearance: none;
    border-radius: 0;
    font-size: 16px;
}

img {
    max-width: 100%;
    height: auto;
    -webkit-user-drag: none;
    user-drag: none;
}

/* 공통 컨테이너 */
.container {
    max-width: 400px;
    margin: 0 auto;
    background-color: #fffbeb;
    min-height: 100vh;
    position: relative;
}

/* 로딩 컨테이너 */
.loading-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    text-align: center;
    padding: 20px;
}

    .loading-container h2 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
        color: #92400e;
    }

    .loading-container p {
        color: #666;
    }

/* 전자영수증 스타일 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background-color: white;
    border-bottom: 1px solid #eaeaea;
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-title {
    font-size: 18px;
    font-weight: normal;
}

.back-button, .info-button {
    width: 32px;
    height: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #666;
    cursor: pointer;
}

.info-button {
    border: 1px solid #eaeaea;
    border-radius: 50%;
    font-size: 12px;
}

.receipt-container {
    margin: 20px 16px;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.2s ease;
}

    .receipt-container:hover {
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    }

.receipt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #eaeaea;
}

.receipt-title {
    font-size: 18px;
    font-weight: bold;
}

.receipt-icons {
    display: flex;
    gap: 16px;
}

.receipt-content {
    padding: 24px 16px;
}

.logo {
    text-align: center;
    margin-bottom: 8px;
}

.logo-text {
    font-size: 24px;
    font-weight: 900;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.logo-subtext {
    font-size: 14px;
    color: #333;
    margin-bottom: 4px;
}

.store-info {
    margin: 24px 0 16px;
    font-size: 12px;
    text-align: left;
}

.store-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}

.divider {
    height: 1px;
    border-top: 1px dashed #ddd;
    margin: 12px 0;
}

.order-number {
    text-align: right;
    font-size: 14px;
    margin-bottom: 8px;
}

.order-items {
    margin-bottom: 16px;
}

.item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.item-name {
    flex: 1;
    text-align: left;
}

.item-price {
    width: 64px;
    text-align: right;
}

.item-quantity {
    width: 32px;
    text-align: right;
    padding: 0 8px;
}

.item-total {
    width: 64px;
    text-align: right;
}

.summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.total-label {
    font-weight: bold;
}

.total-amount {
    font-weight: bold;
    font-size: 18px;
}

.tax-info {
    font-size: 11px;
    color: #777;
    text-align: right;
}

.payment {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 디지털 엽서 버튼 스타일 */
.digital-postcard-button {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 12px;
    margin-top: 24px;
    background-color: #f3f4f6;
    color: 6b7280;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    
}

.digital-postcard-button:hover {
    background-color: #92400e;
}

.digital-postcard-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* 은은한 디지털 엽서 보기 버튼 스타일 */
#view-postcard-button {
    background-color: #f3f4f6;
    color: #6b7280;
    border: 1px solid #d1d5db;
    font-weight: 500;
    
}

#view-postcard-button:hover {
    background-color: #e5e7eb;
    color: #374151;
    border-color: #9ca3af;
}

#view-postcard-button .digital-postcard-icon {
    margin-right: 8px;
}

.digital-postcard-icon {
    margin-right: 8px;
}

/* 디지털 엽서 시스템 스타일 */
#postcard-system {
    display: block;
}

/* 헤더 */
.postcard-header {
    width: 100%;
    background-color: #fef3c7;
    padding: 0.75rem 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.postcard-header-content {
    flex: 1;
}

.postcard-header-title {
    font-size: 1.25rem;
    font-weight: bold;
    color: #92400e;
}

.postcard-header-subtitle {
    font-size: 0.75rem;
    color: #b45309;
    margin-top: 0.25rem;
}

.back-to-receipt {
    padding: 8px;
    color: #92400e;
    cursor: pointer;
    display: flex;
    align-items: center;
}

/* 컨테이너 */
.postcard-container {
    width: 100%;
    padding: 1rem;
}

.page-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #92400e;
}

/* 섹션 */
.section {
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #b45309;
}

/* Swiper 슬라이더 스타일 */
.swiper-container {
    width: 100%;
    height: 20rem;
    margin-bottom: 0;
    border-radius: 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    position: relative;
}

.swiper-slide {
    position: relative;
    background-color: #fff;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    border-radius: 0.375rem;
}

    .swiper-slide.swiper-slide-active {
        border-color: #d97706;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }

.image-card img {
    width: 100%;
    height: 17rem;
    object-fit: cover;
    display: block;
}

.image-info {
    padding: 0.5rem;
    background-color: white;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.image-title {
    font-weight: 500;
    font-size: 0.875rem;
    color: #92400e;
}

.image-desc {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

/* Swiper 네비게이션 버튼 스타일 */
.swiper-button-next, .swiper-button-prev {
    color: #d97706;
    background-color: rgba(255, 255, 255, 0.8);
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

    .swiper-button-next:after, .swiper-button-prev:after {
        font-size: 1rem;
        font-weight: bold;
    }

    .swiper-button-next:hover, .swiper-button-prev:hover,
    .swiper-button-next:active, .swiper-button-prev:active {
        background-color: white;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }

/* Swiper 페이지네이션 스타일 */
.swiper-pagination {
    position: relative;
    text-align: center;
    margin-top: 0.5rem;
    margin-bottom: 1.5rem;
    z-index: 10;
    bottom: auto;
    left: auto;
    width: 100%;
}

.swiper-pagination-bullet {
    width: 0.5rem;
    height: 0.5rem;
    background-color: rgba(215, 119, 6, 0.3);
    opacity: 1;
    margin: 0 3px;
    transition: all 0.3s ease;
}

.swiper-pagination-bullet-active {
    background-color: #d97706;
    transform: scale(1.3);
}

/* 템플릿 버튼 */
.template-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.template-button {
    padding: 0.5rem 0.75rem;
    background-color: #fef3c7;
    color: #92400e;
    border-radius: 0.375rem;
    border: none;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
    white-space: nowrap;
}

    .template-button:hover {
        background-color: #fde68a;
    }

/* 메시지 영역 */
.message-area {
    width: 100%;
    height: 12rem;
    padding: 0.75rem;
    border: 1px solid #fbbf24;
    border-radius: 0.375rem;
    resize: vertical;
    font-size: 1rem;
    font-family: 'Noto Sans KR', sans-serif;
    transition: all 0.3s ease;
}

    .message-area:focus {
        outline: none;
        box-shadow: 0 0 0 2px #fbbf24;
        border-color: transparent;
    }

/* 저장 버튼 */
.save-button-container {
    position: sticky;
    bottom: 1rem;
    left: 0;
    right: 0;
    margin-top: 1.5rem;
    padding: 0 1rem;
}

.save-button {
    width: 100%;
    padding: 0.75rem;
    background-color: #d97706;
    color: white;
    border: none;
    border-radius: 9999px;
    font-size: 1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s ease;
}

    .save-button:hover:not(:disabled) {
        background-color: #b45309;
    }

    .save-button:disabled {
        background-color: #d1d5db;
        cursor: not-allowed;
    }

    .save-button svg {
        margin-right: 0.5rem;
    }

/* 조회 화면 스타일 */
#view-screen {
    display: block;
    position: relative;
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
}

/* 봉투 스타일 - 이미지 기반으로 변경 */
/* 상단 봉투 컨테이너 수정 */
.envelope-top-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 100vh; /* 50vh에서 100vh로 변경하여 전체 화면 높이 차지 */
    z-index: 20; /* 내용물보다 낮게 설정 (내용물이 위에 표시되도록) */
    max-width: 450px;
    margin: 0 auto;
    will-change: transform;
    overflow: hidden;
    background-color: transparent;
    pointer-events: none; /* 아래 요소와 상호작용 가능하도록 설정 */
}

/* 상단 봉투 이미지 스타일 조정 */
#envelope-top-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top; /* 이미지 상단 정렬 */
    display: block;
}

/* 하단 봉투 컨테이너는 여전히 하단 50%에만 위치 */
.envelope-bottom-container {
    position: fixed;
    top: 41vh;                  /*하단 봉투 위치조절*/
    left: 0;
    right: 0;
    height: 100vh;
    z-index: 40; /* 내용물보다 높게 유지 (내용물 위에 표시) */
    transform-origin: top center;
    max-width: 450px;
    margin: 0 auto;
    will-change: transform;
    transform: translateY(0) rotateX(0deg);
    perspective: 1000px;
    overflow: hidden;
    background-color: transparent;
    transition: transform 0.3s ease-out;
}

/* 내용물 컨테이너가 상단 봉투와 하단 봉투 사이에 표시되도록 함 */
/* 내용물 컨테이너가 텍스트 위로 올라가도록 z-index 유지 */
/* 내용물 컨테이너 설정 - 봉투 텍스트와 분리 */
.content-container {
    position: absolute;
    width: 100%;
    top: 50vh;
    z-index: 30; /* 상단 봉투(20)와 봉투 텍스트(25)보다 높게 유지 */
    transition: transform 0.3s ease-out;
    will-change: transform;
    transform: translateY(0);
    perspective: 1000px;
    backface-visibility: hidden;
    max-width: 450px;
    margin: 0 auto;
    left: 0;
    right: 0;
}

/* 봉투 열림 애니메이션 - 내용물만 이동하도록 */
.envelope-open .content-container {
    transform: translateY(-40vh);
}

/* 봉투 열린 상태 클래스 추가 */
.envelope-open .envelope-bottom-container {
    transform: translateY(100%) rotateX(12deg);
}

.envelope-open .content-container {
    transform: translateY(-40vh);
}

/* 내용물이 봉투 밖으로 나오지 않도록 조정 */
.postcard-content {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    padding: 1.25rem;
    background-color: white;
    box-shadow: 0 -4px 6px rgba(0, 0, 0, 0.1);
    min-height: 100vh;
    border-top-left-radius: 1rem;
    border-top-right-radius: 1rem;
    transform: translateZ(0);
    will-change: transform;
}

/* 토글 버튼 */
.toggle-button {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    width: 3rem;
    height: 3rem;
    background-color: #d97706;
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    z-index: 50;
    transition: all 0.3s ease;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

    .toggle-button:hover,
    .toggle-button:active {
        background-color: #b45309;
        transform: scale(1.05);
    }

    .toggle-button svg {
        width: 1.25rem;
        height: 1.25rem;
    }

.return-to-receipt {
    position: fixed;
    top: 1.25rem;
    left: 1.25rem;
    width: 3rem;
    height: 3rem;
    background-color: rgba(255, 255, 255, 0.8);
    color: #92400e;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    z-index: 50;
    transition: all 0.3s ease;
    outline: none;
}

    .return-to-receipt:hover,
    .return-to-receipt:active {
        background-color: white;
        transform: scale(1.05);
    }

/* 사파리 브라우저 호환성을 위해 메시지 박스 장식 수정 */
.message-wrapper {
    position: relative;
    margin: 1.5rem 0 2rem;
    padding: 5px;
    border-radius: 0.9rem;
}

/* 이중 테두리 효과 - 사파리 호환 버전 */
.message-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid rgba(215, 119, 6, 0.15);
    border-radius: 0.9rem;
    pointer-events: none;
    z-index: 1;
    /* 사파리 호환성을 위한 추가 속성 */
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}

.message-box {
    width: 100%;
    padding: 1.5rem;
    background-color: #fffbeb;
    background-image: linear-gradient(rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0));
    border-radius: 0.75rem;
    white-space: pre-line;
    line-height: 1.8;
    font-size: 1.05rem;
    font-family: 'Noto Serif KR', serif;
    font-weight: 400;
    color: #4b3621;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    position: relative;
    border: 1px solid rgba(215, 119, 6, 0.2);
}

/* 인용 부호 요소 수정 - 사파리 호환 버전 */
.quote-mark-top,
.quote-mark-bottom {
    position: absolute;
    font-family: Georgia, serif;
    font-size: 60px;
    color: rgba(215, 119, 6, 0.15);
    line-height: 1;
}

.quote-mark-top::before {
    content: '\201C'; /* 시작 인용 부호 */
}

.quote-mark-bottom::before {
    content: '\201D'; /* 종료 인용 부호 */
}

.quote-mark-top {
    top: 5px;
    left: 10px;
}

.quote-mark-bottom {
    bottom: 5px;
    right: 10px;
}

/* 모바일 최적화 */
@media (max-width: 480px) {
    .quote-mark-top,
    .quote-mark-bottom {
        width: 30px;
        height: 30px;
    }
}

/* 메시지 날짜 스타일 */
.message-date {
    text-align: right;
    font-size: 0.8rem;
    margin-top: 1rem;
    font-style: italic;
    color: #92400e;
    opacity: 0.8;
}

/* 봉투 열릴 때 메시지 박스 애니메이션 */
.envelope-open .message-box {
    animation: gentle-bounce 0.6s ease-out;
}

@keyframes gentle-bounce {
    0% {
        transform: translateY(5px);
        opacity: 0.8;
    }
    50% {
        transform: translateY(-3px);
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 메시지 내용 내의 단락 스타일 */
.message-box p {
    margin-bottom: 0.75rem;
}

.message-box p:last-child {
    margin-bottom: 0;
}

/* 메시지 내용 강조 스타일 */
.message-box strong, 
.message-box b {
    color: #92400e;
    font-weight: 600;
}

.message-box em,
.message-box i {
    font-style: italic;
    color: #6b4226;
}

/* 메시지가 길어질 경우 스크롤 처리 (선택 사항) */
.message-box.long-message {
    max-height: 50vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(215, 119, 6, 0.3) rgba(255, 251, 235, 0.5);
}

.message-box.long-message::-webkit-scrollbar {
    width: 6px;
}

.message-box.long-message::-webkit-scrollbar-track {
    background: rgba(255, 251, 235, 0.5);
    border-radius: 10px;
}

.message-box.long-message::-webkit-scrollbar-thumb {
    background-color: rgba(215, 119, 6, 0.3);
    border-radius: 10px;
}

/* 메시지 박스 호버 효과 */
.message-box:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
    transition: all 0.3s ease;
}

.selected-image {
    width: 100%;
    margin-bottom: 1rem;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

    .selected-image:hover {
        transform: translateY(-3px);
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    }

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

.selected-image-caption {
    background-color: rgba(255, 255, 255, 0.8);
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    color: #92400e;
}

.character-section,
.location-section,
.contact-section {
    width: 100%;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #fde68a;
}

.section-header {
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
    color: #b45309;
}

.character-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.character {
    text-align: center;
}

.character-img {
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 50%;
    margin-bottom: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

    .character-img:hover {
        transform: scale(1.1);
    }

.character-name {
    font-size: 0.875rem;
    color: #92400e;
}

.character-description,
.location-description,
.contact-description {
    font-size: 0.75rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

/* 가로 배치 바로가기 아이콘 스타일 */
.social-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-top: 1rem;
}

.social-link {
    width: 2.75rem;
    height: 2.75rem;
    background-color: #fef3c7;
    color: #92400e;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    text-decoration: none;
}

    .social-link:hover {
        background-color: #fde68a;
        transform: translateY(-3px);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    }

    .social-link:active {
        transform: translateY(-1px);
    }

    /* 아이콘에 툴팁 효과 */
    .social-link::after {
        content: attr(title);
        position: absolute;
        bottom: -2rem;
        left: 50%;
        transform: translateX(-50%);
        padding: 0.25rem 0.5rem;
        background-color: rgba(0, 0, 0, 0.7);
        color: white;
        border-radius: 0.25rem;
        font-size: 0.75rem;
        white-space: nowrap;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        pointer-events: none;
    }

    .social-link:hover::after {
        opacity: 1;
        visibility: visible;
        bottom: -1.75rem;
    }

/* 모바일 환경에서 툴팁 비활성화 */
@media (max-width: 640px) {
    .social-links {
        gap: 1.25rem;
    }

    .social-link {
        width: 4rem;
        height: 4rem;
    }

        .social-link::after {
            display: none;
        }
}

/* 모바일 최적화 */
@media (max-width: 640px) {
    .social-links-vertical {
        gap: 0.5rem;
    }

    .social-link-vertical {
        padding: 0.625rem 0.875rem;
    }

    .social-icon {
        width: 4rem;
        height: 4rem;
        margin-right: 0.5rem;
    }

    .social-label {
        font-size: 0.8125rem;
    }
}

.new-card-button {
    margin-top: 2rem;
    margin-bottom: 1.5rem;
    padding: 0.5rem 1.25rem;
    background-color: #d97706;
    color: white;
    border: none;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

    .new-card-button:hover {
        background-color: #b45309;
        transform: translateY(-2px);
    }

    .new-card-button:active {
        transform: translateY(0);
    }

    .new-card-button svg {
        margin-right: 0.5rem;
    }


/* 봉투 상단 문구 스타일 - 위치만 변경, 색상은 그대로 */
.envelope-top-text {
    position: fixed; /* absolute에서 fixed로 변경 */
    top: 10%; /* 상단에서 10% 위치에 배치 */
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    z-index: 25; /* 봉투 상단(20)보다 위, 내용물(30)보다 아래 */
    padding: 0 1.5rem;
    max-width: 450px; /* 컨테이너 최대 너비와 동일하게 */
    margin: 0 auto; /* 중앙 정렬 */
    pointer-events: none; /* 클릭 이벤트를 내용물에 전달 */
}

/* 로고 컨테이너 - 간격 줄임 */
.ako-logo-container {
    margin-bottom: 0.3rem; /* 1rem에서 0.3rem으로 줄임 */
}

/* 아코제주 로고 */
.ako-logo {
    width: 120px; /* 로고 크기 - 필요에 따라 조정 가능 */
    height: auto;
    opacity: 0.85; /* 투명도 설정 - 0.85는 85% 불투명 */
    transition: opacity 0.3s ease;
}

/* 상단 태그라인 (새로 추가) */
.envelope-tagline {
    font-family: 'Noto Serif KR', serif;
    font-size: 0.85rem;
    font-weight: 300;
    font-style: italic;
    color: #92400e;
    margin-bottom: 0.2rem;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.6);
    letter-spacing: 0.05em;
}

/* 봉투가 열릴 때 로고 투명도 살짝 증가 */
.envelope-open .ako-logo {
    opacity: 0.9;
}

/* 기존 텍스트 스타일에서 상단 제목 마진 줄임 */
.envelope-title {
    font-family: 'Noto Serif KR', serif;
    font-size: 1.5rem;
    font-weight: 500;
    color: #92400e;
    margin-bottom: 0.3rem; /* 0.5rem에서 0.3rem으로 줄임 */
    text-shadow: 0 2px 4px rgba(255, 255, 255, 0.8);
}

.envelope-subtitle {
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 1rem;
    font-weight: 400;
    color: #b45309; /* 기존 색상 유지 */
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.6);
}

/* 하단 추가 메시지 (새로 추가) */
.envelope-footer {
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 0.75rem;
    font-weight: 300;
    color: #b45309;
    opacity: 0.9;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.6);
    margin-top: 0.1rem;
    letter-spacing: 0.03em;
}
/* 모바일 화면에서 로고와 텍스트 크기 조정 */
/* 모바일 화면에서도 간격 조정 */
@media (max-width: 480px) {
    

    .envelope-top-text {
        top: 13%;
    }
    
    .ako-logo-container {
        margin-bottom: 0; /* 모바일에서 더 작은 간격 */
    }
    
    .ako-logo {
        width: 150px;
    }
    
        .envelope-tagline {
        font-size: 0.75rem;
        margin-bottom: 0.15rem;
    }
    
    .envelope-title {
        font-size: 1.2rem;
        margin-bottom: 0.2rem;
    }
    
    .envelope-subtitle {
        font-size: 0.875rem;
        margin-bottom: 0.2rem;
    }
    
    .envelope-footer {
        font-size: 0.7rem;
    }
}

/* 스크롤 인디케이터 애니메이션 수정 - 위로 움직이는 효과로 변경 */
.scroll-indicator {
    margin-top: 2rem;
    margin-bottom: 2rem;
    animation: bounceUp 2s infinite;
}

@keyframes bounceUp {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* 새로 추가된 인디케이터 스타일 - 심플한 디자인 */
.additional-scroll-indicator {
    position: absolute;
    top: 45%; /* 화면 중간보다 약간 위에 위치 */
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 25; /* 봉투 상단(20)보다 위, 내용물(30)보다 아래 */
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.additional-scroll-indicator svg {
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    padding: 6px;
    width: 36px;
    height: 36px;
    stroke: #ffffff; /* 흰색 화살표 */
    animation: simpleUp 1.5s infinite;
}



/* 심플한 위로 움직이는 애니메이션 */
@keyframes simpleUp {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

/* 중앙 정렬 헬퍼 클래스 */
.flex-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.logo {
    width: 3.75rem;
    height: 3.75rem;
    border-radius: 50%;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.postcard-title {
    font-family: 'Noto Serif KR', serif;
    font-weight: normal;
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: #92400e;
}

/* 페이드인 효과를 위한 초기 상태 설정 */
.postcard-title,
.selected-image,
.message-box,
.character-section,
.location-section,
.contact-section {
    opacity: 0;
}

/* 애니메이션 */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* 스와이프 힌트 */
.swipe-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    z-index: 3;
    pointer-events: none;
}

    .swipe-hint.visible {
        opacity: 1;
        visibility: visible;
    }

/* 로딩 애니메이션 */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 251, 235, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(217, 119, 6, 0.2);
    border-radius: 50%;
    border-top-color: #d97706;
    animation: spin 1s linear infinite;
}

/* QR 코드 섹션 스타일 */
.qr-code-section {
    width: 100%;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #fde68a;
    text-align: center;
}

.qr-code-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0.5rem auto 1.5rem;
}

/* QR 이미지 선택 가능하게 만드는 CSS */
#qrcode {
    position: relative;
    z-index: 10;
    pointer-events: auto !important;
}

#qrcode img {
    width: 120px !important;
    height: 120px !important;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 0.25rem;
    background-color: white;
    transition: transform 0.3s ease;
    cursor: pointer;
    z-index: 10;
    pointer-events: auto !important;
    user-select: auto !important;
    -webkit-user-select: auto !important;
    -moz-user-select: auto !important;
    -ms-user-select: auto !important;
}

#qrcode img:hover {
    transform: scale(1.08);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    opacity: 0.9;
}


/* 부모 요소도 pointer-events 속성 활성화 */
.qr-code-container,
.qr-code-section,
.flex-center,
.postcard-content,
.content-container {
    pointer-events: auto !important;
}

#qrcode::after {
    content: "클릭하여 이미지 저장";
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 8px;
    border-radius: 4px;
    font-size: 11px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 10;
}

#qrcode:hover::after {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 480px) {
    #qrcode::after {
        display: none;
    }
}

.qr-code-description {
    font-size: 0.75rem;
    color: #92400e;
    margin-top: 0.5rem;
    line-height: 1.4;
}

/* QR 코드로 접속 시 버튼 숨김 스타일 */
.qr-hidden {
    display: none !important;
}

/* QR 코드로 접속 시 여백 조정 */
.qr-access .qr-code-section {
    margin-bottom: 3rem; /* 버튼이 사라져서 생기는 여백 조정 */
}

/* QR 코드 접속 시 봉투 열기 버튼의 위치 조정 */
.qr-access .toggle-button {
    bottom: 1.5rem; /* 위치 조정 */
}

/* 모바일 디바이스 최적화 */
@media (max-width: 480px) {
    .postcard-content {
        padding: 0.75rem;
    }

    /* 메시지 박스 모바일 최적화 */
    .message-wrapper {
        margin: 1rem 0 1.5rem;
        padding: 4px;
    }
    
    .message-box {
        padding: 1.25rem;
        font-size: 0.95rem;
        line-height: 1.7;
    }
    
    .message-box::before,
    .message-box::after {
        width: 30px;
        height: 30px;
    }
    
    .message-box p:first-child::first-letter {
        font-size: 1.6em;
        padding-right: 4px;
        margin-top: 2px;
    }
    
    .message-date {
        font-size: 0.75rem;
        margin-top: 0.75rem;
    }

    .selected-image {
        margin-bottom: 0.75rem;
    }

    .toggle-button {
        bottom: 1rem;
        right: 1rem;
        width: 2.75rem;
        height: 2.75rem;
    }

    .return-to-receipt {
        top: 1rem;
        left: 1rem;
        width: 2.75rem;
        height: 2.75rem;
    }

    .character-section,
    .location-section,
    .contact-section {
        margin-top: 1.25rem;
        padding-top: 1.25rem;
    }

    .scroll-indicator {
        margin-top: 1.5rem;
    }

    .swiper-container {
        height: 14rem;
    }

    .image-card img {
        height: 12rem;
    }

    .swiper-button-next, .swiper-button-prev {
        width: 2rem;
        height: 2rem;
    }

        .swiper-button-next:after, .swiper-button-prev:after {
            font-size: 0.75rem;
        }
}

/* 터치 기기에 대한 최적화 */
@media (hover: none) {
    .toggle-button:hover,
    .return-to-receipt:hover,
    .new-card-button:hover,
    .selected-image:hover,
    .character-img:hover,
    .social-link:hover {
        transform: none;
        animation: none;
    }
}

/* 중간 사이즈 화면 최적화 */
@media (min-width: 640px) {
    .container {
        max-width: 640px;
    }

    .postcard-content {
        max-width: 640px;
    }
}

/* 개인정보 보호 안내 스타일 */
.privacy-notice {
    margin: 15px 0;
    padding: 0;
}

.privacy-notice-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    position: relative;
}

.privacy-notice-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: #6c757d;
}

.privacy-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 1px;
}

.privacy-icon svg {
    width: 16px;
    height: 16px;
    padding: 4px;
    background: #6c757d;
    border-radius: 4px;
    color: white;
}

.privacy-icon-text {
    font-size: 13px;
    font-weight: 600;
    color: #212529;
}

.privacy-text {
    flex: 1;
    line-height: 1.4;
}

.privacy-description {
    font-size: 12px;
    color: #495057;
    margin-bottom: 8px;
    line-height: 1.4;
    margin-top: 2px;
}

.privacy-description strong {
    color: #212529;
    font-weight: 600;
}

.privacy-features {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.privacy-feature {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: #495057;
    font-weight: 500;
}

.privacy-feature svg {
    color: #dc3545;
    flex-shrink: 0;
    width: 10px;
    height: 10px;
    padding: 0;
    background: none;
    border-radius: 0;
}

/* 반응형 디자인 */
@media (max-width: 480px) {
    .privacy-notice-content {
        padding: 10px;
        gap: 8px;
    }
    
    .privacy-icon svg {
        width: 14px;
        height: 14px;
        padding: 3px;
    }
    
    .privacy-icon-text {
        font-size: 12px;
    }
    
    .privacy-description {
        font-size: 11px;
    }
    
    .privacy-feature {
        font-size: 10px;
    }
    
    .privacy-features {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px 10px;
    }
}