/* ============================================
神格藏經閣 - Pantheon Archive
古籍紙張 × 線裝書 × 藏經閣美學
Prefix: panth-
============================================ */
:root {
    /* 紙張色系 */
    --paper-white: #f8f4e9;
    --paper-cream: #f2ecdb;
    --paper-old: #e5dfca;
    --paper-aged: #dfd8c2;
    /* 古墨色系 */
    --ink-deep: #3a3129;
    --ink-dark: #5d4c3a;
    --ink-medium: #7a6b56;
    --ink-light: #9c8e7a;
    --ink-wash: #d9d0bb;
    /* 朱砂色系 */
    --vermilion-dark: #c62828;
    --vermilion-medium: #d35400;
    --vermilion-light: #e67e22;
    /* 金箔色系 */
    --gold-dark: #f9a825;
    --gold-medium: #fbc02d;
    --gold-light: #ffeb3b;
    /* 靛青色系 */
    --indigo-dark: #283593;
    --indigo-medium: #3949ab;
    --indigo-light: #5c6bc0;
    /* 尺寸系統 */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 3rem;
    --spacing-xl: 4rem;
    /* 陰影系統 */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.25);
    /* 圓角系統 */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    /* 動畫時長 */
    --duraon-fast: 0.2s;
    --duration-normal: 0.3s;
    --duration-slow: 0.5s;
    --duration-very-slow: 1s;
    /* 字體系統 */
    --font-title: 'Ma Shan Zheng', cursive;
    --font-serif: 'Noto Serif TC', serif;
    --font-classic: 'STKaiti', 'KaiTi', cursive;
    --font-fallback: 'SimSun', serif;
    /* 響應式斷點 */
    --breakpoint-mobile: 480px;
    --breakpoint-tablet: 768px;
    --breakpoint-desktop: 1024px;
    --breakpoint-large: 1200px;
}

/* 📚 基礎古籍背景與重置 */
.panth-wrapper * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.panth-wrapper {
    min-height: 100vh;
    width: 100%;
    background:
        /* 古籍紙張底色 */
        linear-gradient(135deg,
            #f8f4e9 0%,
            #f2ecdb 15%,
            #ebe5d2 30%,
            #e5dfca 45%,
            #dfd8c2 60%,
            #d9d2ba 75%,
            #d3ccb2 90%,
            #cdc6aa 100%),
        /* 紙張纖維紋理 */
        url("data:image/svg+xml,%3Csvg width='200' height='200' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10,10 Q30,0 50,20 T90,10' stroke='rgba(140,120,100,0.04)' stroke-width='0.8' fill='none'/%3E%3Cpath d='M20,30 Q40,20 60,40 T100,30' stroke='rgba(130,110,90,0.03)' stroke-width='0.6' fill='none'/%3E%3C/svg%3E"),
        /* 格線紋理 */
        linear-gradient(90deg, transparent 99.5%, rgba(140, 120, 100, 0.05) 99.5%),
        linear-gradient(0deg, transparent 99.5%, rgba(140, 120, 100, 0.05) 99.5%);
    background-size: auto, 300px 300px, 40px 40px, 40px 40px;
    background-attachment: fixed, fixed, fixed, fixed;
    font-family: 'Noto Serif TC', 'Source Han Serif TC', 'STSong', 'SimSun', serif;
    color: #3a3129;
    position: relative;
    overflow-x: hidden;
    line-height: 1.6;
}

/* 古籍紙張深度紋理 */
.panth-paper-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        /* 古籍蟲蛀效果 */
        radial-gradient(circle at 15% 25%,
            rgba(120, 100, 80, 0.03) 0%,
            transparent 3px),
        radial-gradient(circle at 85% 70%,
            rgba(110, 90, 70, 0.02) 0%,
            transparent 2px),
        radial-gradient(circle at 40% 85%,
            rgba(130, 110, 90, 0.025) 0%,
            transparent 2.5px),
        /* 墨跡殘留 */
        radial-gradient(ellipse at 25% 65%,
            rgba(80, 60, 40, 0.02) 0%,
            transparent 30px),
        radial-gradient(ellipse at 75% 35%,
            rgba(70, 50, 30, 0.015) 0%,
            transparent 25px);
    background-size: 400px 400px, 350px 350px, 450px 450px, 200px 200px, 180px 180px;
    opacity: 0.5;
    pointer-events: none;
    z-index: 0;
    filter: blur(0.5px);
}

/* 塵埃粒子效果 */
.panth-dust-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

/* ============================================
塵埃粒子詳細樣式
============================================ */
.panth-dust-particle {
    position: absolute;
    pointer-events: none;
    z-index: 0;
    border-radius: 50%;
    filter: blur(0.5px);
    opacity: 0;
    will-change: transform, opacity;
    /* 動態變量 */
    --start-x: 0%;
    --start-y: 0%;
    --end-x: 0%;
    --end-y: 0%;
    --rotation: 0deg;
    --opacity: 0.1;
    --duration: 20s;
    --delay: 0s;
}

.panth-dust-particle.small {
    width: 1px;
    height: 1px;
}

.panth-dust-particle.medium {
    width: 2px;
    height: 2px;
}

.panth-dust-particle.large {
    width: 3px;
    height: 3px;
}

/* 塵埃顏色變體 */
.panth-dust-particle.color-1 {
    background: rgba(140, 120, 100, var(--opacity));
}

.panth-dust-particle.color-2 {
    background: rgba(156, 142, 122, var(--opacity));
}

.panth-dust-particle.color-3 {
    background: rgba(176, 155, 124, var(--opacity));
}

.panth-dust-particle.color-4 {
    background: rgba(192, 160, 128, var(--opacity));
}

/* 夜間模式塵埃 */

/* 🏛️ 藏經閣主容器 */
.panth-archive-container {
    position: relative;
    max-width: 1100px;
    margin: 0 auto;
    padding: clamp(16px, 4vw, 60px) clamp(10px, 4vw, 50px);
    z-index: 1;
    background:
        linear-gradient(rgba(248, 244, 233, 0.85) 0%,
            rgba(242, 236, 219, 0.9) 100%),
        url("data:image/svg+xml,%3Csvg width='100' height='100' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='2' y='2' width='96' height='96' stroke='rgba(140,120,100,0.08)' stroke-width='1' fill='none' stroke-dasharray='2,2'/%3E%3C/svg%3E");
    border-radius: 2px;
    box-shadow:
        0 15px 50px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.7),
        inset 0 -1px 0 rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(180, 160, 140, 0.3);
    border: 1px solid rgba(212, 201, 184, 0.5);
    backdrop-filter: blur(3px);
}

/* 藏經閣線裝書邊框 */
.panth-archive-container::before,
.panth-archive-container::after {
    content: '';
    position: fixed;
    top: 0;
    width: clamp(20px, 5vw, 70px);
    height: 100%;
    background:
        /* 線裝孔洞 */
        repeating-linear-gradient(to bottom,
            transparent,
            transparent 18px,
            rgba(140, 120, 100, 0.4) 18px,
            rgba(140, 120, 100, 0.4) 22px),
        /* 書脊紋理 */
        linear-gradient(90deg,
            rgba(200, 180, 160, 0.15) 0%,
            rgba(180, 160, 140, 0.1) 10px,
            transparent 20px);
    z-index: 0;
    pointer-events: none;
    filter: drop-shadow(2px 0 3px rgba(0, 0, 0, 0.2));
}

.panth-archive-container::before {
    left: 0;
    border-radius: 2px 0 0 2px;
    box-shadow:
        inset 8px 0 15px rgba(0, 0, 0, 0.1),
        2px 0 5px rgba(0, 0, 0, 0.1);
}

.panth-archive-container::after {
    right: 0;
    transform: rotate(180deg);
    border-radius: 0 2px 2px 0;
    box-shadow:
        inset -8px 0 15px rgba(0, 0, 0, 0.1),
        -2px 0 5px rgba(0, 0, 0, 0.1);
}

/* 書脊裝飾線 */
.panth-archive-container::before::after,
.panth-archive-container::after::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 3px;
    height: 80%;
    background:
        repeating-linear-gradient(to bottom,
            transparent,
            transparent 30px,
            rgba(176, 155, 124, 0.4) 30px,
            rgba(176, 155, 124, 0.4) 35px);
    border-radius: 1.5px;
    box-shadow: 0 0 5px rgba(176, 155, 124, 0.3);
}

/* 🏮 標題區域 - 古籍扉頁 */
.panth-archive-header {
    text-align: center;
    margin: 80px 0 120px;
    position: relative;
    padding: 60px 0;
    background:
        linear-gradient(145deg,
            rgba(242, 236, 219, 0.95) 0%,
            rgba(235, 229, 210, 0.9) 100%),
        url("data:image/svg+xml,%3Csvg width='300' height='200' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20,100 Q150,20 280,100' stroke='rgba(176,155,124,0.1)' stroke-width='1.5' fill='none'/%3E%3Cpath d='M20,100 Q150,180 280,100' stroke='rgba(176,155,124,0.1)' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    border-radius: 15px;
    border: 4px solid #c4b7a0;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        inset 0 -1px 0 rgba(0, 0, 0, 0.25),
        0 0 30px rgba(176, 155, 124, 0.15);
    position: relative;
    overflow: hidden;
}

/* 扉頁裝飾圖案 */
.panth-archive-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        url("data:image/svg+xml,%3Csvg width='200' height='200' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M50,50 L150,50 L150,150 L50,150 Z' stroke='rgba(176,155,124,0.05)' stroke-width='1' fill='none' transform='rotate(45,100,100)'/%3E%3Ccircle cx='100' cy='100' r='40' stroke='rgba(176,155,124,0.05)' stroke-width='0.5' fill='none'/%3E%3C/svg%3E");
    background-size: 200px 200px;
    opacity: 0.4;
    animation: panth-bg-rotate 40s linear infinite;
}

@keyframes panth-bg-rotate {
    from {
        background-position: 0 0;
        transform: rotate(0deg);
    }

    to {
        background-position: 200px 200px;
        transform: rotate(0.1deg);
    }
}

/* 封面裝飾線 */
.panth-archive-header::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 500px;
    height: 3px;
    background:
        linear-gradient(90deg,
            transparent,
            rgba(176, 155, 124, 0.6),
            rgba(156, 142, 122, 0.8),
            rgba(176, 155, 124, 0.6),
            transparent);
    border-radius: 1.5px;
}

.panth-archive-header::after {
    top: 0;
}

.panth-archive-header::before {
    bottom: 0;
}

.panth-archive-title {
    font-size: 5rem;
    font-weight: 400;
    color: #5d4c3a;
    letter-spacing: 20px;
    margin-bottom: 30px;
    text-shadow:
        3px 3px 6px rgba(0, 0, 0, 0.2),
        6px 6px 12px rgba(0, 0, 0, 0.1),
        0 1px 0 rgba(255, 255, 255, 0.7);
    position: relative;
    display: inline-block;
    padding: 40px 100px;
    background:
        linear-gradient(145deg,
            rgba(242, 236, 219, 0.95) 0%,
            rgba(235, 229, 210, 0.85) 100%);
    border-radius: 10px;
    border: 3px solid #b09b7c;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        inset 0 -1px 0 rgba(0, 0, 0, 0.3),
        0 15px 40px rgba(0, 0, 0, 0.3);
    transform: perspective(1200px) rotateX(3deg);
}

/* 古籍印章效果 */
.panth-archive-title::after {
    content: '藏';
    position: absolute;
    top: -40px;
    right: -50px;
    width: 80px;
    height: 80px;
    font-family: 'STKaiti', 'KaiTi', cursive;
    font-size: 3.5rem;
    color: #b64545;
    background:
        linear-gradient(145deg,
            rgba(255, 255, 255, 0.95) 0%,
            rgba(245, 245, 245, 0.9) 100%);
    border: 4px solid #b64545;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: rotate(15deg);
    opacity: 0.9;
    box-shadow:
        5px 5px 15px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.6),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    animation: panth-seal-float 8s ease-in-out infinite;
}

@keyframes panth-seal-float {

    0%,
    100% {
        transform: rotate(15deg) translateY(0);
        opacity: 0.9;
    }

    50% {
        transform: rotate(15deg) translateY(-10px);
        opacity: 1;
    }
}

/* 印章裂紋效果 */
.panth-archive-title::after::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    background:
        linear-gradient(45deg, transparent 97%, rgba(182, 69, 69, 0.3) 97%),
        linear-gradient(-45deg, transparent 97%, rgba(182, 69, 69, 0.3) 97%);
    border-radius: 8px;
    pointer-events: none;
    opacity: 0.5;
}

.panth-archive-subtitle {
    font-size: 1.8rem;
    color: #7a6b56;
    font-style: italic;
    letter-spacing: 8px;
    margin-top: 20px;
    padding: 20px 80px;
    display: inline-block;
    position: relative;
    background: rgba(232, 223, 208, 0.9);
    border-radius: 6px;
    border: 2px solid rgba(192, 160, 128, 0.5);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.7),
        0 10px 25px rgba(0, 0, 0, 0.15);
}

/* 錦緞裝飾 */
.panth-archive-subtitle::before,
.panth-archive-subtitle::after {
    content: '❈';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #b09b7c;
    font-size: 2rem;
    opacity: 0.7;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
    animation: panth-ornament-spin 20s linear infinite;
}

.panth-archive-subtitle::before {
    left: 25px;
}

.panth-archive-subtitle::after {
    right: 25px;
}

@keyframes panth-ornament-spin {
    from {
        transform: translateY(-50%) rotate(0deg);
    }

    to {
        transform: translateY(-50%) rotate(360deg);
    }
}

/* 📚 神明卡片列表 */
.panth-deity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 50px;
    margin: 80px 0;
}

/* 單張神明卡片 - 經卷樣式 */
.panth-deity-card {
    background:
        linear-gradient(145deg,
            rgba(248, 244, 233, 0.95) 0%,
            rgba(242, 236, 219, 0.85) 100%),
        url("data:image/svg+xml,%3Csvg width='100' height='100' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='10' y='10' width='80' height='80' stroke='rgba(140,120,100,0.08)' stroke-width='0.5' fill='none'/%3E%3C/svg%3E");
    border: 2px solid #d9d0bb;
    border-radius: 4px;
    padding: 45px 40px;
    position: relative;
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 320px;
    box-shadow:
        0 10px 35px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    overflow: hidden;
    backdrop-filter: blur(3px);
}

.panth-deity-card:hover {
    transform: translateY(-10px) rotateX(5deg) rotateY(-2deg);
    border-color: #b09b7c;
    box-shadow:
        0 25px 70px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(176, 155, 124, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        0 0 40px rgba(176, 155, 124, 0.15);
    z-index: 10;
}

/* ============================================
卡片效果詳細樣式
============================================ */
.panth-card-scroll-end-left,
.panth-card-scroll-end-right {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 60px;
    background: radial-gradient(ellipse at center,
            rgba(200, 180, 160, 0.8) 0%,
            rgba(180, 160, 140, 0.6) 50%,
            rgba(160, 140, 120, 0.4) 100%);
    border-radius: 15px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2),
        0 3px 10px rgba(0, 0, 0, 0.2);
    z-index: -1;
    pointer-events: none;
}

.panth-card-scroll-end-left {
    left: -15px;
}

.panth-card-scroll-end-right {
    right: -15px;
}

.panth-card-paper-texture {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Cpath d='M0,0 L100,0 L100,100 L0,100 Z' fill='none' stroke='rgba(176,155,124,0.05)' stroke-width='0.5'/%3E%3C/svg%3E");
    background-size: 50px 50px;
    opacity: 0.3;
    pointer-events: none;
    z-index: 0;
}

.panth-card-decorative-border {
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    border: 1px solid rgba(176, 155, 124, 0.1);
    border-radius: 8px;
    pointer-events: none;
    z-index: 1;
    transition: border-color 0.3s ease;
}

.panth-card-ink-effect {
    position: absolute;
    background: radial-gradient(circle,
            rgba(80, 60, 40, 0.3) 0%,
            rgba(60, 40, 20, 0.2) 40%,
            transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
    transform: translate(-50%, -50%);
}

.panth-card-click-ripple {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle,
            rgba(176, 155, 124, 0.3) 0%,
            rgba(156, 142, 122, 0.2) 30%,
            transparent 70%);
    pointer-events: none;
    z-index: 5;
    transform: translate(-50%, -50%);
}

.panth-card-enter-effect {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg,
            transparent 60%,
            rgba(176, 155, 124, 0.1) 60%,
            transparent 70%);
    pointer-events: none;
    z-index: 2;
    opacity: 0;
}

.panth-card-page-shadow {
    position: absolute;
    top: 0;
    right: 0;
    width: 20px;
    height: 100%;
    background: linear-gradient(90deg,
            rgba(0, 0, 0, 0.15) 0%,
            transparent 100%);
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* 卡片邊緣 - 經卷軸裝飾 */
.panth-deity-card::before,
.panth-deity-card::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 25px;
    background:
        linear-gradient(90deg,
            rgba(200, 180, 160, 0.4) 0%,
            rgba(180, 160, 140, 0.2) 50%,
            transparent 100%);
    pointer-events: none;
    z-index: 1;
}

.panth-deity-card::before {
    left: 0;
    border-radius: 4px 0 0 4px;
}

.panth-deity-card::after {
    right: 0;
    transform: rotate(180deg);
    border-radius: 0 4px 4px 0;
}

/* 卷軸端頭 */
.panth-deity-card::before::after,
.panth-deity-card::after::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 60px;
    background:
        radial-gradient(ellipse at center,
            rgba(200, 180, 160, 0.8) 0%,
            rgba(180, 160, 140, 0.6) 50%,
            rgba(160, 140, 120, 0.4) 100%);
    border-radius: 15px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2),
        0 3px 10px rgba(0, 0, 0, 0.2);
}

/* 卡片標題 */
.panth-deity-name {
    font-size: 2rem;
    color: #5d4c3a;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(176, 155, 124, 0.4);
    position: relative;
    z-index: 2;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.panth-deity-name a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s;
    position: relative;
    display: inline-block;
}

.panth-deity-name a:hover {
    color: #8b7355;
}

.panth-deity-name a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg,
            rgba(139, 115, 85, 0.8),
            rgba(176, 155, 124, 0.8));
    transition: width 0.3s ease;
}

.panth-deity-name a:hover::after {
    width: 100%;
}

/* 神明稱號 */
.panth-deity-title {
    font-size: 1.3rem;
    color: #7a6b56;
    font-style: italic;
    margin-bottom: 25px;
    line-height: 1.5;
    padding-left: 20px;
    position: relative;
    z-index: 2;
}

.panth-deity-title::before {
    content: '「';
    position: absolute;
    left: 0;
    top: -5px;
    font-size: 1.8rem;
    color: rgba(176, 155, 124, 0.5);
    font-family: 'STKaiti', cursive;
}

.panth-deity-title::after {
    content: '」';
    position: absolute;
    right: 0;
    bottom: -10px;
    font-size: 1.8rem;
    color: rgba(176, 155, 124, 0.5);
    font-family: 'STKaiti', cursive;
}

/* 神明簡述 */
.panth-deity-desc {
    color: #6d5a45;
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 30px;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    position: relative;
    z-index: 2;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5);
}

/* 狀態標記 */
.panth-deity-status {
    position: absolute;
    bottom: 25px;
    right: 25px;
    padding: 8px 20px;
    background: rgba(232, 223, 208, 0.9);
    border: 1px solid #d4c9b8;
    border-radius: 3px;
    font-size: 0.95rem;
    color: #9c8e7a;
    z-index: 2;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.6),
        0 3px 8px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(2px);
}

/* 🏮 單一神明頁 - 主視覺區 */
.panth-deity-header {
    margin-bottom: 80px;
    position: relative;
    text-align: center;
    padding: 40px 0;
    background:
        linear-gradient(rgba(242, 236, 219, 0.9) 0%,
            rgba(235, 229, 210, 0.85) 100%);
    border-radius: 10px;
    border: 3px solid #d4c9b8;
    box-shadow:
        0 15px 40px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.panth-deity-main-title {
    font-size: 3.5rem;
    color: #5d4c3a;
    text-align: center;
    margin-bottom: 15px;
    letter-spacing: 12px;
    position: relative;
    padding-bottom: 25px;
    text-shadow:
        2px 2px 4px rgba(0, 0, 0, 0.15),
        0 1px 0 rgba(255, 255, 255, 0.5);
}

.panth-deity-main-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 30%;
    right: 30%;
    height: 3px;
    background:
        linear-gradient(90deg,
            transparent,
            #b09b7c,
            rgba(156, 142, 122, 0.8),
            #b09b7c,
            transparent);
    border-radius: 1.5px;
    box-shadow: 0 2px 5px rgba(176, 155, 124, 0.3);
}

.panth-deity-subtitle {
    font-size: 1.8rem;
    color: #7a6b56;
    text-align: center;
    font-style: italic;
    letter-spacing: 6px;
    margin-bottom: 40px;
    padding: 15px 40px;
    display: inline-block;
    background: rgba(232, 223, 208, 0.8);
    border-radius: 4px;
    border: 1px solid rgba(192, 160, 128, 0.4);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.6),
        0 5px 15px rgba(0, 0, 0, 0.1);
}

/* 📷 身份確立區 - 主視覺 */
.panth-identity-section {
    background:
        linear-gradient(rgba(248, 244, 233, 0.85) 0%,
            rgba(242, 236, 219, 0.9) 100%),
        url("data:image/svg+xml,%3Csvg width='150' height='150' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='10' y='10' width='130' height='130' stroke='rgba(140,120,100,0.1)' stroke-width='1' fill='none'/%3E%3C/svg%3E");
    border: 2px solid #d9d0bb;
    border-radius: 6px;
    padding: clamp(20px, 4vw, 50px) clamp(16px, 5vw, 60px);
    margin: clamp(30px, 6vw, 80px) 0;
    position: relative;
    box-shadow:
        0 15px 40px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

/* 經匣裝飾 */
.panth-identity-section::before {
    content: '';
    position: absolute;
    top: -15px;
    left: -15px;
    right: -15px;
    bottom: -15px;
    border: 3px solid #c4b7a0;
    border-radius: 8px;
    pointer-events: none;
    opacity: 0.4;
    z-index: -1;
    background:
        linear-gradient(45deg, transparent 97%, rgba(196, 183, 160, 0.3) 97%),
        linear-gradient(-45deg, transparent 97%, rgba(196, 183, 160, 0.3) 97%);
}

.panth-visual-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 50px;
    margin-bottom: 40px;
}

.panth-image-item {
    text-align: center;
    position: relative;
    font-family: "Klee One", cursive;
    font-weight: 600;
    font-size: 1.3rem;
    margin-bottom: 20px;
}

.panth-image-item-center {
    text-align: center;
    position: relative;
}

.panth-image-container {
    width: auto;
    height: auto;
    /* ✅ 移除固定高度 */
    background:
        linear-gradient(#f5f1e6e6 0%,
            #f0ebddcc 100%);
    border: 2px solid #d4c9b8;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 20px;
    position: relative;
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    transition: all 0.4s ease;
}

.panth-image-container:hover {
    transform: translateY(-5px);
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border-color: #b09b7c;
}

.panth-image-container img {
    width: auto;
    height: auto;
    /* ✅ 保持原始比例 */
    object-fit: contain;
    /* ✅ 不裁剪，完整顯示 */
    transition: opacity 0.8s ease, transform 0.8s ease;
    will-change: opacity, transform;
}

.panth-image-container:hover img {
    transform: scale(1.05);
}

.panth-image-load-effect {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center,
            transparent 0%,
            rgba(176, 155, 124, 0.1) 50%,
            transparent 100%);
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    animation: panth-ink-spread 1s ease-out forwards;
}

/* 圖片邊框裝飾 */
.panth-image-container::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background:
        linear-gradient(45deg, transparent 96%, rgba(176, 155, 124, 0.3) 96%),
        linear-gradient(-45deg, transparent 96%, rgba(176, 155, 124, 0.3) 96%);
    border-radius: 8px;
    pointer-events: none;
    z-index: -1;
    opacity: 0.5;
}

.panth-temple-info-centered {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(180, 160, 140, 0.3);
    text-align: center;
    color: #7a6b56;
    font-size: 0.95rem;
    font-family: "Klee One", cursive;
    font-weight: 600;
    line-height: 1.6;
}

.panth-temple-info-centered div {
    margin: 4px 0;
}

/* 🎴 神格定調區 - 核心內容 */
.panth-essence-section {
    background:
        linear-gradient(145deg,
            rgba(242, 236, 219, 0.95) 0%,
            rgba(235, 229, 210, 0.9) 100%),
        url("data:image/svg+xml,%3Csvg width='200' height='200' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20,100 Q100,20 180,100 T180,100' stroke='rgba(140,120,100,0.05)' stroke-width='1' fill='none'/%3E%3C/svg%3E");
    border: 3px solid #d4c9b8;
    border-radius: 8px;
    padding: clamp(20px, 5vw, 70px) clamp(16px, 6vw, 80px);
    margin: clamp(30px, 6vw, 80px) 0;
    position: relative;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        inset 0 -1px 0 rgba(0, 0, 0, 0.15);
}

/* 書帙裝飾 */
.panth-essence-section::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    bottom: 15px;
    border: 2px solid rgba(176, 155, 124, 0.3);
    border-radius: 6px;
    pointer-events: none;
    z-index: 0;
    background:
        linear-gradient(45deg, transparent 98%, rgba(176, 155, 124, 0.1) 98%),
        linear-gradient(-45deg, transparent 98%, rgba(176, 155, 124, 0.1) 98%);
}

.panth-essence-content {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    line-height: 2.2;
    /* ✅ 寬鬆行距 */
    color: #4a3c2a;
    text-align: justify;
    position: relative;
    z-index: 1;
    letter-spacing: 0.3px;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5);
}

/* 🔑 神格關鍵詞區 */
.panth-keywords-section {
    margin: 70px 0;
    text-align: center;
}

.panth-keywords-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 1.5rem;
    justify-content: center;
}

.panth-keywords-minimal {
    display: flex;
    justify-content: center;
    gap: 1.2rem;
    margin: 4rem auto;
    padding: 1.5rem 0;
    border-top: 1px solid rgba(176, 155, 124, 0.2);
    border-bottom: 1px solid rgba(176, 155, 124, 0.2);
    max-width: 800px;
}

.panth-keyword-minimal {
    font-family: var(--font-title);
    /* Ma Shan Zheng 手寫感 */
    font-size: 1.15rem;
    color: var(--vermilion-dark);
    opacity: 0.9;
    letter-spacing: 1px;
    position: relative;
}

.panth-keyword-minimal::before {
    content: '·';
    position: absolute;
    left: -1.2rem;
    top: 0;
    color: var(--ink-light);
    font-family: var(--font-serif);
}

.panth-keyword-tag {
    /* 方形印章感 */
    background: var(--paper-white);
    border: 2px solid var(--vermilion-dark);
    color: var(--vermilion-dark);
    padding: 0.4rem 1rem;
    font-family: var(--font-title);
    /* Ma Shan Zheng 手寫感 */
    font-size: 1.1rem;
    letter-spacing: 1px;
    text-align: center;
    min-width: 80px;
    box-shadow:
        0 2px 4px rgba(198, 40, 40, 0.1),
        inset 0 0 0 1px rgba(255, 255, 255, 0.8);
    transition: all 0.2s ease;
}

.panth-keyword-tag:hover {
    transform: translateY(-2px);
    box-shadow:
        0 4px 8px rgba(198, 40, 40, 0.2),
        inset 0 0 0 1px rgba(255, 255, 255, 0.9);
    background: rgba(198, 40, 40, 0.03);
}

/* ============================================
關鍵詞效果詳細樣式
============================================ */
.panth-keyword-ink-effect {
    position: absolute;
    top: 50%;
    left: 50%;
    background: radial-gradient(circle,
            rgba(176, 155, 124, 0.2) 0%,
            rgba(156, 142, 122, 0.1) 40%,
            transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
    transform: translate(-50%, -50%);
}

.panth-keyword-text-effect {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-classic);
    color: rgba(176, 155, 124, 0.8);
    font-size: 1.1rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    z-index: 10;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    background: rgba(40, 35, 30, 0.9);
    padding: 5px 10px;
    border-radius: 4px;
    border: 1px solid rgba(176, 155, 124, 0.3);
}

.panth-keyword-seal {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    background: rgba(182, 69, 69, 0.1);
    border: 1px solid rgba(182, 69, 69, 0.3);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-classic);
    color: rgba(182, 69, 69, 0.5);
    font-size: 0.8rem;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.3s ease;
    z-index: 1;
    pointer-events: none;
}

.panth-keyword-ripple {
    position: absolute;
    top: 50%;
    left: 50%;
    background: radial-gradient(circle,
            rgba(176, 155, 124, 0.3) 0%,
            transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0.8;
}

.panth-keyword-tag:hover {
    background:
        linear-gradient(145deg,
            rgba(217, 208, 187, 0.9) 0%,
            rgba(200, 190, 170, 0.8) 100%);
    border-color: #b09b7c;
    transform: translateY(-5px) scale(1.05);
    box-shadow:
        0 15px 35px rgba(0, 0, 0, 0.2),
        0 0 20px rgba(176, 155, 124, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    color: #5d4c3a;
}

/* 關鍵詞印章效果 */
.panth-keyword-tag::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    background:
        linear-gradient(45deg, transparent 95%, rgba(176, 155, 124, 0.2) 95%),
        linear-gradient(-45deg, transparent 95%, rgba(176, 155, 124, 0.2) 95%);
    border-radius: 20px;
    pointer-events: none;
    opacity: 0.3;
}

/* 📜 聖蹟卷宗區 */
.panth-stories-section {
    margin: 80px 0;
}

.panth-stories-list {
    background:
        linear-gradient(rgba(248, 244, 233, 0.9) 0%,
            rgba(242, 236, 219, 0.95) 100%);
    border: 2px solid #d9d0bb;
    border-radius: 6px;
    padding: 60px 70px;
    position: relative;
    box-shadow:
        0 15px 40px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

/* 卷軸裝飾 */
.panth-stories-list::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border: 2px solid rgba(176, 155, 124, 0.4);
    border-radius: 8px;
    pointer-events: none;
    z-index: -1;
    background:
        linear-gradient(45deg, transparent 97%, rgba(176, 155, 124, 0.1) 97%),
        linear-gradient(-45deg, transparent 97%, rgba(176, 155, 124, 0.1) 97%);
}

.panth-story-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 35px;
    margin-top: 40px;
}

.panth-story-item {
    padding: 30px 35px;
    background:
        linear-gradient(rgba(255, 255, 255, 0.95) 0%,
            rgba(250, 250, 245, 0.9) 100%);
    border: 1px solid #e8dfd0;
    border-radius: 4px;
    transition: all 0.4s ease;
    position: relative;
    box-shadow:
        0 8px 25px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.panth-story-item:hover {
    border-color: #b09b7c;
    transform: translateX(8px) translateY(-3px);
    box-shadow:
        0 15px 40px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(176, 155, 124, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.panth-story-item::before {
    content: '卷';
    position: absolute;
    top: 15px;
    right: 15px;
    font-family: 'STKaiti', cursive;
    color: rgba(176, 155, 124, 0.6);
    font-size: 1.1rem;
    padding: 5px 10px;
    background: rgba(232, 223, 208, 0.6);
    border-radius: 3px;
    border: 1px solid rgba(212, 201, 184, 0.4);
}

.panth-story-title {
    font-size: 1.4rem;
    color: #5d4c3a;
    margin-bottom: 15px;
    padding-right: 50px;
    line-height: 1.4;
}

.panth-story-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s;
    position: relative;
    display: inline-block;
}

.panth-story-title a:hover {
    color: #8b7355;
}

.panth-story-title a::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg,
            rgba(139, 115, 85, 0.8),
            rgba(176, 155, 124, 0.8));
    transition: width 0.3s ease;
}

.panth-story-title a:hover::after {
    width: 100%;
}

.panth-story-desc {
    font-size: 1rem;
    color: #7a6b56;
    line-height: 1.6;
    margin-top: 10px;
}

/* 📖 延伸閱讀區 */
.panth-extensions-section {
    margin: 60px 0;
    padding: 50px;
    background:
        linear-gradient(rgba(242, 236, 219, 0.6) 0%,
            rgba(235, 229, 210, 0.7) 100%);
    border: 2px dashed #c4b7a0;
    border-radius: 8px;
    text-align: center;
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.panth-extension-links {
    display: flex;
    justify-content: center;
    gap: 35px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.panth-extension-link {
    padding: 15px 40px;
    background:
        linear-gradient(145deg,
            rgba(232, 223, 208, 0.9) 0%,
            rgba(217, 208, 187, 0.8) 100%);
    border: 2px solid #c4b7a0;
    border-radius: 4px;
    color: #6d5a45;
    text-decoration: none;
    transition: all 0.4s ease;
    font-size: 1.05rem;
    box-shadow:
        0 5px 15px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(2px);
}

.panth-extension-link:hover {
    background:
        linear-gradient(145deg,
            rgba(217, 208, 187, 0.9) 0%,
            rgba(200, 190, 170, 0.8) 100%);
    border-color: #b09b7c;
    transform: translateY(-5px);
    box-shadow:
        0 15px 35px rgba(0, 0, 0, 0.2),
        0 0 20px rgba(176, 155, 124, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    color: #5d4c3a;
}

/* 🏺 印章裝飾元素 */
.panth-seal-decoration {
    position: absolute;
    width: 100px;
    height: 100px;
    background:
        linear-gradient(145deg,
            rgba(182, 69, 69, 0.15) 0%,
            rgba(162, 59, 59, 0.1) 100%);
    border: 3px solid rgba(182, 69, 69, 0.4);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'STKaiti', cursive;
    color: rgba(182, 69, 69, 0.6);
    font-size: 2rem;
    pointer-events: none;
    z-index: 0;
    box-shadow:
        5px 5px 20px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(2px);
    animation: panth-seal-drift 30s ease-in-out infinite;
    transform-style: preserve-3d;
}

@keyframes panth-seal-drift {

    0%,
    100% {
        transform: rotate(0deg) translateY(0) scale(1);
        opacity: 0.1;
    }

    25% {
        transform: rotate(90deg) translateY(-20px) scale(1.05);
        opacity: 0.15;
    }

    50% {
        transform: rotate(180deg) translateY(0) scale(1);
        opacity: 0.1;
    }

    75% {
        transform: rotate(270deg) translateY(10px) scale(0.95);
        opacity: 0.15;
    }
}

/* ============================================
印章交互效果樣式
============================================ */
.panth-seal-decoration.interactive {
    pointer-events: auto;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.panth-seal-decoration.interactive:hover {
    opacity: 0.3;
    transform: scale(1.1);
    z-index: 10;
}

.panth-seal-glow {
    position: fixed;
    border-radius: 50%;
    background: radial-gradient(circle,
            rgba(176, 155, 124, 0.2) 0%,
            transparent 70%);
    pointer-events: none;
    z-index: 9;
    transform: translate(-50%, -50%);
}

.panth-seal-click-effect {
    position: fixed;
    border-radius: 50%;
    background: radial-gradient(circle,
            rgba(182, 69, 69, 0.3) 0%,
            rgba(156, 136, 116, 0.2) 30%,
            transparent 70%);
    pointer-events: none;
    z-index: 999;
    transform: translate(-50%, -50%);
}

.panth-seal-hint {
    position: fixed;
    bottom: 100px;
    right: 30px;
    background: rgba(40, 35, 30, 0.9);
    color: #e6dfcd;
    padding: 12px 20px;
    border-radius: 6px;
    border: 1px solid rgba(176, 155, 124, 0.4);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    font-family: var(--font-classic);
    backdrop-filter: blur(5px);
    font-size: 1.1rem;
    pointer-events: none;
}

/* 印章裂紋效果 */
.panth-seal-crack {
    position: absolute;
    top: 10%;
    left: 10%;
    right: 10%;
    bottom: 10%;
    background:
        linear-gradient(45deg, transparent 97%, rgba(182, 69, 69, 0.3) 97%),
        linear-gradient(-45deg, transparent 97%, rgba(182, 69, 69, 0.3) 97%);
    border-radius: 4px;
    pointer-events: none;
    opacity: 0.3;
}

/* 印章文字效果 */
.panth-seal-decoration::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    background:
        linear-gradient(45deg, transparent 97%, rgba(182, 69, 69, 0.3) 97%),
        linear-gradient(-45deg, transparent 97%, rgba(182, 69, 69, 0.3) 97%);
    border-radius: 4px;
    pointer-events: none;
    opacity: 0.3;
}

/* 🔙 返回按鈕 - 古籍樣式 */
.panth-back-button {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    padding: 18px 50px;
    background:
        linear-gradient(145deg,
            rgba(242, 236, 219, 0.95) 0%,
            rgba(235, 229, 210, 0.9) 100%);
    border: 3px solid #c4b7a0;
    border-radius: 4px;
    color: #5d4c3a;
    text-decoration: none;
    font-size: 1.15rem;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    margin-bottom: 50px;
    box-shadow:
        0 8px 30px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(3px);
}

.panth-back-button:hover {
    border-color: #b09b7c;
    color: #4a3c2a;
    box-shadow:
        0 15px 45px rgba(0, 0, 0, 0.3),
        0 0 25px rgba(176, 155, 124, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transform: translateX(-12px);
    padding-left: 55px;
    padding-right: 45px;
}

.panth-back-button::before {
    content: '↶';
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.panth-back-button:hover::before {
    transform: translateX(-8px) rotate(-20deg);
}

.panth-back-button::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.25),
            transparent);
    transition: left 0.7s ease;
}

.panth-back-button:hover::after {
    left: 100%;
}

/* 📄 古籍分頁線 */
.panth-page-divider {
    height: 2px;
    background:
        repeating-linear-gradient(to right,
            transparent,
            transparent 20px,
            rgba(176, 155, 124, 0.4) 20px,
            rgba(176, 155, 124, 0.4) 40px);
    margin: 80px auto;
    max-width: 850px;
    position: relative;
    border-radius: 1px;
    box-shadow: 0 2px 10px rgba(176, 155, 124, 0.2);
}

.panth-page-divider::before,
.panth-page-divider::after {
    content: '❖';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #b09b7c;
    font-size: 1.8rem;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
    animation: panth-divider-spin 25s linear infinite;
}

.panth-page-divider::before {
    left: -45px;
}

.panth-page-divider::after {
    right: -45px;
}

@keyframes panth-divider-spin {
    from {
        transform: translateY(-50%) rotate(0deg);
    }

    to {
        transform: translateY(-50%) rotate(360deg);
    }
}

/* ============================================
動畫關鍵幀庫
============================================ */
@keyframes panth-fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

@keyframes panth-slide-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

@keyframes panth-text-reveal {
    0% {
        clip-path: inset(0 100% 0 0);
        opacity: 0;
    }

    100% {
        clip-path: inset(0 0 0 0);
        opacity: 1;
    }
}

@keyframes panth-ink-spread {
    0% {
        transform: scale(0);
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

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

@keyframes panth-breathe {

    0%,
    100% {
        opacity: 0.7;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.02);
    }
}

@keyframes panth-card-float {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    33% {
        transform: translateY(-10px) rotate(0.5deg);
    }

    66% {
        transform: translateY(-5px) rotate(-0.5deg);
    }
}

@keyframes panth-page-turn {
    0% {
        transform: scaleX(0) rotateY(0deg);
        opacity: 0;
    }

    50% {
        transform: scaleX(1) rotateY(10deg);
        opacity: 0.3;
    }

    100% {
        transform: scaleX(0) rotateY(0deg);
        opacity: 0;
    }
}

@keyframes panth-keyword-pulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(176, 155, 124, 0.4);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 20px rgba(176, 155, 124, 0.6);
    }
}

@keyframes panth-dust-float {
    0% {
        transform: translate(var(--start-x), var(--start-y)) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: var(--opacity);
    }

    90% {
        opacity: calc(var(--opacity) * 0.3);
    }

    100% {
        transform: translate(var(--end-x), var(--end-y)) rotate(var(--rotation));
        opacity: 0;
    }
}

@keyframes panth-seal-float {

    0%,
    100% {
        transform: rotate(0deg) translateY(0) scale(1);
        opacity: 0.1;
    }

    25% {
        transform: rotate(90deg) translateY(-20px) scale(1.05);
        opacity: 0.15;
    }

    50% {
        transform: rotate(180deg) translateY(0) scale(1);
        opacity: 0.1;
    }

    75% {
        transform: rotate(270deg) translateY(10px) scale(0.95);
        opacity: 0.15;
    }
}

@keyframes panth-page-shadow {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 0.6;
    }
}

@keyframes panth-scroll-unfold {
    0% {
        transform: scaleY(0.8);
        opacity: 0;
    }

    100% {
        transform: scaleY(1);
        opacity: 1;
    }
}

@keyframes panth-ornament-spin {
    from {
        transform: translateY(-50%) rotate(0deg);
    }

    to {
        transform: translateY(-50%) rotate(360deg);
    }
}

@keyframes panth-divider-spin {
    from {
        transform: translateY(-50%) rotate(0deg);
    }

    to {
        transform: translateY(-50%) rotate(360deg);
    }
}

@keyframes panth-scroll-float {

    0%,
    100% {
        transform: translateY(0) rotate(0deg) scale(1);
        opacity: 0.3;
    }

    33% {
        transform: translateY(-30px) rotate(-5deg) scale(1.1);
        opacity: 0.5;
    }

    66% {
        transform: translateY(10px) rotate(5deg) scale(0.95);
        opacity: 0.4;
    }
}

/* ============================================
動畫類別系統
============================================ */
.panth-animate-fade-in {
    animation: panth-fade-in 0.8s ease-out forwards;
    opacity: 0;
}

.panth-animate-slide-up {
    animation: panth-slide-up 0.6s ease-out forwards;
    opacity: 0;
}

.panth-animate-text-reveal {
    animation: panth-text-reveal 1.2s ease-out forwards;
}

.panth-animate-breathe {
    animation: panth-breathe 3s ease-in-out infinite;
}

.panth-animate-card-float {
    animation: panth-card-float 3s ease-in-out infinite;
}

.panth-animate-keyword-pulse {
    animation: panth-keyword-pulse 1.5s ease-in-out infinite;
}

.panth-animate-scroll-unfold {
    animation: panth-scroll-unfold 1s ease-out forwards;
    transform-origin: top center;
}

/* 初始隱藏，等待JS觸發 */
.panth-init-hidden {
    opacity: 0;
    transform: translateY(20px);
}

/* 延遲動畫 */
.panth-delay-100 {
    animation-delay: 0.1s;
}

.panth-delay-200 {
    animation-delay: 0.2s;
}

.panth-delay-300 {
    animation-delay: 0.3s;
}

.panth-delay-500 {
    animation-delay: 0.5s;
}

.panth-delay-1000 {
    animation-delay: 1s;
}

/* ============================================
交互效果類別
============================================ */
/* 卡片激活狀態 */
.panth-card-active {
    z-index: 100;
    box-shadow:
        0 25px 70px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(176, 155, 124, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        0 0 40px rgba(176, 155, 124, 0.15);
}

.panth-card-active .panth-brush-text {
    opacity: 1;
    transform: scale(1);
}

/* 關鍵詞激活狀態 */
.panth-keyword-active {
    background:
        linear-gradient(145deg,
            rgba(217, 208, 187, 0.9) 0%,
            rgba(200, 190, 170, 0.8) 100%);
    border-color: #b09b7c;
    color: #5d4c3a;
}

/* 頁面可見狀態 */
.panth-page-visible {
    opacity: 1;
    transform: translateY(0);
}

.panth-card-visible {
    opacity: 1;
    transform: translateY(0);
}

/* 卷軸狀態 */
.panth-scrolled {
    transform: translateY(var(--scroll-offset));
}

.panth-unrolled {
    max-height: 1000px;
    opacity: 1;
    transform: scaleY(1);
}

.panth-rolled {
    max-height: 0;
    opacity: 0;
    transform: scaleY(0);
}

/* ============================================
工具類別
============================================ */
/* 佈局工具 */
.panth-flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

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

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

/* 文字工具 */
.panth-text-center {
    text-align: center;
}

.panth-text-justify {
    text-align: justify;
}

.panth-text-ellipsis {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.panth-text-multiline-ellipsis {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.6;
    font-size: 1rem;
}

/* 間距工具 */
.panth-mt-sm {
    margin-top: var(--spacing-sm);
}

.panth-mt-md {
    margin-top: var(--spacing-md);
}

.panth-mt-lg {
    margin-top: var(--spacing-lg);
}

.panth-mb-sm {
    margin-bottom: var(--spacing-sm);
}

.panth-mb-md {
    margin-bottom: var(--spacing-md);
}

.panth-mb-lg {
    margin-bottom: var(--spacing-lg);
}

.panth-py-sm {
    padding-top: var(--spacing-sm);
    padding-bottom: var(--spacing-sm);
}

.panth-py-md {
    padding-top: var(--spacing-md);
    padding-bottom: var(--spacing-md);
}

.panth-py-lg {
    padding-top: var(--spacing-lg);
    padding-bottom: var(--spacing-lg);
}

/* 隱藏工具 */
.panth-hidden {
    display: none;
}

.panth-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ✨ 空狀態 */
.panth-empty-state {
    text-align: center;
    padding: 140px 50px;
    color: #9c8e7a;
    font-style: italic;
    position: relative;
    background: rgba(232, 223, 208, 0.6);
    border-radius: 10px;
    border: 3px dashed rgba(176, 155, 124, 0.5);
    margin: 100px auto;
    max-width: 800px;
    backdrop-filter: blur(5px);
}

.panth-empty-state::before {
    content: '📜';
    font-size: 7rem;
    display: block;
    margin-bottom: 50px;
    opacity: 0.3;
    animation: panth-scroll-float 5s ease-in-out infinite;
    filter: drop-shadow(3px 3px 5px rgba(0, 0, 0, 0.2));
}

.panth-empty-state p:first-of-type {
    font-size: 1.6rem;
    margin-bottom: 25px;
    color: #7a6b56;
}

.panth-empty-state p:last-of-type {
    font-size: 1.3rem;
    opacity: 0.8;
}

@keyframes panth-scroll-float {

    0%,
    100% {
        transform: translateY(0) rotate(0deg) scale(1);
        opacity: 0.3;
    }

    33% {
        transform: translateY(-30px) rotate(-5deg) scale(1.1);
        opacity: 0.5;
    }

    66% {
        transform: translateY(10px) rotate(5deg) scale(0.95);
        opacity: 0.4;
    }
}

/* 區塊標題樣式 */
.panth-section-title {
    font-size: clamp(2rem, 7vw, 4.2rem);
    color: #5d4c3a;
    margin-bottom: clamp(16px, 3vw, 40px);
    padding-bottom: 20px;
    border-bottom: 3px solid rgba(176, 155, 124, 0.4);
    position: relative;
    letter-spacing: clamp(1px, 0.5vw, 4px);
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
    text-align: center;
    font-family: 'Klee One';
}

.panth-section-title::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 150px;
    height: 3px;
    background:
        linear-gradient(90deg,
            #b09b7c,
            rgba(156, 142, 122, 0.8),
            transparent);
}

.panth-section-subtitle {
    font-family: "Klee One", "Noto Serif TC", serif;
    font-size: 1.4rem;
    letter-spacing: 0.18em;
    color: rgba(60, 45, 30, 0.65);
    text-align: center;
    margin-bottom: 1.6rem;
}

/* 廟宇信息 */
.panth-temple-info-centered {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(180, 160, 140, 0.3);
    text-align: center;
    color: #7a6b56;
    font-size: 1.15rem;
    line-height: 1.6;
}

.panth-temple-info-centered div {
    margin: 4px 0;
}

/* 空註釋 */
.panth-empty-note {
    text-align: center;
    color: #9c8e7a;
    font-style: italic;
    padding: 60px 30px;
    font-size: 1.3rem;
    background: rgba(232, 223, 208, 0.6);
    border-radius: 6px;
    border: 2px dashed rgba(176, 155, 124, 0.4);
    margin: 40px 0;
}

/* 神明關鍵詞容器 */
.panth-deity-keywords {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    flex-wrap: wrap;
}

/* 故事導航 */
.panth-story-navigation {
    margin-bottom: 40px;
}

/* 翻頁陰影 */
.panth-page-shadow {
    position: absolute;
    top: 0;
    right: 0;
    width: 20px;
    height: 100%;
    background:
        linear-gradient(90deg,
            rgba(0, 0, 0, 0.15) 0%,
            transparent 100%);
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* ============================================
翻頁效果詳細樣式
============================================ */
.panth-page-texture {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        repeating-linear-gradient(0deg,
            transparent,
            transparent 1px,
            rgba(176, 155, 124, 0.05) 1px,
            rgba(176, 155, 124, 0.05) 2px),
        repeating-linear-gradient(90deg,
            transparent,
            transparent 1px,
            rgba(176, 155, 124, 0.03) 1px,
            rgba(176, 155, 124, 0.03) 2px);
    opacity: 0.5;
    pointer-events: none;
    z-index: 0;
}

.panth-page-turn-animation {
    position: absolute;
    top: 0;
    right: 0;
    width: 30px;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(176, 155, 124, 0.1),
            transparent);
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transform-origin: right center;
}

.panth-scroll-unfold-effect {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to right,
            transparent,
            rgba(176, 155, 124, 0.05),
            transparent);
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    transform: scaleY(0.8);
    transform-origin: top center;
}

/* 頁碼 */
.panth-page-number {
    position: absolute;
    bottom: 20px;
    right: 20px;
    font-size: 1rem;
    color: rgba(140, 120, 100, 0.6);
    font-family: 'STKaiti', cursive;
    padding: 5px 10px;
    background: rgba(232, 223, 208, 0.8);
    border-radius: 3px;
    border: 1px solid rgba(212, 201, 184, 0.5);
}

/* 卡片毛筆文字 */
.panth-brush-text {
    position: absolute;
    bottom: 15px;
    right: 15px;
    font-family: 'STKaiti', cursive;
    color: rgba(176, 155, 124, 0.4);
    font-size: 1.8rem;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.3s ease;
    writing-mode: vertical-rl;
}

/* ==================== */
/* 移除內部捲軸，保留視窗滾動 */
/* ==================== */

/* 1. 移除所有內部容器的滾動 */
.panth-archive-container,
.panth-deity-grid,
.panth-essence-section,
.panth-identity-section,
.panth-stories-section {
    overflow: visible !important;
    /* 改為可見，不產生滾動 */
    max-height: none !important;
    /* 移除高度限制 */
    height: auto !important;
    /* 高度自動 */
}

/* 2. 確保主容器不限制滾動 */
.panth-wrapper {
    overflow: visible !important;
    /* 改為可見 */
    min-height: 100vh;
    /* 最小高度為視窗高度 */
    position: relative;
}

/* 3. 修正 fixed/absolute 元素的定位 */
.panth-paper-layer {
    position: fixed !important;
    /* 保持 fixed，但修正覆蓋範圍 */
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    height: auto;
    min-height: 100vh;
    /* 覆蓋整個頁面高度 */
}

.panth-dust-particles {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* 100% 高度，不是 auto */
    min-height: 100vh;
}

/* 4. 修正線裝書邊框的 fixed 定位 */
.panth-archive-container::before,
.panth-archive-container::after {
    height: 100% !important;
    /* 跟隨實際內容高度 */
    min-height: 100vh;
    /* 至少覆蓋視窗高度 */
}

/* 5. 確保所有內容正常顯示 */
.panth-archive-header,
.panth-deity-card,
.panth-essence-content,
.panth-empty-state {
    position: relative;
    z-index: 10;
}

/* 6. 確保 HTML/Body 允許滾動 */
html,
body {
    overflow-y: auto !important;
    /* 允許垂直滾動 */
    overflow-x: hidden !important;
    /* 隱藏水平滾動 */
    height: auto;
    min-height: 100vh;
}

/* 7. 移除可能造成問題的陰影/邊框效果 */
.panth-archive-container {
    box-shadow:
        0 15px 50px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.7) !important;
    /* 移除可能造成滾動的複雜陰影 */
}

/* 9. 特別針對神明頁面 */
body.page-temple-pantheon-xing .panth-wrapper {
    min-height: 100vh;
    overflow: visible;
}

.panth-dynamic-light {
    position: fixed;
    pointer-events: none;
    z-index: 0;
    filter: blur(25px);
    will-change: transform;
    opacity: 0.3;
    transition: opacity 0.5s ease;
}

/* 搜索提示樣式 */
.panth-search-hint {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: rgba(40, 35, 30, 0.9);
    color: #e6dfcd;
    padding: 15px 25px;
    border-radius: 6px;
    border: 1px solid rgba(176, 155, 124, 0.4);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    font-family: 'STKaiti', cursive;
    backdrop-filter: blur(5px);
    pointer-events: none;
}

/* 通知樣式 */
.panth-toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(40, 35, 30, 0.9);
    color: #e6dfcd;
    padding: 12px 24px;
    border-radius: 6px;
    border: 1px solid rgba(176, 155, 124, 0.4);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease;
    font-family: 'STKaiti', cursive;
    backdrop-filter: blur(5px);
    white-space: nowrap;
    pointer-events: none;
}

/* 時間線樣式 */
.panth-timeline-connector {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    background: linear-gradient(to bottom,
            transparent,
            rgba(176, 155, 124, 0.3),
            transparent);
    transform: translateX(-50%);
    z-index: 0;
}

.panth-timeline-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg,
            rgba(182, 69, 69, 0.8),
            rgba(139, 115, 85, 0.9));
    border-radius: 50%;
    border: 3px solid rgba(232, 223, 208, 0.8);
    transform: translate(-50%, -50%);
    z-index: 2;
    box-shadow: 0 0 15px rgba(182, 69, 69, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.panth-timeline-ripple {
    position: fixed;
    border-radius: 50%;
    background: radial-gradient(circle,
            rgba(182, 69, 69, 0.2) 0%,
            transparent 70%);
    pointer-events: none;
    z-index: 1;
}