@charset "UTF-8";

/* ------------------------------------------------------------------
   妙雲蘭若 語音導覽
   色彩取自現場手繪平面圖：金褐色站點印記、粉牆、墨線。
   ------------------------------------------------------------------ */

:root {
  --ink:        #1d211c;   /* 墨 */
  --ink-soft:   #4d534b;
  --ink-faint:  #8a8d84;
  --paper:      #f6f3ec;   /* 宣紙 */
  --paper-up:   #fffdf8;
  --rule:       #ddd7c9;
  --gold:       #a08040;   /* 平面圖上的站點印記 */
  --gold-deep:  #7c6130;
  --seal:       #9e3b32;   /* 硃砂：僅用於播放中的狀態 */
  --rose:       #efd8d4;   /* 平面圖的粉牆 */

  --serif: "Songti TC", "Noto Serif TC", "Source Han Serif TC", "Noto Serif JP",
           "Hiragino Mincho ProN", "Yu Mincho", "PMingLiU", Georgia, serif;
  --sans:  "PingFang TC", "Hiragino Sans", "Noto Sans TC",
           -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --measure: 34rem;
  --seal-shape: 46% 54% 59% 41% / 57% 43% 57% 43%;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.95;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--seal);
  outline-offset: 3px;
}

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 22px;
}

/* ---------------- 頁首 ---------------- */

.topbar {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar__inner {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 13px 22px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  font-size: 15px;
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.brand--back::before {
  content: "←";
  letter-spacing: 0;
  margin-right: 10px;
  color: var(--ink-faint);
}

/* 語言切換：文字加細底線，不用膠囊按鈕 */
.langs { display: flex; gap: 2px; }

.langs button {
  appearance: none;
  border: 0;
  background: none;
  font-family: var(--sans);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  padding: 10px 8px 8px;
  min-height: 44px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.langs button:hover { color: var(--ink); }

.langs button[aria-current="true"] {
  color: var(--ink);
  border-bottom-color: var(--gold);
}

/* ---------------- 站點印記（本站的識別記號）---------------- */

.seal {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.1em;
  height: 2.1em;
  border-radius: var(--seal-shape);
  background: var(--gold);
  color: var(--paper-up);
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1;
  padding-bottom: 0.06em;
}

.seal--lg { font-size: 21px; }

/* ---------------- 首頁 ---------------- */

.intro {
  padding-block: 34px 22px;
}

.intro h1 {
  margin: 0 0 10px;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: 0.16em;
  line-height: 1.5;
}

.intro p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.9;
}

/* 平面圖：滿版，是本頁的主角也是導覽介面 */
.plan {
  margin: 22px 0 0;
  background: var(--paper-up);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 14px 0;
}

.plan__frame {
  position: relative;
  max-width: 44rem;
  margin: 0 auto;
}

.plan__frame img { width: 100%; }

.plan__hot {
  position: absolute;
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color .18s ease;
  -webkit-tap-highlight-color: transparent;
}

.plan__hot span {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.plan__hot:hover,
.plan__hot:focus-visible {
  background-color: rgba(160, 128, 64, 0.22);
}

.plan__hot:active { background-color: rgba(158, 59, 50, 0.24); }

.plan__hint {
  max-width: var(--measure);
  margin: 12px auto 0;
  padding: 0 22px;
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--ink-faint);
  text-align: center;
}

/* 站點索引 */
.index { padding-block: 30px 10px; }

.index h2 {
  margin: 0 0 4px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--ink-faint);
}

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

.index li { border-bottom: 1px solid var(--rule); }

.index a {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 14px 2px;
  min-height: 44px;
  text-decoration: none;
}

.index__name { flex: 1 1 auto; line-height: 1.5; }

.index__name b {
  display: block;
  font-weight: 600;
  font-size: 17.5px;
  letter-spacing: 0.04em;
}

.index__name small {
  display: block;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-faint);
  letter-spacing: 0.02em;
}

.index__audio {
  flex: none;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--gold-deep);
  border: 1px solid rgba(160, 128, 64, .45);
  border-radius: 2px;
  padding: 2px 7px;
}

.index a:hover .index__name b { color: var(--gold-deep); }

/* 尾頁題字 */
.closing { margin-top: 40px; }

.closing img { width: 100%; }

.closing__words {
  padding: 20px 0 46px;
  text-align: center;
  letter-spacing: 0.2em;
  line-height: 2.1;
}

.closing__words span {
  display: block;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}

/* ---------------- 站點頁 ---------------- */

.stop { padding-block: 30px 60px; }

.stop__head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.stop__head h1 {
  margin: 0;
  font-size: 27px;
  font-weight: 600;
  letter-spacing: 0.14em;
  line-height: 1.4;
}

.stop__head p {
  margin: 2px 0 0;
  font-family: var(--sans);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
}

.figure { margin: 0 0 26px; }

.figure img {
  width: 100%;
  border: 1px solid var(--rule);
}

.figure figcaption {
  margin-top: 8px;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-faint);
}

/* 播放器 */
.player {
  background: var(--paper-up);
  border: 1px solid var(--rule);
  padding: 16px 18px 14px;
  margin-bottom: 30px;
}

.player__row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.player__play {
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  background: var(--gold);
  color: var(--paper-up);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease;
}

.player__play svg { width: 22px; height: 22px; fill: currentColor; }

.player.is-playing .player__play {
  background: var(--seal);
  border-color: var(--seal);
}

.player__skip {
  flex: none;
  width: 44px;
  height: 44px;
  border: 0;
  background: none;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.02em;
  cursor: pointer;
  border-radius: 50%;
}

.player__skip:hover { color: var(--ink); background: rgba(0,0,0,.04); }

.player__bar {
  flex: 1 1 auto;
  min-width: 0;
}

/* 進度：一道細墨線 */
.player__track {
  position: relative;
  height: 22px;
  display: flex;
  align-items: center;
  cursor: pointer;
  touch-action: none;
}

.player__track::before {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: var(--rule);
}

.player__fill {
  position: absolute;
  left: 0;
  height: 2px;
  background: var(--gold);
  width: 0;
}

.player.is-playing .player__fill { background: var(--seal); }

.player__knob {
  position: absolute;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--gold);
  left: 0;
  margin-left: -5.5px;
}

.player.is-playing .player__knob { background: var(--seal); }

.player__times {
  display: flex;
  justify-content: space-between;
  font-family: var(--sans);
  font-size: 11.5px;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

.player__meta {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-faint);
}

.player__rate {
  appearance: none;
  border: 1px solid var(--rule);
  background: var(--paper);
  border-radius: 2px;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-soft);
  padding: 5px 8px;
  min-height: 32px;
  cursor: pointer;
}

/* 內文 */
.prose p {
  margin: 0 0 1.35em;
  text-align: justify;
  word-break: normal;
  overflow-wrap: break-word;
}

.prose p:last-child { margin-bottom: 0; }

/* 參觀物件等附註 */
.note {
  margin-top: 30px;
  border-top: 1px solid var(--rule);
  padding-top: 18px;
}

.note h2 {
  margin: 0 0 10px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--gold-deep);
}

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

.note li {
  padding: 7px 0 7px 18px;
  position: relative;
  line-height: 1.75;
  font-size: 16px;
  border-bottom: 1px solid rgba(221, 215, 201, .55);
}

.note li:last-child { border-bottom: 0; }

.note li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.05em;
  width: 7px;
  height: 1px;
  background: var(--gold);
}

.note li em {
  display: block;
  font-style: normal;
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--ink-faint);
  line-height: 1.6;
}

/* 偈頌 */
.verse {
  margin-top: 34px;
  background: var(--rose);
  padding: 22px 20px;
}

.verse h2 {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.28em;
  color: var(--gold-deep);
}

.verse p {
  margin: 0 0 .5em;
  line-height: 2.1;
  letter-spacing: 0.02em;
}

.verse cite {
  display: block;
  margin-top: 12px;
  font-style: normal;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-soft);
}

/* 缺內容時的提示 */
.pending {
  border: 1px dashed var(--rule);
  background: var(--paper-up);
  padding: 20px;
  color: var(--ink-soft);
  font-size: 15.5px;
  line-height: 1.85;
}

.pending button {
  appearance: none;
  margin-top: 12px;
  border: 1px solid var(--gold);
  background: none;
  color: var(--gold-deep);
  font-family: var(--sans);
  font-size: 13px;
  padding: 9px 16px;
  min-height: 44px;
  border-radius: 2px;
  cursor: pointer;
}

.pending button:hover { background: rgba(160, 128, 64, .1); }

/* 缺照片時的題名卡 */
.placeholder {
  aspect-ratio: 16 / 9;
  border: 1px solid var(--rule);
  background: var(--rose);
  display: grid;
  place-items: center;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  font-size: 22px;
  color: var(--gold-deep);
}

/* 前後站 */
.pager {
  margin-top: 46px;
  border-top: 1px solid var(--rule);
  display: flex;
}

.pager a {
  flex: 1 1 50%;
  padding: 16px 4px;
  min-height: 44px;
  text-decoration: none;
  font-size: 15px;
}

.pager a + a { text-align: right; border-left: 1px solid var(--rule); }

.pager small {
  display: block;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
}

/* 主要行動 */
.cta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 26px 0 0;
  padding: 14px 16px;
  background: var(--paper-up);
  border: 1px solid var(--gold);
  text-decoration: none;
}

.cta img {
  width: 62px;
  height: 62px;
  object-fit: cover;
  flex: none;
}

.cta b {
  display: block;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.cta small {
  display: block;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-faint);
}

.cta::after {
  content: "▶";
  margin-left: auto;
  font-size: 11px;
  color: var(--gold);
}

.fade-in { animation: rise .4s ease both; }

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* ------------------------------------------------------------------
   動態：全部源自導師自況——
   「自己如水面的一片落葉，向前流去、流去，
     忽而停滯，又忽而團團轉」（《平凡的一生》）
   以及寺名「妙雲」。節奏一律緩慢，動比靜少。
   ------------------------------------------------------------------ */

/* 妙雲：極緩慢飄移的如意雲，藏在首頁題字之後 */
.intro { position: relative; }

.cloud {
  position: absolute;
  pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 60'%3E%3Cpath d='M20 45q-12 0-12-11 0-11 11-11 2-12 15-12 11 0 14 9 4-5 11-5 11 0 12 10 10 1 10 10 0 10-12 10z' fill='none' stroke='%23a08040' stroke-opacity='.5' stroke-width='2'/%3E%3C/svg%3E") center / contain no-repeat;
  opacity: .30;
  animation: cloud-drift 90s ease-in-out infinite alternate;
}

.cloud--1 { width: 150px; height: 75px; right: -18px; top: 4px; }
.cloud--2 {
  width: 92px; height: 46px; right: 118px; top: 52px;
  opacity: .18;
  animation-duration: 130s;
  animation-direction: alternate-reverse;
}

@keyframes cloud-drift {
  from { transform: translateX(-14px); }
  to   { transform: translateX(30px); }
}

/* 水面：站點清單之後、一片落葉沿著水線前行 */
.river {
  margin-top: 44px;
  border-top: 1px solid var(--rule);
  background: var(--paper-up);
  padding: 30px 0 36px;
  overflow: hidden;
}

.river__stage {
  position: relative;
  height: 72px;
  overflow: hidden;
}

.river__water {
  position: absolute;
  left: -94px; right: -94px; bottom: 6px;
  height: 34px;
  width: calc(100% + 188px);
  animation: water-flow 9s linear infinite;
}

.river__water path {
  fill: none;
  stroke: var(--rule);
  stroke-width: 1.5;
}

.river__water path + path { opacity: .55; }

@keyframes water-flow {
  to { transform: translateX(47px); }
}

/* 落葉的三層動作：前行（有時停滯）、上下輕浮、迴旋 */
.river__leaf {
  position: absolute;
  left: 14%;
  top: 22px;
  width: 26px;
  height: 26px;
  animation: leaf-journey 46s linear infinite;
}

.leaf-bob {
  display: block;
  animation: leaf-bob 5.2s ease-in-out infinite;
}

.leaf-rotor {
  display: block;
  animation: leaf-turn 46s ease-in-out infinite;
}

.river__leaf svg { width: 26px; height: 26px; display: block; }
.river__leaf svg .leaf-body { fill: var(--gold); }
.river__leaf svg .leaf-vein { stroke: var(--paper-up); stroke-width: 1.4; fill: none; }

/* 向前流去、流去（0–20）…忽而停滯（20–34）…
   又忽而團團轉（34–46，緩慢原地迴旋）…再隨流而去 */
@keyframes leaf-journey {
  0%   { left: -9%; }
  20%  { left: 24%; }
  26%  { left: 24.6%; }
  34%  { left: 25.4%; }
  46%  { left: 40%; }
  56%  { left: 43%; }
  76%  { left: 79%; }
  100% { left: 106%; }
}

@keyframes leaf-turn {
  0%   { transform: rotate(-8deg); }
  20%  { transform: rotate(9deg); }
  26%  { transform: rotate(3deg); }
  34%  { transform: rotate(5deg); }
  46%  { transform: rotate(371deg); }   /* 團團轉：一整圈 */
  56%  { transform: rotate(384deg); }
  70%  { transform: rotate(352deg); }
  84%  { transform: rotate(366deg); }
  100% { transform: rotate(354deg); }
}

@keyframes leaf-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-3.5px); }
}

.river__quote {
  margin: 8px auto 0;
  text-align: center;
}

.river__quote p {
  margin: 0 auto .4em;
  max-width: 27em;
  font-size: 16.5px;
  line-height: 2.15;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

.river__quote .river__tr {
  font-size: 13.5px;
  line-height: 1.9;
  letter-spacing: 0.02em;
  color: var(--ink-faint);
}

.river__quote cite {
  display: block;
  margin-top: 10px;
  font-style: normal;
  font-family: var(--sans);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
}

/* 站點頁：印記如鈐印般落下 */
.stop__head .seal {
  animation: seal-stamp .5s cubic-bezier(.2, .9, .3, 1.15) both;
}

@keyframes seal-stamp {
  from { opacity: 0; transform: scale(1.3); }
  to   { opacity: 1; transform: scale(1); }
}

/* 內文段落緩緩浮現 */
.prose p { animation: rise .6s ease both; }
.prose p:nth-child(1) { animation-delay: .05s; }
.prose p:nth-child(2) { animation-delay: .16s; }
.prose p:nth-child(3) { animation-delay: .27s; }
.prose p:nth-child(4) { animation-delay: .38s; }
.prose p:nth-child(n+5) { animation-delay: .48s; }

/* 播放器：進度旋鈕即是水上的落葉 */
.player__knob {
  width: 20px;
  height: 20px;
  margin-left: -10px;
  background: none;
  border-radius: 0;
}

.player.is-playing .player__knob { background: none; }

.player__knob svg { width: 20px; height: 20px; display: block; }
.player__knob svg .leaf-body { fill: var(--gold); }
.player__knob svg .leaf-vein { stroke: var(--paper-up); stroke-width: 1.6; fill: none; }
.player.is-playing .player__knob svg .leaf-body { fill: var(--seal); }

.player.is-playing .player__knob svg {
  animation: knob-drift 3.6s ease-in-out infinite;
}

@keyframes knob-drift {
  0%, 100% { transform: translateY(0) rotate(-9deg); }
  50%      { transform: translateY(-2.5px) rotate(9deg); }
}

/* 播放中，墨線上流過一道微光，如水面反光 */
.player__fill { overflow: hidden; }

.player.is-playing .player__fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 253, 248, .7), transparent);
  background-size: 80px 100%;
  background-repeat: repeat-x;
  animation: water-light 2.8s linear infinite;
}

@keyframes water-light {
  to { background-position-x: 80px; }
}

/* 偈頌區塊：角落一抹淡雲 */
.verse { position: relative; overflow: hidden; }

.verse::after {
  content: "";
  position: absolute;
  right: -14px;
  bottom: -8px;
  width: 110px;
  height: 55px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 60'%3E%3Cpath d='M20 45q-12 0-12-11 0-11 11-11 2-12 15-12 11 0 14 9 4-5 11-5 11 0 12 10 10 1 10 10 0 10-12 10z' fill='none' stroke='%23a08040' stroke-opacity='.6' stroke-width='2'/%3E%3C/svg%3E") center / contain no-repeat;
  opacity: .22;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

@media (min-width: 700px) {
  body { font-size: 17.5px; }
  .intro h1 { font-size: 34px; }
  .stop__head h1 { font-size: 30px; }
}
