/*
Theme Name: 無極九天玄母宮 5.2.3 公開相簿分類側欄瀏覽
Version: 5.2.3
*/
:root{
  --wjx-dark:#1f2b34;
  --wjx-red:#8e0f12;
  --wjx-red-dark:#6f090c;
  --wjx-red-bright:#a4272b;
  --wjx-paper:#faf7ef;
  --wjx-white:#fff;
  --wjx-ink:#1f2328;
  --wjx-muted:#6f7378;
  --wjx-line:#eadcc7;
  --wjx-soft:#f8f3e9;
  --wjx-shell:1240px;
  --wjx-shadow:0 8px 24px rgba(74,45,17,.06);
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
html,body{margin:0;padding:0;max-width:100%;overflow-x:hidden}
body{font-family:system-ui,-apple-system,"Noto Sans TC","Microsoft JhengHei",sans-serif;background:#fff;color:var(--wjx-ink);line-height:1.75}
a{color:inherit}
img{max-width:100%;height:auto}
.wjx-shell{width:min(var(--wjx-shell),calc(100% - 48px));margin:0 auto}

/* ===== 截圖基準：深色細頂欄 + 白色主導覽 ===== */
.wjx-site-header{position:sticky;top:0;z-index:1000;background:#fff}
.admin-bar .wjx-site-header{top:32px}
.wjx-topline{background:var(--wjx-dark);color:#fff;min-height:48px;display:flex;align-items:center}
.wjx-topline-inner{display:flex;align-items:center;justify-content:space-between;gap:24px;font-size:15px}
.wjx-topline-name{color:#fff;text-decoration:none;font-weight:500}
.wjx-topline-tagline{white-space:nowrap}
.wjx-navbar{background:#fff;border-bottom:1px solid #eee}
.wjx-navbar-inner{min-height:84px;display:flex;align-items:center;justify-content:space-between;gap:36px}
.wjx-brand{color:var(--wjx-red);text-decoration:none;font-weight:800;font-size:26px;line-height:1.2;white-space:nowrap}
.wjx-primary-nav{margin-left:auto}
.wjx-primary-nav ul{display:flex;align-items:center;justify-content:flex-end;gap:28px;list-style:none;margin:0;padding:0}
.wjx-primary-nav a{display:block;color:#181818;text-decoration:none;font-size:16px;font-weight:700;white-space:nowrap;padding:28px 0}
.wjx-primary-nav a:hover,.wjx-primary-nav .current-menu-item>a{color:var(--wjx-red)}
.wjx-menu-toggle{display:none;width:44px;height:44px;border:1px solid #e2d6c7;border-radius:9px;background:#fff;color:var(--wjx-red);font-size:24px;line-height:1;cursor:pointer}

/* ===== 首頁：完整保留使用者截圖的紅白版型 ===== */
.wjx-home{background:#fff}
.wjx-home-hero{position:relative;color:#fff;min-height:330px;text-align:center;overflow:hidden;background:linear-gradient(105deg,var(--wjx-red-dark) 0%,#861315 44%,var(--wjx-red-bright) 100%)}
.wjx-home-hero-fallback{display:flex;align-items:center}.wjx-home-hero-inner{padding:62px 0}.wjx-home-hero h1{font-size:clamp(38px,4vw,58px);line-height:1.2;margin:0 0 18px;font-weight:800;letter-spacing:.02em}.wjx-home-hero p{font-size:18px;margin:0;font-weight:400}
/* A+B 5.1.6：照片自動適配。取消白框與大面積文字遮罩；比例差異大的照片以「完整照片 + 模糊背景」呈現，不硬裁切。 */
.wjx-home-slider{--wjx-slider-h:clamp(380px,30vw,520px);min-height:var(--wjx-slider-h);padding:0;background:#650b0e;isolation:isolate}
.wjx-slider-track{position:relative;min-height:var(--wjx-slider-h);overflow:hidden}
.wjx-slide{position:absolute;inset:0;min-height:var(--wjx-slider-h);opacity:0;visibility:hidden;transition:opacity .7s ease,visibility .7s ease;background:#650b0e}
.wjx-slide.is-active{opacity:1;visibility:visible;z-index:2}
.wjx-slide-backdrop{position:absolute;inset:-28px;z-index:0;background-position:center;background-size:cover;filter:blur(22px) saturate(.88) brightness(.62);transform:scale(1.08);opacity:.9;transition:background-image .25s ease}
.wjx-slide-media{position:absolute;inset:0;z-index:1;display:block}.wjx-slide-media img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center;display:block;transition:transform .7s ease,opacity .25s ease}
.wjx-slide.is-contain .wjx-slide-media img{object-fit:contain;object-position:center;filter:drop-shadow(0 0 20px rgba(0,0,0,.16))}
.wjx-slide-shade{position:absolute;inset:0;z-index:2;background:linear-gradient(180deg,rgba(69,0,4,.06) 35%,rgba(69,0,4,.18) 62%,rgba(55,0,4,.62) 100%);pointer-events:none}
.wjx-slide.no-copy .wjx-slide-shade{background:linear-gradient(180deg,rgba(69,0,4,.03),rgba(69,0,4,.12))}
.wjx-slide-copy{position:absolute;left:50%;bottom:34px;z-index:4;width:min(var(--wjx-shell),calc(100% - 96px));transform:translateX(-50%);padding:0;text-align:left;pointer-events:none}
.wjx-slide-caption{width:min(510px,58%);padding:16px 20px 17px;border-radius:14px;background:rgba(68,5,8,.62);box-shadow:0 8px 30px rgba(0,0,0,.16);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);text-shadow:0 1px 7px rgba(0,0,0,.35);pointer-events:auto}
.wjx-slide-copy h1{margin:0 0 4px;font-size:clamp(23px,2.25vw,32px);line-height:1.35;letter-spacing:.01em}.wjx-slide-subtitle{font-size:15px!important;line-height:1.65!important;margin:0!important;opacity:.95}.wjx-slide-kicker{display:none!important}
.wjx-slide-actions{display:flex;gap:8px;margin-top:11px;justify-content:flex-start;flex-wrap:wrap}.wjx-slide-btn{display:inline-flex;align-items:center;justify-content:center;min-height:38px;padding:7px 15px;border:1px solid rgba(255,255,255,.82);border-radius:8px;color:#fff;text-decoration:none;font-size:14px;font-weight:800;text-shadow:none}.wjx-slide-btn.primary{background:rgba(159,20,25,.82)}.wjx-slide-btn.secondary{display:none}.wjx-slide-btn:hover{background:#fff;color:var(--wjx-red)}
.wjx-slider-arrow{position:absolute;top:50%;z-index:8;transform:translateY(-50%);width:44px;height:44px;border:0;border-radius:50%;background:rgba(28,16,16,.48);color:#fff;font-size:34px;line-height:1;cursor:pointer;box-shadow:0 3px 12px rgba(0,0,0,.14)}.wjx-slider-arrow.prev{left:22px}.wjx-slider-arrow.next{right:22px}.wjx-slider-dots{position:absolute;left:50%;bottom:18px;z-index:9;transform:translateX(-50%);display:flex;gap:9px}.wjx-slider-dots button{width:10px;height:10px;padding:0;border:2px solid #fff;border-radius:50%;background:rgba(0,0,0,.12);cursor:pointer;box-shadow:0 1px 4px rgba(0,0,0,.25)}.wjx-slider-dots button.is-active{background:#fff}.wjx-home-slider.is-paused .wjx-slider-dots:after{content:""}
.wjx-quick-band{background:var(--wjx-paper);padding:46px 0 48px}
.wjx-quick{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:14px}
.wjx-quick a{min-height:108px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:9px;background:#fff;border:1px solid var(--wjx-line);border-radius:15px;text-decoration:none;color:#151515;box-shadow:none;transition:.18s ease}
.wjx-quick a:hover{transform:translateY(-2px);box-shadow:var(--wjx-shadow);border-color:#dcc5a3}
.wjx-quick span{font-size:18px;line-height:1}.wjx-quick strong{font-size:16px}
.wjx-home-content{background:#fff;padding:12px 0 72px}
.wjx-home-section{padding:34px 0 28px;border-bottom:0}
.wjx-home-section-head{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:18px}
.wjx-home-section-head h2{margin:0;font-size:28px;line-height:1.3;font-weight:800}
.wjx-home-section-head a{color:var(--wjx-red);text-decoration:none;font-weight:700}
.wjx-empty{margin:0;color:#3e4449;font-size:17px;min-height:72px}

/* ===== 列表 / 單篇 / 一般頁 ===== */
.site-main{width:min(var(--wjx-shell),calc(100% - 48px));margin:0 auto;padding:42px 0 72px;min-height:62vh}
.site-main article,.wjx-plain-article{background:#fff;border:1px solid #eee;border-radius:14px;padding:24px;margin-bottom:20px;box-shadow:0 5px 20px rgba(0,0,0,.035)}
.site-main article h1,.site-main article h2,.site-main article h3{line-height:1.35;margin-top:0}
.site-main article img{border-radius:10px}
.wjx-page-title{margin:0 0 24px;color:var(--wjx-red);font-size:clamp(30px,4vw,42px);line-height:1.25}
.wjx-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:20px}
.wjx-card{background:#fff;border:1px solid #eee;border-radius:14px;overflow:hidden;box-shadow:0 5px 20px rgba(0,0,0,.04);padding:0!important;margin:0!important}
.wjx-card>a{display:block;text-decoration:none}
.wjx-card img{display:block;width:100%;aspect-ratio:16/10;object-fit:cover;border-radius:0!important}
.wjx-card-body{padding:18px}
.wjx-card h2,.wjx-card h3{font-size:20px;margin:0 0 8px;line-height:1.35;color:#181818}
.wjx-card p{margin:0;color:var(--wjx-muted)}
.wjx-meta{font-size:14px;color:var(--wjx-muted);margin-bottom:8px}
.wjx-content{font-size:17px}.wjx-content>*:first-child{margin-top:0}.wjx-content iframe{max-width:100%}
.wjx-btn{display:inline-flex;align-items:center;justify-content:center;min-height:46px;padding:10px 18px;border-radius:8px;text-decoration:none;font-weight:700;border:1px solid var(--wjx-red);color:#fff;background:var(--wjx-red)}
.wjx-btn.secondary{background:#fff;color:var(--wjx-red)}

/* ===== 外掛前台拍照／相簿上傳：保留 5.1.2 已修好功能 ===== */
.wjx-upload{background:#fff;border:1px solid #e7ded2;border-radius:16px;padding:clamp(18px,4vw,28px);max-width:760px;margin:0 auto;box-shadow:var(--wjx-shadow)}
.wjx-upload h3{font-size:24px;margin:0 0 14px}.wjx-upload label{display:block;font-weight:700}
.wjx-upload input,.wjx-upload select{width:100%;min-height:46px;padding:10px 12px;border:1px solid #cfc6ba;border-radius:10px;background:#fff;font-size:16px;margin-top:6px}
.wjx-upload button{width:100%;min-height:50px;padding:12px 18px;border:0;border-radius:10px;cursor:pointer;background:var(--wjx-red);color:#fff;font-weight:800;font-size:16px}
.wjx-upload-success{background:#edf7ed;border:1px solid #b8d9ba;color:#245b2a;padding:10px 12px;border-radius:10px;margin-bottom:14px}
.wjx-front-photo-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin:18px 0}
.wjx-photo-action{display:flex!important;flex-direction:column;align-items:center;justify-content:center;gap:4px;text-align:center;min-height:150px;padding:18px;border:2px dashed #cdbb9d;border-radius:14px;background:#fdf9f2;cursor:pointer}
.wjx-photo-action span{font-size:36px}.wjx-photo-action small{font-weight:400;color:var(--wjx-muted)}.wjx-photo-action input{margin-top:10px}
.wjx-file-preview{display:flex;flex-wrap:wrap;gap:8px}.wjx-file-preview img{width:78px;height:78px;object-fit:cover;border-radius:8px;border:1px solid #e7ded2}
input[type=file]::file-selector-button{border:0;border-radius:8px;padding:8px 10px;background:#f1e6d5;color:var(--wjx-ink);font-weight:700;margin-right:8px;cursor:pointer}


/* ===== 5.1.4 導覽子選單 / 首頁勸世文與年度注意事項 ===== */
.wjx-primary-nav .wjx-has-submenu,.wjx-primary-nav .menu-item-has-children{position:relative}
.wjx-primary-nav .wjx-submenu-toggle{display:inline-flex;align-items:center;gap:5px}
.wjx-primary-nav .sub-menu{display:none;position:absolute;top:calc(100% - 8px);left:50%;transform:translateX(-50%);min-width:170px;padding:8px!important;background:#fff;border:1px solid #eadfce;border-radius:10px;box-shadow:0 12px 30px rgba(0,0,0,.10);z-index:40}
.wjx-primary-nav .sub-menu li{display:block;width:100%}
.wjx-primary-nav .sub-menu a{padding:10px 14px!important;text-align:left;font-size:14px;white-space:nowrap}
.wjx-primary-nav .wjx-has-submenu:hover>.sub-menu,.wjx-primary-nav .wjx-has-submenu:focus-within>.sub-menu,.wjx-primary-nav .menu-item-has-children:hover>.sub-menu,.wjx-primary-nav .menu-item-has-children:focus-within>.sub-menu{display:block}
.wjx-advice-list{display:grid;gap:12px}
.wjx-advice-item{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:18px;align-items:center;padding:18px 20px;border:1px solid var(--wjx-line);border-left:4px solid var(--wjx-red);border-radius:12px;background:#fff8f3;text-decoration:none}
.wjx-advice-item h3{margin:0 0 5px;font-size:20px;color:#241b18}.wjx-advice-item p{margin:0;color:var(--wjx-muted)}.wjx-advice-item .wjx-advice-date{color:var(--wjx-red);font-weight:800;white-space:nowrap}
.wjx-annual-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}.wjx-annual-card{display:block;padding:20px;border:1px solid var(--wjx-line);border-radius:14px;background:#fff;text-decoration:none;box-shadow:var(--wjx-shadow)}.wjx-annual-card .year{display:inline-block;margin-bottom:8px;padding:3px 9px;border-radius:99px;background:#8e0f12;color:#fff;font-size:12px;font-weight:800}.wjx-annual-card h3{margin:0 0 8px;font-size:20px}.wjx-annual-card p{margin:0;color:var(--wjx-muted)}

/* ===== Footer ===== */
.wjx-site-footer{background:var(--wjx-dark);color:#fff;padding:36px 0;margin-top:0}
.wjx-site-footer .wjx-shell{display:flex;align-items:center;justify-content:center;gap:16px;flex-wrap:wrap;text-align:center}
.wjx-site-footer strong{font-size:16px}.wjx-site-footer span{opacity:.9}.wjx-site-footer small{width:100%;opacity:.65}
.wjx-bottom{display:none!important}

@media(max-width:1050px){
  .wjx-primary-nav ul{gap:18px}.wjx-primary-nav a{font-size:15px}.wjx-brand{font-size:23px}
  .wjx-quick{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(max-width:900px){.wjx-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:782px){.admin-bar .wjx-site-header{top:46px}}
@media(max-width:760px){
  .wjx-shell,.site-main{width:min(100% - 28px,var(--wjx-shell))}
  .wjx-topline{min-height:38px}.wjx-topline-inner{font-size:12px;gap:10px}.wjx-topline-tagline{font-size:12px}
  .wjx-navbar-inner{min-height:70px;gap:10px}.wjx-brand{font-size:21px;white-space:normal;max-width:calc(100% - 108px)}
  .wjx-menu-toggle{display:block;margin-left:auto;flex:0 0 44px}
  .wjx-primary-nav{display:none;position:absolute;top:100%;left:0;right:0;margin:0;background:#fff;border-top:1px solid #eee;border-bottom:1px solid #e5d9c8;box-shadow:0 12px 24px rgba(0,0,0,.08);padding:10px 14px 14px}
  .wjx-site-header.is-open .wjx-primary-nav{display:block}
  .wjx-primary-nav ul{display:grid;grid-template-columns:1fr 1fr;gap:8px}
  .wjx-primary-nav a{padding:11px 8px;text-align:center;background:#faf7f1;border:1px solid #eadfce;border-radius:8px;font-size:14px}

  .wjx-primary-nav .wjx-has-submenu,.wjx-primary-nav .menu-item-has-children{grid-column:1/-1}
  .wjx-primary-nav .wjx-has-submenu>a,.wjx-primary-nav .menu-item-has-children>a{margin-bottom:6px}
  .wjx-primary-nav .sub-menu{display:grid!important;position:static;transform:none;min-width:0;padding:0!important;background:transparent;border:0;box-shadow:none;grid-template-columns:1fr 1fr;gap:6px}
  .wjx-primary-nav .sub-menu a{padding:10px 8px!important;text-align:center;background:#fff;border:1px solid #eadfce;border-radius:8px}
  .wjx-advice-item{grid-template-columns:1fr;gap:8px}.wjx-advice-item .wjx-advice-date{white-space:normal}
  .wjx-annual-grid{grid-template-columns:1fr}
  .wjx-home-hero{min-height:240px}.wjx-home-hero-inner{padding:45px 0}.wjx-home-hero h1{font-size:clamp(34px,11vw,46px);margin-bottom:14px}.wjx-home-hero p{font-size:16px}
  .wjx-home-slider{--wjx-slider-h:440px}.wjx-slide-copy{bottom:48px;width:calc(100% - 32px)}.wjx-slide-caption{width:min(100%,360px);padding:13px 15px 14px;border-radius:12px}.wjx-slide-copy h1{font-size:22px;margin-bottom:3px}.wjx-slide-subtitle{font-size:14px!important}.wjx-slide-actions{margin-top:9px}.wjx-slide-btn{min-height:38px;padding:7px 14px}.wjx-slider-arrow{width:40px;height:40px;font-size:30px}.wjx-slider-arrow.prev{left:12px}.wjx-slider-arrow.next{right:12px}.wjx-slider-dots{bottom:17px}.wjx-slide-shade{background:linear-gradient(180deg,rgba(69,0,4,.03) 38%,rgba(69,0,4,.14) 62%,rgba(55,0,4,.64) 100%)}
  .wjx-quick-band{padding:28px 0}.wjx-quick{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.wjx-quick a{min-height:94px;border-radius:12px}.wjx-quick a:last-child:nth-child(odd){grid-column:1 / -1}
  .wjx-home-content{padding-bottom:42px}.wjx-home-section{padding:28px 0 22px}.wjx-home-section-head h2{font-size:25px}
  .wjx-grid{grid-template-columns:1fr;gap:14px}.site-main{padding:28px 0 46px}.site-main article,.wjx-plain-article{padding:18px;border-radius:12px}
  .wjx-front-photo-grid{grid-template-columns:1fr}.wjx-photo-action{min-height:132px}
  .wjx-site-footer{padding:28px 0}.wjx-site-footer .wjx-shell{display:block}.wjx-site-footer span{display:block;margin-top:6px}.wjx-site-footer small{display:block;margin-top:12px}
}
@media(max-width:420px){
  .wjx-topline-name{max-width:48%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wjx-topline-tagline{max-width:52%;overflow:hidden;text-overflow:ellipsis}
  .wjx-primary-nav ul{grid-template-columns:1fr}.wjx-home-hero-fallback{min-height:220px}.wjx-home-hero h1{font-size:34px}.wjx-home-slider{--wjx-slider-h:410px}.wjx-slide-copy{width:calc(100% - 24px);bottom:45px}.wjx-slide-caption{padding:12px 13px}.wjx-slide-copy h1{font-size:20px}
}


/* 5.1.7 玄母宮介紹：直接由管理外掛「玄母宮介紹／資料」同步到首頁 */
html{scroll-behavior:smooth}
#wjx-about{scroll-margin-top:110px}
.wjx-about-card{overflow:hidden}
.wjx-about-layout{display:grid;grid-template-columns:minmax(0,.9fr) minmax(0,1.35fr);gap:28px;align-items:start}
.wjx-about-layout.no-image{grid-template-columns:1fr}
.wjx-about-photo{margin:0;border-radius:14px;overflow:hidden;background:#f3eee6;aspect-ratio:4/3}
.wjx-about-photo img{width:100%;height:100%;display:block;object-fit:contain;object-position:center}
.wjx-about-summary{margin:0 0 18px;font-size:19px;line-height:1.9;font-weight:700;color:#5f1717;border-left:4px solid var(--wjx-red);padding:2px 0 2px 16px}
.wjx-about-details{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin-top:26px}
.wjx-about-details>section{background:#fbf8f2;border:1px solid #eadfce;border-radius:12px;padding:18px}
.wjx-about-details h3{margin:0 0 10px;color:#821616;font-size:19px}
.wjx-about-details .wjx-content{font-size:15px;line-height:1.8}
.wjx-about-contact{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-top:24px;padding-top:20px;border-top:1px solid #eee0cf}
.wjx-about-contact>div{display:flex;flex-direction:column;gap:6px;padding:14px;background:#fffaf3;border:1px solid #efe0cb;border-radius:10px}
.wjx-about-contact b{color:#811515}.wjx-about-contact span{line-height:1.65;color:#444}
.wjx-about-map{display:flex;align-items:center;justify-content:center;border-radius:10px;border:1px solid #a91c1c;color:#991717;text-decoration:none;font-weight:800;padding:14px}
.wjx-about-map:hover{background:#991717;color:#fff}
@media(max-width:900px){.wjx-about-layout{grid-template-columns:1fr}.wjx-about-photo{max-height:430px}.wjx-about-details{grid-template-columns:1fr 1fr}.wjx-about-contact{grid-template-columns:1fr 1fr}}
@media(max-width:600px){#wjx-about{scroll-margin-top:82px}.wjx-about-summary{font-size:17px}.wjx-about-details,.wjx-about-contact{grid-template-columns:1fr}.wjx-about-card{padding:16px}.wjx-about-photo{border-radius:10px;aspect-ratio:16/11}}

/* ===== 5.1.8：WordPress 正式選單 + 獨立玄母宮介紹頁 ===== */
.wjx-primary-nav .menu-item-has-children>a:after{content:" ▾";font-size:12px;color:#777}
.wjx-palace-intro-page{display:grid;gap:28px}
.wjx-palace-intro-hero{margin:0;border-radius:18px;overflow:hidden;background:#f5efe5;aspect-ratio:16/7;max-height:520px}
.wjx-palace-intro-hero img{display:block;width:100%;height:100%;max-height:none;object-fit:contain;object-position:center}
.wjx-palace-intro-main h2{margin:0 0 18px;color:var(--wjx-red);font-size:clamp(27px,3vw,40px)}
.wjx-palace-intro-page .wjx-about-details,.wjx-palace-intro-page .wjx-about-contact{margin-top:0}
@media(max-width:760px){.wjx-primary-nav .menu-item-has-children>a:after{content:""}.wjx-palace-intro-hero{border-radius:12px}}


/* ===== 5.1.11：介紹圖片使用原圖比例完整置中，不依賴 object-fit 拉滿盒子 ===== */
.wjx-smart-photo{position:relative;isolation:isolate;display:grid;place-items:center;overflow:hidden;background:#e9e2d8}
.wjx-smart-photo-backdrop{position:absolute;inset:-30px;z-index:0;background-size:cover;background-position:center;filter:blur(24px) saturate(.9) brightness(.68);transform:scale(1.1);opacity:.80}
.wjx-smart-photo-media{position:absolute;inset:0;z-index:1;display:flex;align-items:center;justify-content:center;padding:16px}
.wjx-smart-photo-media img{display:block!important;width:auto!important;height:auto!important;max-width:100%!important;max-height:100%!important;object-fit:contain!important;object-position:center!important;margin:auto!important;border-radius:8px!important;filter:drop-shadow(0 4px 20px rgba(0,0,0,.16))}
.wjx-palace-intro-hero.wjx-smart-photo{height:clamp(360px,38vw,520px);aspect-ratio:auto!important}
.wjx-about-photo.wjx-smart-photo{min-height:320px;aspect-ratio:4/3}
.wjx-about-summary.wjx-content{display:block;margin:0 0 18px;font-size:19px;line-height:1.9;font-weight:700;color:#5f1717;border-left:4px solid var(--wjx-red);padding:2px 0 2px 16px}
.wjx-about-summary.wjx-content p:first-child{margin-top:0}.wjx-about-summary.wjx-content p:last-child{margin-bottom:0}
@media(max-width:760px){.wjx-palace-intro-hero.wjx-smart-photo{height:clamp(280px,82vw,420px)}.wjx-smart-photo-media{padding:10px}.wjx-about-photo.wjx-smart-photo{min-height:260px;aspect-ratio:16/11}}


/* ===== 5.1.10 前台活動花絮：有權限人員直接建立相簿／多圖上傳 ===== */
.wjx-page-head{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;margin-bottom:22px}
.wjx-page-head .wjx-page-title{margin-bottom:0}
.wjx-album-upload-jump{white-space:nowrap}
.wjx-front-staff-tools{margin:0 0 30px;padding:18px;border:1px solid #eadfce;border-radius:18px;background:#fbf7ef;box-shadow:var(--wjx-shadow)}
.wjx-staff-tools-note{display:flex;align-items:center;gap:10px;flex-wrap:wrap;max-width:760px;margin:0 auto 14px;padding:10px 12px;border-left:4px solid var(--wjx-red);background:#fff;border-radius:8px;color:var(--wjx-muted)}
.wjx-staff-tools-note strong{color:var(--wjx-red)}
.wjx-front-staff-tools .wjx-upload{max-width:860px;box-shadow:none;margin:0 auto}
@media(max-width:760px){
  .wjx-page-head{align-items:stretch}.wjx-page-head .wjx-btn{width:100%}
  .wjx-front-staff-tools{margin-left:-8px;margin-right:-8px;padding:12px;border-radius:14px}
  .wjx-front-photo-grid{grid-template-columns:1fr}
}


/* ===== 5.1.12：前台會員登入入口 + 手機活動花絮標題／錨點安全區 ===== */
.wjx-member-link{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:40px;padding:7px 12px;border:1px solid #e2d6c7;border-radius:9px;color:var(--wjx-red);text-decoration:none;font-size:14px;font-weight:800;background:#fff;white-space:nowrap}
.wjx-member-link:hover{background:#fff8f3;border-color:#cfb693}
.wjx-member-link span{font-size:16px;line-height:1}
.wjx-page-head{overflow:visible!important;padding-top:4px}
.wjx-page-title{display:block!important;overflow:visible!important;padding:.12em 0 .14em!important;line-height:1.35!important}
#wjx-upload,.wjx-front-staff-tools{scroll-margin-top:190px}
.wjx-login-card{max-width:560px;margin:0 auto;padding:22px;border:1px solid #eadfce;border-radius:16px;background:#fff;box-shadow:var(--wjx-shadow)}
.wjx-login-card h3{margin:0 0 8px;color:var(--wjx-red);font-size:24px}.wjx-login-card>p{margin:0 0 16px;color:var(--wjx-muted)}
.wjx-login-card form p{margin:0 0 14px}.wjx-login-card label{display:block;font-weight:700}.wjx-login-card input[type=text],.wjx-login-card input[type=password]{width:100%;min-height:48px;margin-top:6px;padding:10px 12px;border:1px solid #cfc6ba;border-radius:10px;font-size:16px}
.wjx-login-card .login-remember label{display:flex;align-items:center;gap:8px}.wjx-login-card .button-primary{width:100%;min-height:48px;border:0;border-radius:10px;background:var(--wjx-red);color:#fff;font-weight:800;font-size:16px;cursor:pointer}.wjx-login-help{text-align:right!important;margin:10px 0 0!important}.wjx-login-help a{color:var(--wjx-red)}
@media(max-width:760px){
  .wjx-navbar-inner{position:relative}
  .wjx-member-link{margin-left:auto;min-width:44px;width:44px;padding:0;flex:0 0 44px}
  .wjx-member-link b{display:none}
  .wjx-member-link span{font-size:20px}
  .wjx-menu-toggle{margin-left:0!important}
  .wjx-page-head{padding-top:10px;margin-top:0;margin-bottom:18px}
  .wjx-page-title{font-size:clamp(30px,9vw,40px)!important;padding:.18em 0 .20em!important;line-height:1.38!important}
  #wjx-upload,.wjx-front-staff-tools{scroll-margin-top:175px}
}
@media(max-width:420px){
  .wjx-page-title{font-size:32px!important}
  .wjx-member-link{width:42px;min-width:42px;flex-basis:42px}
}


/* ===== 5.1.13：全站手機頁首／標題安全區 =====
 * 任何內容頁、活動、活動花絮、最新消息、服務、結緣品、注意事項、會員頁都共用。
 * 實際 sticky header 高度由 JS 寫入 --wjx-sticky-offset，避免固定寫死造成不同手機裁切。
 */
:root{--wjx-sticky-offset:150px}
html{scroll-padding-top:var(--wjx-sticky-offset)!important}
.site-main{position:relative;overflow:visible!important}
.site-main [id],.wjx-page-head,.wjx-page-title,#wjx-upload,.wjx-front-staff-tools{scroll-margin-top:var(--wjx-sticky-offset)!important}
.wjx-page-head{min-height:max-content!important;overflow:visible!important;contain:none!important}
.wjx-page-title{position:relative!important;z-index:1;max-width:100%;height:auto!important;min-height:1.65em!important;margin-top:0!important;margin-bottom:0!important;padding:.18em 0 .22em!important;overflow:visible!important;clip:auto!important;clip-path:none!important;white-space:normal!important;text-wrap:balance}
@media(max-width:760px){
  .site-main{padding-top:36px!important}
  .wjx-page-head{padding-top:14px!important;margin-top:0!important;margin-bottom:20px!important}
  .wjx-page-title{font-size:clamp(30px,9vw,40px)!important;line-height:1.45!important;min-height:1.85em!important;padding:.20em 0 .28em!important}
}
@media(max-width:420px){
  .site-main{padding-top:34px!important}
  .wjx-page-title{font-size:32px!important;line-height:1.48!important;min-height:1.9em!important}
}


/* ===== 5.2.0：首頁示意圖對齊（桌機雙欄內容） ===== */
.wjx-home-dashboard{padding:30px 0 72px;background:#fff}
.wjx-home-dashboard-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:28px 34px;align-items:start}
.wjx-home-panel{min-width:0}
.wjx-home-panel .wjx-home-section-head{margin-bottom:14px}
.wjx-home-panel-card{border:1px solid var(--wjx-line);border-radius:14px;background:#fff;overflow:hidden}
.wjx-home-news-list{display:flex;flex-direction:column}
.wjx-home-news-row{display:grid;grid-template-columns:150px minmax(0,1fr);gap:18px;padding:14px;border-bottom:1px solid #eee2d1;text-decoration:none;align-items:center}
.wjx-home-news-row:last-child{border-bottom:0}
.wjx-home-news-row img,.wjx-home-news-placeholder{width:150px;height:92px;object-fit:cover;border-radius:10px;background:#f4eee5;display:block}
.wjx-home-news-copy{min-width:0}
.wjx-home-news-copy h3{margin:0 0 6px;font-size:18px;line-height:1.4}
.wjx-home-news-copy p{margin:0 0 5px;color:var(--wjx-muted);font-size:14px;line-height:1.65}
.wjx-home-news-copy time{font-size:13px;color:#777}
.wjx-home-morebar{display:block;text-align:center;padding:10px 14px;border:1px solid #d9a7a7;border-radius:0 0 12px 12px;color:var(--wjx-red);text-decoration:none;font-weight:800;background:#fff}
.wjx-home-events{display:flex;flex-direction:column;gap:10px}
.wjx-home-event-row{display:grid;grid-template-columns:112px minmax(0,1fr) auto;gap:16px;align-items:center;padding:13px 14px;border:1px solid var(--wjx-line);border-radius:12px;text-decoration:none;background:#fff}
.wjx-home-event-date{text-align:center;border-right:1px solid #eadfce;padding-right:14px;color:var(--wjx-red)}
.wjx-home-event-date .year{display:block;color:#555;font-size:13px;line-height:1.2}
.wjx-home-event-date .md{display:block;font-size:27px;font-weight:800;line-height:1.15}
.wjx-home-event-date .week{display:block;color:#555;font-size:12px}
.wjx-home-event-copy h3{margin:0 0 5px;font-size:17px;line-height:1.35}
.wjx-home-event-copy p{margin:2px 0;color:#555;font-size:13px}
.wjx-home-event-btn{white-space:nowrap;border:1px solid #d39b9b;border-radius:8px;padding:8px 12px;color:var(--wjx-red);font-weight:800}
.wjx-home-compact-card{border:1px solid var(--wjx-line);border-radius:14px;background:#fffaf4;overflow:hidden}
.wjx-home-compact-card .wjx-advice-list{margin:0}
.wjx-home-compact-card .wjx-advice-item{border-radius:0;border-left:4px solid var(--wjx-red);border-top:0;border-right:0;border-bottom:1px solid #eddfcc}
.wjx-home-compact-card .wjx-advice-item:last-child{border-bottom:0}
.wjx-home-annual-mini{padding:16px 18px;min-height:138px}
.wjx-home-annual-mini .wjx-annual-grid{grid-template-columns:1fr}
.wjx-home-extra{grid-column:1/-1;padding-top:4px}
.wjx-home-extra .wjx-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
.wjx-home-extra .wjx-card img{aspect-ratio:16/10}
.wjx-home-empty-card{padding:24px;border:1px solid var(--wjx-line);border-radius:14px;color:#666;background:#fff}

/* ===== 5.2.0：相簿封面、年月日篩選與看完一本直接換下一本 ===== */
.wjx-album-filter{display:flex;gap:10px;flex-wrap:wrap;align-items:end;margin:0 0 22px;padding:14px 16px;border:1px solid var(--wjx-line);border-radius:14px;background:#fffaf4}
.wjx-album-filter label{display:flex;flex-direction:column;gap:5px;font-size:13px;font-weight:800;color:#666}
.wjx-album-filter select{min-width:110px;min-height:42px;border:1px solid #d9cbbc;border-radius:9px;padding:7px 10px;background:#fff;font-size:15px}
.wjx-album-filter button,.wjx-album-filter a{min-height:42px;display:inline-flex;align-items:center;justify-content:center;padding:7px 14px;border-radius:9px;text-decoration:none;font-weight:800}
.wjx-album-filter button{border:0;background:var(--wjx-red);color:#fff}.wjx-album-filter a{border:1px solid #d7c7b7;background:#fff;color:#555}
.wjx-album-grid .wjx-card{position:relative}
.wjx-album-cover,.wjx-album-cover-placeholder{display:block;width:100%;aspect-ratio:16/10;object-fit:cover;background:#f3eee6}
.wjx-album-cover-placeholder{display:grid;place-items:center;font-size:44px}
.wjx-album-date-badge{display:inline-flex;align-items:center;gap:5px;margin-bottom:6px;padding:3px 8px;border-radius:999px;background:#fff2e9;color:var(--wjx-red);font-size:13px;font-weight:800}
.wjx-album-cat-path{font-size:13px;color:#777;margin-top:6px}
.wjx-album-nav{display:grid;grid-template-columns:1fr auto 1fr;gap:10px;align-items:center;margin:0 0 18px}
.wjx-album-nav a{min-height:44px;display:flex;align-items:center;padding:9px 13px;border:1px solid var(--wjx-line);border-radius:10px;text-decoration:none;background:#fff}
.wjx-album-nav .all{justify-content:center;color:var(--wjx-red);font-weight:800}
.wjx-album-nav .next{justify-content:flex-end;text-align:right}
.wjx-other-albums{margin-top:36px}
.wjx-other-albums h2{margin:0 0 16px;color:var(--wjx-red)}
.wjx-other-album-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}
.wjx-other-album-card{border:1px solid var(--wjx-line);border-radius:12px;overflow:hidden;text-decoration:none;background:#fff}
.wjx-other-album-card img,.wjx-other-album-card .ph{width:100%;aspect-ratio:16/10;object-fit:cover;display:block;background:#f3eee6}
.wjx-other-album-card .ph{display:grid;place-items:center;font-size:32px}
.wjx-other-album-card div{padding:10px 12px}.wjx-other-album-card b{display:block;line-height:1.35}.wjx-other-album-card small{color:#777}
.wjx-album-single-date{display:inline-block;margin:0 0 12px;padding:4px 9px;border-radius:999px;background:#fff3eb;color:var(--wjx-red);font-weight:800}
.wjx-front-date-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:12px 0}

@media(max-width:900px){
  .wjx-home-dashboard-grid{grid-template-columns:1fr}
  .wjx-home-extra{grid-column:auto}
  .wjx-home-extra .wjx-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .wjx-other-album-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:760px){
  .wjx-home-dashboard{padding:18px 0 48px}
  .wjx-home-dashboard-grid{gap:24px}
  .wjx-home-news-row{grid-template-columns:110px minmax(0,1fr);gap:12px;padding:12px}
  .wjx-home-news-row img,.wjx-home-news-placeholder{width:110px;height:78px}
  .wjx-home-event-row{grid-template-columns:82px minmax(0,1fr);gap:12px}
  .wjx-home-event-btn{grid-column:2;justify-self:start}
  .wjx-home-event-date{padding-right:10px}
  .wjx-home-extra .wjx-grid{grid-template-columns:1fr}
  .wjx-album-nav{grid-template-columns:1fr 1fr}.wjx-album-nav .all{grid-column:1/-1;grid-row:1}.wjx-album-nav .prev{grid-row:2}.wjx-album-nav .next{grid-row:2}
  .wjx-other-album-grid{grid-template-columns:1fr 1fr}
  .wjx-front-date-grid{grid-template-columns:1fr 1fr 1fr}
}
@media(max-width:440px){
  .wjx-home-news-row{grid-template-columns:92px minmax(0,1fr)}
  .wjx-home-news-row img,.wjx-home-news-placeholder{width:92px;height:72px}
  .wjx-other-album-grid{grid-template-columns:1fr}
  .wjx-album-filter label{flex:1 1 28%}.wjx-album-filter select{min-width:0;width:100%}
}


/* ===== 5.2.1：全站照片共用自動適配規則 =====
 * 所有封面／相簿／活動／消息／產品圖片都以完整圖片置中為優先，
 * 不因直式、橫式、正方形或不同手機拍攝比例而硬裁掉主體。
 * 外框比例由版面決定；不足空間以同圖模糊背景補滿。
 */
.wjx-smart-media{position:relative;isolation:isolate;display:grid;place-items:center;overflow:hidden;background:#eee7dd;border-radius:12px}
.wjx-smart-media::before{content:"";position:absolute;inset:-22px;z-index:0;background-image:var(--wjx-smart-bg);background-position:center;background-size:cover;filter:blur(20px) saturate(.88) brightness(.76);transform:scale(1.08);opacity:.72}
.wjx-smart-media::after{content:"";position:absolute;inset:0;z-index:1;background:rgba(255,255,255,.05);pointer-events:none}
.wjx-smart-media>img{position:relative!important;z-index:2!important;display:block!important;width:auto!important;height:auto!important;max-width:100%!important;max-height:100%!important;object-fit:contain!important;object-position:center!important;margin:auto!important;border-radius:0!important}
.wjx-smart-card-media{width:100%;aspect-ratio:16/10;border-radius:0}
.wjx-smart-single-media{width:100%;aspect-ratio:16/7;margin:18px 0 24px;max-height:560px}
.wjx-smart-home-news{width:150px;height:92px;border-radius:10px;flex:none}
.wjx-smart-home-event{width:112px;height:84px;border-radius:10px;flex:none}
.wjx-smart-album-cover{width:100%;aspect-ratio:16/10;border-radius:0}
.wjx-smart-other-album{width:100%;aspect-ratio:16/10;border-radius:0}
/* 覆蓋舊的 cover 裁切規則 */
.wjx-card .wjx-smart-media img,.wjx-album-grid .wjx-smart-media img,.wjx-other-album-card .wjx-smart-media img{aspect-ratio:auto!important;object-fit:contain!important}
.wjx-home-news-row .wjx-smart-media img{width:auto!important;height:auto!important;max-width:100%!important;max-height:100%!important;object-fit:contain!important}
.wjx-home-event-row.has-cover{grid-template-columns:112px 112px minmax(0,1fr) auto}
.wjx-home-event-row.has-cover .wjx-home-event-copy{min-width:0}
.wjx-event-single-cover{margin-top:16px}
@media(max-width:760px){
  .wjx-smart-home-news{width:110px;height:78px}
  .wjx-home-event-row.has-cover{grid-template-columns:82px 92px minmax(0,1fr)}
  .wjx-home-event-row.has-cover .wjx-home-event-btn{grid-column:3}
  .wjx-smart-home-event{width:92px;height:72px}
  .wjx-smart-single-media{aspect-ratio:4/3;max-height:68vh}
}
@media(max-width:440px){
  .wjx-smart-home-news{width:92px;height:72px}
  .wjx-home-event-row.has-cover{grid-template-columns:76px 82px minmax(0,1fr);gap:9px}
  .wjx-smart-home-event{width:82px;height:68px}
}
.wjx-file-preview img{object-fit:contain!important;object-position:center!important;background:#eee8df!important}


/* ===== 5.2.3：公開活動花絮「左分類、右相簿」瀏覽 =====
 * 相簿與分類皆為前台公開瀏覽；工作人員上傳區仍依登入 capability 顯示。
 * 桌機左側固定分類樹，右側顯示該分類（含子分類）相簿；手機改為上方可收合分類。
 */
.wjx-album-browser{display:grid;grid-template-columns:250px minmax(0,1fr);gap:24px;align-items:start}
.wjx-album-category-panel{position:sticky;top:var(--wjx-sticky-offset,150px);z-index:5}
.wjx-album-category-details{border:1px solid var(--wjx-line);border-radius:16px;background:#fffaf4;overflow:hidden;box-shadow:var(--wjx-shadow)}
.wjx-album-category-details>summary{list-style:none;display:flex;pointer-events:none;align-items:center;justify-content:space-between;gap:10px;padding:15px 16px;border-bottom:1px solid var(--wjx-line);cursor:default;font-weight:900;color:var(--wjx-red);font-size:18px}
.wjx-album-category-details>summary::-webkit-details-marker{display:none}
.wjx-album-category-details>summary small{font-size:12px;color:#8a8178;font-weight:700}
.wjx-album-cat-nav{display:flex;flex-direction:column;padding:8px}
.wjx-album-cat-link{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:44px;padding:9px 10px 9px calc(10px + var(--wjx-cat-depth,0)*17px);border-radius:10px;text-decoration:none;color:#3e3934;font-weight:750;transition:background .16s ease,color .16s ease}
.wjx-album-cat-link:hover{background:#f4eadf;color:var(--wjx-red)}
.wjx-album-cat-link.active{background:var(--wjx-red);color:#fff}
.wjx-album-cat-name{display:flex;align-items:center;gap:5px;min-width:0;line-height:1.35}
.wjx-album-cat-branch{opacity:.65}
.wjx-album-cat-count{flex:none;display:inline-grid;place-items:center;min-width:26px;height:26px;padding:0 7px;border-radius:999px;background:rgba(31,43,52,.08);font-size:12px;font-weight:900}
.wjx-album-cat-link.active .wjx-album-cat-count{background:rgba(255,255,255,.18);color:#fff}
.wjx-album-results{min-width:0}
.wjx-album-results-head{display:flex;align-items:end;justify-content:space-between;gap:18px;margin:0 0 14px}
.wjx-album-results-kicker{display:block;font-size:12px;letter-spacing:.14em;color:#8d8175;font-weight:800}
.wjx-album-results-head h2{margin:2px 0 0;font-size:24px;line-height:1.35;color:var(--wjx-red)}
.wjx-album-clear-cat{color:var(--wjx-red);text-decoration:none;font-weight:800;white-space:nowrap}
.wjx-album-results .wjx-album-filter{margin-bottom:18px}
.wjx-album-results .wjx-album-grid{grid-template-columns:repeat(3,minmax(0,1fr))}

@media(max-width:1050px){
  .wjx-album-browser{grid-template-columns:220px minmax(0,1fr);gap:18px}
  .wjx-album-results .wjx-album-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:760px){
  .wjx-album-browser{display:block}
  .wjx-album-category-panel{position:static;margin-bottom:16px}
  .wjx-album-category-details>summary{cursor:pointer;pointer-events:auto}
  .wjx-album-category-details>summary::after{content:"▾";margin-left:auto;color:var(--wjx-red);font-size:14px}
  .wjx-album-category-details[open]>summary::after{content:"▴"}
  .wjx-album-cat-nav{max-height:42vh;overflow:auto;-webkit-overflow-scrolling:touch}
  .wjx-album-results-head{align-items:flex-start}
  .wjx-album-results-head h2{font-size:21px}
  .wjx-album-results .wjx-album-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:520px){
  .wjx-album-results .wjx-album-grid{grid-template-columns:1fr}
  .wjx-album-results-head{display:block}.wjx-album-clear-cat{display:inline-block;margin-top:6px}
}
