/* ============================================================
 * 文件：css/chronicle.css（v3 新增）
 * 作用：【北地编年史】悬浮魔法书 + 图鉴样式
 * ============================================================ */

/* 卡组备战界面里的悬浮魔法书按钮 */
.chron-book-btn {
  position: absolute; right: 12px; top: 70px; z-index: 20;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  cursor: pointer;
}
.chron-book-icon {
  font-size: 50px;
  filter: drop-shadow(0 0 13px rgba(255,215,0,0.55));
  animation: bookBob 2.6s ease-in-out infinite; /* 动画只给图标，按钮本体稳如老狗 */
}
.chron-book-label {
  font-size: 13px; color: #ffd700; letter-spacing: 1px;
  text-shadow: 0 0 8px rgba(255,215,0,0.6), 0 1px 2px rgba(0,0,0,0.8);
  background: rgba(40,26,8,0.75); padding: 2px 6px; border-radius: 8px;
  border: 1px solid rgba(255,215,0,0.35);
}
@keyframes bookBob {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-8px) rotate(3deg); }
}

/* 编年史书本本体 */
#chronicle {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(3px);
}
.chron-book {
  position: relative;
  width: min(94%, 380px); max-height: 92%;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(120,86,40,0.35) 0%, transparent 60%),
    linear-gradient(160deg, #3a2a12 0%, #241806 55%, #160e03 100%);
  border: 3px solid #8b6914;
  outline: 1px solid rgba(255,215,0,0.25);
  border-radius: 14px;
  box-shadow: 0 0 40px rgba(0,0,0,0.9), inset 0 0 60px rgba(0,0,0,0.5);
  padding: 18px 16px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  box-sizing: border-box;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.chron-title {
  font-size: 22px; font-weight: bold; color: #ffd700; letter-spacing: 3px;
  text-shadow: 0 0 14px rgba(255,215,0,0.5), 0 2px 3px rgba(0,0,0,0.8);
  font-family: 'STKaiti','KaiTi','楷体','FangSong','仿宋','STFangsong',serif;
}
.chron-subtitle {
  font-size: 11px; color: #a88a4a; letter-spacing: 2px; font-style: italic;
  font-family: 'STKaiti','KaiTi','楷体',serif;
}

/* 目录格子 */
.chron-toc {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  width: 100%;
}
.chron-cell {
  aspect-ratio: 3/4;
  background: linear-gradient(160deg, rgba(255,235,190,0.08), rgba(30,20,6,0.9));
  border: 2px solid rgba(255,215,0,0.35);
  border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  cursor: pointer;
  transition: transform 0.18s, box-shadow 0.18s;
}
.chron-cell:active { transform: scale(0.94); }
.chron-cell:hover { box-shadow: 0 0 12px rgba(255,215,0,0.35); }
.chron-cell-locked {
  cursor: not-allowed; opacity: 0.55;
  border-style: dashed;
}
.chron-icon { font-size: 30px; filter: drop-shadow(0 0 8px rgba(255,215,0,0.35)); }
.chron-name {
  font-size: 11px; color: #ffe9b0; letter-spacing: 1px; text-align: center;
  font-family: 'STKaiti','KaiTi','楷体',serif;
}
.chron-cat {
  font-size: 9px; color: #b39ddb; letter-spacing: 1px;
  background: rgba(149,117,205,0.15); padding: 1px 6px; border-radius: 6px;
}

/* 详情页 */
.chron-entry {
  display: none; flex-direction: column; align-items: center; gap: 8px;
  width: 100%; text-align: center;
  flex: 1;
}
.chron-entry-icon { font-size: 56px; filter: drop-shadow(0 0 16px rgba(255,215,0,0.5)); }
.chron-entry-name {
  font-size: 22px; color: #ffd700; letter-spacing: 3px; font-weight: bold;
  font-family: 'STKaiti','KaiTi','楷体',serif;
  text-shadow: 0 0 12px rgba(255,215,0,0.45);
}
.chron-entry-cat { font-size: 12px; color: #b39ddb; letter-spacing: 2px; }
.chron-entry-stats {
  font-size: 12px; color: #e8d9b0; line-height: 1.7;
  background: rgba(0,0,0,0.3); border: 1px solid rgba(255,215,0,0.2);
  border-radius: 8px; padding: 6px 12px;
}
.chron-entry-skill {
  font-size: 12px; color: #a5d6a7; line-height: 1.7; padding: 0 6px;
}
.chron-entry-lore {
  font-size: 12px; color: #8d7a52; font-style: italic; line-height: 1.7;
  font-family: 'STKaiti','KaiTi','楷体',serif;
}

/* 页点 */
.chron-dots { display: flex; gap: 10px; }
.chron-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: rgba(255,215,0,0.25); cursor: pointer;
  border: 1px solid rgba(255,215,0,0.4);
  transition: all 0.2s;
}
.chron-dot.active { background: #ffd700; box-shadow: 0 0 8px rgba(255,215,0,0.7); }

/* 翻页导航（左右箭头 + 圆点） */
.chron-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
}
.chron-nav-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: #ffd700;
  background: rgba(30,20,6,0.9);
  border: 2px solid rgba(255,215,0,0.5);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.18s;
  user-select: none;
}
.chron-nav-btn:hover {
  background: rgba(255,215,0,0.15);
  box-shadow: 0 0 10px rgba(255,215,0,0.35);
}
.chron-nav-btn:active { transform: scale(0.92); }

/* 返回按钮最上层 */
.chron-book .menu-btn { position: relative; z-index: 30; flex-shrink: 0; }

/* ============================================================
 * 皇家书库首次进入引导手指
 * ============================================================ */
.deck-finger {
  position: absolute;
  top: 62px;
  left: -60px;
  font-size: 34px;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  filter: drop-shadow(0 0 10px rgba(255,255,255,0.6));
  transition: left 0.7s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.35s ease;
  transform: rotate(90deg);
}

.deck-finger.show {
  left: calc(50% - 72px);
  opacity: 1;
  animation: fingerWag 0.7s ease-in-out infinite;
}

@keyframes fingerWag {
  0%, 100% { transform: rotate(90deg) translateX(0); }
  50% { transform: rotate(90deg) translateX(8px); }
}

/* ============================================================
 * 详情页模式：上下流式布局（占屏幕约55%）
 * ============================================================ */

/* 进入详情页时隐藏标题和引言 */
.chron-book.chron-entry-mode .chron-title,
.chron-book.chron-entry-mode .chron-subtitle {
  display: none;
}

/* 详情页板子：占屏幕约55%，板子整体滚动，不裁剪内部内容 */
.chron-book.chron-entry-mode {
  max-height: 55%;
  height: 55%;
}

/* 上下流式布局 */
.chron-entry-vertical {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  flex: 1;
}

/* 顶部：大图标 + 名字 + 类别费用 */
.chron-entry-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,215,0,0.15);
}

.chron-entry-icon-large {
  font-size: 68px;
  filter: drop-shadow(0 0 18px rgba(255,215,0,0.5));
  line-height: 1;
}

.chron-entry-name-large {
  font-size: 24px;
  color: #ffd700;
  letter-spacing: 3px;
  font-weight: bold;
  font-family: 'STKaiti','KaiTi','楷体','FangSong','仿宋','STFangsong',serif;
  text-shadow: 0 0 14px rgba(255,215,0,0.5), 0 2px 3px rgba(0,0,0,0.8);
}

.chron-entry-cat-line {
  font-size: 12px;
  color: #ffd700;
  letter-spacing: 2px;
  text-shadow: 0 0 6px rgba(255,215,0,0.45), 0 0 12px rgba(255,215,0,0.25);
}

/* 身体：属性 + 技能 + 引言 */
.chron-entry-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  text-align: left;
  flex: 1;
}

.chron-entry-stats-box {
  font-size: 12px;
  color: #e8d9b0;
  line-height: 1.7;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,215,0,0.2);
  border-radius: 8px;
  padding: 8px 12px;
}

/* 【概述】= 绿字（技能描述） */
.chron-entry-skill-box {
  font-size: 13px;
  color: #a5d6a7;
  line-height: 1.7;
  padding: 0 4px;
}

/* 【记述】= 暗字（生物记载正文） */
.chron-entry-lore-box {
  flex: 1;
  display: flex;
  align-items: center;
  overflow: hidden;
  font-size: 12px;
  color: #8d7a52;
  font-style: italic;
  line-height: 1.7;
  font-family: 'STKaiti','KaiTi','楷体','FangSong','仿宋','STFangsong',serif;
  padding: 0 4px;
}


/* 左上角返回按钮（详情页用） */
.chron-back-btn {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #e8d9b0;
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(255,215,0,0.3);
  border-radius: 8px;
  cursor: pointer;
  z-index: 50;
  transition: all 0.18s;
  user-select: none;
}
.chron-back-btn:active { transform: scale(0.92); }
/* 【自述】= 双引号（人物自语语录） */
.chron-entry-quote {
  font-size: 16px;
  color: #ffffff;
  font-style: italic;
  line-height: 1.6;
  font-family: 'STKaiti','KaiTi','楷体','FangSong','仿宋','STFangsong',serif;
  text-align: center;
  margin-top: auto;
  padding: 16px 8px 4px;
  text-shadow: 0 0 10px rgba(255,255,255,0.35), 0 1px 3px rgba(0,0,0,0.8);
}

.chron-book::-webkit-scrollbar {
  display: none;
}
