/* ── Design Tokens ── v2 */
:root {
  --bg:          #1C1712;
  --bgLight:     #252019;
  --bgCard:      #2A231C;
  --border:      #3D3228;
  --borderLight: #4E4236;
  --parchment:   #E8DCC8;
  --textBody:    #BFB09A;
  --textMuted:   #8A7D6B;
  --copper:      #C4956A;
  --gold:        #D4A843;
  --stranger:    #9B8EC4;
  --wood:        #8B6F5C;
  --woodLight:   #A0886E;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Noto Sans TC', sans-serif;
  background: var(--bg);
  color: var(--parchment);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Nav Bar ── */
#nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 60px;
  background: var(--bgCard);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 0;
  z-index: 100;
}
#nav .nav-brand {
  color: var(--gold);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(212,168,67,0.3);
  margin-right: 16px;
  white-space: nowrap;
}
#font-controls {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 12px;
  padding-left: 12px;
  border-left: 1px solid var(--border);
}
.font-btn {
  background: transparent;
  border: 1px solid var(--borderLight);
  color: var(--textBody);
  cursor: pointer;
  font-family: inherit;
  font-size: 17px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 4px;
  transition: all 0.2s;
  line-height: 1;
  letter-spacing: 0.5px;
}
.font-btn:hover { border-color: var(--gold); color: var(--gold); background: rgba(212,168,67,0.08); }
.font-btn.active { border-color: var(--gold); color: var(--gold); background: rgba(212,168,67,0.1); }
#nav .nav-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--textBody);
  padding: 8px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 19px;
  font-family: inherit;
  letter-spacing: 1px;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-block;
}
#nav .nav-btn:hover {
  border-color: var(--borderLight);
  color: var(--gold);
}
#nav .nav-btn.active {
  background: rgba(212,168,67,0.12);
  border-color: var(--gold);
  color: var(--gold);
  font-weight: 700;
  box-shadow: 0 0 8px rgba(212,168,67,0.2);
}
#nav a.nav-btn {
  text-decoration: none;
}

/* ── Pages ── */
.page { display: none; padding: 72px 24px 120px; min-height: 100vh; }
.page.active { display: block; }

/* ── Village Decorative Title ── */
.village-title {
  text-align: center;
  margin-bottom: 40px;
}
.village-title-box {
  display: inline-block;
  padding: 14px 40px;
  border: 2px solid var(--gold);
  border-radius: 4px;
  position: relative;
}
.village-title-box::before,
.village-title-box::after {
  content: '◆';
  position: absolute;
  color: var(--gold);
  font-size: 14px;
  top: -7px;
}
.village-title-box::before { left: 8px; }
.village-title-box::after  { right: 8px; }
.village-title h1 {
  color: var(--gold);
  font-size: 26px;
  letter-spacing: 3px;
  text-shadow: 0 0 12px rgba(212,168,67,0.3);
}
.village-title .subtitle {
  color: var(--textMuted);
  font-size: 16px;
  letter-spacing: 2px;
  margin-top: 6px;
}
.divider {
  text-align: center;
  color: var(--textMuted);
  font-size: 16px;
  letter-spacing: 4px;
  margin: 24px 0;
}

/* ── P1 Hero Banner ── */
.hero-banner {
  max-width: 960px;
  margin: 0 auto 40px;
  text-align: center;
}
.banner-title {
  margin-bottom: 56px;
}
.banner-title h1 {
  font-size: 42px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 6px;
  text-shadow: 0 0 20px rgba(212,168,67,0.35), 0 0 60px rgba(212,168,67,0.1);
  margin-bottom: 8px;
}
.banner-title .en-title {
  font-size: 15px;
  color: var(--textMuted);
  letter-spacing: 4px;
  text-transform: uppercase;
}
.banner-title .ornament {
  color: var(--gold);
  font-size: 13px;
  letter-spacing: 8px;
  margin-top: 12px;
  opacity: 0.5;
}
.avatar-row {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.avatar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0;
}
.avatar-frame {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 2.5px solid var(--gold);
  padding: 3px;
  background: linear-gradient(135deg, rgba(212,168,67,0.15), rgba(196,149,106,0.08));
  box-shadow: 0 0 16px rgba(212,168,67,0.15), inset 0 0 8px rgba(212,168,67,0.05);
  transition: transform 0.3s, box-shadow 0.3s;
}
.avatar-frame:hover {
  transform: scale(1.1);
  box-shadow: 0 0 28px rgba(212,168,67,0.35), inset 0 0 12px rgba(212,168,67,0.1);
}
.avatar-frame img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.avatar-name {
  margin-top: 10px;
  font-size: 14px;
  color: var(--parchment);
  font-weight: 500;
  letter-spacing: 1px;
}
.banner-footer {
  margin-top: 8px;
  font-size: 22px;
  color: var(--textMuted);
  letter-spacing: 1px;
  opacity: 0;
}
.banner-footer em {
  font-style: normal;
  color: var(--copper);
}
@keyframes bannerFadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes bannerFadeIn {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes bannerFadeInSoft {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.avatar-row .avatar-item:nth-child(1) { animation: bannerFadeIn 0.4s ease-out 0.20s forwards; }
.avatar-row .avatar-item:nth-child(2) { animation: bannerFadeIn 0.4s ease-out 0.32s forwards; }
.avatar-row .avatar-item:nth-child(3) { animation: bannerFadeIn 0.4s ease-out 0.44s forwards; }
.avatar-row .avatar-item:nth-child(4) { animation: bannerFadeIn 0.4s ease-out 0.56s forwards; }
.avatar-row .avatar-item:nth-child(5) { animation: bannerFadeIn 0.4s ease-out 0.68s forwards; }
.avatar-row .avatar-item:nth-child(6) { animation: bannerFadeIn 0.4s ease-out 0.80s forwards; }
.avatar-row .avatar-item:nth-child(7) { animation: bannerFadeIn 0.4s ease-out 0.92s forwards; }
.banner-footer { animation: bannerFadeInSoft 0.6s ease-out 1.30s forwards; }
@media (max-width: 640px) {
  .banner-title h1 { font-size: 32px; letter-spacing: 4px; }
  .avatar-row { gap: 14px; }
  .avatar-frame { width: 64px; height: 64px; }
  .avatar-name { font-size: 12px; }
}

/* ── P1 Welcome ── */
.welcome-body {
  max-width: 860px;
  margin: 0 auto;
  text-align: center;
}
.welcome-desc {
  color: var(--textBody);
  font-size: 20px;
  line-height: 2;
  margin-bottom: 32px;
}
.welcome-cards {
  display: flex;
  gap: 16px;
  margin-bottom: 40px;
  flex-wrap: wrap;
  justify-content: center;
}
.welcome-card {
  background: var(--bgCard);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 20px 24px;
  flex: 1;
  min-width: 160px;
  max-width: 180px;
  text-align: center;
}
.welcome-card .icon { font-size: 28px; margin-bottom: 10px; }
.welcome-card .label { color: var(--gold); font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.welcome-card .desc { color: var(--textBody); font-size: 17px; line-height: 1.7; }
.cta-btn {
  display: inline-block;
  padding: 12px 40px;
  border: 2px solid var(--gold);
  color: var(--gold);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 2px;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  background: transparent;
  transition: all 0.2s;
  text-decoration: none;
}
.cta-btn:hover {
  background: var(--gold);
  color: var(--bg);
}

/* ── P2 Chat ── */
.chat-wrap { max-width: 680px; margin: 0 auto; }

/* 入場三問 */
.onboarding {
  background: var(--bgCard);
  border: 1px solid var(--borderLight);
  border-radius: 6px;
  padding: 28px 32px;
  margin-bottom: 32px;
}
.onboarding h2 {
  color: var(--gold);
  font-size: 19px;
  letter-spacing: 1px;
  margin-bottom: 20px;
  text-align: center;
}
.q-item { margin-bottom: 20px; }
.q-label {
  color: var(--textBody);
  font-size: 18px;
  margin-bottom: 8px;
  display: block;
}
.q-input {
  width: 100%;
  background: var(--bgLight);
  border: 1px solid var(--border);
  color: var(--parchment);
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 18px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
.q-input:focus { border-color: var(--gold); }
.q-options {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.q-opt {
  padding: 7px 16px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--textBody);
  font-size: 18px;
  cursor: pointer;
  font-family: inherit;
  background: transparent;
  transition: all 0.2s;
}
.q-opt.selected, .q-opt:hover {
  border-color: var(--gold);
  color: var(--gold);
}
.q-hint { color: var(--textBody); font-size: 17px; margin-top: 6px; }
.enter-btn {
  display: block;
  width: 100%;
  padding: 10px;
  margin-top: 24px;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-size: 18px;
  font-family: inherit;
  background: transparent;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}
.enter-btn:hover { background: var(--gold); color: var(--bg); }

/* Chat Interface */
.chat-stage {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}
.bubble-wrap { display: flex; }
.bubble-wrap.left  { justify-content: flex-start; }
.bubble-wrap.right { justify-content: flex-end; }
.bubble {
  max-width: 72%;
  background: linear-gradient(135deg, var(--bgCard), var(--bgLight));
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.bubble.ai { border-left: 3px solid var(--gold); }
.bubble.user { border-right: 3px solid var(--copper); background: rgba(196,149,106,0.06); }
.bubble .spk {
  font-size: 16px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 6px;
}
.bubble.user .spk { color: var(--copper); text-align: right; }
.bubble .txt { font-size: 18px; line-height: 1.8; color: var(--parchment); }
.chat-input-row {
  display: flex;
  gap: 8px;
}
.chat-input {
  flex: 1;
  background: var(--bgCard);
  border: 1px solid var(--border);
  color: var(--parchment);
  padding: 10px 14px;
  border-radius: 4px;
  font-size: 18px;
  font-family: inherit;
  outline: none;
}
.chat-input:focus { border-color: var(--gold); }
.chat-send {
  padding: 10px 20px;
  border: 1px solid var(--gold);
  color: var(--gold);
  background: transparent;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  font-size: 18px;
  transition: all 0.2s;
}
.chat-send:hover { background: var(--gold); color: var(--bg); }

/* ── 頭像對話泡泡系統 ── */
.msg-row {
  display: flex;
  gap: 12px;
  padding: 4px 0;
  opacity: 0;
  transform: translateY(10px);
  animation: msgSlide 0.35s cubic-bezier(0.34,1.56,0.64,1) forwards;
}
@keyframes msgSlide { to { opacity: 1; transform: translateY(0); } }
.msg-row-user { flex-direction: row-reverse; }
.msg-av {
  width: 60px; height: 60px;
  border-radius: 6px;
  border: 2px solid var(--borderLight);
  overflow: hidden;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 700;
  background: var(--bgCard);
  color: var(--gold);
}
.msg-av img { width: 100%; height: 100%; object-fit: cover; }
.msg-av-user { color: var(--copper); border-color: var(--copper); }
.msg-speech {
  background: linear-gradient(135deg, var(--bgCard) 0%, var(--bgLight) 100%);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 10px 14px;
  max-width: calc(100% - 64px);
}
.msg-speech-host    { border-left: 3px solid var(--copper); }
.msg-speech-villager { border-left: 3px solid var(--gold); }
.msg-speech-guest   { border-left: 3px solid #7ab87a; }
.msg-speech-user    { border-right: 3px solid var(--copper); border-left: none; }
.msg-spk {
  font-size: 15px; font-weight: 700; color: var(--gold);
  margin-bottom: 5px;
}
.msg-speech-user .msg-spk { color: var(--copper); text-align: right; }
.msg-txt { font-size: 18px; line-height: 1.8; color: var(--parchment); }

/* ── 圖片佔位槽 ── */
.img-slot {
  width: 100%;
  height: 210px;
  background: var(--bgCard);
  border: 1px dashed rgba(160,136,110,0.3);
  border-radius: 6px;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  color: var(--textMuted);
  overflow: hidden;
  flex-shrink: 0;
}
.img-slot img { width: 100%; height: 100%; object-fit: cover; display: none; }
.img-slot img.img-loaded { display: block; }
.img-slot-hint { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.img-slot-hint .slot-icon { font-size: 40px; }
.img-slot-hint .slot-label { font-size: 15px; letter-spacing: 2px; color: var(--textMuted); }

/* ── 歷史卡縮圖 ── */
.hc-thumb {
  width: 100%;
  height: 88px;
  background: var(--bgLight);
  border-radius: 3px;
  margin-bottom: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--textMuted);
  font-size: 24px;
  border: 1px dashed rgba(160,136,110,0.2);
}
.hc-thumb img { width: 100%; height: 100%; object-fit: cover; display: none; }
.hc-thumb img.img-loaded { display: block; }

/* ── P3 History ── */
.history-wrap { max-width: 860px; margin: 0 auto; }
.history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.history-card {
  background: var(--bgCard);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 20px;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.history-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(212,168,67,0.15), 0 0 0 1px rgba(212,168,67,0.2);
}
.hc-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.hc-date { color: var(--textMuted); font-size: 15px; }
.hc-type {
  font-size: 14px;
  padding: 2px 8px;
  border-radius: 3px;
  border: 1px solid;
}
.hc-type.hybrid { border-color: var(--gold); color: var(--gold); }
.hc-type.ai-only { border-color: var(--stranger); color: var(--stranger); }
.hc-title {
  color: var(--parchment);
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.4;
}
.hc-summary {
  color: var(--textBody);
  font-size: 17px;
  line-height: 1.6;
  margin-bottom: 12px;
}
.hc-participants {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.hc-tag {
  font-size: 15px;
  padding: 2px 6px;
  background: var(--bgLight);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--textMuted);
}

/* ── P3-1 Single ── */
.single-wrap { max-width: 700px; margin: 0 auto; }
.back-btn {
  background: transparent;
  border: none;
  color: var(--textMuted);
  font-size: 17px;
  cursor: pointer;
  font-family: inherit;
  margin-bottom: 24px;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
}
.back-btn:hover { color: var(--gold); }
.single-meta-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 28px;
  font-size: 17px;
}
.single-meta-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--textBody);
}
.single-meta-table td:first-child {
  color: var(--textMuted);
  width: 80px;
  white-space: nowrap;
}
.meta-link-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.profile-link {
  appearance: none;
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  color: var(--gold);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.profile-link:hover { color: var(--parchment); }
.profile-chip {
  padding: 6px 10px;
  border: 1px solid rgba(212,168,67,0.26);
  border-radius: 999px;
  background: rgba(212,168,67,0.08);
  font-size: 17px;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}
.profile-inline {
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  line-height: inherit;
  text-underline-offset: 2px;
}
.speaker-avatar-btn {
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  flex-shrink: 0;
}
.profile-highlight {
  box-shadow: 0 0 0 2px rgba(212,168,67,0.38), 0 0 30px rgba(212,168,67,0.12);
  transition: box-shadow 0.25s ease;
}
.single-summary-box {
  border-left: 3px solid var(--gold);
  padding: 12px 16px;
  background: rgba(212,168,67,0.05);
  margin-bottom: 28px;
  color: var(--parchment);
  font-size: 18px;
  line-height: 1.8;
}
.section-title {
  color: var(--gold);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 16px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.dialog-block { margin-bottom: 34px; }
/* ── 章節標題：全視窗出血橫幅 ── */
.dialog-block h3 {
  display: block;
  width: 100vw;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  color: var(--parchment);
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 2px;
  margin-top: 0;
  margin-bottom: 28px;
  padding: 28px 32px;
  background: linear-gradient(135deg, rgba(60,45,32,0.98) 0%, rgba(82,63,47,0.98) 50%, rgba(60,45,32,0.98) 100%);
  border-top: 2px solid rgba(212,168,67,0.45);
  border-bottom: 2px solid rgba(212,168,67,0.45);
  border-left: none;
  border-right: none;
  border-radius: 0;
  box-shadow: 0 6px 24px rgba(0,0,0,0.35);
}
.dialog-block h3::before,
.dialog-block h3::after {
  content: '';
  display: block;
  width: 48px;
  height: 1px;
  background: rgba(212,168,67,0.5);
  margin: 0 auto;
  position: static;
}
.dialog-block h3::before { margin-bottom: 12px; }
.dialog-block h3::after { margin-top: 12px; }
.dialog-topic-index {
  display: block;
  margin-bottom: 6px;
  color: var(--gold);
  font-size: 15px;
  letter-spacing: 3px;
  text-transform: uppercase;
}
/* ── 本段重點：卡片樣式 ── */
.highlight-card {
  display: flex;
  gap: 16px;
  background: linear-gradient(180deg, rgba(74,57,42,0.98) 0%, rgba(58,44,33,0.98) 100%);
  border: 1px solid rgba(212,168,67,0.28);
  border-left: 4px solid var(--gold);
  border-radius: 12px;
  padding: 22px 24px;
  margin: 20px 0 28px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}
.highlight-card .card-avatar {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  flex-shrink: 0;
  overflow: hidden;
  border: 2px solid rgba(212,168,67,0.3);
  background: var(--bgLight);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  align-self: flex-start;
}
.highlight-card .card-avatar img { width: 100%; height: 100%; object-fit: cover; }
.highlight-card .card-body { flex: 1; }
.highlight-card .card-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--gold);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 2px;
}
.highlight-card .card-label::before {
  content: '✦';
  color: var(--copper);
  font-size: 14px;
}
.highlight-card .card-quote {
  color: var(--parchment);
  font-size: 21px;
  line-height: 1.9;
}
.highlight-card .card-quote p { margin-bottom: 10px; }
.highlight-card .card-quote p:last-child { margin-bottom: 0; }
.highlight-card .card-speaker {
  font-size: 16px;
  color: var(--textMuted);
  margin-top: 12px;
  text-align: right;
  letter-spacing: 1px;
}
/* ── 結構化摘要 ── */
.summary-structured { color: var(--textBody); }
.summary-intro-text {
  font-size: 19px;
  line-height: 1.9;
  margin-bottom: 20px;
  color: var(--textBody);
}
.summary-topic-block {
  background: rgba(42,35,28,0.8);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 12px;
}
.summary-topic-block h4 {
  color: var(--parchment);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 10px;
}
.summary-topic-block ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.summary-topic-block ul li {
  color: var(--textBody);
  font-size: 17px;
  line-height: 1.7;
  padding-left: 16px;
  position: relative;
}
.summary-topic-block ul li::before {
  content: '✦';
  position: absolute;
  left: 0;
  color: var(--gold);
  font-size: 13px;
  top: 4px;
}
/* ── 歷史紀錄 quote bubble ── */
.quote-row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin: 14px 0;
  max-width: 88%;
}
.quote-row.right {
  margin-left: auto;
  flex-direction: row-reverse;
}
.q-av {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(212,168,67,0.22);
  background: var(--bgLight);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.24);
}
.q-av img { width: 100%; height: 100%; object-fit: cover; }
.q-bubble {
  background: linear-gradient(180deg, rgba(58,44,32,0.96) 0%, rgba(48,37,29,0.96) 100%);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: 10px;
  padding: 14px 18px;
  flex: 1;
  box-shadow: 0 8px 18px rgba(0,0,0,0.18);
}
.quote-row.right .q-bubble {
  border-left: 1px solid var(--border);
  border-right: 3px solid var(--copper);
  background: linear-gradient(180deg, rgba(70,53,39,0.96) 0%, rgba(56,43,33,0.96) 100%);
}
.q-spk {
  color: var(--gold);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 8px;
}
.quote-row.right .q-spk {
  color: var(--copper);
  text-align: right;
}
.quote-row.center {
  max-width: 94%;
  margin-left: auto;
  margin-right: auto;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.quote-row.center .q-av {
  border: 2px solid var(--gold);
}
.quote-row.center .q-bubble {
  border-left: 1px solid var(--border);
  border-top: 3px solid var(--gold);
  text-align: center;
  width: 100%;
}
.quote-row.center .q-spk {
  color: var(--gold);
  text-align: center;
}
.q-text {
  color: var(--parchment);
  font-size: 22px;
  line-height: 1.9;
}
.quote-row.recap {
  max-width: 100%;
  margin: 18px 0;
  align-items: stretch;
}
.quote-row.recap .q-av {
  width: 72px;
  height: 72px;
  border-radius: 12px;
}
.quote-row.recap .q-bubble {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 72px;
}
.recap-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--gold);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.recap-label::before {
  content: '✦';
  color: var(--copper);
  font-size: 15px;
}
.dialog-recap-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 10px 86px;
  color: var(--gold);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.dialog-recap-label::before {
  content: '✦';
  font-size: 15px;
  color: var(--copper);
}
.dialog-recap {
  margin-left: 86px;
  background: linear-gradient(180deg, rgba(74,57,42,0.98) 0%, rgba(62,48,37,0.98) 100%);
  border: 1px solid rgba(212,168,67,0.28);
  border-left: 5px solid var(--gold);
  border-radius: 12px;
  padding: 22px 26px;
  color: var(--textBody);
  font-size: 21px;
  line-height: 1.95;
  box-shadow: 0 10px 24px rgba(0,0,0,0.2);
}
/* 保留舊 quote-block 給全域 quotes 區 */
.quote-block {
  border-left: 2px solid var(--gold);
  padding: 8px 14px;
  background: rgba(212,168,67,0.05);
  color: var(--parchment);
  font-size: 18px;
  line-height: 1.7;
  margin: 10px 0;
}
.quotes-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 28px; }
.gains-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.gains-list li {
  color: var(--textBody);
  font-size: 18px;
  line-height: 1.7;
  padding-left: 16px;
  position: relative;
}
.gains-list li::before {
  content: '✦';
  position: absolute;
  left: 0;
  color: var(--gold);
  font-size: 14px;
  top: 4px;
}

/* ── P4 About ── */
.about-wrap { max-width: 860px; margin: 0 auto; }
.about-block {
  background: var(--bgCard);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 24px;
  margin-bottom: 16px;
}
.about-block h2 {
  color: var(--gold);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 14px;
  letter-spacing: 1px;
}
.about-block p {
  color: var(--textBody);
  font-size: 18px;
  line-height: 1.8;
  margin-bottom: 10px;
}
.about-block p:last-child { margin-bottom: 0; }
.tech-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 17px;
}
.tech-row:last-child { border-bottom: none; }
.tech-row .key { color: var(--textMuted); }
.tech-row .val { color: var(--parchment); }
.github-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border: 1px solid var(--borderLight);
  color: var(--textBody);
  border-radius: 4px;
  font-size: 17px;
  font-family: inherit;
  background: transparent;
  cursor: pointer;
  margin-top: 8px;
  transition: all 0.2s;
}
.github-btn:hover { border-color: var(--gold); color: var(--gold); }

/* ── P-Village 村民介紹 ── */
.village-intro-wrap { max-width: 860px; margin: 0 auto; }

/* 角色介紹面板 */
.profile-header {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 24px;
}
.profile-avatar {
  width: 200px; height: 200px; border-radius: 8px;
  overflow: hidden; flex-shrink: 0;
  border: 2px solid var(--gold);
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-meta { flex: 1; }
.profile-badge {
  font-size: 15px; color: var(--textMuted);
  margin-bottom: 4px;
}
.profile-name {
  font-size: 26px; font-weight: 700;
  color: var(--parchment); margin-bottom: 6px;
}
.profile-tagline {
  font-size: 17px; color: var(--gold);
  line-height: 1.5; margin-bottom: 8px;
}
.profile-greeting {
  font-size: 17px; color: var(--textMuted);
  font-style: italic; line-height: 1.6;
  padding: 10px 14px;
  border-left: 2px solid var(--border);
  margin-bottom: 20px;
}
.profile-body {
  font-size: 18px; color: var(--textBody);
  line-height: 1.8;
}
.profile-body p { margin-bottom: 12px; }
.profile-quote {
  margin-top: 20px; padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: 6px; background: var(--bgLight);
}
.profile-quote .pq-text {
  font-size: 18px; color: var(--parchment);
  line-height: 1.7; font-style: italic;
}

/* 村長區塊 */
.chief-block {
  display: flex;
  gap: 32px;
  align-items: flex-start;
  background: var(--bgCard);
  border: 1px solid var(--borderLight);
  border-top: 3px solid var(--gold);
  border-radius: 6px;
  padding: 32px;
  margin-bottom: 40px;
}
.chief-avatar {
  width: 150px; height: 150px;
  border-radius: 6px;
  background: var(--bgLight);
  border: 2px solid var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-size: 52px;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 0 20px rgba(212,168,67,0.15);
}
.chief-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; }
.chief-info { flex: 1; }
.chief-badge {
  display: inline-block;
  font-size: 15px;
  padding: 2px 10px;
  border: 1px solid var(--gold);
  color: var(--gold);
  border-radius: 3px;
  letter-spacing: 1px;
  margin-bottom: 10px;
}
.chief-name {
  color: var(--parchment);
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 14px;
  letter-spacing: 1px;
}
.chief-bio {
  color: var(--textBody);
  font-size: 18px;
  line-height: 2;
}
.village-desc {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--textMuted);
  font-size: 17px;
  line-height: 1.9;
}

/* 客座講師區塊 */
.section-header {
  color: var(--gold);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 2px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.guest-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 40px;
}
.guest-block {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  background: var(--bgCard);
  border: 1px solid var(--border);
  border-left: 3px solid var(--copper);
  border-radius: 6px;
  padding: 20px 24px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.guest-block:hover {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px rgba(212,168,67,0.2);
}
.guest-avatar {
  width: 150px; height: 150px;
  border-radius: 6px;
  background: var(--bgLight);
  border: 1px solid var(--copper);
  display: flex; align-items: center; justify-content: center;
  font-size: 34px;
  flex-shrink: 0;
  overflow: hidden;
}
.guest-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 5px; display: block; }
.guest-info { flex: 1; }
.guest-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.guest-badge {
  display: inline-block;
  font-size: 14px;
  padding: 2px 8px;
  border: 1px solid var(--copper);
  color: var(--copper);
  border-radius: 3px;
  letter-spacing: 1px;
}
.guest-skill-pill {
  display: inline-block;
  font-size: 14px;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(212,168,67,0.12);
  border: 1px solid rgba(212,168,67,0.28);
  color: var(--gold);
  letter-spacing: 0.5px;
}
.guest-name {
  color: var(--parchment);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}
.guest-bio {
  color: var(--textBody);
  font-size: 17px;
  line-height: 1.9;
}

/* 村民列表 */
.villager-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 40px;
}
.villager-card {
  background: var(--bgCard);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px 18px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  transition: border-color 0.2s, box-shadow 0.2s;
  cursor: pointer;
}
.villager-card:hover {
  border-color: var(--copper);
  box-shadow: 0 0 0 1px rgba(196,149,106,0.2);
}
.villager-avatar {
  width: 120px; height: 120px;
  border-radius: 4px;
  background: var(--bgLight);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  overflow: hidden;
}
.villager-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 3px; display: block; }
.villager-info { flex: 1; min-width: 0; }
.villager-id { color: var(--textMuted); font-size: 14px; margin-bottom: 3px; }
.villager-name { color: var(--parchment); font-size: 18px; font-weight: 700; margin-bottom: 5px; }
.villager-bio { color: var(--textBody); font-size: 16px; line-height: 1.7; }

/* ── Village Scene ── */
.village-scene {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 90px;
  pointer-events: none;
  z-index: 200;
  overflow: hidden;
}
.grass {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 24px;
  background: #3D5A28;
}
.grass-top {
  position: absolute;
  bottom: 24px; left: 0; right: 0;
  height: 4px;
  background: #4A6B30;
}
.v-star {
  position: absolute;
  width: 2px; height: 2px;
  background: #FFD700;
  border-radius: 50%;
}
@keyframes twinkle {
  0%, 100% { opacity: 0.2; }
  50%       { opacity: 1; }
}
@media (max-width: 720px) {
  .dialog-block h3 {
    font-size: 20px;
    padding: 20px 14px;
  }
  .meta-link-list { gap: 6px; }
  .profile-chip {
    font-size: 16px;
    padding: 5px 8px;
  }
  .dialog-block h3::before,
  .dialog-block h3::after {
    width: 32px;
  }
  .dialog-topic-index {
    font-size: 14px;
    letter-spacing: 2px;
  }
  .highlight-card {
    flex-direction: row;
    gap: 12px;
    padding: 16px 18px;
  }
  .highlight-card .card-avatar {
    width: 44px;
    height: 44px;
  }
  .highlight-card .card-quote {
    font-size: 19px;
  }
  .summary-topic-block {
    padding: 14px 16px;
  }
  .quote-row { max-width: 100%; gap: 10px; }
  .q-av {
    width: 52px;
    height: 52px;
    font-size: 22px;
  }
  .quote-row.recap .q-av {
    width: 52px;
    height: 52px;
    border-radius: 10px;
  }
  .q-bubble { padding: 12px 14px; }
  .q-text {
    font-size: 20px;
    line-height: 1.8;
  }
  .dialog-recap-label,
  .dialog-recap {
    margin-left: 0;
  }
  .dialog-recap {
    padding: 18px 18px;
    font-size: 20px;
    line-height: 1.85;
  }
}

/* ── P1 Feature Cards ── */
.feature-cards { max-width: 860px; margin: 0 auto 32px; display: flex; flex-direction: column; gap: 20px; }
.feature-card {
  background: var(--bgCard);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 28px 32px;
  text-align: left;
}
.feature-card .fc-title {
  color: var(--gold);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 14px;
}
.feature-card .fc-desc {
  color: var(--textBody);
  font-size: 18px;
  line-height: 1.9;
  margin-bottom: 18px;
}
.feature-card .fc-btn {
  display: inline-block;
  padding: 7px 22px;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-size: 17px;
  font-family: inherit;
  background: transparent;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}
.feature-card .fc-btn:hover { background: var(--gold); color: var(--bg); }

/* ── Activity Section (Homepage) ── */
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
.upcoming-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  padding: 2px 10px;
  border-radius: 20px;
  border: 1px solid var(--copper);
  color: var(--copper);
  background: rgba(196,149,106,0.08);
}
.upcoming-badge::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--copper);
  animation: pulse-dot 1.6s ease-in-out infinite;
}
.activity-section {
  max-width: 520px;
  margin: 56px auto 28px;
}
.activity-event-card {
  display: block;
  background: linear-gradient(135deg, var(--bgCard) 0%, rgba(196,149,106,0.06) 100%);
  border: 1.5px solid var(--copper);
  border-radius: 44px;
  padding: 18px 28px;
  text-decoration: none;
  box-shadow: 0 2px 12px rgba(196,149,106,0.1);
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.activity-event-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212,168,67,0.18), 0 0 0 1px rgba(212,168,67,0.2);
}
.ae-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.ae-label {
  color: var(--parchment);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 2px;
  flex: 0 0 auto;
}
.ae-arrow {
  margin-left: auto;
  color: var(--copper);
  font-size: 18px;
  transition: transform 0.2s;
}
.activity-event-card:hover .ae-arrow {
  transform: translateX(3px);
}
.ae-body {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.ae-info {
  text-align: left;
}
.ae-avatar-square {
  width: 64px;
  height: 64px;
  border-radius: 4px;
  overflow: hidden;
  border: 2px solid var(--border);
  flex: 0 0 auto;
}
.ae-avatar-square img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ae-info {
  min-width: 0;
}
.ae-title {
  color: var(--parchment);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
  line-height: 1.4;
}
.ae-subtitle {
  color: var(--textMuted);
  font-size: 14px;
}

/* ── Upcoming Event Section (Dialogues page) ── */
.upcoming-section {
  margin-bottom: 36px;
}
.upcoming-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.upcoming-section-label {
  color: var(--parchment);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 2px;
}
.upcoming-event-card {
  background: var(--bgCard);
  border: 1px solid var(--border);
  border-top: 3px solid var(--copper);
  border-radius: 6px;
  padding: 28px 32px;
}
.ue-header-center {
  text-align: center;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.ue-title {
  color: var(--parchment);
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 12px;
  line-height: 1.4;
}
.ue-lead-quote {
  color: var(--copper);
  font-size: 17px;
  line-height: 1.7;
  font-style: italic;
  max-width: 620px;
  margin: 0 auto;
}
.ue-guest-group {
  margin-bottom: 24px;
}
.ue-guest-group:last-of-type {
  margin-bottom: 32px;
}
.ue-group-label {
  text-align: center;
  color: var(--gold);
  font-size: 14px;
  letter-spacing: 3px;
  margin-bottom: 14px;
}
.ue-avatar-row {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}
.ue-avatar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  min-width: 90px;
  transition: transform 0.2s;
}
.ue-avatar-item:hover {
  transform: translateY(-3px);
}
.ue-avatar-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--border);
  margin-bottom: 8px;
  transition: border-color 0.2s;
}
.ue-avatar-item:hover .ue-avatar-circle {
  border-color: var(--gold);
}
.ue-avatar-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ue-avatar-name {
  color: var(--parchment);
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 2px;
}
.ue-avatar-role {
  color: var(--textMuted);
  font-size: 12px;
  letter-spacing: 0.5px;
}
.ue-section {
  margin-bottom: 24px;
}
.ue-section:last-child {
  margin-bottom: 0;
}
.ue-section-title {
  color: var(--gold);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.ue-text {
  color: var(--textBody);
  font-size: 17px;
  line-height: 1.85;
  margin-bottom: 12px;
}
.ue-text:last-child {
  margin-bottom: 0;
}
.ue-person {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 24px;
}
.ue-person:last-child {
  margin-bottom: 0;
}
.ue-person-avatar {
  flex: 0 0 100px;
  width: 100px;
  height: 100px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid var(--border);
  display: block;
  transition: border-color 0.2s, transform 0.2s;
}
.ue-person-avatar:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}
.ue-person-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ue-person-body {
  flex: 1;
  min-width: 0;
}
.ue-person-name {
  color: var(--parchment);
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 10px;
}
.ue-quote {
  color: var(--copper);
  font-size: 16px;
  line-height: 1.7;
  border-left: 3px solid var(--copper);
  padding: 6px 14px;
  margin: 12px 0 0;
  background: rgba(196,149,106,0.05);
  font-style: italic;
}
.ue-hint {
  color: var(--textBody);
  font-size: 16px;
  line-height: 1.8;
  margin-bottom: 10px;
}
.ue-hint-strong {
  color: var(--gold);
  font-weight: 700;
  font-size: 17px;
  margin-top: 14px;
}
.upcoming-divider {
  text-align: center;
  color: var(--textMuted);
  font-size: 15px;
  margin: 36px 0 24px;
  letter-spacing: 4px;
}

.skill-teaser {
  max-width: 860px;
  margin: 0 auto;
  border-left: 3px solid var(--borderLight);
  padding: 12px 18px;
  color: var(--textMuted);
  font-size: 17px;
  line-height: 1.8;
}
/* ── Video Slot ── */
.video-slot {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--bgLight);
  border: 1px dashed rgba(160,136,110,0.3);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  color: var(--textMuted);
  font-size: 15px;
  letter-spacing: 1px;
  margin: 16px 0;
}
/* ── Enter Section ── */
.enter-section {
  background: var(--bgCard);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 28px 32px;
  margin-bottom: 20px;
}
.enter-section h2 {
  color: var(--gold);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 14px;
}
.enter-section p {
  color: var(--textBody);
  font-size: 18px;
  line-height: 1.9;
  margin-bottom: 12px;
}
.enter-section p:last-child { margin-bottom: 0; }
.skill-card {
  background: var(--bgLight);
  border: 1px solid var(--border);
  border-left: 3px solid var(--copper);
  border-radius: 6px;
  padding: 16px 20px;
  margin: 16px 0;
}
.skill-card .sk-name {
  color: var(--parchment);
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 6px;
}
.skill-card .sk-desc {
  color: var(--textBody);
  font-size: 17px;
  line-height: 1.7;
  margin-bottom: 10px;
}
.dl-link {
  display: inline-block;
  padding: 6px 18px;
  border: 1px solid var(--borderLight);
  color: var(--textBody);
  font-size: 16px;
  font-family: inherit;
  background: transparent;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}
.dl-link:hover { border-color: var(--gold); color: var(--gold); }
.more-link {
  color: var(--gold);
  font-size: 17px;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  background: none;
  border: none;
  font-family: inherit;
  padding: 0;
}
.more-link:hover { color: var(--parchment); }
