/* =========================
   RESET & BASE
   ========================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: #05070b;
  background-image: url("bg-grid.png");
  background-size: cover;
  background-attachment: fixed;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Noto Sans TC", "Segoe UI", sans-serif;
  color: #e8ecf5;
}

/* 讓所有內容不被 fixed NAV 吃掉 */
.page-wrap {
  padding-top: 96px;
}

/* =========================
   NAV BAR（SWTOR 藍 + 金線）
   ========================= */

.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 72px;
  background: linear-gradient(to bottom, #141b27 0%, #080c12 80%);
  border-bottom: 1px solid rgba(200, 155, 60, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  box-shadow: 0 0 22px rgba(0, 0, 0, 0.75);
}

.nav-inner {
  width: 100%;
  max-width: 1100px;
  padding: 0 48px;
  display: flex;
  justify-content: center;
  gap: 70px;
  font-size: 1.5rem;
  letter-spacing: 0.09em;
}

.nav-inner a {
  color: #f5f1e6;
  text-decoration: none;
  font-family: "Courier New", monospace;
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.8);
}

.nav-inner a:hover {
  color: #ffe9a9;
  text-shadow: 0 0 10px rgba(255, 211, 120, 0.9);
}

/* 小螢幕 NAV 縮一點 */
@media (max-width: 600px) {
  .top-bar {
    height: 72px;
  }

  .page-wrap {
    padding-top: 90px;
  }

  .nav-inner {
    gap: 20px;
    font-size: 1.05rem;
    padding: 0 16px;
  }
}

/* =========================
   FULL-WIDTH BANNER（高 100px）
   ========================= */

.page-banner {
  margin-top: 72px; /* 剛好接在 nav 下方 */
  width: 100vw;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  overflow: hidden;
}

.page-banner img {
  width: 100vw;       /* 左右貼滿 */
  height: 100px;      /* 你說的預設高度 100px */
  object-fit: cover;  /* 需要時上下裁切 */
  display: block;
}

/* 手機版可以稍微矮一點或維持一樣都行，這裡維持 100px */
/* =========================
   HOME / CHAPTERS 共用主面板
   ========================= */

.center-panel {
  max-width: 960px;
  margin: 40px auto 120px;
  padding: 48px 64px;
  position: relative;

  background: rgba(8, 12, 20, 0.92);
  border-radius: 18px;
  border: 1px solid #323c50;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
}

.center-panel::before {
  content: "";
  position: absolute;
  top: 14px;
  left: 26px;
  right: 26px;
  height: 2px;
  background: linear-gradient(to right, #c89b3c, #f5e3a4, #c89b3c);
  opacity: 0.95;
}

.center-panel h1 {
  margin-top: 18px; /* 避開上方金線 */
  margin-bottom: 12px;
  font-size: 1.5rem;
  letter-spacing: 0.16em;
  color: #f5f1e6;
}

.center-panel h2 {
  margin-top: 26px;
  margin-bottom: 8px;
  font-size: 1.05rem;
  letter-spacing: 0.14em;
  color: #f0dfaa;
  text-transform: uppercase;
}

.center-panel p {
  margin: 0 0 0.9em;
  font-size: 0.96rem;
  line-height: 1.7;
  color: #d1d6e5;
}

@media (max-width: 900px) {
  .center-panel {
    margin: 32px 16px 80px;
    padding: 24px 18px;
  }

  .center-panel::before {
    left: 16px;
    right: 16px;
  }
}

/* =========================
   CHAPTERS 列表
   ========================= */

.chapter-list {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
}

.chapter-item {
  padding: 8px 0 10px;
  border-bottom: 1px solid #2c3546;
}

.chapter-item:last-child {
  border-bottom: none;
}

.chapter-title {
  font-weight: 600;
  font-size: 0.98rem;
  color: #f3f0e7;
}

.chapter-meta {
  font-size: 0.8rem;
  color: #9aa2be;
  margin-top: 2px;
}

.chapter-desc {
  font-size: 0.88rem;
  color: #c1c7dd;
  margin-top: 3px;
}

.chapter-none {
  font-size: 0.93rem;
  color: #8c94ac;
  margin-top: 6px;
}

/* 章節連結整行可點 */
.chapter-link {
  display: block;
  text-decoration: none;
  padding: 6px 0;
  color: inherit;
}

.chapter-link:hover {
  background: rgba(255, 221, 120, 0.08);
  border-left: 3px solid #d4b96f;
}

/* =========================
   TIMELINE
   ========================= */

.timeline {
  border-left: 2px solid #3c465a;
  padding-left: 16px;
  margin-top: 10px;
}

.timeline-item {
  position: relative;
  margin-bottom: 12px;
}

.timeline-dot {
  position: absolute;
  left: -8px;
  top: 7px;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #bda165;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
}

.timeline-year {
  font-size: 0.84rem;
  color: #c3c9dd;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.timeline-title {
  font-size: 0.9rem;
  color: #eef1fa;
  margin-top: 2px;
}

.timeline-note {
  font-size: 0.86rem;
  color: #9ba2bd;
  margin-bottom: 6px;
}

/* =========================
   CHARACTER PAGE：左立繪 + 右資訊
   ========================= */

.char-layout {
  max-width: 1200px;
  margin: 96px auto 120px;
  padding: 0 56px;
  display: flex;
  align-items: stretch;
  gap: 40px;
}

.char-art-panel {
  flex: 0 0 420px;
  height: 700px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: transparent;
  overflow: hidden;
}

.char-art-panel img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.char-info-panel {
  flex: 1;
  min-height: 700px;
  padding: 32px 40px;
  background: radial-gradient(circle at top left, #243246 0%, #0f141c 70%);
  border-radius: 20px;
  border: 1px solid #2f3f55;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.9);
  color: #f7f4ea;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  position: relative;
}

.char-info-panel::before {
  content: "";
  position: absolute;
  top: 12px;
  left: 28px;
  right: 28px;
  height: 2px;
  background: linear-gradient(to right, #c89b3c, #f3dd9b, #c89b3c);
  opacity: 0.9;
}

.char-info-panel h1 {
  margin-top: 18px;
  margin-bottom: 6px;
  font-size: 1.6rem;
  letter-spacing: 0.14em;
}

.char-info-meta {
  font-size: 0.9rem;
  color: #c6ccdd;
  margin-bottom: 16px;
}

.char-section-title {
  font-size: 0.94rem;
  font-weight: 700;
  margin-top: 12px;
  margin-bottom: 2px;
  color: #f4e0a4;
}

.char-section-body {
  font-size: 0.9rem;
  margin: 0 0 0.6em;
  color: #e1e4ef;
  line-height: 1.7;
}

/* 角色頁 RWD */
@media (max-width: 960px) {
  .char-layout {
    flex-direction: column;
    padding: 0 20px;
    margin: 80px auto 96px;
  }

  .char-art-panel {
    width: 100%;
    height: 360px;
  }

  .char-info-panel {
    min-height: auto;
  }

  .nav-inner {
    gap: 32px;
    font-size: 1.2rem;
    padding: 0 24px;
  }
}

/* 右下角角色切換小圓按鈕 */
.char-switcher {
  position: fixed;
  right: 24px;
  bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 200;
}

.char-switcher a {
  position: relative;
  display: block;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid #c89b3c;
  background: #0e1218;
  box-shadow: 0 0 10px rgba(200, 155, 60, 0.4);
  transition:
    border-color 0.2s ease,
    box-shadow 0.25s ease,
    transform 0.25s ease,
    filter 0.25s ease;
}

.char-switcher a img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

/* hover 亮線 */
.char-switcher a::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: 6px;
  height: 2px;
  background: linear-gradient(to right, #f5e3a4, #ffe9b8, #f5e3a4);
  opacity: 0;
  transform: scaleX(0);
  transform-origin: center;
  box-shadow: 0 0 6px rgba(255, 230, 170, 0.8);
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
}

.char-switcher a:hover {
  border-color: #f3e4b1;
  box-shadow: 0 0 12px rgba(255, 220, 130, 0.55);
  transform: translateY(-4px);
  filter: brightness(1.12);
}

.char-switcher a:hover img {
  transform: scale(1.06);
}

.char-switcher a:hover::after {
  opacity: 1;
  transform: scaleX(1);
}

@media (max-width: 600px) {
  .char-switcher {
    right: 14px;
    bottom: 14px;
  }
}

/* =========================
   INLINE SPOILER
   ========================= */

.spoiler-inline {
  color: transparent;
  background: #dfe3ef20;
  filter: blur(4px);
  transition: 0.2s ease;
  border-radius: 4px;
  padding: 0 4px;
  cursor: pointer;
  user-select: none;
}

.spoiler-inline:hover {
  color: #dfe3ef;
  filter: blur(0);
  background: rgba(0, 0, 0, 0.25);
}

/* =========================
   HOME：SWTOR 世界觀說明展開卡片
   ========================= */

.lore-wrapper {
  margin-top: 12px;
  border: 1px solid #343d52;
  border-radius: 10px;
  background: rgba(10, 14, 22, 0.9);
  overflow: hidden;
}

.lore-toggle {
  width: 100%;
  padding: 10px 14px;
  background: linear-gradient(to right, #151c28, #0f141d);
  border: none;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #f0dfaa;
  letter-spacing: 0.12em;
  cursor: pointer;
  font-size: 0.92rem;
}

.lore-toggle-icon {
  width: 10px;
  height: 10px;
  border-right: 2px solid #f0dfaa;
  border-bottom: 2px solid #f0dfaa;
  transform: rotate(45deg);
  transition: transform 0.25s ease;
}

.lore-wrapper.open .lore-toggle-icon {
  transform: rotate(135deg);
}

.lore-box {
  max-height: 0;
  overflow: hidden;
  padding: 0 14px;
  background: rgba(14, 18, 30, 0.96);
  border-top: 1px solid #2f3748;
  transition:
    max-height 0.35s ease,
    padding-top 0.35s ease,
    padding-bottom 0.35s ease;
}

.lore-wrapper.open .lore-box {
  max-height: 800px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.lore-box p {
  margin: 0 0 0.7em;
  color: #d5dae7;
  line-height: 1.7;
}

.lore-box h3 {
  color: #f3e0a4;
  margin: 12px 0 6px;
}

.lore-box hr {
  border: none;
  border-top: 1px solid #3b4457;
  margin: 10px 0;
}

/* =========================
   CHAPTER READ：CODEX 風版面
   左側目錄 + 右側正文
   ========================= */

.chapter-read-layout {
  max-width: 1200px;
  margin: 48px auto 120px;
  padding: 0 40px;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 32px;
}

/* 手機改單欄 */
@media (max-width: 900px) {
  .chapter-read-layout {
    grid-template-columns: 1fr;
    padding: 0 16px;
    margin: 32px auto 80px;
  }
}

/* ----- 左側 CODEX 側欄 ----- */

.codex-sidebar {
  background: rgba(8, 12, 20, 0.92);
  border-radius: 16px;
  border: 1px solid #323c50;
  box-shadow: 0 0 24px rgba(0, 0, 0, 0.8);
  padding: 18px 18px 20px;
}

.codex-title {
  font-size: 0.95rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #f0dfaa;
  margin-bottom: 10px;
}

.codex-sub {
  font-size: 0.8rem;
  color: #a9b0c6;
  margin-bottom: 14px;
}

.codex-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.88rem;
}

.codex-item {
  padding: 6px 0;
  border-bottom: 1px solid #262f3f;
}

.codex-item:last-child {
  border-bottom: none;
}

.codex-link {
  color: #d3d9ea;
  text-decoration: none;
  display: block;
  padding: 4px 2px;
}

.codex-link:hover {
  background: rgba(255, 221, 120, 0.08);
  border-left: 3px solid #d4b96f;
}

.codex-link span {
  display: block;
}

.codex-link .codex-label {
  font-size: 0.78rem;
  color: #9097ae;
}

/* ----- 右側正文（全息面板）----- */

.chapter-read-panel {
  position: relative;
  max-width: 100%;
  padding: 32px 40px 40px;
  background: rgba(10, 14, 22, 0.96);
  border-radius: 18px;
  border: 1px solid #323c50;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
  color: #d9deea;
  overflow: hidden;
}

/* 上方金線 */
.chapter-read-panel::before {
  content: "";
  position: absolute;
  top: 14px;
  left: 26px;
  right: 26px;
  height: 2px;
  background: linear-gradient(to right, #c89b3c, #f5e3a4, #c89b3c);
  opacity: 0.95;
}

/* 背景线條（全息） */
.chapter-read-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(
      to right,
      rgba(120, 180, 255, 0.06),
      rgba(120, 180, 255, 0.06) 1px,
      transparent 1px,
      transparent 24px
    ),
    repeating-linear-gradient(
      135deg,
      rgba(90, 150, 240, 0.05),
      rgba(90, 150, 240, 0.05) 1px,
      transparent 1px,
      transparent 32px
    );
  mix-blend-mode: screen;
  opacity: 0.7;
}

/* 內文本體不要被 ::after 擋住 */
.chapter-read-inner {
  position: relative;
  z-index: 1;
}

/* 章節標題區 */
.chapter-read-inner h1 {
  margin-top: 18px;
  margin-bottom: 4px;
  font-size: 1.5rem;
  letter-spacing: 0.16em;
  color: #f5f1e6;
  text-transform: uppercase;
}

.chapter-subtitle {
  margin-top: 2px;
  margin-bottom: 18px;
  font-size: 0.95rem;
  color: #c6ccdd;
  letter-spacing: 0.12em;
}

/* Summary 區塊 */
.chapter-summary {
  margin-bottom: 16px;
}

.chapter-summary h3 {
  margin: 0 0 6px;
  font-size: 0.95rem;
  color: #f0dfaa;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.chapter-summary p {
  margin: 0;
  font-size: 0.92rem;
  color: #d6d9e5;
}

/* 內文分隔線（鏡頭切換） */
.scene-divider {
  margin: 20px 0;
  height: 1px;
  border: none;
  background: linear-gradient(to right, transparent, #3a4354, transparent);
}

/* 內文 */
.chapter-content p {
  margin: 0 0 1.2em;
  line-height: 1.8;
  color: #d6d9e5;
  font-size: 0.98rem;
}

/* 內文中的小標題（如果需要） */
.chapter-content h2 {
  font-size: 1.02rem;
  margin: 1.6em 0 0.6em;
  color: #f0dfaa;
  letter-spacing: 0.08em;
}

/* =========================
   FOOTNOTE 區域
   ========================= */

.chapter-notes {
  margin-top: 28px;
  padding-top: 14px;
  border-top: 1px solid #3a4354;
  font-size: 0.86rem;
  color: #b7bed4;
}

.chapter-notes h3 {
  margin: 0 0 8px;
  font-size: 0.9rem;
  letter-spacing: 0.14em;
  color: #f0dfaa;
  text-transform: uppercase;
}

.chapter-notes ol {
  margin: 0;
  padding-left: 1.2em;
}

.chapter-notes li {
  margin-bottom: 6px;
}

/* 如果你之後想做「點腳註跳回正文」可以再加樣式 */
.footnote-ref {
  font-size: 0.8em;
  vertical-align: super;
  cursor: pointer;
  color: #f0dfaa;
}

.footnote-ref:hover {
  color: #ffe9b0;
}