/* 九龍殿網站樣式 - 現代藝術與書香氣息融合 */

/* 全域重置和變數 */
:root {
    /* 色彩系統 */
    --primary-color: #2c3e50;      /* 深藍灰 - 穩重感 */
    --secondary-color: #8b4513;    /* 古銅色 - 傳統感 */
    --accent-color: #d4a574;       /* 古金色 - 典雅感 */
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --text-muted: #95a5a6;
    --background-light: #fdfcfa;   /* 宣紙色 */
    --background-white: #ffffff;
    --border-light: #ecf0f1;
    --shadow-soft: rgba(44, 62, 80, 0.1);
    --shadow-medium: rgba(44, 62, 80, 0.15);
    --gradient-primary: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    --gradient-accent: linear-gradient(135deg, #d4a574 0%, #c89c5a 100%);
    
    /* 字體 */
    --font-serif: 'Noto Serif TC', serif;
    --font-sans: 'Noto Sans TC', sans-serif;
    
    /* 間距 */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 3rem;
    --spacing-xl: 4rem;
    --spacing-xxl: 6rem;
    
    /* 圓角 */
    --radius-sm: 0.5rem;
    --radius-md: 1rem;
    --radius-lg: 1.5rem;
    
    /* 動畫 */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* 全域重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    scroll-padding-top: 80px; /* 為固定導航欄留出空間 */
}

body {
    font-family: var(--font-sans);
    line-height: 1.7;
    color: var(--text-dark);
    background-color: var(--background-light);
    overflow-x: hidden;
}

/* 通用類別 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-sm);
}

@media (min-width: 768px) {
    .container {
        padding: 0 var(--spacing-md);
    }
}

/* 按鈕樣式 - 仙俠風格 */
.btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    text-align: center;
    cursor: pointer;
    border: none;
    font-size: 1.1rem;
    font-family: var(--font-serif);
    letter-spacing: 0.2em;
    margin: 0 var(--spacing-sm);
}

.btn-primary {
    background: linear-gradient(135deg, #8b4513 0%, #d4a574 50%, #8b4513 100%);
    color: #f4f1e8;
    border: 2px solid rgba(139, 69, 19, 0.8);
    box-shadow: 
        0 6px 20px rgba(139, 69, 19, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

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

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 12px 30px rgba(139, 69, 19, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    background: linear-gradient(135deg, #d4a574 0%, #8b4513 50%, #d4a574 100%);
}

.btn-secondary {
    background: rgba(244, 241, 232, 0.9);
    color: #8b4513;
    border: 2px solid #8b4513;
    backdrop-filter: blur(5px);
    box-shadow: 
        0 4px 15px rgba(139, 69, 19, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background: #8b4513;
    color: #f4f1e8;
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(139, 69, 19, 0.4);
}

/* 導航欄 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(253, 252, 250, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid var(--border-light);
    transition: all var(--transition-normal);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem var(--spacing-sm);
    max-width: 1200px;
    margin: 0 auto;
}

.nav-logo h1 {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.2rem;
}

.nav-logo .subtitle {
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 300;
}

.nav-menu {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 400;
    transition: color var(--transition-fast);
    position: relative;
}

.nav-link:hover {
    color: var(--secondary-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: width var(--transition-normal);
}

.nav-link:hover::after {
    width: 100%;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-normal);
}

.nav-toggle:hover {
    background: rgba(44, 62, 80, 0.1);
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: var(--primary-color);
    transition: all var(--transition-normal);
    border-radius: 2px;
    transform-origin: center;
}

/* Hamburger 動畫 */
.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* 響應式導航 */
@media (max-width: 768px) {
    .navbar {
        z-index: 9999; /* 提高圖層優先級 */
    }
    
    .nav-container {
        padding: 0 var(--spacing-sm);
        justify-content: flex-start; /* 讓logo靠左 */
    }
    
    .nav-logo {
        margin-right: auto; /* 推送toggle到右邊 */
        text-align: left; /* 確保文字靠左對齊 */
    }
    
    .nav-logo h1 {
        font-size: 1.6rem; /* 手機版稍微縮小 */
    }
    
    .nav-menu {
        position: fixed;
        top: 70px; /* 導航欄高度 */
        left: 0;
        right: 0;
        background: var(--background-white);
        flex-direction: column;
        padding: var(--spacing-md);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition-normal);
        box-shadow: 0 10px 30px var(--shadow-medium);
        z-index: 998;
        border-top: 2px solid var(--accent-color);
    }
    
    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-link {
        padding: var(--spacing-sm) 0;
        border-bottom: 1px solid var(--border-light);
        text-align: center;
        font-size: 1.1rem;
    }
    
    .nav-link:last-child {
        border-bottom: none;
    }
    
    .nav-toggle {
        display: flex;
        z-index: 1000;
    }
}

/* 主頁橫幅 - 仙俠風格 */
.hero {
    height: 110vh; /* 調整高度給滾動指示器適當空間 */
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 80px var(--spacing-md) 0; /* 為導航欄留出空間 */
    background: 
        linear-gradient(135deg, rgba(139, 69, 19, 0.1) 0%, rgba(212, 165, 116, 0.2) 100%),
        radial-gradient(circle at 30% 70%, rgba(139, 69, 19, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(212, 165, 116, 0.1) 0%, transparent 40%),
        #f4f1e8;
}

/* 宣紙紋理背景 */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" width="200" height="200"><defs><filter id="paper"><feTurbulence baseFrequency="0.04" numOctaves="5" result="noise" seed="1"/><feDiffuseLighting in="noise" lighting-color="white" surfaceScale="1"><feDistantLight azimuth="45" elevation="60"/></feDiffuseLighting></filter></defs><rect width="100%" height="100%" fill="%23f4f1e8" filter="url(%23paper)" opacity="0.8"/></svg>');
    z-index: 1;
}

/* 潑墨效果 */
.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse 200px 100px at 10% 20%, rgba(139, 69, 19, 0.3) 0%, transparent 70%),
        radial-gradient(ellipse 150px 200px at 90% 80%, rgba(44, 62, 80, 0.2) 0%, transparent 60%),
        radial-gradient(ellipse 300px 150px at 60% 30%, rgba(212, 165, 116, 0.25) 0%, transparent 80%),
        radial-gradient(ellipse 250px 180px at 20% 90%, rgba(139, 69, 19, 0.2) 0%, transparent 70%);
    animation: inkFlow 30s infinite ease-in-out;
    z-index: 2;
}

@keyframes inkFlow {
    0%, 100% { 
        opacity: 0.6; 
        transform: scale(1) rotate(0deg); 
    }
    25% { 
        opacity: 0.8; 
        transform: scale(1.1) rotate(5deg); 
    }
    50% { 
        opacity: 0.7; 
        transform: scale(0.95) rotate(-3deg); 
    }
    75% { 
        opacity: 0.9; 
        transform: scale(1.05) rotate(2deg); 
    }
}

/* 潑墨轉場效果 */
.ink-drop-transition {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 4; /* 確保在hero-content下方 */
    pointer-events: none;
    overflow: hidden;
}

.ink-drop {
    position: absolute;
    width: 3px;
    height: 3px;
    background: radial-gradient(circle, 
        rgba(44, 62, 80, 0.9) 0%, 
        rgba(139, 69, 19, 0.7) 40%, 
        rgba(44, 62, 80, 0.5) 70%, 
        transparent 100%);
    border-radius: 50%;
    animation: inkDrop 3s ease-in forwards;
    opacity: 0;
}

@keyframes inkDrop {
    0% {
        opacity: 0;
        transform: translateY(-20px) scale(0.5);
    }
    10% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    30% {
        transform: translateY(50vh) scale(1.5);
        opacity: 0.8;
    }
    60% {
        transform: translateY(80vh) scale(2.5);
        opacity: 0.6;
    }
    80% {
        transform: translateY(95vh) scale(4);
        opacity: 0.4;
    }
    100% {
        transform: translateY(110vh) scale(8);
        opacity: 0;
    }
}

.ink-splash {
    position: absolute;
    bottom: -50px;
    width: 100px;
    height: 50px;
    background: radial-gradient(ellipse, 
        rgba(44, 62, 80, 0.6) 0%, 
        rgba(139, 69, 19, 0.4) 30%, 
        transparent 70%);
    border-radius: 50%;
    animation: inkSplash 1s ease-out forwards;
    opacity: 0;
}

@keyframes inkSplash {
    0% {
        opacity: 0;
        transform: scale(0) rotate(0deg);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.5) rotate(180deg);
    }
    100% {
        opacity: 0;
        transform: scale(3) rotate(360deg);
    }
}

.hero-background {
    display: none; /* 隱藏照片背景，使用宣紙風格 */
}

.hero-bg-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.3;
}

.hero-overlay {
    display: none; /* 移除遮罩，保持宣紙清爽感 */
}

.hero-content {
    text-align: center;
    position: relative;
    z-index: 5; /* 提高層級，確保在最上層 */
    max-width: 900px;
    width: 90%; /* 確保有適當的寬度 */
    margin: 0 auto; /* 水平居中 */
    padding: var(--spacing-xl) var(--spacing-md);
    background: rgba(244, 241, 232, 0.85);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(5px);
    border: 3px solid rgba(139, 69, 19, 0.3);
    box-shadow: 
        0 20px 40px rgba(139, 69, 19, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* Hero content 響應式調整 */
@media (max-width: 1200px) {
    .hero-content {
        max-width: 800px;
        width: 95%;
    }
}

@media (max-width: 768px) {
    .hero-content {
        max-width: 90%;
        width: 95%;
        padding: var(--spacing-lg) var(--spacing-sm);
        margin: 0 auto;
    }
    
    /* 平板版圖片標題調整 */
    .hero-title-image-file {
        max-width: min(85vw, 500px) !important;
        margin-bottom: 1.8rem !important;
    }
    
    .hero {
        padding-top: 90px; /* 手機版導航欄可能較高 */
    }
}

@media (max-width: 480px) {
    .hero-content {
        width: 95%;
        margin: 0 auto;
        padding: var(--spacing-md) var(--spacing-xs);
    }
    
    /* 手機版圖片標題調整 */
    .hero-title-image-file {
        max-width: min(80vw, 320px) !important;
        margin: 0 0 1.2rem 8% !important; /* 小屏幕左邊偏移8% */
        transform: rotate(-1deg) translateX(-15px) !important; /* 更多向左偏移 */
        position: relative !important;
        z-index: 99999 !important; /* 確保在最上層 */
    }
    
    .hero {
        padding-top: 100px; /* 小螢幕留更多空間 */
        min-height: 100vh;
    }
    
    .hero-description {
        font-size: 1rem;
        line-height: 1.6;
        padding: var(--spacing-sm);
        margin-bottom: var(--spacing-md);
    }
    
    .hero-buttons {
        gap: var(--spacing-xs);
    }
    
    .btn {
        width: 180px;
        font-size: 0.9rem;
        padding: 10px 20px;
    }
}

/* 書法風格裝飾邊框 */
.hero-content::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    bottom: 15px;
    border: 2px solid rgba(139, 69, 19, 0.4);
    border-radius: var(--radius-md);
    pointer-events: none;
}

.hero-content::after {
    content: '';
    position: absolute;
    top: 25px;
    left: 25px;
    right: 25px;
    bottom: 25px;
    border: 1px solid rgba(212, 165, 116, 0.6);
    border-radius: var(--radius-sm);
    pointer-events: none;
}

/* 九龍殿圖片標題樣式 */
.hero-title-image-file {
    display: block !important;
    margin: 0 auto 2rem auto !important;
    max-width: min(80vw, 600px) !important;
    height: auto !important;
    filter: 
        brightness(0) /* 將圖片變成黑色 */
        drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3))
        drop-shadow(4px 4px 8px rgba(0, 0, 0, 0.2)) !important;
    transition: all 0.3s ease !important;
    z-index: 99999 !important; /* 提高層級 */
    opacity: 0.95 !important;
    transform: rotate(-1deg) !important; /* 輕微逆時針旋轉修正傾斜 */
    position: relative !important; /* 確保層級生效 */
}

.hero-title-image-file:hover {
    transform: rotate(-1deg) scale(1.02) !important; /* 保持旋轉角度 */
    filter: 
        brightness(0) 
        drop-shadow(3px 3px 6px rgba(0, 0, 0, 0.4))
        drop-shadow(6px 6px 12px rgba(0, 0, 0, 0.3)) !important;
}

/* 九龍殿黑色標題樣式 - 模擬圖檔中的書法字體 */
.hero-title-black {
    font-family: 'Noto Serif TC', '思源宋體', serif !important;
    font-size: clamp(4rem, 12vw, 8rem) !important;
    font-weight: 900 !important;
    color: #1a1a1a !important;
    letter-spacing: 0.15em !important;
    text-shadow: 
        2px 2px 4px rgba(0, 0, 0, 0.9),
        4px 4px 8px rgba(0, 0, 0, 0.6),
        0 0 15px rgba(0, 0, 0, 0.4),
        6px 6px 12px rgba(0, 0, 0, 0.3) !important;
    position: relative !important;
    line-height: 1.1 !important;
    display: block !important;
    margin-bottom: 2rem !important;
    text-align: center !important;
    filter: 
        drop-shadow(4px 4px 8px rgba(0, 0, 0, 0.8))
        contrast(1.2)
        saturate(0.8) !important;
    -webkit-text-stroke: 2px rgba(0, 0, 0, 0.5) !important;
    z-index: 10 !important;
    transform: scale(1.02) !important;
    font-variant: small-caps !important;
}

/* 九龍殿標題圖檔樣式 */
.hero-title-image {
    position: relative;
    display: block !important; /* 改為block確保正確顯示 */
    margin-bottom: 2rem; /* 使用固定值而非CSS變數 */
    text-align: center; /* 確保居中 */
    width: 100%; /* 確保寬度 */
    min-height: 120px; /* 確保有高度 */
    /* 臨時調試背景 */
    /* background: rgba(255, 0, 0, 0.1); */
}

.hero-title-image::before {
    content: '九龍殿';
    font-family: 'Noto Serif TC', serif; /* 直接指定字體 */
    font-size: clamp(3.5rem, 10vw, 7rem);
    font-weight: 900;
    color: #000000 !important; /* 添加!important確保優先級 */
    letter-spacing: 0.2em;
    text-shadow: 
        1px 1px 2px rgba(0, 0, 0, 0.8),
        2px 2px 4px rgba(0, 0, 0, 0.5),
        0 0 10px rgba(0, 0, 0, 0.3);
    position: relative;
    line-height: 1.2;
    display: block !important; /* 添加!important確保顯示 */
    filter: drop-shadow(3px 3px 6px rgba(0, 0, 0, 0.7));
    -webkit-text-stroke: 1px rgba(0, 0, 0, 0.3); /* 添加描邊效果 */
    text-align: center; /* 確保文字居中 */
    z-index: 10; /* 確保顯示在上層 */
}

.hero-title {
    font-family: var(--font-serif);
    font-size: clamp(3.5rem, 10vw, 7rem);
    font-weight: 900;
    margin-bottom: var(--spacing-md);
    color: #2c1810;
    letter-spacing: 0.2em;
    text-shadow: 
        2px 2px 0px rgba(139, 69, 19, 0.3),
        4px 4px 0px rgba(212, 165, 116, 0.2);
    position: relative;
    line-height: 1.2;
}

/* 原有的hero-subtitle樣式保持不變但現在不會顯示 */

.hero-subtitle {
    font-size: 1.6rem;
    margin-bottom: var(--spacing-lg);
    font-weight: 500;
    color: rgba(139, 69, 19, 0.9);
    letter-spacing: 0.3em;
    border-bottom: 3px solid rgba(212, 165, 116, 0.5);
    padding-bottom: var(--spacing-sm);
    display: inline-block;
    margin-bottom: var(--spacing-xl);
}

.hero-description {
    font-size: 1.3rem;
    margin-bottom: var(--spacing-xl);
    line-height: 2;
    color: rgba(44, 24, 16, 0.8);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    font-family: var(--font-serif);
    letter-spacing: 0.1em;
    padding: var(--spacing-lg);
    background: rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-md);
    border: 1px solid rgba(212, 165, 116, 0.3);
    box-shadow: inset 0 2px 4px rgba(139, 69, 19, 0.1);
}

.hero-buttons {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
    flex-wrap: wrap;
}

.scroll-indicator {
    position: absolute;
    bottom: -5px; /* 再往上調整 */
    left: 50%; /* 修正為水平居中 */
    transform: translateX(-50%);
    z-index: 50; /* 大幅提高層級確保絕對不會被遮擋 */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
}

.scroll-indicator::before {
    content: '下探聖境';
    color: rgba(139, 69, 19, 0.9); /* 增加不透明度 */
    font-size: 1.1rem; /* 稍微放大字體 */
    font-family: var(--font-serif);
    letter-spacing: 0.3em;
    font-weight: 600; /* 增加字重 */
    animation: fadeInOut 4s infinite ease-in-out;
    text-shadow: 
        1px 1px 2px rgba(255, 255, 255, 0.8),
        0 0 10px rgba(244, 241, 232, 0.5); /* 增強文字陰影 */
    background: rgba(244, 241, 232, 0.2); /* 添加背景 */
    padding: 0.3em 0.8em;
    border-radius: 20px;
    border: 1px solid rgba(139, 69, 19, 0.3);
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.5; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(-5px); }
}

.scroll-arrow {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(139, 69, 19, 0.7);
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
    animation: ancientBounce 4s infinite ease-in-out;
    cursor: pointer;
    background: rgba(244, 241, 232, 0.5);
    backdrop-filter: blur(3px);
    border-radius: 3px;
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.2);
}

.scroll-arrow:hover {
    border-color: rgba(139, 69, 19, 1);
    background: rgba(244, 241, 232, 0.8);
    transform: rotate(45deg) scale(1.1);
}

@keyframes ancientBounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0) rotate(45deg);
        opacity: 0.7;
    }
    40% {
        transform: translateX(-50%) translateY(-20px) rotate(45deg);
        opacity: 1;
    }
    60% {
        transform: translateX(-50%) translateY(-10px) rotate(45deg);
        opacity: 0.9;
    }
}

/* 章節通用樣式 */
section {
    padding: var(--spacing-xxl) 0;
}

/* 主殿風采區塊 */
.temple-showcase {
    background: linear-gradient(135deg, #f4f1e8 0%, #faf8f3 100%);
    position: relative;
}

.temple-showcase::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" width="150" height="150"><defs><filter id="paperTexture"><feTurbulence baseFrequency="0.02" numOctaves="3" result="noise" seed="2"/><feDiffuseLighting in="noise" lighting-color="white" surfaceScale="0.5"><feDistantLight azimuth="45" elevation="60"/></feDiffuseLighting></filter></defs><rect width="100%" height="100%" fill="%23f4f1e8" filter="url(%23paperTexture)" opacity="0.3"/></svg>');
    opacity: 0.5;
    pointer-events: none;
}

.temple-gallery {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--spacing-xl);
    margin-top: var(--spacing-xl);
}

.main-temple-image {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(139, 69, 19, 0.3);
    border: 3px solid rgba(139, 69, 19, 0.4);
}

.temple-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.temple-img.primary {
    height: 500px;
    object-position: center;
}

.main-temple-image:hover .temple-img {
    transform: scale(1.05);
}

.temple-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(139, 69, 19, 0.9));
    color: #f4f1e8;
    padding: var(--spacing-lg) var(--spacing-md) var(--spacing-md);
    text-align: center;
}

.temple-caption h3 {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    margin-bottom: var(--spacing-xs);
    letter-spacing: 0.1em;
}

.temple-caption p {
    font-size: 1rem;
    opacity: 0.9;
    letter-spacing: 0.05em;
}

.temple-images-grid {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.temple-image-item {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 2px solid rgba(139, 69, 19, 0.3);
    box-shadow: 0 10px 20px rgba(139, 69, 19, 0.2);
    height: 240px;
}

.temple-image-item .temple-img {
    height: 100%;
    object-position: center;
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(139, 69, 19, 0.7), rgba(212, 165, 116, 0.5));
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.temple-image-item:hover .image-overlay {
    opacity: 1;
}

.temple-image-item:hover .temple-img {
    transform: scale(1.1);
}

.image-overlay h4 {
    color: #f4f1e8;
    font-family: var(--font-serif);
    font-size: 1.2rem;
    letter-spacing: 0.1em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

@media (max-width: 768px) {
    .temple-gallery {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .temple-images-grid {
        flex-direction: row;
        overflow-x: auto;
        gap: var(--spacing-sm);
    }
    
    .temple-image-item {
        min-width: 200px;
        height: 150px;
    }
}

.section-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.section-title {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 5vw, 3rem);
    color: var(--primary-color);
    margin-bottom: var(--spacing-sm);
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--gradient-accent);
    border-radius: 2px;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* 關於章節 */
.about {
    background: var(--background-white);
}

.about-content {
    max-width: 900px;
    margin: 0 auto;
}

.intro-text {
    font-size: 1.2rem;
    line-height: 1.8;
    color: var(--text-dark);
    margin-bottom: var(--spacing-xl);
    text-align: center;
    font-family: var(--font-serif);
}

/* 主神展示 */
.deity-showcase {
    margin: var(--spacing-xl) 0;
    text-align: center;
}

.main-deity {
    max-width: 400px;
    margin: 0 auto var(--spacing-xl);
    padding: var(--spacing-md);
    background: var(--background-light);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 25px var(--shadow-soft);
    border: 2px solid var(--accent-color);
}

.deity-image {
    width: 100%;
    max-width: 300px;
    height: 350px;
    object-fit: cover;
    object-position: center top;
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
    box-shadow: 0 4px 15px var(--shadow-medium);
    border: 3px solid var(--accent-color);
    transition: all var(--transition-normal);
}

.deity-image:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 25px var(--shadow-medium);
}

.main-deity h3 {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: var(--spacing-xs);
    display: inline-block;
}

.main-deity p {
    color: var(--text-light);
    line-height: 1.6;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-xl);
}

.feature-item {
    text-align: center;
    padding: var(--spacing-md);
    background: var(--background-light);
    border-radius: var(--radius-lg);
    transition: transform var(--transition-normal);
    border: 1px solid var(--border-light);
}

.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px var(--shadow-soft);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-sm);
}

.feature-item h3 {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    color: var(--primary-color);
    margin-bottom: var(--spacing-sm);
}

.feature-item p {
    color: var(--text-light);
    line-height: 1.6;
}

/* 歷史章節 */
.history {
    background: var(--background-light);
    position: relative;
    overflow: hidden;
}

.timeline {
    max-width: 800px;
    margin: 0 auto;
    padding: var(--spacing-md) 0;
}

/* 古代卷軸容器 */
.scroll-container {
    max-width: 900px;
    margin: var(--spacing-xl) auto;
    position: relative;
    perspective: 1000px;
}

/* 卷軸軸桿 */
.scroll-rod {
    height: 40px;
    background: linear-gradient(90deg, 
        #8b4513 0%, 
        #a0522d 20%, 
        #cd853f 40%, 
        #daa520 50%, 
        #cd853f 60%, 
        #a0522d 80%, 
        #8b4513 100%);
    border-radius: 20px;
    position: relative;
    box-shadow: 
        0 8px 20px rgba(139, 69, 19, 0.4),
        inset 0 4px 8px rgba(218, 165, 32, 0.3),
        inset 0 -4px 8px rgba(139, 69, 19, 0.6);
    z-index: 3;
}

.scroll-rod::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    background: repeating-linear-gradient(90deg,
        transparent 0px,
        rgba(139, 69, 19, 0.2) 2px,
        rgba(139, 69, 19, 0.2) 4px,
        transparent 6px);
    border-radius: 15px;
}

.scroll-rod::after {
    content: '';
    position: absolute;
    top: 15px;
    left: -10px;
    right: -10px;
    height: 10px;
    background: linear-gradient(90deg, 
        #654321 0%, 
        #8b4513 50%, 
        #654321 100%);
    border-radius: 5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.scroll-rod.top {
    margin-bottom: -20px;
    z-index: 4;
}

.scroll-rod.bottom {
    margin-top: -20px;
    z-index: 4;
}

/* 卷軸紙張 */
.scroll-paper {
    background: 
        radial-gradient(circle at 20% 80%, rgba(139, 69, 19, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(212, 165, 116, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(139, 69, 19, 0.04) 0%, transparent 50%),
        #faf8f5;
    
    /* 宣紙紋理 */
    background-image: 
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" width="100" height="100"><defs><filter id="paperTexture2"><feTurbulence baseFrequency="0.04" numOctaves="4" result="noise" seed="5"/><feDiffuseLighting in="noise" lighting-color="white" surfaceScale="0.3"><feDistantLight azimuth="45" elevation="60"/></feDiffuseLighting></filter></defs><rect width="100%" height="100%" fill="%23f8f6f0" filter="url(%23paperTexture2)" opacity="0.8"/></svg>');
    
    border: 3px solid rgba(139, 69, 19, 0.2);
    border-top: 1px solid rgba(139, 69, 19, 0.3);
    border-bottom: 1px solid rgba(139, 69, 19, 0.3);
    box-shadow: 
        0 0 30px rgba(139, 69, 19, 0.2),
        inset 0 0 50px rgba(139, 69, 19, 0.05);
    position: relative;
    z-index: 2;
    overflow: hidden;
}

/* 卷軸邊緣磨損效果 */
.scroll-paper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(180deg, 
        rgba(139, 69, 19, 0.1) 0%, 
        rgba(139, 69, 19, 0.05) 50%, 
        transparent 100%);
    z-index: 1;
}

.scroll-paper::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(0deg, 
        rgba(139, 69, 19, 0.1) 0%, 
        rgba(139, 69, 19, 0.05) 50%, 
        transparent 100%);
    z-index: 1;
}

/* 卷軸內容 */
.scroll-content {
    padding: var(--spacing-xl) var(--spacing-lg);
    position: relative;
    z-index: 2;
    max-height: 800px;
    overflow-y: auto;
    
    /* 自定義滾動條 */
    scrollbar-width: thin;
    scrollbar-color: rgba(139, 69, 19, 0.3) transparent;
}

.scroll-content::-webkit-scrollbar {
    width: 8px;
}

.scroll-content::-webkit-scrollbar-track {
    background: rgba(139, 69, 19, 0.1);
    border-radius: 4px;
}

.scroll-content::-webkit-scrollbar-thumb {
    background: rgba(139, 69, 19, 0.3);
    border-radius: 4px;
    transition: background var(--transition-normal);
}

.scroll-content::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 69, 19, 0.5);
}

/* 修改原有的歷史內容樣式以適應卷軸 */
.scroll-content .sacred-poem,
.scroll-content .historical-poem,
.scroll-content .deity-biography {
    background: rgba(255, 255, 255, 0.3);
    border: 2px solid rgba(139, 69, 19, 0.2);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.1);
    backdrop-filter: blur(2px);
}

.scroll-content .sacred-poem:last-child,
.scroll-content .historical-poem:last-child,
.scroll-content .deity-biography:last-child {
    margin-bottom: 0;
}

/* 響應式調整 */
@media (max-width: 768px) {
    .scroll-container {
        max-width: 95%;
        margin: var(--spacing-lg) auto;
    }
    
    .scroll-content {
        padding: var(--spacing-lg) var(--spacing-md);
        max-height: 600px;
    }
    
    .scroll-rod {
        height: 30px;
        border-radius: 15px;
    }
    
    .scroll-rod::after {
        top: 10px;
        height: 8px;
    }
}

/* 聖祖鴻恩詩詞 */
.sacred-poem {
    background: rgba(244, 241, 232, 0.9);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
    border: 3px solid rgba(139, 69, 19, 0.3);
    box-shadow: 0 15px 35px rgba(139, 69, 19, 0.2);
    backdrop-filter: blur(5px);
    text-align: center;
}

.sacred-poem h3 {
    font-family: var(--font-serif);
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: var(--spacing-lg);
    letter-spacing: 0.3em;
    position: relative;
}

.sacred-poem h3::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: var(--gradient-accent);
    border-radius: 2px;
}

.poem-text p {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    line-height: 2.2;
    color: rgba(44, 24, 16, 0.9);
    margin-bottom: var(--spacing-md);
    letter-spacing: 0.2em;
    padding: 0.3rem 0;
}

.center-verse {
    margin: var(--spacing-lg) 0;
    padding: var(--spacing-md);
    background: rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-md);
    border: 1px solid rgba(139, 69, 19, 0.2);
}

.center-verse p {
    font-weight: 600;
    color: rgba(139, 69, 19, 0.9);
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
}

/* 歷史詩詞雙欄排版 */
.historical-poem {
    background: rgba(244, 241, 232, 0.85);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
    border: 2px solid rgba(139, 69, 19, 0.3);
    box-shadow: 0 10px 25px rgba(139, 69, 19, 0.15);
}

.historical-poem h3 {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    color: var(--secondary-color);
    margin-bottom: var(--spacing-lg);
    text-align: center;
    letter-spacing: 0.2em;
}

.poem-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xl);
    align-items: start;
}

.poem-column p {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    line-height: 1.8;
    color: rgba(44, 24, 16, 0.8);
    margin-bottom: var(--spacing-sm);
    letter-spacing: 0.1em;
    padding: var(--spacing-xs) 0;
    border-bottom: 1px solid rgba(139, 69, 19, 0.1);
}

/* 神明傳記 */
.deity-biography {
    background: rgba(244, 241, 232, 0.95);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
    border: 3px solid rgba(139, 69, 19, 0.4);
    box-shadow: 0 20px 40px rgba(139, 69, 19, 0.25);
    backdrop-filter: blur(8px);
    position: relative;
}

.deity-biography::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    bottom: 15px;
    border: 1px solid rgba(212, 165, 116, 0.4);
    border-radius: var(--radius-md);
    pointer-events: none;
}

.deity-biography h3 {
    font-family: var(--font-serif);
    font-size: 2.2rem;
    color: var(--primary-color);
    margin-bottom: var(--spacing-lg);
    text-align: center;
    letter-spacing: 0.3em;
    position: relative;
    padding-bottom: var(--spacing-sm);
}

.deity-biography h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(139, 69, 19, 0.8), transparent);
}

.biography-content p {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    line-height: 1.9;
    color: rgba(44, 24, 16, 0.85);
    margin-bottom: var(--spacing-lg);
    text-align: justify;
    letter-spacing: 0.08em;
    text-indent: 2em;
    padding: 0.5rem 0;
}

/* 結尾詩詞 */
.closing-poem {
    margin-top: var(--spacing-xl);
    padding: var(--spacing-lg);
    background: rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-md);
    border: 2px solid rgba(139, 69, 19, 0.3);
    text-align: center;
}

.closing-poem h4 {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    color: var(--secondary-color);
    margin-bottom: var(--spacing-md);
    letter-spacing: 0.2em;
}

.closing-poem .poem-verses {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
}

.closing-poem p {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    line-height: 1.8;
    color: rgba(139, 69, 19, 0.9);
    margin-bottom: 0;
    letter-spacing: 0.15em;
    text-indent: 0;
    font-weight: 500;
    padding: 0.2rem 0;
}

/* 響應式調整 */
@media (max-width: 768px) {
    .poem-columns {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .history-content {
        padding: var(--spacing-lg) var(--spacing-sm);
    }
    
    .sacred-poem,
    .historical-poem,
    .deity-biography {
        padding: var(--spacing-lg) var(--spacing-md);
    }
    
    .sacred-poem h3,
    .deity-biography h3 {
        font-size: 1.6rem;
    }
    
    .poem-text p,
    .biography-content p {
        font-size: 1rem;
    }
}

/* 鯉魚裝飾效果 - 移至活動祭典區域 */
.events {
    background: var(--background-white);
    position: relative; /* 為鯉魚定位提供基準 */
    min-height: 500px; /* 確保有足夠高度容納鯉魚裝飾 */
    padding-bottom: var(--spacing-xxl); /* 為鯉魚留出空間 */
}

.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
}

.events .fish-decoration {
    position: absolute;
    bottom: 10%; /* 位於區域底部 */
    right: 8%; /* 位於區域右側 */
    width: 220px; /* 調小尺寸 */
    height: auto;
    z-index: 2;
    pointer-events: none;
    opacity: 0.85; /* 稍微降低透明度 */
}

.scroll-fish {
    width: 100%;
    height: auto;
    opacity: 1.0; /* 提高基礎透明度 */
    filter: drop-shadow(0 4px 12px rgba(139, 69, 19, 0.4)) brightness(1.1) contrast(1.1); /* 增強顏色對比和亮度 */
    transition: all 0.3s ease;
}

/* 圖片翻轉效果 */
.fish-flipped {
    transform: scaleX(-1) scaleY(-1); /* 左右翻轉 + 上下翻轉 */
}

/* 滾動動畫效果 */
.scroll-fish.in-view {
    opacity: 1.0; /* 在視野中時更加清晰 */
    transform: scaleX(-1) scaleY(-1) translateY(-20px) rotate(5deg);
}

/* 響應式調整 */
@media (max-width: 768px) {
    .events .fish-decoration {
        width: 160px; /* 平板尺寸調小 */
        right: 5%;
        bottom: 5%;
    }
}

@media (max-width: 480px) {
    .events .fish-decoration {
        width: 120px; /* 手機尺寸調小 */
        right: 3%;
        bottom: 8%;
    }
}

/* 服務項目鯉魚2裝飾 */
.services-fish-decoration {
    position: absolute;
    top: 20%;
    left: 5%;
    width: 180px;
    height: auto;
    z-index: 2;
    pointer-events: none;
    opacity: 0.7;
}

.fish-2-decoration {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 3px 8px rgba(139, 69, 19, 0.3)) brightness(1.05) contrast(1.05);
    transition: all 0.3s ease;
    transform: rotate(-15deg); /* 輕微旋轉 */
}

/* 服務項目區域設定為相對定位 */
.services {
    position: relative;
}

/* 響應式調整 */
@media (max-width: 768px) {
    .services-fish-decoration {
        width: 140px;
        left: 3%;
        top: 15%;
    }
}

@media (max-width: 480px) {
    .services-fish-decoration {
        width: 100px;
        left: 2%;
        top: 10%;
        opacity: 0.6;
    }
}

/* 九龍真經獨立章節樣式 */
.scripture {
    background: var(--background-light);
    padding: var(--spacing-xxl) 0;
    position: relative;
}

.scripture::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" width="150" height="150"><defs><filter id="paperTexture3"><feTurbulence baseFrequency="0.03" numOctaves="3" result="noise" seed="4"/><feDiffuseLighting in="noise" lighting-color="white" surfaceScale="0.4"><feDistantLight azimuth="45" elevation="60"/></feDiffuseLighting></filter></defs><rect width="100%" height="100%" fill="%23f4f1e8" filter="url(%23paperTexture3)" opacity="0.3"/></svg>');
    opacity: 0.6;
    pointer-events: none;
}

.scripture-decorative-frame {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    background: linear-gradient(135deg, #fdfcfa 0%, #f9f7f2 100%);
    border: 2px solid rgba(139, 69, 19, 0.4);
    border-radius: 20px;
    padding: var(--spacing-xxl) var(--spacing-xl);
    box-shadow: 
        0 20px 60px rgba(139, 69, 19, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* 裝飾角落 */
.frame-corner {
    position: absolute;
    width: 60px;
    height: 60px;
    border: 3px solid rgba(139, 69, 19, 0.6);
    background: linear-gradient(45deg, rgba(212, 165, 116, 0.2), rgba(139, 69, 19, 0.1));
}

.frame-corner.top-left {
    top: -3px;
    left: -3px;
    border-right: none;
    border-bottom: none;
    border-top-left-radius: 20px;
}

.frame-corner.top-right {
    top: -3px;
    right: -3px;
    border-left: none;
    border-bottom: none;
    border-top-right-radius: 20px;
}

.frame-corner.bottom-left {
    bottom: -3px;
    left: -3px;
    border-right: none;
    border-top: none;
    border-bottom-left-radius: 20px;
}

.frame-corner.bottom-right {
    bottom: -3px;
    right: -3px;
    border-left: none;
    border-top: none;
    border-bottom-right-radius: 20px;
}

/* 裝飾線條 */
.frame-corner::before {
    content: '';
    position: absolute;
    width: 30px;
    height: 30px;
    background: 
        repeating-linear-gradient(45deg,
            transparent 0px,
            rgba(139, 69, 19, 0.3) 2px,
            rgba(139, 69, 19, 0.3) 4px,
            transparent 6px,
            transparent 10px);
    border-radius: 50%;
}

.frame-corner.top-left::before {
    top: 10px;
    left: 10px;
}

.frame-corner.top-right::before {
    top: 10px;
    right: 10px;
}

.frame-corner.bottom-left::before {
    bottom: 10px;
    left: 10px;
}

.frame-corner.bottom-right::before {
    bottom: 10px;
    right: 10px;
}

.frame-content {
    text-align: center;
    position: relative;
    z-index: 2;
}

.scripture .scripture-icon {
    font-size: 4rem;
    margin-bottom: var(--spacing-lg);
    filter: drop-shadow(0 4px 8px rgba(139, 69, 19, 0.3));
}

.scripture .scripture-title {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: var(--spacing-md);
    letter-spacing: 0.3em;
    font-weight: 700;
    text-shadow: 1px 1px 2px rgba(139, 69, 19, 0.2);
    position: relative;
}

.scripture .scripture-title::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 4px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(139, 69, 19, 0.8) 50%, 
        transparent 100%);
    border-radius: 2px;
}

.scripture-subtitle {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    color: rgba(139, 69, 19, 0.9);
    font-weight: 500;
    letter-spacing: 0.15em;
    line-height: 1.8;
    margin-bottom: var(--spacing-xl);
    font-style: italic;
}

.scripture-text {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(139, 69, 19, 0.2);
    border-radius: 15px;
    padding: var(--spacing-xl);
    margin-top: var(--spacing-lg);
    position: relative;
}

.scripture-text::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 20px;
    background: linear-gradient(135deg, #fdfcfa 0%, #f9f7f2 100%);
    border: 1px solid rgba(139, 69, 19, 0.2);
    border-bottom: none;
    border-radius: 10px 10px 0 0;
}

.scripture-text p {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    line-height: 2;
    color: rgba(44, 24, 16, 0.9);
    letter-spacing: 0.08em;
    text-align: justify;
    text-indent: 2.5em;
    margin: 0 0 var(--spacing-md) 0;
    padding: var(--spacing-sm) 0;
}

/* 九龍真經區段樣式 */
.scripture-section {
    margin-bottom: var(--spacing-lg);
    padding: var(--spacing-md);
    background: rgba(212, 165, 116, 0.1);
    border-left: 4px solid var(--accent-color);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.scripture-section:last-child {
    margin-bottom: 0;
}

.scripture-section-title {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    color: var(--secondary-color);
    margin-bottom: var(--spacing-sm);
    text-align: center;
    font-weight: 600;
    position: relative;
}

.scripture-section-title::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
}

.scripture-section p {
    text-indent: 0; /* 區段內容不要首行縮排 */
    margin: 0;
    text-align: center; /* 居中對齊 */
    line-height: 1.8;
    font-size: 1.1rem;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .scripture-decorative-frame {
        margin: 0 var(--spacing-md);
        padding: var(--spacing-lg) var(--spacing-md);
    }
    
    .frame-corner {
        width: 40px;
        height: 40px;
    }
    
    .frame-corner::before {
        width: 20px;
        height: 20px;
    }
    
    .frame-corner.top-left::before,
    .frame-corner.top-right::before {
        top: 6px;
    }
    
    .scripture-section {
        margin-bottom: var(--spacing-md);
        padding: var(--spacing-sm);
    }
    
    .scripture-section-title {
        font-size: 1.1rem;
    }
    
    .scripture-section p {
        font-size: 1rem;
        line-height: 1.6;
    }
    
    .scripture-text {
        padding: var(--spacing-md);
    }
    
    .frame-corner.top-left::before,
    .frame-corner.bottom-left::before {
        left: 6px;
    }
    
    .frame-corner.top-right::before,
    .frame-corner.bottom-right::before {
        right: 6px;
    }
    
    .frame-corner.bottom-left::before,
    .frame-corner.bottom-right::before {
        bottom: 6px;
    }
    
    .scripture .scripture-title {
        font-size: 2rem;
    }
    
    .scripture-subtitle {
        font-size: 1.1rem;
    }
    
    .scripture-text p {
        font-size: 1.1rem;
        text-indent: 2em;
    }
}

@media (max-width: 480px) {
    .scripture .scripture-icon {
        font-size: 3rem;
    }
    
    .scripture .scripture-title {
        font-size: 1.6rem;
        letter-spacing: 0.2em;
    }
    
    .scripture-subtitle {
        font-size: 1rem;
    }
    
    .scripture-text p {
        font-size: 1rem;
        line-height: 1.8;
        text-indent: 1.5em;
    }
}

/* 活動公告章節 */
.announcements {
    background: var(--background-white);
}

.announcements-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--spacing-xl);
    align-items: start;
}

.announcement-list {
    min-height: 200px;
}

.announcement-sidebar {
    position: sticky;
    top: 100px;
}

.quick-info {
    background: var(--background-light);
    padding: var(--spacing-md);
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--accent-color);
}

.quick-info h3 {
    font-family: var(--font-serif);
    color: var(--primary-color);
    margin-bottom: var(--spacing-sm);
}

.quick-info ul {
    list-style: none;
}

.quick-info li {
    padding: var(--spacing-xs) 0;
    color: var(--text-light);
    border-bottom: 1px solid var(--border-light);
    position: relative;
    padding-left: 1.5rem;
}

.quick-info li::before {
    content: '•';
    color: var(--accent-color);
    font-size: 1.2rem;
    position: absolute;
    left: 0;
}

.quick-info li:last-child {
    border-bottom: none;
}

@media (max-width: 768px) {
    .announcements-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .announcement-sidebar {
        position: static;
    }
}

/* 奉祀神明章節 - 中國風設計 */
.deities {
    background: linear-gradient(135deg, #f4f1e8 0%, #faf8f3 100%);
    position: relative;
    min-height: 100vh;
}

.deities::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" width="200" height="200"><defs><filter id="paperDeity"><feTurbulence baseFrequency="0.03" numOctaves="4" result="noise" seed="3"/><feDiffuseLighting in="noise" lighting-color="white" surfaceScale="0.8"><feDistantLight azimuth="45" elevation="60"/></feDiffuseLighting></filter></defs><rect width="100%" height="100%" fill="%23f4f1e8" filter="url(%23paperDeity)" opacity="0.4"/></svg>');
    opacity: 0.6;
    pointer-events: none;
}

.deities-showcase {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: var(--spacing-xl);
    margin-top: var(--spacing-xl);
    min-height: 70vh;
}

/* 神明選單列表 */
.deity-nav {
    background: rgba(244, 241, 232, 0.9);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    border: 2px solid rgba(139, 69, 19, 0.3);
    box-shadow: 0 10px 30px rgba(139, 69, 19, 0.2);
    backdrop-filter: blur(5px);
    height: fit-content;
    position: sticky;
    top: 100px;
}

.deity-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.deity-list li {
    margin-bottom: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-normal);
    border: 1px solid transparent;
    font-family: var(--font-serif);
    font-weight: 500;
    color: rgba(139, 69, 19, 0.8);
    letter-spacing: 0.1em;
    position: relative;
}

.deity-list li::before {
    content: '◆';
    margin-right: var(--spacing-xs);
    color: rgba(212, 165, 116, 0.6);
}

.deity-list li:hover {
    background: rgba(139, 69, 19, 0.1);
    border-color: rgba(139, 69, 19, 0.3);
    transform: translateX(5px);
}

.deity-list li.active {
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.2), rgba(212, 165, 116, 0.2));
    border-color: rgba(139, 69, 19, 0.5);
    color: rgba(139, 69, 19, 1);
    font-weight: 600;
}

.deity-list li.active::before {
    color: rgba(139, 69, 19, 0.8);
}

/* 神明展示區域 */
.deity-display {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xl);
    align-items: center;
}

/* 八角窗戶相框 */
.deity-portrait {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.octagon-frame {
    width: 400px;
    height: 400px;
    position: relative;
    background: linear-gradient(135deg, #8b4513 0%, #d4a574 50%, #8b4513 100%);
    clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
    padding: 8px;
    box-shadow: 
        0 20px 40px rgba(139, 69, 19, 0.4),
        inset 0 0 20px rgba(255, 255, 255, 0.2);
    transition: transform var(--transition-slow);
}

.octagon-frame::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    background: linear-gradient(135deg, #d4a574 0%, #8b4513 50%, #d4a574 100%);
    clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
}

.octagon-frame:hover {
    transform: scale(1.05) rotate(2deg);
}

.deity-main-image {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: calc(100% - 24px);
    height: calc(100% - 24px);
    object-fit: cover;
    object-position: center 20%;
    clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
    transition: transform var(--transition-slow);
}

.octagon-frame:hover .deity-main-image {
    transform: scale(1.1);
}

/* 宣紙風格信息面板 */
.deity-info-panel {
    background: rgba(244, 241, 232, 0.95);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    border: 3px solid rgba(139, 69, 19, 0.3);
    box-shadow: 
        0 15px 35px rgba(139, 69, 19, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    position: relative;
    backdrop-filter: blur(5px);
}

.deity-info-panel::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    bottom: 15px;
    border: 1px solid rgba(212, 165, 116, 0.4);
    border-radius: var(--radius-md);
    pointer-events: none;
}

.deity-description h3 {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    color: #2c1810;
    margin-bottom: var(--spacing-md);
    letter-spacing: 0.2em;
    text-align: center;
    position: relative;
    padding-bottom: var(--spacing-sm);
}

.deity-description h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(139, 69, 19, 0.8), transparent);
}

.deity-seal {
    display: inline-block;
    background: linear-gradient(135deg, #8b4513, #d4a574);
    color: #f4f1e8;
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    font-family: var(--font-serif);
    font-weight: 600;
    letter-spacing: 0.2em;
    margin-bottom: var(--spacing-lg);
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.3);
    border: 2px solid rgba(212, 165, 116, 0.5);
}

.deity-description p {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    line-height: 1.8;
    color: rgba(44, 24, 16, 0.8);
    text-align: justify;
    margin-bottom: var(--spacing-lg);
    letter-spacing: 0.05em;
}

.deity-attributes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

.attribute-item {
    background: rgba(255, 255, 255, 0.5);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    border: 1px solid rgba(139, 69, 19, 0.2);
    text-align: center;
}

.attr-label {
    display: block;
    font-family: var(--font-serif);
    font-size: 0.9rem;
    color: rgba(139, 69, 19, 0.7);
    margin-bottom: var(--spacing-xs);
    letter-spacing: 0.1em;
}

.attr-value {
    display: block;
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 600;
    color: rgba(44, 24, 16, 0.9);
    letter-spacing: 0.1em;
}

/* 響應式設計 */
@media (max-width: 1024px) {
    .deities-showcase {
        grid-template-columns: 250px 1fr;
        gap: var(--spacing-lg);
    }
    
    .octagon-frame {
        width: 300px;
        height: 300px;
    }
}

@media (max-width: 768px) {
    .deities-showcase {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .deity-display {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .deity-nav {
        position: static;
        order: 2;
    }
    
    .deity-list {
        display: flex;
        flex-wrap: wrap;
        gap: var(--spacing-xs);
    }
    
    .deity-list li {
        margin-bottom: 0;
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: 0.9rem;
    }
    
    .octagon-frame {
        width: 250px;
        height: 250px;
    }
}

/* 服務章節 */
.services {
    background: var(--background-light);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-lg);
}

/* 聯絡章節 */
.contact {
    background: var(--background-white);
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xl);
    align-items: start;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.contact-item h3 {
    font-family: var(--font-serif);
    color: var(--primary-color);
    margin-bottom: var(--spacing-sm);
    font-size: 1.2rem;
}

.contact-item p {
    color: var(--text-light);
    line-height: 1.6;
}

/* Facebook連結樣式 */
.facebook-link {
    color: #1877f2;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    transition: var(--transition-normal);
    padding: 0.5rem 0;
    border-radius: var(--radius-sm);
}

.facebook-link:hover {
    color: #166fe5;
    background: rgba(24, 119, 242, 0.1);
    padding: 0.5rem 0.8rem;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(24, 119, 242, 0.2);
}

/* Google地圖樣式 */
.google-map {
    background: var(--background-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(139, 69, 19, 0.2);
    border: 3px solid rgba(139, 69, 19, 0.3);
    margin-bottom: var(--spacing-md);
}

.google-map iframe {
    width: 100%;
    height: 400px;
    border: none;
    border-radius: var(--radius-md);
}

/* 地圖鏈接 */
.map-links {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
    flex-wrap: wrap;
}

.map-link {
    display: inline-block;
    padding: var(--spacing-sm) var(--spacing-md);
    background: rgba(139, 69, 19, 0.1);
    color: var(--secondary-color);
    text-decoration: none;
    border-radius: var(--radius-sm);
    border: 2px solid rgba(139, 69, 19, 0.3);
    font-family: var(--font-serif);
    font-weight: 500;
    transition: all var(--transition-normal);
    font-size: 0.9rem;
}

.map-link:hover {
    background: var(--secondary-color);
    color: var(--background-white);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(139, 69, 19, 0.3);
}

@media (max-width: 768px) {
    .contact-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .google-map iframe {
        height: 300px;
    }
    
    .map-links {
        flex-direction: column;
        align-items: center;
    }
    
    .map-link {
        width: 80%;
        text-align: center;
    }
}

/* 頁尾 */
.footer {
    position: relative;
    background: linear-gradient(135deg, #af7c68 0%, #8b5a47 50%, #6d4536 100%);
    color: #f5f1eb;
    padding: var(--spacing-xl) 0 var(--spacing-md);
    overflow: hidden;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../底圖線搞.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.15;
    z-index: 1;
}

.footer::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, transparent 0%, rgba(175, 124, 104, 0.3) 70%);
    z-index: 2;
}

.footer .container {
    position: relative;
    z-index: 3;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.footer-section {
    background: rgba(245, 241, 235, 0.05);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    border: 1px solid rgba(245, 241, 235, 0.1);
    backdrop-filter: blur(5px);
}

.footer-section h3,
.footer-section h4 {
    font-family: var(--font-serif);
    margin-bottom: var(--spacing-sm);
    color: #f5e6d3;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    font-weight: 600;
}

.footer-section h3 {
    font-size: 1.4rem;
    border-bottom: 2px solid rgba(245, 230, 211, 0.3);
    padding-bottom: 0.5rem;
}

.footer-section p {
    color: rgba(245, 241, 235, 0.9);
    line-height: 1.6;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.2);
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: var(--spacing-xs);
    position: relative;
    padding-left: 1rem;
}

.footer-section ul li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: #f5e6d3;
    font-size: 0.8rem;
}

.footer-section ul li a {
    color: rgba(245, 241, 235, 0.85);
    text-decoration: none;
    transition: all var(--transition-fast);
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.2);
}

.footer-section ul li a:hover {
    color: #f5e6d3;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.4);
    transform: translateX(3px);
}

.footer-bottom {
    text-align: center;
    padding-top: var(--spacing-md);
    border-top: 1px solid rgba(245, 241, 235, 0.2);
    color: rgba(245, 241, 235, 0.7);
    background: rgba(0, 0, 0, 0.1);
    margin: 0 calc(-1 * var(--spacing-md));
    padding-left: var(--spacing-md);
    padding-right: var(--spacing-md);
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.3);
}

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

.fade-in-up {
    animation: fadeInUp 0.8s ease forwards;
}

/* 滾動條樣式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--background-light);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* 載入動畫 */
.loading {
    opacity: 0;
    transform: translateY(20px);
    transition: all var(--transition-slow);
}

.loading.loaded {
    opacity: 1;
    transform: translateY(0);
}

/* 響應式調整 */
@media (max-width: 768px) {
    .hero-buttons {
        flex-direction: column;
        align-items: center;
        gap: var(--spacing-sm);
    }
    
    .btn {
        width: 200px;
        font-size: 1rem;
        padding: 12px 24px;
    }
    
    .hero-description {
        font-size: 1.1rem;
        line-height: 1.8;
        padding: var(--spacing-md);
        margin-bottom: var(--spacing-lg);
        text-align: center;
    }
    
    .features {
        grid-template-columns: 1fr;
    }
    
    /* 手機版圖片標題調整 */
    .hero-title-image-file {
        max-width: min(85vw, 380px) !important;
        margin: 0 0 1.5rem 5% !important; /* 左邊偏移5% */
        transform: rotate(-1deg) translateX(-10px) !important; /* 增加向左偏移 */
        position: relative !important;
        z-index: 99999 !important; /* 確保在最上層 */
    }
    
    /* 手機版標題圖檔調整 */
    .hero-title-black {
        font-size: clamp(2.5rem, 8vw, 4rem) !important;
        letter-spacing: 0.1em !important;
    }
    
    .hero-title-image::before {
        font-size: clamp(2.5rem, 8vw, 4rem);
        letter-spacing: 0.1em;
    }
    
    /* 手機版下探聖境調整 */
    .scroll-indicator {
        bottom: -30px; /* 手機版也往上調整 */
    }
}

/* 印刷樣式 */
@media print {
    .navbar,
    .hero,
    .footer {
        display: none;
    }
    
    * {
        color: black !important;
        background: white !important;
    }
}

/* SEO 優化樣式 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.footer-seo-links {
    margin-top: var(--spacing-sm);
    padding-top: var(--spacing-sm);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
}

.footer-seo-links span {
    margin-right: var(--spacing-xs);
    font-weight: 500;
}

.footer-seo-links a {
    color: var(--accent-color);
    text-decoration: none;
    margin: 0 var(--spacing-xs);
    transition: var(--transition-fast);
}

.footer-seo-links a:hover {
    color: var(--background-white);
    text-decoration: underline;
}

/* 結構化資料樣式隱藏 */
[itemscope] meta {
    display: none;
}
