/* 重置和基礎設定 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans TC', 'Microsoft JhengHei', sans-serif;
    font-weight: 400;
    line-height: 1.7;
    color: #333;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* 簡體中文字體設定 */
body[data-lang="zh-cn"] {
    font-family: 'Noto Sans SC', 'Microsoft YaHei', 'SimHei', sans-serif;
    font-weight: 500;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 簡體中文統一使用粗體 - 主要文字元素 */
body[data-lang="zh-cn"] .toc-text,
body[data-lang="zh-cn"] .departed-text,
body[data-lang="zh-cn"] .article-text,
body[data-lang="zh-cn"] .contact-label,
body[data-lang="zh-cn"] .contact-value,
body[data-lang="zh-cn"] .article-date,
body[data-lang="zh-cn"] .article-author,
body[data-lang="zh-cn"] .footer-text,
body[data-lang="zh-cn"] .business-hours,
body[data-lang="zh-cn"] .designer-contact-item,
body[data-lang="zh-cn"] .swipe-instruction,
body[data-lang="zh-cn"] .back-button {
    font-weight: 500 !important;
}

/* 簡體中文標題使用更粗的字體 */
body[data-lang="zh-cn"] h1,
body[data-lang="zh-cn"] h2,
body[data-lang="zh-cn"] h3,
body[data-lang="zh-cn"] .magazine-title,
body[data-lang="zh-cn"] .article-content h1,
body[data-lang="zh-cn"] .contact-name h2 {
    font-family: 'Noto Serif SC', 'Microsoft YaHei', 'SimHei', serif;
    font-weight: 700 !important;
}

/* 主要內容區域 */
.main {
    min-height: 100vh;
    padding: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.page-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
    position: relative;
    overflow-y: auto;
}

.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 0.5rem 2rem 3rem 2rem;
    max-width: calc(100vw - 45px);
    padding-top: 0.5rem;
    position: relative;
    min-height: 100vh;
}

/* 雜誌卡片樣式 */
.magazine-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 3rem 2.5rem;
    max-width: 480px;
    width: 100%;
    text-align: left;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
}

.magazine-title {
    font-family: 'Noto Serif TC', serif;
    font-size: 3rem;
    font-weight: 700;
    color: #2c2c2c;
    margin-bottom: 1rem;
    letter-spacing: 0.1em;
}

/* 簡體中文標題字體 */
body[data-lang="zh-cn"] .magazine-title {
    font-family: 'Noto Serif SC', 'Microsoft YaHei', 'SimHei', serif;
}

.magazine-subtitle {
    font-size: 1rem;
    color: #666;
    margin-bottom: 1.5rem;
    letter-spacing: 0.05em;
}

.magazine-description {
    font-size: 0.9rem;
    color: #777;
    margin-bottom: 3rem;
    line-height: 1.6;
}

/* Logo容器和樣式 */
.logo-container {
    text-align: center;
    margin-bottom: 3rem;
    padding: 1rem 0;
}

.magazine-logo {
    max-width: 100%;
    width: auto;
    height: auto;
    max-height: 350px;
    object-fit: contain;
    border-radius: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.magazine-logo:hover {
    transform: scale(1.02);
}

/* 離逝者目錄樣式 */
.departed-index {
    padding: 2rem 0;
}

.departed-article-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.departed-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.departed-item:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #e91e63;
}

.departed-text {
    font-size: 1.2rem;
    color: #333;
    font-weight: 500;
    letter-spacing: 0.05em;
}

.departed-number {
    font-size: 1rem;
    color: #e91e63;
    font-weight: 600;
    min-width: 2.5rem;
    text-align: center;
    background: rgba(233, 30, 99, 0.1);
    padding: 0.5rem;
    border-radius: 8px;
}

/* 返回按鈕樣式 */
/* 標題區域容器 */
.title-header {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1rem;
}

.back-button {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    border: 1px solid rgba(0, 0, 0, 0.2);
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    white-space: nowrap;
    flex-shrink: 0;
}

.back-button:hover {
    background: rgba(233, 30, 99, 0.9);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(233, 30, 99, 0.3);
}

/* 目錄樣式 */
.table-of-contents {
    text-align: left;
}

.toc-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
}

.toc-item:hover {
    background: rgba(0, 0, 0, 0.02);
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    border-radius: 8px;
}

.toc-item:last-child {
    border-bottom: none;
}

.toc-text {
    font-size: 1.1rem;
    color: #333;
    font-weight: 400;
}

.toc-number {
    font-size: 0.9rem;
    color: #e91e63;
    font-weight: 500;
    min-width: 2rem;
    text-align: right;
}

/* 語言切換樣式 */
.language-switch {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.lang-option {
    cursor: pointer;
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 500;
    color: #666;
}

.lang-option.active {
    color: #2c2c2c;
    background: rgba(44, 44, 44, 0.1);
    font-weight: 600;
}

.lang-option:hover {
    color: #2c2c2c;
    background: rgba(44, 44, 44, 0.05);
}

.lang-separator {
    color: #999;
    margin: 0 0.2rem;
}

/* 文章內容樣式 */
.article-content {
    padding: 3rem 4rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-width: 800px;
    width: 100%;
    overflow-y: auto;
}

.article-content h1 {
    font-family: 'Noto Serif TC', serif;
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
    color: #2c2c2c;
    letter-spacing: 0.1em;
    flex: 1;
}

/* 簡體中文文章標題字體 */
body[data-lang="zh-cn"] .article-content h1 {
    font-family: 'Noto Serif SC', 'Microsoft YaHei', 'SimHei', serif;
}

.article-date {
    text-align: center;
    font-size: 1rem;
    color: #666;
    margin-bottom: 1rem;
    letter-spacing: 0.05em;
}

.article-author {
    text-align: center;
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 2rem;
    letter-spacing: 0.05em;
}

.article-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
    margin-bottom: 1.5rem;
    text-align: justify;
}

.continue-reading {
    color: #666;
    font-style: italic;
    text-align: center;
    margin-top: 2rem;
}

/* 文章網格 */
.articles-grid {
    display: grid;
    gap: 1.5rem;
}

.article-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.article-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.article-card-content {
    padding: 1.5rem;
}

.article-card h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
    line-height: 1.4;
    color: #333;
}

.article-card p {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.article-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: #999;
}

/* 載入狀態 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100px;
    color: #666;
    font-size: 1.1rem;
}



/* 響應式設計 */
@media (max-width: 1024px) {
    .content-area {
        grid-template-columns: 1fr;
        grid-template-rows: 40vh 60vh;
        padding-right: 70px;
    }
    
    .article-content {
        padding: 2rem 1.5rem;
    }
    
    .right-menu {
        width: 45px;
        min-width: 45px;
        height: 100vh;
        position: fixed;
        right: 0;
        top: 0;
        z-index: 1000;
    }
}

@media (max-width: 768px) {
    .main {
        padding: 0.5rem;
    }
    
    .content-area {
        padding: 0;
        max-width: calc(100vw - 65px);
        align-items: flex-start;
    }
    
    .magazine-card {
        padding: 2rem 1.5rem;
        min-height: calc(100vh - 1rem);
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        max-width: none;
    }
    
    .magazine-title {
        font-size: 2.8rem;
        margin-bottom: 1rem;
    }
    
    .magazine-subtitle {
        font-size: 1.1rem;
        margin-bottom: 1.5rem;
    }
    
    .magazine-description {
        font-size: 1rem;
        margin-bottom: 2rem;
        line-height: 1.7;
        text-align: left;
    }
    
    .table-of-contents {
        flex-grow: 2;
        display: flex;
        flex-direction: column;
        justify-content: space-evenly;
    }
    
    .toc-item {
        padding: 1.5rem 0;
        margin-bottom: 0.8rem;
        border-bottom: 2px solid rgba(0, 0, 0, 0.1);
    }
    
    .toc-text {
        font-size: 1.3rem;
        font-weight: 500;
    }
    
    .toc-number {
        font-size: 1.1rem;
        font-weight: 600;
    }
    
    .article-content {
        padding: 1rem 1.5rem;
        min-height: auto;
        display: flex;
        flex-direction: column;
        max-width: none;
        margin-top: 0;
    }
    
    .title-header {
        gap: 0.8rem;
        margin-bottom: 1.5rem;
    }
    
    .back-button {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
    
    .article-content h1 {
        font-size: 1.4rem;
        margin: 0;
    }
    
    .article-date {
        font-size: 1rem;
        margin-bottom: 1rem;
    }
    
    .article-author {
        font-size: 1.1rem;
        margin-bottom: 2rem;
    }
    
    .article-text {
        font-size: 1.1rem;
        line-height: 1.8;
        margin-bottom: 1.5rem;
        text-align: left;
    }
    
    .right-menu {
        width: 42px;
        min-width: 42px;
    }
    
    .vertical-tab {
        min-height: 75px;
        padding: 0.4rem 0;
    }
    
    .tab-text {
        font-size: 0.9rem;
    }
    
    /* 英文語言時的平板樣式 */
    body[data-lang="en"] .vertical-tab {
        min-height: 75px;
        max-height: calc(100vh / 8);
        padding: 0.4rem 0;
    }
    
    body[data-lang="en"] .tab-text {
        font-size: 0.65rem;
        line-height: 0.9;
        font-weight: bold;
    }
}

@media (max-width: 480px) {
    .main {
        padding: 0.3rem;
    }
    
    .content-area {
        max-width: calc(100vw - 55px);
        padding: 0.5rem 0.3rem;
        padding-top: 1rem;
        align-items: flex-start;
    }
    
    .magazine-card {
        padding: 1.5rem 1.2rem;
        min-height: calc(100vh - 0.6rem);
    }
    
    .magazine-title {
        font-size: 2.5rem;
        margin-bottom: 0.8rem;
    }
    
    .magazine-subtitle {
        font-size: 1rem;
        margin-bottom: 1.2rem;
    }
    
    .magazine-description {
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
    }
    
    .toc-item {
        padding: 1.3rem 0;
        margin-bottom: 0.5rem;
    }
    
    .toc-text {
        font-size: 1.2rem;
    }
    
    .toc-number {
        font-size: 1rem;
    }
    
    .article-content {
        padding: 1rem 1.2rem;
        min-height: auto;
        margin-top: 0;
    }
    
    .title-header {
        gap: 0.6rem;
        margin-bottom: 1rem;
    }
    
    .back-button {
        padding: 0.4rem 0.8rem;
        font-size: 0.75rem;
    }
    
    .article-content h1 {
        font-size: 1.2rem;
        margin: 0;
    }
    
    .article-text {
        font-size: 1rem;
        line-height: 1.75;
        margin-bottom: 1.3rem;
    }
    
    .right-menu {
        width: 40px;
        min-width: 40px;
    }
    
    .vertical-tab {
        min-height: 65px;
        padding: 0.3rem 0;
    }
    
    .tab-text {
        font-size: 0.85rem;
    }
    
    /* 手機版英文語言時的樣式 */
    body[data-lang="en"] .vertical-tab {
        min-height: 65px;
        max-height: calc(100vh / 8);
        padding: 0.3rem 0;
    }
    
    body[data-lang="en"] .tab-text {
        font-size: 0.55rem;
        line-height: 0.8;
        font-weight: bold;
    }
}

/* 動畫效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeInUp 0.6s ease-out;
}

/* 錯誤狀態 */
.error {
    text-align: center;
    color: #e91e63;
    padding: 2rem;
    font-size: 1.1rem;
}

.empty-state {
    text-align: center;
    color: #666;
    padding: 3rem 1rem;
    font-size: 1.1rem;
}

.empty-state h3 {
    margin-bottom: 1rem;
    color: #333;
}

/* 右側選單 */
.right-menu {
    width: 45px;
    min-width: 45px;
    background: #fff;
    border: 2px solid #333;
    border-left: 8px solid #333;
    height: 100vh;
    position: sticky;
    top: 0;
    box-shadow: 3px 3px 8px rgba(0,0,0,0.2);
    overflow: hidden;
    flex-shrink: 0;
}

.index-content {
    background: #fff;
    height: 100%;
}

.vertical-tabs {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.vertical-tab {
    background: #fff;
    transition: all 0.2s ease;
    flex: 1;
    min-height: 80px;
    max-height: calc(100vh / 8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    padding: 0.4rem 0;
}

.vertical-tab.active {
    background: #333;
    color: #fff;
}

.vertical-tab:hover {
    background: #f5f5f5;
}

.vertical-tab.active:hover {
    background: #333;
}

.vertical-tab:last-child {
    border-bottom: none;
}

.vertical-tab:hover {
    background: #f5f5f5;
}

.vertical-tab.active {
    background: #e91e63;
    color: white;
}

.vertical-tab.active::before {
    content: '';
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid #e91e63;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    z-index: 10;
}

.tab-text {
    font-size: 0.85rem;
    font-weight: 500;
    text-align: center;
    line-height: 1.3;
    color: #333;
    transition: color 0.2s ease;
    margin: 0.05rem 0;
}

/* 生活的輔助項目特殊間距 */
.vertical-tab[data-section="life-support"] {
    margin: 0.3rem 0;
}

/* 英文語言時的垂直導航樣式 */
body[data-lang="en"] .vertical-tab {
    min-height: 85px;
    max-height: calc(100vh / 8);
    padding: 0.4rem 0;
}

body[data-lang="en"] .tab-text {
    font-size: 0.75rem;
    line-height: 1.0;
    font-weight: bold;
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

.vertical-tab.active .tab-text {
    color: #fff;
}

/* 離逝者頁面樣式 */
.departed-section {
    text-align: center;
    padding: 2rem;
}

.departed-gallery {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.book-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    height: 600px;
    perspective: 1200px;
    cursor: grab;
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.book-page {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3), 
                inset 0 0 10px rgba(255, 255, 255, 0.1);
    border: 3px solid #fff;
    backface-visibility: hidden;
    transform-style: preserve-3d;
    transform-origin: left center;
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                box-shadow 0.8s ease;
}

.book-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg, 
        transparent 0%, 
        rgba(0, 0, 0, 0.1) 2%, 
        rgba(0, 0, 0, 0.05) 8%, 
        transparent 15%
    );
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.book-page.active::before {
    opacity: 1;
}

/* 預設頁面狀態 */
.book-page {
    transform: rotateY(0deg);
}

/* 確保翻頁動畫期間頁面的背面不可見 */
.book-page.flipping-away {
    backface-visibility: hidden;
}

/* 翻頁動畫效果 */
.book-page.flipping-away {
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4), 
                inset 0 0 20px rgba(255, 255, 255, 0.05);
}

.book-page.flipping-away::before {
    opacity: 1;
    background: linear-gradient(
        90deg, 
        rgba(0, 0, 0, 0.15) 0%, 
        rgba(0, 0, 0, 0.08) 30%, 
        rgba(0, 0, 0, 0.03) 60%, 
        transparent 100%
    );
}

/* 當前活躍頁面的樣式 */
.book-page.active {
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35), 
                inset 0 0 15px rgba(255, 255, 255, 0.1);
}

/* 非活躍頁面的樣式 */
.book-page:not(.active) {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* 確保翻頁時頁面層級正確 */
.book-page.active {
    z-index: 2 !important;
}

.book-page.flipping-away {
    z-index: 3 !important;
}

.departed-image {
    width: calc(100% - 1.5rem);
    height: calc(100% - 1.5rem);
    max-width: 95%;
    max-height: 95%;
    object-fit: cover;
    border-radius: 9px;
    user-select: none;
    cursor: pointer;
    transition: transform 0.2s ease;
    margin: auto;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translateX(-50%) translateY(-50%);
}

.departed-image:hover {
    transform: translateX(-50%) translateY(-50%) scale(1.02);
}

.departed-image:active {
    transform: translateX(-50%) translateY(-50%) scale(0.98);
}

.swipe-instruction {
    margin-top: 1.5rem;
    color: #666;
    font-size: 0.9rem;
    text-align: center;
}

.swipe-instruction p {
    margin: 0;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    display: inline-block;
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.swipe-instruction p::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg, 
        transparent, 
        rgba(255, 255, 255, 0.6), 
        transparent
    );
    transition: left 0.5s ease;
}

.swipe-instruction p:hover::before {
    left: 100%;
}

.swipe-instruction p:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 頁面指示器 */
.page-indicator {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.indicator-dot.active {
    background: #e91e63;
    transform: scale(1.2);
    border-color: rgba(233, 30, 99, 0.3);
    box-shadow: 0 0 10px rgba(233, 30, 99, 0.4);
}

.indicator-dot:hover:not(.active) {
    background: rgba(0, 0, 0, 0.5);
    transform: scale(1.1);
}

/* 圖片放大模態窗口 */
.image-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-modal.active {
    display: flex;
    opacity: 1;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.image-modal.active .modal-image {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: -50px;
    right: -10px;
    color: #fff;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.modal-info {
    position: absolute;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    text-align: center;
    font-size: 0.9rem;
    background: rgba(0, 0, 0, 0.5);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

/* 手機版模態窗口優化 */
@media (max-width: 768px) {
    .image-modal.active {
        padding: 1rem;
    }
    
    .modal-close {
        top: -40px;
        right: 0;
        font-size: 1.5rem;
        width: 35px;
        height: 35px;
    }
    
    .modal-info {
        bottom: -50px;
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
}

/* 手機版離逝者頁面樣式 */
@media (max-width: 768px) {
    .book-container {
        height: 70vh;
        max-width: 90vw;
        perspective: 1000px;
    }
    
    .departed-section {
        padding: 1.5rem 1rem;
        min-height: calc(100vh - 1rem);
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
    }
    
    .departed-gallery {
        flex-grow: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    
    .swipe-instruction p {
        background: rgba(255, 255, 255, 0.95);
        font-weight: 500;
    }
}

@media (max-width: 480px) {
    .book-container {
        height: 65vh;
        max-width: 95vw;
        perspective: 900px;
    }
    
    .swipe-instruction {
        margin-top: 1rem;
    }
    
    .swipe-instruction p {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
        font-weight: 500;
    }
    
    .book-page {
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
        border: 2px solid #fff;
    }
    
    /* 手機版圖片調整 */
    .departed-image {
        width: calc(100% - 1rem);
        height: calc(100% - 1rem);
        max-width: 92%;
        max-height: 92%;
    }
    
    /* Logo手機版樣式 */
    .logo-container {
        margin-bottom: 2rem;
        padding: 0.5rem 0;
    }
    
    .magazine-logo {
        max-height: 250px;
    }
    
    /* 離逝者目錄手機版樣式 */
    .departed-item {
        padding: 1rem 1.5rem;
        margin: 0 0.5rem;
    }
    
    .departed-text {
        font-size: 1.1rem;
    }
    
    .departed-number {
        min-width: 2rem;
        padding: 0.4rem;
        font-size: 0.9rem;
    }
    
    /* 返回按鈕手機版樣式 */
    .back-button {
        top: 1rem;
        left: 1rem;
        padding: 0.6rem 1.2rem;
        font-size: 0.8rem;
    }
    
    /* 聯絡我們頁面手機版樣式 */
    .contact-section {
        padding: 1.5rem 1.2rem;
    }
    
    .contact-info {
        margin-top: 1.5rem;
    }
    
    .contact-name h2 {
        font-size: 1.4rem;
        margin-bottom: 1rem;
    }
    
    .contact-item {
        margin-bottom: 1rem;
        padding: 0.8rem;
    }
    
    .contact-label {
        font-size: 1rem;
    }
    
    .contact-value {
        font-size: 1rem;
    }
    
    /* 小螢幕進一步調整圖片 */
    .departed-image {
        width: calc(100% - 0.8rem);
        height: calc(100% - 0.8rem);
        max-width: 88%;
        max-height: 88%;
    }
}

/* 聯絡我們頁面樣式 */
.contact-section {
    padding: 2rem;
}

.contact-info {
    text-align: center;
    margin-top: 3rem;
}

.contact-name {
    margin-bottom: 2rem;
}

.contact-name h2 {
    font-family: 'Noto Serif TC', serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: #2c2c2c;
    letter-spacing: 0.1em;
}

/* 簡體中文聯絡名稱字體 */
body[data-lang="zh-cn"] .contact-name h2 {
    font-family: 'Noto Serif SC', 'Microsoft YaHei', 'SimHei', serif;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: min(100%, 800px);
    margin: 0 auto;
    padding: 0 40px;
}

.contact-item {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    max-width: 400px;
    width: 100%;
    margin: 0 auto;
    text-align: center;
}

.contact-item:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.contact-label {
    display: block;
    font-weight: 500;
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.contact-value {
    display: block;
    font-size: 1.1rem;
    color: #e91e63;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-value:hover {
    color: #c2185b;
    text-decoration: underline;
}

.footer-text {
    margin-top: 1rem;
    padding-top: 0;
    border-top: none;
    text-align: center;
    font-size: 0.85rem;
    color: #000;
    font-weight: 400;
    letter-spacing: 0.05em;
}

.business-hours {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 1rem;
    color: #666;
    font-style: normal;
}

.designer-contact-item {
    font-size: 0.95rem;
    color: #999;
    display: flex !important;
    justify-content: center;
    align-items: center;
    gap: 0.45rem;
    width: 100% !important;
    max-width: 100% !important;
    white-space: nowrap !important;
    overflow: hidden;
    text-align: center;
    border-radius: 12px;
    padding: 0.75rem 0.9rem;
    margin: 0 !important;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.designer-contact-item:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.designer-contact-item * {
    white-space: normal !important;
}

.designer-contact-item span {
    color: #999;
    display: inline;
}

.designer-contact-item a {
    display: inline;
    font-size: inherit !important;
    color: #e91e63;
}

@media (max-width: 900px) {
    .contact-details {
        padding: 0 20px;
    }
    
    .designer-contact-item {
        gap: 0.35rem;
        padding: 0.65rem 0.75rem;
        font-size: 0.95rem;
    }
    
    .designer-contact-item:hover {
        transform: translateY(-2px);
    }
}

@media (max-width: 600px) {
    .designer-contact-item {
        flex-direction: column !important;
        align-items: center !important;
        gap: 0.2rem !important;
        word-break: break-all;
        white-space: normal !important;
        text-align: center !important;
    }
    .designer-contact-item * {
        text-align: center !important;
    }
}


/* 圖片放大模態框導航按鈕 */
.modal-nav-prev,
.modal-nav-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    font-size: 1.4rem;
    cursor: pointer;
    z-index: 1001;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    font-weight: bold;
}

.modal-nav-prev {
    left: 1.5rem;
}

.modal-nav-next {
    right: 1.5rem;
}

.modal-nav-prev:hover,
.modal-nav-next:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: translateY(-50%) scale(1.05);
}

.modal-nav-prev:active,
.modal-nav-next:active {
    transform: translateY(-50%) scale(0.95);
}

/* 手機版導航按鈕調整 */
@media (max-width: 768px) {
    .modal-nav-prev,
    .modal-nav-next {
        width: 38px;
        height: 38px;
        font-size: 1.1rem;
    }
    
    .modal-nav-prev {
        left: 1rem;
    }
    
    .modal-nav-next {
        right: 1rem;
    }
}

/* 書頁導航按鈕 */
.book-nav-prev,
.book-nav-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.4);
    color: white;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    font-size: 1.3rem;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.book-nav-prev {
    left: -70px;
}

.book-nav-next {
    right: -70px;
}

.book-nav-prev:hover,
.book-nav-next:hover {
    background: rgba(233, 30, 99, 0.9);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(233, 30, 99, 0.4);
}

.book-nav-prev:active,
.book-nav-next:active {
    transform: translateY(-50%) scale(0.95);
}

/* 當只有一頁時隱藏導航按鈕 */
.book-nav-prev.hidden,
.book-nav-next.hidden {
    display: none;
}

/* 手機版書頁導航按鈕調整 */
@media (max-width: 768px) {
    .book-nav-prev,
    .book-nav-next {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
        z-index: 20;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    }
    
    .book-nav-prev {
        left: -60px;
    }
    
    .book-nav-next {
        right: -60px;
    }
}

@media (max-width: 480px) {
    .book-nav-prev,
    .book-nav-next {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
        z-index: 25;
        background: rgba(0, 0, 0, 0.3);
        border: 2px solid rgba(255, 255, 255, 0.2);
    }
    
    .book-nav-prev {
        left: 15px;
        top: 50%;
    }
    
    .book-nav-next {
        right: 15px;
        top: 50%;
    }
}

@media (max-width: 375px) {
    .book-nav-prev,
    .book-nav-next {
        width: 34px;
        height: 34px;
        font-size: 1rem;
    }
    
    .book-nav-prev {
        left: 8px;
    }
    
    .book-nav-next {
        right: 8px;
    }
}

/* 語言選擇器樣式 */
.language-selector-container {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.language-selector {
    position: relative;
    font-family: 'Noto Sans TC', 'Microsoft JhengHei', sans-serif;
    display: flex;
    align-items: center;
}

.language-options {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    align-items: center;
    background: transparent;
}

.language-option {
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    color: #333;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.1);
    white-space: nowrap;
}

/* 國旗圖標樣式 */
.flag-icon {
    display: inline-block;
    width: 16px;
    height: 12px;
    border-radius: 2px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

.flag-hk {
    background-image: url('assets/flags/hk.png');
}

.flag-cn {
    background-image: url('assets/flags/cn.png');
}

.flag-gb {
    background-image: url('assets/flags/gb.png');
}

.language-option:hover {
    background: rgba(233, 30, 99, 0.1);
    color: #e91e63;
}

.language-option.active {
    background: rgba(233, 30, 99, 0.15);
    color: #e91e63;
    font-weight: 600;
}

/* 手機版語言選擇器調整 */
@media (max-width: 768px) {
    .language-selector-container {
        top: 15px;
        right: 15px;
    }
    
    .language-options {
        gap: 0.3rem;
    }
    
    .language-option {
        padding: 6px 10px;
        font-size: 0.8rem;
        gap: 4px;
    }
    
    .flag-icon {
        width: 14px;
        height: 10px;
    }
}

/* 更小螢幕的手機版語言選擇器調整 */
@media (max-width: 480px) {
    .language-selector-container {
        top: 12px;
        right: 12px;
    }
    
    .language-options {
        gap: 0.25rem;
    }
    
    .language-option {
        padding: 5px 8px;
        font-size: 0.75rem;
        gap: 3px;
    }
    
    .flag-icon {
        width: 12px;
        height: 9px;
    }
}

/* Designer Credit */
.designer-credit {
    text-align: center;
    color: #666;
    font-size: 0.9rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    margin-top: 0.75rem;
    margin-bottom: 1.5rem;
    padding: 0.5rem 0;
    width: 100%;
}

@media (max-width: 768px) {
    .designer-credit {
        font-size: 0.8rem;
        margin-top: 0.5rem;
        margin-bottom: 1rem;
    }
}

