/* 傳承（功能包 features/legacy；開發規範手冊 3.7）：展開屬性裡的入口一行（.lg-entry）與整頁的傳承、識海（.lg-layer，web/app.js 的 legacyPageHtml）。
   企劃者 2026-11-04「要有真的傳承、識海的感覺」：傳承是月夜山影、三卷墨水、竹簡門路；識海是深海、發光的意境、封印符紙。
   兩頁的底是企劃者給的圖（web/img/legacy/：水墨月夜山水、識海夜浪、卷軸、符紙、竹簡），淺色、深色模式一樣（同列傳的竹簡）。字型：霞鶩文楷（index.html 載 400、700）、Noto Serif TC 700（zhuan.css 載）。 */

.lg-entry {
  display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; width: 100%; min-height: 44px; margin-top: 8px; padding: 8px 12px;
  border: 1px solid #4a3e2f; border-radius: 10px; background: #1b1611; color: #efe4cf; font: 400 14px "LXGW WenKai TC", var(--serif, serif);
  text-align: left; cursor: pointer;
}
.lg-entry-main { flex: 1 1 auto; }
.lg-entry-sub { flex: 1 0 100%; order: 3; font-size: 13px; color: #a9c6dd; }
.lg-entry-go { color: #bfae8c; font-size: 18px; }
.lg-v-zheng { color: #9cc6ec; } .lg-v-xie { color: #e08a55; } .lg-v-luck { color: #f0cf78; }
.lg-entry b { font-weight: 700; }

.lg-layer {
  position: fixed; inset: 0; z-index: 42; overflow-y: auto; overscroll-behavior: contain; animation: fade 0.2s;
  padding-bottom: calc(28px + var(--bottom, 0px)); font-family: "LXGW WenKai TC", "Kaiti TC", "BiauKai", serif;
}
/* 背景圖（web/img/legacy/，企劃者 2026-11-04 給）：寬照欄寬（最多 560px）、貼著頂端，底下接圖最底那一截的顏色 */
.lg-layer.lg-main { background: #181818 url("/static/img/legacy/legacy-bg.webp") center top / min(100%, 560px) auto no-repeat; color: #efe4cf; }
.lg-layer.lg-shihai { background: #1c2130 url("/static/img/legacy/shihai-bg.webp") center top / min(100%, 560px) auto no-repeat; color: #dcebf7; }
.lg-layer > * { max-width: 560px; margin-left: auto; margin-right: auto; }
.lg-bar {
  position: sticky; top: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: calc(8px + var(--top, 0px)) 12px 8px; background: rgba(12, 10, 8, 0.82); backdrop-filter: blur(4px);
}
.lg-bar > button { border: 0; background: transparent; color: inherit; font: 600 16px var(--sans, sans-serif); min-height: 44px; padding: 6px 8px; cursor: pointer; }
.lg-bar .seg-lite { display: flex; gap: 4px; padding: 3px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); }
.lg-bar .seg-lite button {
  min-height: 38px; padding: 0 16px; border: 0; border-radius: 999px; background: transparent; color: inherit;
  font: 700 15px "LXGW WenKai TC", serif; letter-spacing: 0.3em; cursor: pointer; opacity: 0.7;
}
.lg-bar .seg-lite button[aria-pressed="true"] { background: #efe4cf; color: #1a140e; opacity: 1; }
.lg-shihai .lg-bar .seg-lite button[aria-pressed="true"] { background: #dcebf7; color: #0b1826; }

@keyframes lg-breathe { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }
@keyframes lg-drift { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes lg-sway { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(-14px); } }
.lg-breathe { animation: lg-breathe 5s ease-in-out infinite; }
.lg-drift { animation: lg-drift 7s ease-in-out infinite; }
.lg-sway { animation: lg-sway 9s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .lg-breathe, .lg-drift, .lg-sway { animation: none; } }

/* ── 傳承頁 ── */
.lg-head { position: relative; height: 210px; }
.lg-title { position: relative; padding: 28px 24px 0; }
.lg-title h2 { margin: 0; font: 700 52px/1 "Noto Serif TC", serif; letter-spacing: 0.16em; color: #2a1f14; }
.lg-title p { margin: 10px 0 0; font-size: 14px; letter-spacing: 0.06em; color: #5a4632; }
.lg-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 0 12px; position: relative; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85), 0 0 10px rgba(0, 0, 0, 0.6); }
.lg-col { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.lg-scroll { width: 88px; height: 251px; overflow: visible; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.45)); }
.lg-ink { mix-blend-mode: multiply; opacity: 0.9; }
.lg-tick { stroke: #5a4632; stroke-opacity: 0.45; stroke-width: 2; stroke-dasharray: 8 8; }
.lg-seal-on { fill: #b8352b; }
.lg-seal-off { fill: rgba(255, 250, 240, 0.7); stroke: #8a7550; stroke-width: 2; }
.lg-seal-t { font-size: 22px; fill: #6b5a42; text-anchor: middle; font-family: "Noto Serif TC", serif; font-weight: 700; }
.lg-seal-t.on { fill: #fff4e4; }
.lg-ink-a-zheng { stop-color: #3b6fa3; } .lg-ink-b-zheng { stop-color: #9cc6ec; }
.lg-ink-a-xie { stop-color: #7a2a1c; } .lg-ink-b-xie { stop-color: #d0743d; }
.lg-ink-a-luck { stop-color: #8a6420; } .lg-ink-b-luck { stop-color: #f0cf78; }
.lg-ink-top { fill: none; stroke-width: 5; opacity: 0.7; }
.lg-ink-top-zheng { stroke: #cfe5f7; } .lg-ink-top-xie { stroke: #f0a070; } .lg-ink-top-luck { stroke: #f6e0a0; }
/* 三項的名字、值、上一季：底下是淡色的山霧，字照舊淺色但壓一圈深色的暈，才看得清（企劃者 2026-11-05「字跟背景顏色相近根本看不清楚」） */
.lg-name, .lg-val, .lg-gain { text-shadow: 0 0 2px #0d0a07, 0 0 6px #0d0a07, 0 1px 10px rgba(13, 10, 7, 0.9); }
.lg-name { font: 700 18px "Noto Serif TC", serif; letter-spacing: 0.24em; }
.lg-c-zheng { color: #9cc6ec; } .lg-c-xie { color: #e08a55; } .lg-c-luck { color: #f0cf78; }
.lg-val { font: 700 32px/1 "Noto Serif TC", serif; color: #f3e6c8; }
.lg-gain { font-size: 14px; font-weight: 700; color: #d8f7df; }
.lg-slips { display: flex; gap: 4px; justify-content: center; margin-top: 6px; }
.lg-slip {
  position: relative; isolation: isolate; overflow: hidden;
  width: 32px; height: 150px; padding: 8px 0; border-radius: 3px; border: 1px dashed #6b5a42; background: #1e1a15; color: #e2d5b8; text-shadow: 0 1px 2px #000;
  font: 400 14px "LXGW WenKai TC", serif; writing-mode: vertical-rl; letter-spacing: 0.12em;
  display: flex; align-items: center; justify-content: space-between; cursor: pointer;
}
/* 竹簡（bamboo-slip.webp）：開了的照原色，沒開的壓暗 */
.lg-slip::before { content: ""; position: absolute; inset: 0; z-index: -1; background: url("/static/img/legacy/bamboo-slip.webp") center / 100% 100%; filter: grayscale(0.7) brightness(0.35); }
.lg-slip.open::before { filter: none; }
.lg-slip.open { border: 1px solid #8a7550; background: #d9c69a; color: #2a1f14; }
.lg-slip.open span { font-weight: 700; }
.lg-slip small { font-size: 12px; letter-spacing: 0; color: #f0c98a; }
.lg-slip.open { text-shadow: none; }
.lg-slip.open small { color: #9a2a20; }
.lg-slip[aria-pressed="true"] { outline: 2px solid #e0b860; outline-offset: 2px; }
.lg-note { min-height: 3.2em; margin: 16px 20px 0; font-size: 15px; line-height: 1.6; text-align: center; color: #e6d8b8; text-shadow: 0 1px 3px #000; }
.lg-note-st { display: block; font-size: 13px; color: #bfae8c; }
.lg-portal {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; width: calc(100% - 40px); min-height: 150px;
  margin: 22px 20px 0; padding: 22px 20px; overflow: hidden; border: 1px solid #3b5a78; border-radius: 16px;
  background: #0c1620; color: #dcebf7; font: inherit; text-align: left; cursor: pointer;
}
.lg-layer > .lg-portal { max-width: 520px; margin-left: auto; margin-right: auto; }
.lg-portal svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.lg-portal span { position: relative; }
.lg-portal-t { font: 700 26px "Noto Serif TC", serif; letter-spacing: 0.24em; }
.lg-portal-s { font-size: 14px; color: #a9c6dd; }
.lg-portal-n { font-size: 14px; color: #e0b860; }
.lg-foot { margin: 18px 24px 0; font-size: 13px; line-height: 1.7; color: #b8a888; }

/* ── 識海頁 ── */
.lg-sea { position: relative; height: 640px; overflow: hidden; }
.lg-sea-title { position: absolute; left: 24px; top: 24px; display: flex; gap: 14px; align-items: flex-start; }
.lg-sea-title h2 { margin: 0; writing-mode: vertical-rl; font: 700 48px/1 "Noto Serif TC", serif; letter-spacing: 0.2em; color: #e6f1fb; }
.lg-sea-title { text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7); }
.lg-sea-title p { margin: 6px 0 0; writing-mode: vertical-rl; font-size: 15px; line-height: 1.8; letter-spacing: 0.24em; color: #d3e6f6; text-shadow: 0 0 3px #0a1220, 0 0 8px #0a1220; }
.lg-orb-wrap { position: absolute; left: 50%; top: 200px; width: 240px; height: 300px; margin-left: -120px; }
.lg-orb-wrap svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.lg-talisman {
  position: absolute; left: 92px; top: 40px; width: 56px; height: 224px; box-sizing: border-box; padding: 16px 0; transform: rotate(14deg);
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  background: url("/static/img/legacy/seal-talisman.webp") center / 100% 100%; filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.5));
}
.lg-talisman span { writing-mode: vertical-rl; font: 700 13px "Noto Serif TC", serif; letter-spacing: 0.2em; color: #5a3f22; }
.lg-talisman b { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border-radius: 4px; background: #b8352b; color: #fff1dc; font: 700 20px "Noto Serif TC", serif; }
.lg-insight { text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8); position: absolute; left: 0; right: 0; top: 520px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.lg-insight small { font-size: 14px; letter-spacing: 0.24em; color: #d3e6f6; text-shadow: 0 0 3px #0a1220, 0 0 8px #0a1220; }
.lg-insight b { font: 700 30px "Noto Serif TC", serif; letter-spacing: 0.24em; color: #f2f8ff; }
.lg-insight.empty { top: 300px; }
.lg-insight.empty b { color: #e6f1fb; text-shadow: 0 0 3px #0a1220, 0 0 10px #0a1220; }
.lg-sea-body { position: relative; padding: 24px 20px 0; margin-top: -24px; display: flex; flex-direction: column; gap: 12px;
  background: linear-gradient(rgba(28, 33, 47, 0), rgba(28, 33, 47, 0.88) 40px, #1c2130 220px); }
.lg-sep span { text-shadow: 0 1px 4px #000; }
.lg-sep { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.lg-sep::before, .lg-sep::after { content: ""; flex: 1; height: 1px; background: #24405c; }
.lg-sep span { font: 700 17px "Noto Serif TC", serif; letter-spacing: 0.3em; color: #a9c6dd; }
.lg-seals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.lg-seal {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 6px; border-radius: 12px;
  border: 1px solid #6a2a22; background: #160e10; text-align: center;
}
.lg-seal i {
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 50%;
  background: #b8352b; color: #fff1dc; font: normal 700 18px "Noto Serif TC", serif;
}
.lg-seal span { font-size: 14px; color: #dcebf7; }
.lg-seal small { font-size: 12px; color: #e3b1a3; }
.lg-seal.broken { border-color: #2f5d8a; background: #0e2236; }
.lg-seal.broken i { background: transparent; border: 1px dashed #7fb4e0; color: #dcebf7; text-decoration: line-through; text-decoration-color: #7fb4e0; }
.lg-seal.broken small { color: #8fc79f; letter-spacing: 0.2em; }
.lg-break {
  min-height: 52px; border-radius: 26px; border: 1px solid #7fb4e0; background: #1d4a73; color: #f2f8ff;
  font: 700 18px "Noto Serif TC", serif; letter-spacing: 0.3em; cursor: pointer;
}
.lg-break:disabled { border-color: #3d6c99; background: #0e2236; color: #a9c1d6; cursor: default; }
.lg-hint { margin: 0; font-size: 13px; line-height: 1.6; color: #bcd0e2; text-align: center; }
.lg-warn { margin: 0; font-size: 14px; line-height: 1.6; color: #f0b89f; }
.lg-rename p { margin: 0 0 8px; font-size: 14px; line-height: 1.6; color: #dcebf7; }
.lg-rename .row { display: flex; flex-wrap: wrap; gap: 8px; }
.lg-btn {
  min-height: 44px; padding: 0 16px; border-radius: 22px; border: 1px solid #3b5a78; background: transparent; color: #cfe2f2;
  font: 400 15px "LXGW WenKai TC", serif; cursor: pointer;
}
.lg-keep {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px;
  border: 1px solid #1c3248; border-radius: 12px; background: #0b1826;
}
.lg-keep div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lg-keep b { font: 700 20px "Noto Serif TC", serif; letter-spacing: 0.12em; color: #f2f8ff; }
.lg-keep small { font-size: 12px; color: #8fb2cf; }
.lg-skip { align-self: center; min-width: 160px; }
.lg-sea.bare { height: 400px; } /* 沒封著東西（開季挑候選時）：海面收矮，候選在第一屏 */
.lg-sea.bare .lg-insight.empty { top: 300px; }
.lg-sea.bare + .lg-sea-body { min-height: 520px; box-sizing: border-box; } /* 蓋過背景圖下半的浪：候選底下不再露出一截浪 */
