/* ============================================================
   menu.css —— 顶部章节栏、底部功能栏、亮度面板
   ============================================================ */

:root {
  --bar-bottom-h: calc(66px + env(safe-area-inset-bottom));
}

/* ---------- 顶栏：上一章 / 进度 / 下一章（对应设计图 1） ---------- */

.bar-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(env(safe-area-inset-top) + 10px) 14px 10px;
  background: var(--ui-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transform: translateY(-110%);
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
}

.bar-top.is-open {
  transform: translateY(0);
}

.bar-btn {
  flex: none;
  padding: 6px 2px;
  font-size: 16px;
  color: var(--ui-text);
  white-space: nowrap;
}

.bar-btn:disabled {
  color: var(--ui-sub);
  opacity: 0.5;
}

.bar-top .range-lg {
  flex: 1;
  min-width: 0;
}

/* 拖动进度时浮出的章节名 */
.progress-toast {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 4px);
  transform: translateX(-50%);
  padding: 5px 12px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}

.progress-toast.is-show {
  opacity: 1;
}

/* ---------- 底栏：目录 / 夜间模式 / 亮度 / 设置 ---------- */

.bar-bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  height: var(--bar-bottom-h);
  display: flex;
  align-items: flex-start;
  padding: 8px 6px calc(env(safe-area-inset-bottom) + 6px);
  background: var(--ui-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--ui-line);
  transform: translateY(110%);
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
}

.bar-bottom.is-open {
  transform: translateY(0);
}

/* 目录等全屏浮层打开时先让菜单栏立即退场：关掉过渡，位移瞬间生效，
   避免栏与浮层的动画同时播、出现"两层同现" */
.bar-top.is-stowed,
.bar-bottom.is-stowed {
  transition: none;
}

/* ---------- 浮在底栏之上的面板 ---------- */

.panel-bottom {
  bottom: var(--bar-bottom-h);
  border-radius: 14px 14px 0 0;
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.08);
  /* 收起位移必须等于「自身高度 + 图标栏高度」：面板基准位置在底栏之上，
     只下移自身高度的话，会在屏幕底部留出一条露边 */
  transform: translateY(calc(100% + var(--bar-bottom-h)));
  /* visibility 延迟到收起动画结束才生效，动画才播得完；隐藏态也不接收点击 */
  visibility: hidden;
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1), visibility 0s linear 0.28s;
}

.panel-bottom.is-open {
  transform: translateY(0);
  visibility: visible;
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
}

/* ---------- 亮度面板（对应设计图 3） ---------- */

.panel-brightness .row {
  gap: 12px;
}

.panel-brightness .row-label {
  width: auto;
}

.panel-brightness .range-md {
  flex: 1;
  min-width: 0;
}

.brightness-follow {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  font-size: 15px;
  color: var(--ui-text);
}
