/* --- 自定义标题字体 ------------------------------------------------------ */
@font-face {
  font-family: "CtrlPoop";
  src: url("../assets/fonts/ctrl-poop.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ============================================================================
   攻略页导航：左侧拖拽预览条 + 右侧轮盘 / 星图
   ========================================================================== */

/* --- 左侧预览条 ---------------------------------------------------------- */
.wiki-rail {
  position: fixed;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 62vh;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s var(--ease);
  pointer-events: none;
}
.wiki-rail.is-ready {
  opacity: 1;
  pointer-events: auto;
}

.wiki-rail__track {
  position: relative;
  width: 3px;
  height: 100%;
  border-radius: 999px;
  background: rgba(120, 160, 220, 0.16);
  cursor: pointer;
}

.wiki-rail__tick {
  position: absolute;
  left: -4px;
  width: 11px;
  height: 2px;
  border-radius: 2px;
  background: rgba(127, 216, 255, 0.28);
  transition: background 0.2s var(--ease), width 0.2s var(--ease);
}
.wiki-rail__tick.is-major {
  width: 15px;
  left: -6px;
  background: rgba(127, 216, 255, 0.45);
}
.wiki-rail__tick.is-active {
  background: var(--cyan);
  box-shadow: 0 0 8px rgba(127, 216, 255, 0.7);
}

.wiki-rail__thumb {
  position: absolute;
  left: 50%;
  width: 14px;
  height: 34px;
  margin-left: -7px;
  margin-top: -17px;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(155, 231, 255, 0.95), rgba(167, 139, 250, 0.95));
  box-shadow: 0 0 14px rgba(127, 216, 255, 0.45);
  cursor: grab;
  touch-action: none;
}
.wiki-rail__thumb:active {
  cursor: grabbing;
}

.wiki-rail__label {
  position: absolute;
  left: 34px;
  top: 50%;
  transform: translateY(-50%);
  max-width: 220px;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(10, 16, 30, 0.95);
  border: 1px solid var(--line);
  color: #cfe0f7;
  font-size: 0.76rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s var(--ease);
}
.wiki-rail__label.is-show {
  opacity: 1;
}

/* --- 右侧轮盘（文档级导航） ---------------------------------------------- */
.wiki-dial {
  position: fixed;
  top: 0;
  right: 0;
  width: 46vw;
  max-width: 640px;
  height: 100vh;
  z-index: 46;
  pointer-events: none;
  overflow: hidden;
}

.wiki-dial__inner {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* 只有这一条接收滚轮，其余区域不挡正文 */
.wiki-dial__scroller {
  position: absolute;
  right: 46px;      /* 让出最右侧给「右拉·星图」把手 */
  top: 0;
  width: 168px;
  height: 100%;
  pointer-events: auto;
}

.wiki-dial__arc {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.55;
}
.wiki-dial__arc path {
  fill: none;
  stroke: rgba(150, 190, 235, 0.28);
  stroke-width: 1;
}

.wiki-dial__item {
  position: absolute;
  left: 0;
  top: 0;
  max-width: 330px;
  padding: 0;
  border: 0;
  background: none;
  color: #dbe8fb;
  font-size: 22px;
  font-weight: 300;
  letter-spacing: 0.02em;
  line-height: 1.25;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  pointer-events: auto;
  transform-origin: center;
  transition: color 0.25s var(--ease), text-shadow 0.25s var(--ease);
  will-change: transform, opacity;
}

.wiki-dial__item.is-sub {
  font-size: 15px;
  color: rgba(190, 210, 235, 0.85);
}

.wiki-dial__item.is-center {
  color: #ffffff;
  text-shadow: 0 0 22px rgba(150, 215, 255, 0.55);
}

.wiki-dial__item:hover {
  color: #fff;
}

.wiki-dial__hint {
  position: absolute;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: rgba(140, 165, 200, 0.45);
  pointer-events: none;
}

/* 平板及以下：左侧预览条太占地方，收掉；轮盘改成手机抽屉形态（见文件末尾） */
@media (max-width: 1180px) {
  .wiki-rail {
    display: none;
  }
}

/* --- 右侧拉出星图 -------------------------------------------------------- */
.wiki-pull {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 60;   /* 必须高于 .wiki-dial(46)，否则点击会被轮盘的滚动区吃掉 */
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 6px 14px 10px;
  border-radius: 12px 0 0 12px;
  border: 1px solid rgba(127, 216, 255, 0.25);
  border-right: 0;
  background: rgba(10, 16, 30, 0.92);
  color: #9fd8ff;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  writing-mode: vertical-rl;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.wiki-pull:hover {
  border-color: var(--cyan);
  color: #fff;
}
.wiki-pull:active {
  cursor: grabbing;
}

/* --- 星图 ---------------------------------------------------------------- */
.wiki-starmap {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: radial-gradient(ellipse at 60% 40%, rgba(24, 34, 62, 0.96), rgba(4, 7, 14, 0.98));
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease);
}
.wiki-starmap.is-open {
  opacity: 1;
  pointer-events: auto;
}

.wiki-starmap__head {
  position: absolute;
  z-index: 2;
  pointer-events: none;
  top: 74px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
}
.wiki-starmap__title {
  font-family: "CtrlPoop", "Impact", sans-serif;
  font-size: 2.5rem;
  line-height: 1.05;
  letter-spacing: 0.02em;
  color: #eaf6ff;
  text-transform: uppercase;
  text-shadow: 0 0 26px rgba(140, 210, 255, 0.45), 0 0 70px rgba(100, 160, 255, 0.25);
  opacity: 0;
  transform: translateY(-10px) scale(0.985);
  transition: letter-spacing 1.05s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.75s ease 0.05s,
    transform 1.05s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: letter-spacing, opacity, transform;
}

/* 打开时整体展开：字距张开 + 淡入 + 轻微下沉 */
.wiki-starmap.is-open .wiki-starmap__title {
  letter-spacing: 0.26em;
  opacity: 1;
  transform: translateY(0) scale(1);
}

.wiki-starmap__sub {
  margin-top: 10px;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  color: rgba(148, 166, 198, 0.7);
  opacity: 0;
  transition: opacity 0.6s ease 0.35s;
}
.wiki-starmap.is-open .wiki-starmap__sub {
  opacity: 1;
}
.wiki-starmap__head p {
  margin-top: 6px;
  font-size: 0.76rem;
  color: rgba(148, 166, 198, 0.7);
}

.wiki-starmap__close {
  position: absolute;
  z-index: 3;
  top: 68px;
  right: 28px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(10, 16, 30, 0.9);
  color: #cfe0f7;
  font-size: 1rem;
  cursor: pointer;
}
.wiki-starmap__close:hover {
  border-color: var(--cyan);
}

.wiki-starmap__field {
  position: absolute;
  inset: 0;
}

.wiki-star {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.wiki-star__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #9be7ff;
  box-shadow: 0 0 12px rgba(155, 231, 255, 0.9);
  transition: transform 0.2s var(--ease);
}
.wiki-star--major .wiki-star__dot {
  width: 14px;
  height: 14px;
  background: #ffd76a;
  box-shadow: 0 0 18px rgba(255, 199, 64, 0.9);
}
.wiki-star:hover .wiki-star__dot {
  transform: scale(1.6);
}
.wiki-star__label {
  max-width: 130px;
  font-size: 0.7rem;
  color: rgba(200, 216, 240, 0.85);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wiki-star:hover .wiki-star__label {
  color: #fff;
}

.wiki-starmap__canvas {
  position: absolute;
  inset: 0;
  display: block;
}

.wiki-starmap__tip {
  position: absolute;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(10, 16, 30, 0.96);
  border: 1px solid rgba(127, 216, 255, 0.35);
  color: #e8f1ff;
  font-size: 0.78rem;
  white-space: nowrap;
  pointer-events: none;
  transform: translateY(-50%);
}

.wiki-starmap__legend {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: center;
  font-size: 0.72rem;
  color: rgba(168, 188, 214, 0.75);
}
.wiki-starmap__legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.wiki-starmap__legend i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

/* --- 小屏：预览条藏掉，轮盘和星图改成手机可用的形态 ---------------------- */
@media (max-width: 1180px) {
  .wiki-rail {
    display: none;
  }
}

/* 手机端：轮盘变成右上角按钮 + 从右侧滑出的抽屉 */
@media (max-width: 900px) {
  .wiki-dial {
    width: 100vw;
    max-width: none;
    pointer-events: none;
  }

  .wiki-dial__inner {
    display: none;
  }

  /* 右上角小按钮 */
  .wiki-dial__fab {
    position: fixed;
    top: 74px;
    right: 14px;
    z-index: 60;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid rgba(127, 216, 255, 0.35);
    background: rgba(10, 16, 30, 0.92);
    color: #cfe0f7;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    display: grid;
    place-items: center;
    pointer-events: auto;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
  }

  /* 抽屉 */
  .wiki-dial__sheet {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(4, 7, 14, 0.94);
    padding: 76px 18px 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .wiki-dial__sheet[hidden] {
    display: none;
  }
  .wiki-dial__sheet h3 {
    font-size: 0.78rem;
    letter-spacing: 0.18em;
    color: rgba(148, 166, 198, 0.7);
    margin-bottom: 6px;
  }
  .wiki-dial__sheet button {
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(20, 30, 54, 0.7);
    color: #dbe8fb;
    font-size: 0.92rem;
    text-align: left;
  }
  .wiki-dial__sheet button.is-sub {
    font-size: 0.84rem;
    color: rgba(190, 210, 235, 0.85);
    padding-left: 28px;
  }
  .wiki-dial__sheet button.is-current {
    border-color: var(--cyan);
    color: #fff;
  }

  .wiki-dial__hint {
    display: none;   /* 手机上滚轮提示没意义 */
  }

  /* 手机端的星图把手变成一个贴底的细条，横向滑动 */
  .wiki-pull {
    top: auto;
    bottom: 84px;
    right: 0;
    transform: none;
    writing-mode: horizontal-tb;
    padding: 10px 14px;
    border-radius: 12px 0 0 12px;
    font-size: 0.7rem;
  }

  /* 星图本身：手机上字号小一点，标签不至于糊成一片 */
  .wiki-starmap__title {
    font-size: 1.6rem;
  }
  .wiki-starmap__head {
    top: 62px;
  }
  .wiki-starmap__sub {
    font-size: 0.68rem;
    padding: 0 20px;
  }

  .wiki-starmap__legend {
    gap: 10px;
    font-size: 0.64rem;
    bottom: 14px;
    padding: 0 12px;
  }
}

