/**
 * Palace section shell — shared by static demos & future React `SectionPalaceTemplate` variants.
 * Edit here only; HTML demos link this file (single source of truth).
 */

:root {
  --void-base: #020408;
  --glow-abyss: rgba(12, 38, 50, 0.5);
  --trunk-pulse: rgba(255,255,255,0.86);
  --yin-base: rgba(255,255,255,0.2);
  --yin-pulse: #020408;
  --core-blue: #38bdf8;
  --core-blue-dim: rgba(56, 189, 248, 0.38);
  --text: #e2e8f0;
  --muted: #94a3b8;
  --gold: #d4af37;
  --panel-border: rgba(255,255,255,0.08);
  --panel-top: rgba(255,255,255,0.14);
  --panel-bg-a: rgba(15, 23, 42, 0.68);
  --panel-bg-b: rgba(6, 10, 20, 0.9);
  /** 浮水印感：字卡半透明＋低 blur，讓生命線與流光透得過來 */
  --watermark-blur: 4px;
  --watermark-blur-strong: 5px;
  /** 長文／多段解讀：略提高不透明度、略增 blur，優先可讀性 */
  --palace-read-blur: 6px;
}

html, body {
  margin: 0;
  width: 100%;
  min-height: 100%;
  background-color: var(--void-base);
  color: var(--text);
  font-family: "Noto Sans TC", sans-serif;
  overflow-x: hidden;
  background-image: radial-gradient(rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 30px 30px;
}

.abyss-light {
  position: fixed;
  bottom: -10vh;
  left: 50%;
  transform: translateX(-50%);
  width: 160vw;
  height: 80vh;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, var(--glow-abyss) 0%, transparent 70%);
  filter: blur(40px);
  animation: breathe 14s ease-in-out infinite alternate;
}

.app {
  position: relative;
  z-index: 5;
  max-width: 520px;
  margin: 0 auto;
  padding: 34px 18px 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
}

/** 生命線：自畫面底部延伸至 main 全高，置於所有字卡下層（浮水印感） */
.app-life-lines {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  width: 100%;
  min-height: 100%;
  z-index: 0;
  pointer-events: none;
}

.app-life-lines svg {
  width: 100%;
  height: 100%;
  min-height: 100%;
  display: block;
  overflow: visible;
}

/** 略提高線條與流光可見度（仍低於字卡對比） */
.app-life-lines .energy-flow-yang,
.app-life-lines .energy-flow-yin {
  opacity: 0.92;
}

.app-life-lines .trunk-body-yang {
  opacity: 0.88;
}

.app-stack {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.core {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  animation: fade-in-up 1.1s ease forwards;
}

.blue-star {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  transform-origin: center center;
  will-change: transform, box-shadow, filter;
  background: radial-gradient(circle at 35% 35%, #fff 0%, var(--core-blue) 40%, #0284c7 80%);
  box-shadow: 0 0 40px var(--core-blue-dim), inset 0 0 15px rgba(255,255,255,0.78);
  /** 與生命線 trunk-breathe 同為 8s ease-in-out alternate，呼吸節奏一致；峰值帶微量金輝呼應流光 */
  animation: blue-star-breathe 8s ease-in-out infinite alternate;
  z-index: 2;
}

.palace-name {
  font-family: "Noto Serif TC", serif;
  letter-spacing: 6px;
  font-size: 24px;
  font-weight: 600;
  text-shadow: 0 0 15px var(--core-blue);
}

.subcopy {
  text-align: center;
  font-size: 12px;
  color: rgba(255,255,255,0.42);
  letter-spacing: 1px;
  margin-top: 2px;
}

.scene {
  position: relative;
  width: 100%;
  animation: fade-in-up 1.8s ease 0.15s forwards;
  opacity: 0;
}

.trunk-body-yang {
  fill: none;
  stroke: url(#pmso-trunk-gradient);
  stroke-width: 2.1px;
  filter: url(#pmso-glow-gold);
  animation: trunk-breathe 8s ease-in-out infinite alternate;
}

.energy-flow-yang {
  fill: none;
  stroke: var(--trunk-pulse);
  stroke-width: 1.15px;
  stroke-dasharray: 120 1500;
  stroke-dashoffset: 1650;
  animation: flow-up 9s linear infinite;
  filter: url(#pmso-glow-gold);
}

.trunk-body-yin {
  fill: none;
  stroke: var(--yin-base);
  stroke-width: 1.2px;
}

.energy-flow-yin {
  fill: none;
  stroke: var(--yin-pulse);
  stroke-width: 3.2px;
  stroke-dasharray: 80 1500;
  stroke-dashoffset: 1650;
  animation: flow-up 12s linear infinite;
  filter: drop-shadow(0 0 2px rgba(255,255,255,0.28));
}

.main-star-wrap {
  position: relative;
  z-index: 5;
  width: 100%;
  display: flex;
  justify-content: center;
  margin: 10px 0 18px;
}

.main-star-card {
  width: min(88%, 336px);
  padding: 16px 18px 15px;
  border-radius: 24px;
  background:
    radial-gradient(circle at 12% 10%, rgba(245, 158, 11, 0.11), transparent 36%),
    linear-gradient(145deg, rgba(15, 23, 42, 0.4) 0%, rgba(6, 10, 20, 0.52) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow:
    0 16px 36px rgba(0, 0, 0, 0.38),
    inset 0 0 24px rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(var(--watermark-blur-strong)) saturate(1.06);
  -webkit-backdrop-filter: blur(var(--watermark-blur-strong)) saturate(1.06);
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
}

.main-star-icon {
  width: 70px;
  height: 70px;
  min-width: 70px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 8, 15, 0.72);
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.14);
}

.main-star-icon svg {
  width: 78%;
  height: 78%;
}

.main-star-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.main-star-kicker {
  font-size: 10px;
  font-family: "Share Tech Mono", monospace;
  letter-spacing: 2px;
  color: var(--gold);
  text-transform: uppercase;
}

.main-star-title {
  font-family: "Noto Serif TC", serif;
  font-size: 24px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.2;
  flex-wrap: wrap;
}

.main-star-badge {
  font-size: 10px;
  letter-spacing: 1px;
  padding: 4px 8px;
  border-radius: 999px;
  color: #f5d27b;
  border: 1px solid rgba(212,175,55,0.25);
  background: rgba(212,175,55,0.08);
  font-family: "Share Tech Mono", monospace;
}

.main-star-summary {
  font-size: 13px;
  line-height: 1.7;
  color: #cbd5e1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.main-star-summary.ming-dual-wrap p {
  margin: 0 0 8px;
  font-size: 12px;
  line-height: 1.65;
  text-align: justify;
}

.main-star-summary.ming-dual-wrap p:last-child {
  margin-bottom: 0;
}

.main-star-pair {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pair-sep {
  font-size: 14px;
  color: rgba(255,255,255,0.36);
  font-family: "Share Tech Mono", monospace;
}

.constellation-zone {
  position: relative;
  z-index: 4;
  width: 100%;
  min-height: 230px;
  margin-bottom: 10px;
}

.cluster-title {
  text-align: center;
  font-size: 10px;
  color: rgba(255,255,255,0.28);
  letter-spacing: 2px;
  margin-bottom: 6px;
}

.star-arc-layer {
  position: relative;
  width: 100%;
  height: 210px;
}

.star-node {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: auto;
  cursor: pointer;
  transition: transform 0.24s ease, filter 0.24s ease;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  min-width: 0;
}

.star-node:hover,
.star-node:active {
  transform: translate(-50%, -50%) scale(1.08);
  z-index: 10;
}

.star-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: filter 0.3s;
  position: relative;
}

.star-icon::before {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.06), transparent 70%);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.star-node:hover .star-icon::before {
  opacity: 1;
}

.star-icon svg {
  width: 100%;
  height: 100%;
}

.star-name {
  font-family: "Noto Serif TC", serif;
  font-size: 12px;
  letter-spacing: 2px;
  color: rgba(255,255,255,0.82);
  text-align: center;
  line-height: 1.2;
  text-shadow: 0 0 10px rgba(0,0,0,0.7);
}

.star-type {
  font-size: 9px;
  color: rgba(255,255,255,0.28);
  font-family: "Share Tech Mono", monospace;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.tier-main .star-icon {
  width: 46px;
  height: 46px;
}

.tier-support .star-icon,
.tier-malefic .star-icon {
  width: 38px;
  height: 38px;
}

.tier-minor .star-icon {
  width: 32px;
  height: 32px;
  opacity: 0.94;
}

.more-stars-wrap {
  margin: 2px 0 18px;
  position: relative;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.more-stars-toggle {
  width: min(88%, 360px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px;
  background: rgba(8, 14, 26, 0.38);
  backdrop-filter: blur(var(--watermark-blur));
  -webkit-backdrop-filter: blur(var(--watermark-blur));
  color: rgba(255,255,255,0.78);
  padding: 10px 16px;
  font-size: 12px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: 0.25s;
  box-shadow:
    0 8px 22px rgba(0,0,0,0.28),
    inset 0 0 16px rgba(255,255,255,0.04);
}

.more-stars-toggle:hover {
  background: rgba(12, 20, 36, 0.48);
  color: #fff;
  border-color: rgba(255,255,255,0.16);
}

.more-stars-grid {
  display: none;
  margin-top: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
}

.more-stars-grid.show {
  display: grid;
  animation: fade-in-up 0.35s ease;
}

.mini-star-card {
  border-radius: 14px;
  padding: 10px 8px;
  background: rgba(10, 14, 24, 0.26);
  border: 1px solid rgba(255,255,255,0.07);
  text-align: center;
  cursor: pointer;
  transition: 0.25s;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.mini-star-card:hover {
  background: rgba(18, 26, 44, 0.56);
  transform: translateY(-1px);
}

.mini-star-card svg {
  width: 30px;
  height: 30px;
  margin-bottom: 6px;
}

.mini-star-name {
  font-family: "Noto Serif TC", serif;
  font-size: 12px;
  color: #fff;
  margin-bottom: 4px;
}

.mini-star-role {
  font-size: 9px;
  color: rgba(255,255,255,0.36);
  letter-spacing: 1px;
  font-family: "Share Tech Mono", monospace;
}

.hint {
  text-align: center;
  font-size: 11px;
  color: rgba(255,255,255,0.26);
  margin-top: -2px;
  margin-bottom: 18px;
  letter-spacing: 1px;
}

.signals-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 8px;
}

.vm-rune {
  font-size: 10px;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.78);
}

.vm-rune.vm-rune-warn {
  border-color: rgba(248,113,113,0.4);
  color: #fecaca;
}

.vm-section-divider {
  width: 100%;
  text-align: center;
  font-family: "Share Tech Mono", monospace;
  font-size: 10px;
  letter-spacing: 3px;
  color: rgba(255,255,255,0.28);
  margin: 20px 0 10px;
}

/** 浮水印玻璃：底色偏淡、blur 低，下方生命線＋流光可透視 */
.glass-panel {
  background:
    radial-gradient(circle at 10% 0%, rgba(56, 189, 248, 0.07), transparent 48%),
    linear-gradient(155deg, rgba(15, 23, 42, 0.34) 0%, rgba(6, 10, 20, 0.46) 100%);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.35),
    inset 0 0 28px rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(var(--watermark-blur)) saturate(1.08);
  -webkit-backdrop-filter: blur(var(--watermark-blur)) saturate(1.08);
}

.resonance-dashboard {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 16px 14px 18px;
  border-radius: 22px;
  margin-bottom: 16px;
}

.resonance-dashboard.glass-panel {
  background:
    radial-gradient(circle at 85% 8%, rgba(245, 158, 11, 0.08), transparent 42%),
    radial-gradient(circle at 12% 20%, rgba(56, 189, 248, 0.07), transparent 44%),
    linear-gradient(165deg, rgba(15, 23, 42, 0.36) 0%, rgba(6, 10, 20, 0.5) 100%);
}

.calibration-state {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(2, 6, 12, 0.22);
  border: 1px solid rgba(255,255,255,0.07);
  box-shadow: inset 0 0 14px rgba(255,255,255,0.03);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

#vm-calibration-msg {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  color: rgba(226, 232, 240, 0.94);
}

.calibration-state.cal-balanced { border-left: 3px solid rgba(52,211,153,0.6); }
.calibration-state.cal-caution { border-left: 3px solid rgba(250,204,21,0.55); }
.calibration-state.cal-overburn { border-left: 3px solid rgba(248,113,113,0.55); }

.cal-icon { font-size: 20px; line-height: 1; }
.cal-badge {
  display: block;
  font-family: "Share Tech Mono", monospace;
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--muted);
  margin-bottom: 4px;
}

.dynamic-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.d-card {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(8, 12, 22, 0.28);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 6px 14px rgba(0,0,0,0.2);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.d-card.d-card-alert {
  border-color: rgba(248,113,113,0.28);
  box-shadow: 0 0 20px rgba(248,113,113,0.08);
}

.d-tag {
  font-family: "Share Tech Mono", monospace;
  font-size: 9px;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.38);
  margin-bottom: 6px;
}

.d-quote {
  font-family: "Noto Serif TC", serif;
  font-size: 13px;
  line-height: 1.65;
  color: #cbd5e1;
  margin: 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.situational-triggers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.s-trigger {
  font-size: 11px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: #e2e8f0;
  cursor: pointer;
  transition: 0.2s;
}

.s-trigger:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

.angel-whisper {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 16px 18px;
  margin-bottom: 8px;
  border-radius: 18px;
}

.angel-whisper.glass-panel {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255,255,255,0.05), transparent 58%),
    linear-gradient(145deg, rgba(15, 23, 42, 0.32) 0%, rgba(6, 10, 20, 0.44) 100%);
}

.angel-whisper p {
  margin: 0;
  font-family: "Noto Serif TC", serif;
  font-size: 15px;
  line-height: 1.75;
  color: #e2e8f0;
  text-align: justify;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

.sacred-slate {
  position: relative;
  z-index: 2;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.s-block {
  padding: 16px 18px;
  border-radius: 18px;
}

.s-block.glass-panel {
  background:
    radial-gradient(circle at 0% 0%, rgba(167, 139, 250, 0.1), transparent 48%),
    linear-gradient(145deg, rgba(15, 23, 42, 0.34) 0%, rgba(6, 10, 20, 0.48) 100%);
}

.s-block.s-block-shadow.glass-panel {
  background:
    radial-gradient(circle at 100% 0%, rgba(248,113,113,0.1), transparent 45%),
    linear-gradient(145deg, rgba(15, 23, 42, 0.34) 0%, rgba(6, 10, 20, 0.48) 100%);
  border-color: rgba(248,113,113,0.14);
}

.s-block.s-block-directive.glass-panel {
  background:
    radial-gradient(circle at 0% 100%, rgba(212,175,55,0.12), transparent 50%),
    linear-gradient(145deg, rgba(15, 23, 42, 0.34) 0%, rgba(6, 10, 20, 0.48) 100%);
  border-left: 3px solid rgba(212,175,55,0.55);
}

.s-label {
  font-family: "Share Tech Mono", monospace;
  font-size: 10px;
  letter-spacing: 2px;
  color: rgba(255,255,255,0.42);
  margin-bottom: 8px;
}

.s-text {
  font-family: "Noto Serif TC", serif;
  font-size: 14px;
  line-height: 1.8;
  color: #cbd5e1;
  text-align: justify;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.preserved-section {
  position: relative;
  z-index: 5;
  width: 100%;
  margin-bottom: 16px;
}

.long-notes {
  border-radius: 18px;
  padding: 4px 8px 14px 14px;
}

.long-notes.glass-panel {
  background:
    radial-gradient(circle at 50% 100%, rgba(56, 189, 248, 0.06), transparent 52%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.32) 0%, rgba(6, 10, 20, 0.46) 100%);
}

.long-notes summary {
  cursor: pointer;
  padding: 12px 4px;
  font-size: 13px;
  color: rgba(255,255,255,0.72);
  list-style: none;
}

.long-notes summary::-webkit-details-marker { display: none; }

.long-notes-body p {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.75;
  color: #cbd5e1;
  text-align: justify;
}

.timeline-section {
  position: relative;
  z-index: 2;
  width: 100%;
  margin-bottom: 16px;
}

.t-node {
  padding: 14px 16px 14px 18px;
  border-radius: 16px;
  margin-left: 0;
  border-left: 3px solid rgba(212,175,55,0.35);
}

.t-node.glass-panel {
  background:
    radial-gradient(circle at 0% 50%, rgba(212,175,55,0.08), transparent 52%),
    linear-gradient(90deg, rgba(15, 23, 42, 0.34) 0%, rgba(6, 10, 20, 0.48) 100%);
}

.t-year {
  font-family: "Share Tech Mono", monospace;
  font-size: 12px;
  color: var(--gold);
  margin-bottom: 6px;
}

.t-desc {
  font-size: 13px;
  color: #cbd5e1;
  line-height: 1.65;
}

/** 與 SectionPalaceTemplate「進階試讀／結界」同構 */
.sealed-domain {
  position: relative;
  margin-top: 8px;
  margin-bottom: 16px;
  padding: 36px 20px 44px;
  border-radius: 18px;
  border: 1px solid rgba(212, 175, 55, 0.18);
  background: repeating-linear-gradient(
    45deg,
    rgba(6, 9, 19, 0.55),
    rgba(6, 9, 19, 0.55) 10px,
    rgba(13, 19, 38, 0.48) 10px,
    rgba(13, 19, 38, 0.48) 20px
  );
  /* 結界內容高於模糊底文時仍要完整顯示；僅靠底文高度會過矮導致按鈕被 overflow 裁切 */
  min-height: 288px;
  overflow: hidden;
  z-index: 2;
}

.sealed-content {
  opacity: 0.28;
  filter: blur(3px);
  user-select: none;
  pointer-events: none;
  max-width: 100%;
}

.premium-karmic-label {
  font-family: "Share Tech Mono", monospace;
  font-size: 10px;
  letter-spacing: 2px;
  color: #e8c76a;
  margin-bottom: 10px;
}

.premium-body-blur {
  font-family: "Noto Serif TC", serif;
  font-size: 14px;
  line-height: 1.75;
  color: #cbd5e1;
  margin: 0;
  text-align: justify;
}

.veil-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 5;
  text-align: center;
  padding: 24px 18px 40px;
  box-sizing: border-box;
  gap: 0;
  background: rgba(3, 4, 8, 0.52);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.veil-icon {
  font-size: 22px;
  color: #e8c76a;
  margin-bottom: 10px;
  filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.45));
}

.veil-overlay .veil-title {
  font-family: "Noto Serif TC", serif;
  margin: 0 0 8px;
  font-size: 17px;
  color: #f8fafc;
  letter-spacing: 3px;
  font-weight: 600;
}

.veil-overlay .veil-desc {
  margin: 0 0 22px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.65;
  letter-spacing: 0.5px;
  white-space: pre-line;
  max-width: 280px;
  flex-shrink: 0;
}

.veil-overlay .btn-unlock {
  flex-shrink: 0;
}

.btn-unlock {
  background: transparent;
  border: 1px solid rgba(212, 175, 55, 0.65);
  color: #f5d27b;
  padding: 12px 26px;
  border-radius: 6px;
  font-family: "Noto Serif TC", serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 2px;
  cursor: pointer;
  transition: background 0.25s, transform 0.12s;
  box-shadow: 0 0 22px rgba(212, 175, 55, 0.12);
}

.btn-unlock:hover {
  background: rgba(212, 175, 55, 0.1);
}

.btn-unlock:active {
  transform: scale(0.98);
}

/** 條狀 CTA：呼應共振儀「流月／流日」價值 */
.cta-strip {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
  padding: 14px 16px;
  border-radius: 18px;
  margin-bottom: 14px;
  z-index: 2;
}

@media (min-width: 400px) {
  .cta-strip {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.cta-strip-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.65;
  color: rgba(226, 232, 240, 0.88);
  text-align: left;
}

.cta-strip-btn {
  flex-shrink: 0;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.1);
  color: #7dd3fc;
  font-size: 12px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: 0.2s;
}

.cta-strip-btn:hover {
  background: rgba(56, 189, 248, 0.18);
  color: #e0f2fe;
}

/** 橫幅 CTA：流年／節點深讀 */
.cta-banner {
  width: 100%;
  margin-bottom: 12px;
  z-index: 2;
}

.cta-banner-inner {
  padding: 16px 18px;
  border-radius: 18px;
  text-align: center;
}

.cta-banner-kicker {
  font-family: "Share Tech Mono", monospace;
  font-size: 9px;
  letter-spacing: 3px;
  color: rgba(255, 255, 255, 0.35);
  display: block;
  margin-bottom: 8px;
}

.cta-banner-text {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.65;
  color: #cbd5e1;
}

/** 神諭 Modal 底部升級（對應 home RevelationModal cta） */
.rc-footer-cta {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
}

.rc-cta-upgrade {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(212, 175, 55, 0.35);
  background: rgba(212, 175, 55, 0.08);
  color: #f5d27b;
  font-size: 13px;
  letter-spacing: 1px;
  cursor: pointer;
  font-family: "Noto Sans TC", sans-serif;
  transition: 0.2s;
}

.rc-cta-upgrade:hover {
  background: rgba(212, 175, 55, 0.14);
}

.scripture-wrap {
  position: relative;
  z-index: 5;
  width: 100%;
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}

.scripture-card {
  width: 100%;
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.64) 0%, rgba(6, 10, 20, 0.84) 100%);
  border: 1px solid rgba(255,255,255,0.06);
  border-top: 1px solid rgba(255,255,255,0.12);
  border-radius: 18px;
  padding: 20px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.scripture-section + .scripture-section {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px dashed rgba(255,255,255,0.08);
}

.scripture-label {
  font-family: "Share Tech Mono", monospace;
  font-size: 10px;
  color: var(--gold);
  letter-spacing: 3px;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.scripture-text {
  font-family: "Noto Serif TC", serif;
  line-height: 1.85;
  font-size: 15px;
  color: #cbd5e1;
  text-align: justify;
}

.scripture-text strong {
  color: #f8fafc;
  font-weight: 600;
}

.related-wrap {
  position: relative;
  z-index: 5;
  width: 100%;
  margin-bottom: 16px;
}

.link-section-palace {
  width: 100%;
}

.related-title {
  text-align: center;
  font-size: 11px;
  color: rgba(255,255,255,0.28);
  letter-spacing: 2px;
  margin-bottom: 10px;
}

.related-links {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.related-link {
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  color: #cbd5e1;
  font-size: 12px;
  text-decoration: none;
  transition: 0.25s;
}

.related-link:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
  border-color: rgba(255,255,255,0.14);
}

.revelation-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2,6,12,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.revelation-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.rev-card {
  width: 100%;
  max-width: 430px;
  background:
    radial-gradient(circle at 10% 0%, rgba(255,255,255,0.06), transparent 25%),
    linear-gradient(180deg, rgba(15,23,42,0.88) 0%, rgba(5,7,14,0.96) 100%);
  border: 1px solid rgba(255,255,255,0.08);
  border-top: 2px solid rgba(255,255,255,0.14);
  border-radius: 26px;
  padding: 30px 24px 24px;
  box-shadow: 0 40px 80px rgba(0,0,0,0.9), inset 0 0 20px rgba(255,255,255,0.03);
  transform: translateY(20px) scale(0.95);
  transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.revelation-overlay.show .rev-card {
  transform: translateY(0) scale(1);
}

.rc-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 22px;
}

.rc-title-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.rc-icon-box {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: rgba(2, 6, 23, 0.8);
  border: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 10px rgba(255,255,255,0.03);
}

.rc-icon-box svg {
  width: 76%;
  height: 76%;
}

.rc-title-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rc-title {
  font-family: "Noto Serif TC", serif;
  margin: 0;
  font-size: 24px;
  color: #fff;
  font-weight: 600;
}

.rc-tag {
  font-family: "Share Tech Mono", monospace;
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--gold);
  background: rgba(212,175,55,0.1);
  border: 1px solid rgba(212,175,55,0.2);
  border-radius: 12px;
  padding: 4px 10px;
  width: fit-content;
}

.rc-close {
  background: none;
  border: 0;
  color: #64748b;
  font-size: 32px;
  font-weight: 300;
  cursor: pointer;
  line-height: 1;
  transition: 0.3s;
  margin-top: -8px;
}

.rc-close:hover {
  color: #fff;
}

.rc-oneline {
  font-family: "Noto Serif TC", serif;
  color: #f8fafc;
  margin-bottom: 10px;
  line-height: 1.6;
  font-size: 15px;
}

.rc-quote {
  font-family: "Noto Serif TC", serif;
  color: rgba(255,255,255,0.62);
  font-size: 14px;
  line-height: 1.7;
  font-style: italic;
  border-bottom: 1px dashed rgba(255,255,255,0.1);
  padding-bottom: 16px;
  margin-bottom: 18px;
}

.rc-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.rc-block {
  padding: 0 4px;
}

.rc-label {
  font-family: "Noto Sans TC", sans-serif;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 6px;
  letter-spacing: 1px;
}

.rc-text {
  font-family: "Noto Serif TC", serif;
  color: #cbd5e1;
  line-height: 1.85;
  font-size: 14px;
  text-align: justify;
}

.rc-advice-block {
  margin-top: 8px;
  padding: 16px;
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(255,255,255,0.05), transparent);
  border-left: 3px solid var(--gold);
}

.rc-advice-block .rc-label {
  color: var(--gold);
}

.rc-advice-block .rc-text {
  color: #f8fafc;
  font-weight: 500;
}

@keyframes breathe {
  0% { opacity: 0.3; transform: translateX(-50%) scale(0.95); }
  100% { opacity: 0.8; transform: translateX(-50%) scale(1.05); }
}

@keyframes blue-star-breathe {
  0% {
    transform: scale(0.93);
    filter: brightness(0.88) saturate(0.95);
    box-shadow:
      0 0 18px rgba(56, 189, 248, 0.22),
      0 0 6px rgba(2, 132, 199, 0.15),
      inset 0 0 10px rgba(255, 255, 255, 0.38);
  }
  100% {
    transform: scale(1.07);
    filter: brightness(1.12) saturate(1.05);
    box-shadow:
      0 0 48px rgba(56, 189, 248, 0.55),
      0 0 32px rgba(212, 175, 55, 0.22),
      0 0 14px rgba(52, 211, 153, 0.18),
      inset 0 0 24px rgba(255, 255, 255, 0.95);
  }
}

@keyframes trunk-breathe {
  0% { stroke-width: 1.5px; opacity: 0.5; }
  100% { stroke-width: 3px; opacity: 1; }
}

@keyframes flow-up {
  0% { stroke-dashoffset: 1650; }
  100% { stroke-dashoffset: -150; }
}

@keyframes fade-in-up {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}

@media (max-width: 430px) {
  .app {
    padding-inline: 14px;
  }

  .main-star-card {
    width: 94%;
  }

  .main-star-title {
    font-size: 22px;
  }

  .constellation-zone {
    min-height: 220px;
  }

  .star-arc-layer {
    height: 200px;
  }

  .tier-main .star-icon {
    width: 42px;
    height: 42px;
  }

  .tier-support .star-icon,
  .tier-malefic .star-icon {
    width: 34px;
    height: 34px;
  }

  .tier-minor .star-icon {
    width: 28px;
    height: 28px;
  }

  .star-name {
    font-size: 11px;
  }

  .more-stars-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ========== Readability: long-form / multi-paragraph (less transparent than hero glass) ========== */
.angel-whisper.glass-panel {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.07), transparent 58%),
    linear-gradient(145deg, rgba(15, 23, 42, 0.5) 0%, rgba(6, 10, 20, 0.68) 100%);
  backdrop-filter: blur(var(--palace-read-blur)) saturate(1.06);
  -webkit-backdrop-filter: blur(var(--palace-read-blur)) saturate(1.06);
}

.sacred-slate .s-block.glass-panel {
  background:
    radial-gradient(circle at 0% 0%, rgba(167, 139, 250, 0.12), transparent 48%),
    linear-gradient(145deg, rgba(15, 23, 42, 0.5) 0%, rgba(6, 10, 20, 0.7) 100%);
  backdrop-filter: blur(var(--palace-read-blur)) saturate(1.06);
  -webkit-backdrop-filter: blur(var(--palace-read-blur)) saturate(1.06);
}

.sacred-slate .s-block.s-block-shadow.glass-panel {
  background:
    radial-gradient(circle at 100% 0%, rgba(248, 113, 113, 0.12), transparent 45%),
    linear-gradient(145deg, rgba(15, 23, 42, 0.5) 0%, rgba(6, 10, 20, 0.7) 100%);
}

.sacred-slate .s-block.s-block-directive.glass-panel {
  background:
    radial-gradient(circle at 0% 100%, rgba(212, 175, 55, 0.14), transparent 50%),
    linear-gradient(145deg, rgba(15, 23, 42, 0.5) 0%, rgba(6, 10, 20, 0.7) 100%);
}

.long-notes.glass-panel {
  background:
    radial-gradient(circle at 50% 100%, rgba(56, 189, 248, 0.08), transparent 52%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.54) 0%, rgba(6, 10, 20, 0.74) 100%);
  backdrop-filter: blur(var(--palace-read-blur)) saturate(1.05);
  -webkit-backdrop-filter: blur(var(--palace-read-blur)) saturate(1.05);
}

/* ========== Accessibility: focus ========== */
a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid rgba(56, 189, 248, 0.75);
  outline-offset: 3px;
}

a:focus:not(:focus-visible),
button:focus:not(:focus-visible) {
  outline: none;
}

/* ========== prefers-reduced-motion: stop decorative motion, keep layout ========== */
@media (prefers-reduced-motion: reduce) {
  .abyss-light,
  .blue-star {
    animation: none !important;
  }

  .blue-star {
    will-change: auto;
  }

  .core,
  .scene {
    animation: none !important;
    opacity: 1;
    transform: none;
  }

  .trunk-body-yang,
  .energy-flow-yang,
  .trunk-body-yin,
  .energy-flow-yin {
    animation: none !important;
  }

  .more-stars-grid.show {
    animation: none !important;
  }

  .glass-panel,
  .main-star-card,
  .mini-star-card,
  .angel-whisper.glass-panel,
  .long-notes.glass-panel {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }
}
