html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;  /* ✅ 禁止横向滚动 */
}

/* 加载像素字体（可选） */
@font-face {
  font-family: 'FusionPixelCN';
  src: url('../fusionpixel-hans.woff2') format('woff2');
  font-display: swap;
}



.current-tag-label {
  position: fixed;
  top: 12px;
  left: 16px;
  font-family: 'FusionPixelCN', monospace;
  font-size: 22px;
  color: white;
  text-shadow: 0 0 10px rgba(0, 255, 224, 0.5);
  background: none;
  padding: 4px 10px;
  border-radius: 0;
  z-index: 100;
  pointer-events: none;
}

/* 背景图容器 */
.background-container {
  position: fixed;      /* ✅ 关键修改：固定在视口 */
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;          /* ✅ 保证在最底层 */
  overflow: hidden;
}

.background-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 面部互动区域 */
.face-area {
  position: absolute;
  width: 8%;
  aspect-ratio: 1 / 1;
  pointer-events: auto;
  z-index: 10;
}

.face-highlight {
  width: 100%;
  height: 100%;
  border: 2px solid rgba(0, 255, 224, 0.7);
  box-shadow: 0 0 10px rgba(0, 255, 224, 0.5);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: auto;
  cursor: pointer;
  position: relative;
  z-index: 2;
}

.face-info {
  position: absolute;
  top: 0;
  left: 100%;
  margin-left: 10px;
  background-color: rgba(0, 0, 0, 0.85);
  color: #00ffe0;
  font-family: "Press Start 2P", monospace;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 10px;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 1;
  pointer-events: none;
}

.face-highlight:hover {
  opacity: 1;
}

.face-highlight:hover + .face-info {
  opacity: 1;
  transform: translateX(0);
}

/* 可选动画 */
@keyframes pulse {
  0% {
    box-shadow: 0 0 4px #00ffe0;
  }
  50% {
    box-shadow: 0 0 12px #00ffe0;
  }
  100% {
    box-shadow: 0 0 4px #00ffe0;
  }
}

/* ===============================
   基础设置
   =============================== */

/* ---------- 字体 ---------- */
/* Google 字体预下载到本地也可，用 fallback 防止加载失败 */
@font-face {
  font-family: 'IBMPlexSans';
  src: local('IBM Plex Sans'), local('IBM Plex Sans Regular');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'NotoSansSC';
  src: local('Noto Sans SC'), local('Noto Sans SC Regular');
  font-weight: 400;
  font-display: swap;
}

:root {
  --bg: #0d1117;
  --panel: rgba(20, 24, 28, 0.60);
  --panel-hover: rgba(28, 34, 40, 0.72);
  --border: rgba(255,255,255,0.08);
  --text: #dce3ea;
  --muted: #93a1af;
  --heading: #f0f6fc;
  --accent: #1fddb7;
  --shadow: 0 10px 24px rgba(0,0,0,.35);
}

body {
  font-family: 'IBMPlexSans','NotoSansSC',sans-serif;
  color: var(--text);
  line-height: 1.85;
  letter-spacing: .2px;
}

/* ---------- 多章节标题 ---------- */
.novel.multi .novel-title {
  font-family: 'FusionPixelCN', monospace;
  font-size: clamp(36px, 3.5vw, 48px);
  text-align: center;
  color: #ffffff;
  text-shadow: 0 0 8px rgba(0, 255, 224, 0.7),
               0 0 16px rgba(0, 255, 224, 0.3);
  margin: 2rem 0 1.2rem 0;
  z-index: 2;
  position: relative;
}

/* ---------- 章节目录布局 ---------- */
/* ---------- Chapters list: cyber effect ---------- */

.chapter-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  padding: 2rem 0;
  font-family: 'FusionPixelCN', monospace, sans-serif;
}

.chapter-list a {
  font-family: 'FusionPixelCN', monospace, sans-serif;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  width: 240px;
  height: 54px;
  padding: 0 24px;
  overflow: hidden;                  /* ⬅ 必须有！确保伪元素不干扰排版 */

  color: #e6edf3;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  background: rgba(20,24,28,.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 6px 18px rgba(0,0,0,.35);
  transition:
    width .40s cubic-bezier(.3,.7,.4,1.2),
    height .40s cubic-bezier(.3,.7,.4,1.2),
    padding .35s ease,
    background .25s ease,
    box-shadow .25s ease,
    transform .25s ease;
}

.chapter-list a .title {
  font-size: 18px;
  color: #e6edf3;
  text-align: center;
  transition: all .3s ease;
  font-family: 'FusionPixelCN', monospace, sans-serif;
}

.chapter-list a .preview {
  display: block;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.6;
  color: rgba(230,237,243,0.75);
  text-align: center;
  margin-top: 0;                          /* ⬅ 初始无间距 */
  padding: 0 12px 0 12px;                 /* ⬅ 预览内边距 */
  background: linear-gradient(to bottom,
    rgba(20, 24, 28, 0) 0%,
    rgba(20, 24, 28, 0.3) 30%,
    rgba(20, 24, 28, 0.65) 100%);
  mask-image: linear-gradient(to bottom, black 75%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 75%, transparent 100%);
  transition: opacity .35s ease, max-height .35s ease, margin-top .35s ease;
}

/* ---------- hover 展开：上靠齐 + 预览出现 ---------- */
.chapter-list a:hover{
  width: 580px;              /* 横向拉长 */
  height: 120px;             /* 纵向拉高 */
  padding: 20px 22px;
  justify-content: flex-start;  /* 顶部对齐 */
  align-items: center;          /* 仍保持水平居中 */
  gap: 0px;                    /* 标题与预览的自然间距 */

  background: rgba(28,34,40,.82);
  box-shadow: 0 12px 28px rgba(0,0,0,.45);
  transform: translateY(-2px);
}

.chapter-list a:hover .preview{
  opacity: 1;
  max-height: 100px;
}

/* ========= 电光刃 Hover 动画 ========= */

.chapter-list a {
  position: relative;
  overflow: hidden;
}

.chapter-list a::before,
.chapter-list a::after {
  content: "";
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* 底边电光刃 */
.chapter-list a::before {
  bottom: 0;
  left: 100%;
  height: 3px;
  width: 100%;
  background: linear-gradient(90deg, #00ffe0, #00ffe0 60%, transparent 100%);
  box-shadow: 0 0 6px #00ffe0, 0 0 12px #00ffe0;
}

/* 右侧电光刃 */
.chapter-list a::after {
  bottom: -100%;
  right: 0;
  width: 3px;
  height: 100%;
  background: linear-gradient(180deg, #00ffe0, #00ffe0 60%, transparent 100%);
  box-shadow: 0 0 6px #00ffe0, 0 0 12px #00ffe0;
}

/* Hover 动画触发 */
.chapter-list a:hover {
  width: 580px;
  height: 120px;
  padding: 20px 22px;
  justify-content: flex-start;
  align-items: center;
  background: rgba(28, 34, 40, 0.8);
  transform: translateY(-2px);
  box-shadow: 0 0 28px rgba(0, 255, 224, 0.25);
}

.chapter-list a:hover .title {
  margin-bottom: 10px;
}

.chapter-list a:hover .preview {
  opacity: 1;
  max-height: 100px;
  margin-top: 16px;
}

/* 让电光刃出现并播放动画 */
.chapter-list a:hover::before,
.chapter-list a:hover::after {
  opacity: 1;
  animation: slash-h 0.5s linear forwards, spark-flicker 0.5s linear;
}

/* 横向划开 */
@keyframes slash-h {
  0% { left: 100%; }
  100% { left: 0%; }
}

/* 竖向划开 */
.chapter-list a:hover::after {
  animation: slash-v 0.5s linear forwards, spark-flicker 0.5s linear;
}

@keyframes slash-v {
  0% { bottom: -100%; }
  100% { bottom: 0%; }
}

/* 电光闪烁抖动感 */
@keyframes spark-flicker {
  0%, 100% { filter: drop-shadow(0 0 1px #00ffe0); }
  25% { filter: drop-shadow(0 0 4px #00ffe0); }
  50% { filter: drop-shadow(0 0 8px #00ffe0); }
  75% { filter: drop-shadow(0 0 4px #00ffe0); }
}



.back-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  font-family: 'FusionPixelCN', monospace, sans-serif; /* 像素字体 */
  font-size: 14px;
  color: white;
  text-shadow: 0 0 10px rgba(0, 255, 224, 0.5);
  background: transparent;
  border: none;
  cursor: pointer;
  line-height: 1.5;
  text-align: center;
  z-index: 9999;
  text-decoration: none;
  user-select: none;
}

.back-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  font-family: 'FusionPixelCN', monospace, sans-serif; /* 像素字体 */
  font-size: 14px;
  color: white;
  text-shadow: 0 0 10px rgba(0, 255, 224, 0.5);
  background: transparent;
  border: none;
  cursor: pointer;
  line-height: 1.5;
  text-align: center;
  z-index: 9999;
  text-decoration: none;
  user-select: none;
}

.back-button:hover {
  text-shadow: 0 0 6px #ff4e4e;
  transform: scale(1.05);
}
