.deity-detail-page {
  background-color: var(--paper-white);
  position: relative;
  min-height: 100vh;
  font-family: var(--font-serif);
  color: var(--ink-deep);
}

.deity-detail-page::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    url("image/svg+xml,%3Csvg width='600' height='600' viewBox='0 0 600 600' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 300 Q 150 280, 300 300 T 600 300' stroke='%23d7ccc8' stroke-width='0.5' fill='none' opacity='0.1'/%3E%3Cpath d='M300 0 Q 280 150, 300 300 T 300 600' stroke='%23d7ccc8' stroke-width='0.5' fill='none' opacity='0.1'/%3E%3C/svg%3E"),
    radial-gradient(circle at 20% 20%, rgba(156, 93, 56, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(156, 93, 56, 0.02) 0%, transparent 50%);
  background-size: 300px 300px, cover, cover;
  opacity: 0.5;
  pointer-events: none;
  z-index: 1;
}

/* === 頁首：神明基本資料 === */
.deity-detail-header {
  background: linear-gradient(135deg, var(--paper-white) 0%, var(--paper-cream) 100%);
  border-radius: 8px;
  padding: 3rem;
  margin-bottom: 3rem;
  box-shadow:
    0 8px 30px rgba(0,0,0,0.1),
    inset 0 0 0 1px rgba(255,255,255,0.5);
  position: relative;
  overflow: hidden;
  border-left: 4px solid var(--vermilion-medium);
}

.deity-profile {
  display: flex;
  align-items: center;
  gap: 3rem;
  margin-bottom: 2rem;
}

.deity-symbol {
  flex-shrink: 0;
  position: relative;
}

.deity-symbol-icon {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ochre) 0%, var(--gamboge) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--paper-white);
  font-family: var(--font-title);
  font-size: 3.5rem;
  border: 5px solid var(--paper-white);
  box-shadow:
    0 12px 35px rgba(156, 93, 56, 0.4),
    inset 0 0 25px rgba(255,255,255,0.5);
  position: relative;
  z-index: 2;
}

.deity-basic-info { flex: 1; }

.deity-title {
  font-size: 3.2rem;
  color: var(--ochre);
  margin-bottom: 0.8rem;
  font-family: var(--font-title);
  text-shadow:
    2px 2px 0 var(--paper-white),
    4px 4px 0 rgba(0,0,0,0.05);
  letter-spacing: 4px;
}

.deity-subtitle {
  font-size: 1.4rem;
  color: var(--vermilion-dark);
  margin-bottom: 1.5rem;
  font-weight: 600;
  border-left: 3px solid var(--vermilion-dark);
  padding-left: 1rem;
}

.deity-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 2rem;
}

.deity-tag {
  background: rgba(156, 93, 56, 0.1);
  color: var(--ochre);
  padding: 0.5rem 1.2rem;
  border-radius: 20px;
  font-size: 0.95rem;
  border: 1px solid rgba(156, 93, 56, 0.3);
  font-weight: 500;
  transition: all 0.3s ease;
}
.deity-tag:hover {
  background: rgba(156, 93, 56, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(156, 93, 56, 0.2);
}

/* === 神格定調區塊（靜態卷軸）=== */
.deity-essence-section {
  margin: 4rem 0;
  position: relative;
  text-align: center;
}

.deity-essence-title {
  font-family: var(--font-title);
  font-size: 2.5rem;
  color: var(--vermilion-dark);
  margin-bottom: 3rem;
  position: relative;
  letter-spacing: 6px;
}
.deity-essence-title::before,
.deity-essence-title::after {
  content: '❖';
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ochre);
  opacity: 0.5;
  font-size: 1.5rem;
}
.deity-essence-title::before { left: 25%; }
.deity-essence-title::after { right: 25%; }

/* 卷軸容器 - 僅視覺模擬 */
.deity-scroll-mockup {
  max-width: 900px;
  margin: 0 auto;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 軸頭（靜態裝飾） */
.deity-scroll-handle {
  width: 60px;
  min-height: 400px;
  background: linear-gradient(135deg,
    var(--ochre) 0%,
    var(--gamboge) 30%,
    var(--ochre) 70%,
    #654321 100%);
  border-radius: 8px;
  box-shadow:
    inset 0 0 20px rgba(0, 0, 0, 0.3),
    0 4px 12px rgba(0, 0, 0, 0.2);
  z-index: 2;
  position: relative;
}
.deity-scroll-handle.left {
  border-right: 2px solid #654321;
  transform: rotate(1deg);
  margin-right: -30px;
}
.deity-scroll-handle.right {
  border-left: 2px solid #654321;
  transform: rotate(-1deg);
  margin-left: -30px;
}
.handle-ornament {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2.5rem;
  color: #d2b48c;
  opacity: 0.7;
  font-family: var(--font-classic);
}

/* 卷軸內容（不可互動） */
.deity-scroll-content {
  flex: 1;
  min-height: 400px;
  position: relative;
  background: var(--paper-old);
  border-top: 1px solid var(--ink-wash);
  border-bottom: 1px solid var(--ink-wash);
}

.deity-scroll-paper {
  padding: 4rem;
  min-height: 400px;
  position: relative;
  background-image:
    url("image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%238b4513' fill-opacity='0.03' fill-rule='evenodd'/%3E%3C/svg%3E"),
    radial-gradient(circle at 10% 10%, rgba(139, 69, 19, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 90% 90%, rgba(139, 69, 19, 0.05) 0%, transparent 50%);
  background-size: 100px 100px, cover, cover;
  border: 1px solid rgba(139, 69, 19, 0.2);
  box-shadow:
    inset 0 0 50px rgba(139, 69, 19, 0.1),
    0 5px 20px rgba(0, 0, 0, 0.1);
}

/* 內容樣式 */
.deity-scroll-paper p {
  font-size: 1.15rem;
  line-height: 1.9;
  color: var(--ink-deep);
  font-family: var(--font-serif);
  text-align: justify;
  text-indent: 2em;
  margin-bottom: 1.5rem;
}
.deity-scroll-paper p:last-child {
  margin-bottom: 0;
}

/* 印章裝飾（靜態） */
.essence-seals {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 2px dashed var(--ink-wash);
}
.essence-seal {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg,
    var(--vermilion-dark) 0%,
    var(--ochre) 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-classic);
  color: white;
  font-size: 1.2rem;
  opacity: 0.9;
  box-shadow: 2px 2px 5px rgba(0,0,0,0.2);
}

/* === 聖蹟卷宗區塊 === */
.deity-stories-section {
  margin: 3rem 0;
}

.deity-stories-title {
  color: var(--gold-dark);
  font-size: 2.2rem;
  margin-bottom: 2rem;
  font-family: var(--font-title);
  text-align: center;
  border-bottom: 2px solid rgba(249,168,37,0.3);
  padding-bottom: 0.8rem;
}

.deity-stories-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.deity-story-item {
  background: rgba(250,248,243,0.85);
  padding: 1.8rem;
  border-radius: 10px;
  border-left: 4px solid var(--gold-dark);
  position: relative;
}

.deity-story-preview h3 {
  font-family: var(--font-title);
  font-size: 1.5rem;
  color: var(--ink-deep);
  margin-bottom: 0.6rem;
}

.deity-story-intro {
  color: var(--ink-light);
  line-height: 1.7;
  margin-bottom: 0.8rem;
}

.deity-story-toggle {
  background: var(--paper-aged);
  color: var(--vermilion-dark);
  border: 1px solid var(--gold-dark);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.95rem;
  transition: all 0.2s;
}
.deity-story-toggle:hover {
  background: #e0e0e0;
}

.deity-story-content {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px dashed var(--ink-wash);
  background-image: url("image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Cpath d='M0,0 L100,0' stroke='%23f5f0e6' stroke-width='0.5' opacity='0.5'/%3E%3C/svg%3E");
  background-size: 100px 100px;
}
.deity-story-content.hidden {
  display: none;
}

/* === 雙版本內容 === */
.deity-dual-version {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-top: 1rem;
}

.deity-dual-version h4 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.8rem;
  color: var(--vermilion-dark);
  display: flex;
  align-items: center;
}

.deity-version-original blockquote {
  background: var(--paper-cream);
  border-left: 3px solid var(--ochre);
  padding: 1.2rem;
  margin: 0;
  font-size: 0.95rem;
  color: var(--ink-light);
  line-height: 1.8;
  font-style: italic;
}

.deity-story-location-tag {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--ink-wash);
  font-style: italic;
  color: var(--vermilion-dark);
  text-align: right;
}

/* === 廟宇記錄區塊 === */
.deity-temple-section {
  background: rgba(250,248,243,0.95);
  border-radius: 16px;
  padding: 2.5rem;
  margin: 3rem 0;
  border-left: 5px solid var(--indigo-dark);
  position: relative;
  overflow: hidden;
}

.deity-temple-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(40,53,147,0.02) 0%, transparent 50%, rgba(40,53,147,0.01) 100%);
  pointer-events: none;
  z-index: 0;
}

.deity-temple-title {
  color: var(--indigo-dark);
  font-size: 2rem;
  margin-bottom: 1.5rem;
  font-family: var(--font-title);
  border-bottom: 2px solid rgba(40,53,147,0.2);
  padding-bottom: 0.8rem;
}

.deity-temple-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.deity-temple-item {
  background: var(--paper-white);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.deity-temple-item h4 {
  color: var(--indigo-dark);
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
  font-weight: 700;
}
.deity-temple-item p {
  color: var(--ink-light);
  line-height: 1.6;
  font-size: 0.95rem;
}

.deity-temple-note {
  font-style: italic;
  color: var(--ink-deep);
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--ink-wash);
  text-align: center;
}

/* === 延伸閱讀區塊 === */
.deity-related-section {
  background: rgba(250,248,243,0.95);
  border-radius: 16px;
  padding: 2.5rem;
  margin: 3rem 0;
  border-left: 5px solid var(--gold-dark);
}

.deity-related-title {
  color: var(--gold-dark);
  font-size: 2rem;
  margin-bottom: 1.5rem;
  font-family: var(--font-title);
  text-align: center;
}

.deity-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.deity-related-card {
  background: var(--paper-white);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  transition: all 0.3s ease;
  text-decoration: none;
  display: block;
}
.deity-related-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.deity-related-card h4 {
  color: var(--ink-deep);
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
  font-weight: 700;
}
.deity-related-card p {
  color: var(--ink-light);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* === 返回按鈕 === */
.deity-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(198, 40, 40, 0.08);
  color: var(--vermilion-medium);
  padding: 0.8rem 1.8rem;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  border: 1px solid var(--vermilion-medium);
  margin-bottom: 2rem;
  box-shadow:
    0 3px 10px rgba(0,0,0,0.05),
    inset 0 0 0 1px rgba(255,255,255,0.5);
}
.deity-back-btn:hover {
  background: rgba(198, 40, 40, 0.15);
  transform: translateX(-5px);
  box-shadow:
    0 6px 15px rgba(0,0,0,0.08),
    inset 0 0 0 1px rgba(255,255,255,0.6);
}

/* === 暗色模式支援 === */
@media (prefers-color-scheme: dark) {
  .deity-detail-page {
    background-color: var(--paper-dark-bg);
    color: var(--paper-text-light);
  }
  .deity-detail-header,
  .deity-scroll-paper,
  .deity-temple-section,
  .deity-related-section,
  .deity-story-item {
    background: rgba(40, 35, 30, 0.95);
    border-color: var(--ink-wash-dark);
    color: var(--paper-text-light);
  }
  .deity-title,
  .deity-essence-title,
  .deity-stories-title,
  .deity-temple-title,
  .deity-related-title {
    color: var(--gold-light);
  }
  .deity-tag,
  .deity-back-btn {
    background: rgba(60, 50, 40, 0.8);
    border-color: var(--ink-wash-dark);
    color: var(--paper-text-light);
  }
  .deity-scroll-paper p,
  .deity-story-intro,
  .deity-temple-item p,
  .deity-related-card p {
    color: var(--paper-text-light);
  }
}

/* === 響應式調整 === */
@media (max-width: 768px) {
  .deity-detail-header { padding: 2rem 1.5rem; }
  .deity-profile { flex-direction: column; gap: 2rem; text-align: center; }
  .deity-title { font-size: 2.5rem; letter-spacing: 2px; }
  .deity-essence-section,
  .deity-temple-section,
  .deity-related-section { padding: 1.8rem; }
  .deity-scroll-paper p { text-indent: 1em; }
}


.panth-story-header {
    margin-bottom: 50px;
    text-align: center;
}

.panth-story-main-title {
    font-size: 2.4rem;
    color: #5d4c3a;
    margin-bottom: 15px;
    letter-spacing: 4px;
}

.panth-story-subtitle {
    font-size: 1.3rem;
    color: #7a6b56;
    font-style: italic;
    margin-bottom: 25px;
}

.panth-story-meta {
    display: flex;
    justify-content: center;
    gap: 30px;
    color: #9c8e7a;
    font-size: 0.95rem;
    flex-wrap: wrap;
}

.panth-meta-deity,
.panth-meta-date {
    padding: 8px 20px;
    background: rgba(232, 223, 208, 0.7);
    border: 1px solid #d4c9b8;
    border-radius: 2px;
}

.panth-story-cover {
    margin: 40px 0;
    text-align: center;
}

.panth-story-cover .panth-image-container {
    height: 400px;
    margin-bottom: 15px;
}

.panth-story-content {
    margin: 60px 0;
}

.panth-story-chapters {
    background: rgba(248, 244, 233, 0.7);
    border: 1px solid #d9d0bb;
    border-radius: 3px;
    padding: 30px;
    margin: 40px 0;
}

.panth-chapter-title {
    color: #5d4c3a;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(176, 155, 124, 0.3);
}

.panth-chapter-list {
    list-style: none;
    padding-left: 0;
}

.panth-chapter-item {
    padding: 10px 0;
    color: #6d5a45;
    border-bottom: 1px dashed rgba(176, 155, 124, 0.2);
    position: relative;
    padding-left: 25px;
}

.panth-chapter-item::before {
    content: '·';
    position: absolute;
    left: 0;
    color: #b09b7c;
    font-size: 1.5rem;
}

.panth-story-pagination {
    display: flex;
    justify-content: space-between;
    margin: 60px 0;
    padding: 20px 0;
    border-top: 1px dashed rgba(176, 155, 124, 0.3);
    border-bottom: 1px dashed rgba(176, 155, 124, 0.3);
}

.panth-prev-story,
.panth-next-story {
    padding: 12px 25px;
    background: rgba(232, 223, 208, 0.8);
    border: 1px solid #d4c9b8;
    border-radius: 2px;
    color: #6d5a45;
    text-decoration: none;
    transition: all 0.3s;
    max-width: 45%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.panth-prev-story:hover,
.panth-next-story:hover {
    border-color: #b09b7c;
    color: #5d4c3a;
    background: rgba(176, 155, 124, 0.1);
}

@media (max-width: 768px) {
    .panth-story-main-title {
        font-size: 1.8rem;
    }
    
    .panth-story-pagination {
        flex-direction: column;
        gap: 15px;
    }
    
    .panth-prev-story,
    .panth-next-story {
        max-width: 100%;
        text-align: center;
    }
}
