/* 穴位照片 · 句內相機 icon ＋ 右側彈窗（2026-10-07 第二版）
   模式與尺寸對齊「針灸臨床考試温習」站（acupuncture-clinical-exam）：右側貼邊浮窗、
   標題列（穴名 ／ 穴碼 ／ 經脈）、圖片完整顯示不裁切。
   用法：<button class="acu-photo-btn" data-acu-photo="../../assets/acu-photo/LI4.webp"
                data-acu-name="合谷" data-acu-code="LI4" data-acu-mer="手陽明大腸經"></button>
   依賴：assets/js/acu-photo.js（自動建立彈窗 DOM，免每頁手寫） */

.acu-photo-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 .12em;
  padding: .1em .34em;
  font-family: inherit;
  font-size: .84em;
  line-height: 1;
  color: #C2544C;
  background: #FBF3F1;
  border: 1px solid #E6CFCB;
  border-radius: 999px;
  cursor: pointer;
  vertical-align: -.08em;
  transition: background .15s;
}
.acu-photo-btn:hover { background: #F6E4E1; }
.acu-photo-btn:focus-visible { outline: 2px solid #C2544C; outline-offset: 2px; }
.acu-photo-btn svg { width: 1.02em; height: 1.02em; flex: none; display: block; }
td .acu-photo-btn { font-size: .8em; }

/* ── 右側浮窗 ───────────────────────────────────────────── */
.acu-photo-lb {
  position: fixed;
  top: 50%;
  right: 20px;
  transform: translateY(-50%) translateX(24px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}
.acu-photo-lb[data-open="1"] {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%) translateX(0);
}
.acu-photo-box {
  position: relative;
  display: flex;
  flex-direction: column;
  width: fit-content;
  max-width: min(820px, 92vw);
  max-height: 96vh;
  padding: 8px;
  background: #fff;
  color: #222;
  border: 1px solid #E4E1D8;
  border-radius: 12px;
  box-shadow: 0 12px 34px rgba(60, 40, 20, .18);
}
.acu-photo-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 190px;
  margin-bottom: 6px;
  padding: 0 2px 6px;
  border-bottom: 1px solid #E4E1D8;
  flex-wrap: wrap;
}
.acu-photo-head b { font-size: 1.15rem; letter-spacing: .08em; color: #1F1E1B; }
.acu-photo-head .acu-photo-code { font-size: .85rem; color: #8A8578; }
.acu-photo-head em { margin-left: auto; font-style: normal; font-size: .76rem; color: #C2544C; }

.acu-photo-box img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(96vh - 96px);
  margin: 0 auto;
  border-radius: 10px;
  background: #f4f2ed;
}
.acu-photo-box img[hidden],
.acu-photo-load[hidden] { display: none; }

.acu-photo-load {
  display: block;
  min-width: 260px;
  padding: 60px 40px;
  color: #8A8578;
  font-size: .9em;
  text-align: center;
}
.acu-photo-x {
  position: absolute;
  top: -11px;
  right: -11px;
  width: 30px;
  height: 30px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #C2544C;
  color: #fff;
  font: inherit;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .25);
}
.acu-photo-x:hover { background: #A83E2E; }

/* 窄螢幕：退回底部面板 */
@media (max-width: 860px) {
  .acu-photo-lb {
    top: auto;
    bottom: 12px;
    left: 12px;
    right: 12px;
    transform: translateY(24px);
    align-items: flex-end;
  }
  .acu-photo-lb[data-open="1"] { transform: translateY(0); }
  .acu-photo-box { max-height: 62vh; margin: 0 auto; }
  .acu-photo-box img { max-height: calc(62vh - 90px); }
  .acu-photo-head { min-width: 0; padding: 0 24px 6px 2px; }
  .acu-photo-x { top: -9px; right: -4px; }
}
