/*! nav.css —— 四屏导航（PC 左 rail / 移动底 tabbar）与启动题记
 *
 * 同一份语义、两套形体：
 *   PC  ≥1024px  左侧竖排 84px，图标 + 两字标签，鼠标够得着、不占主区宽度
 *   移动 <1024px  底部横排，拇指可达，图标 + 两字标签
 *
 * 温润版的取向：**用底色分层，不用线框图**。选中态是一块蓝色底 + 蓝字，
 * 不做左边彩条、不描边（那两样都是上一版制图语汇的残留）。
 */
.rail { display: none; }
.tabbar { display: flex; }

@media (min-width: 1024px) {
  .rail { display: flex; }
  .tabbar { display: none; }
}

/* ---------- PC 左侧 rail ---------- */
.rail {
  flex: 0 0 var(--rail-w);
  width: var(--rail-w);
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  padding: 14px 8px;
  background: var(--paper);
  border-right: 1px solid var(--rail);
}

.rail-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  padding: 10px 0 20px;
  color: var(--ink);
}
.rail-brand .vico-brand {
  width: 34px;
  height: 34px;
  background-color: var(--ink);
}
.rail-word {
  font-size: 13px;
  font-weight: 600;
  /* 三个字竖排读起来像书脊 —— PC 侧栏的品牌位只有这么宽 */
  writing-mode: vertical-rl;
  text-orientation: upright;
  letter-spacing: .18em;
  line-height: 1;
  color: var(--ink-2);
}

.rail-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 54px;
  padding: 0;
  border: 0;
  border-radius: var(--r-ctrl);
  background: transparent;
  color: var(--ink-2);
  font-size: 11px;
  letter-spacing: .04em;
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.rail-item .vico { width: 21px; height: 21px; }
.rail-item:hover { background: var(--card-2); color: var(--ink); }
.rail-item.on {
  background: var(--blue-bg);
  color: var(--blue);
  font-weight: 600;
}

.rail-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* 明暗：半明半暗的圆 —— 纯 CSS 画，不引图标库（这不是插画，是一个开关） */
.glyph-theme {
  display: block;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  border: 1.6px solid currentColor;
  background: linear-gradient(90deg, currentColor 0 50%, transparent 50% 100%);
}

/* ---------- 移动底 tabbar ---------- */
.tabbar {
  flex: 0 0 auto;
  align-items: stretch;
  background: var(--card);
  border-top: 1px solid var(--rail);
}

.tab {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: var(--nav-h);
  padding: 7px 0 6px;
  border: 0;
  background: transparent;
  color: var(--ink-3);
  font-size: 10.5px;
  letter-spacing: .04em;
}
.tab .vico { width: 22px; height: 22px; }
.tab:active { background: var(--card-2); }
.tab.on { color: var(--blue); font-weight: 600; }

/* ---------- 演示沙箱横条 ---------- */
.demo-bar {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + 14px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 8px 7px 14px;
  border-radius: 999px;
  background: var(--blue-bg);
  color: var(--blue-2);
  box-shadow: var(--sh-1);
  font-size: var(--fs-xs);
  white-space: nowrap;
}
@media (min-width: 1024px) {
  .demo-bar { bottom: 20px; left: calc(var(--rail-w) + 50%); }
}
.demo-x {
  height: 24px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: var(--blue);
  color: var(--on-accent);
  font-size: var(--fs-xs);
}

/* ---------- 启动题记 ---------- */
.splash {
  position: fixed;
  inset: 0;
  z-index: 96;
  display: none;
}
.splash.open { display: block; }

.splash-mask {
  position: absolute;
  inset: 0;
  background: var(--mask-strong);
  animation: splashIn var(--dur-2) var(--ease) both;
}

.splash-card {
  position: absolute;
  left: 50%;
  top: 46%;
  width: 480px;
  max-width: min(88vw, 480px);
  transform: translate(-50%, -50%);
  padding: 38px 32px 24px;
  background: var(--card);
  border-radius: var(--r-modal);
  box-shadow: var(--sh-3);
  animation: splashCard var(--dur-3) var(--ease) both;
}

/* 题记：左侧一道发丝竖规，取「引文」的意思 —— 平面世界用线不用框 */
.splash-quote {
  position: relative;
  padding-left: 16px;
  font-size: var(--fs-xl);
  line-height: var(--lh-body);
  letter-spacing: .02em;
  color: var(--ink);
}
.splash-quote::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 2px;
  background: var(--rubric);
}
.splash-from {
  margin: 12px 0 0 16px;
  font-size: var(--fs-xs);
  color: var(--ink-3);
  letter-spacing: .02em;
}
.splash-acts {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 30px;
}
.splash-chk {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--ink-2);
  font-size: var(--fs-sm);
}
.splash-box {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--rail-2);
  border-radius: var(--r-tag);
  background: var(--card);
  position: relative;
}
.splash-box.on { background: var(--blue); border-color: var(--blue); }
.splash-box.on::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 0px;
  width: 6px;
  height: 10px;
  border: 2px solid var(--on-accent);
  border-top: 0;
  border-left: 0;
  transform: rotate(42deg);
}

@keyframes splashIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes splashCard {
  from { opacity: 0; transform: translate(-50%, -47%) scale(.98); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* 移动端：题记卡贴底，像一张递到手里的纸 */
@media (max-width: 1023px) {
  .splash-card {
    /* left 必须复位：桌面上它是 left:50% + translate(-50%) 的居中盒，
       这里只把 transform 清掉、忘了 left，卡片就会从屏幕中线开始、右半边跑到屏外。 */
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    width: 100%;
    max-width: 100%;
    transform: none;
    border-radius: var(--r-modal) var(--r-modal) 0 0;
    padding: 30px 22px calc(20px + env(safe-area-inset-bottom, 0px));
  }
  @keyframes splashCard {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
  }
  .splash-quote { font-size: var(--fs-lg); }
}

/* 选中条与演示横条都贴底 —— 选中条出现时横条上移一层，别把按钮压住。
 * 手机：底栏 + 选中条（约 58px）；PC：没有底栏，抬 72px 即可。 */
body.pick-open .demo-bar { bottom: calc(var(--nav-h) + 74px + env(safe-area-inset-bottom, 0px)); }
@media (min-width: 1024px) {
  body.pick-open .demo-bar { bottom: 86px; }
}

/* ---------- PC 侧栏收合 ----------
 * 展开 84px（图标 + 两字），收合 56px（只留图标）。宽度走 --rail-w，
 * 所以 demo-bar 那些 calc() 会自动跟着让位，不用各写一份。
 * 收合后每个按钮仍有 title / aria-label，鼠标悬停读得到名字。 */
/* 收合只属于 PC：小屏没有侧栏，这条不该改动任何移动端尺寸 */
@media (min-width: 1024px) {
  body.rail-collapsed { --rail-w: var(--rail-w-collapsed); }
}
.rail { transition: width var(--dur-2) var(--ease), flex-basis var(--dur-2) var(--ease); }
.rail.collapsed { padding-left: 6px; padding-right: 6px; }
.rail.collapsed .rail-item span { display: none; }
.rail.collapsed .rail-word { display: none; }
.rail.collapsed .rail-brand { padding-bottom: 10px; }
.rail.collapsed .rail-item { height: 46px; }
.rail.collapsed .rail-item.on { background: var(--blue-bg); }

.rail-toggle .vico { width: 15px; height: 15px; opacity: .75; transition: transform var(--dur-2) var(--ease); }
.rail.collapsed .rail-toggle .vico { transform: rotate(180deg); }
.rail-toggle:hover .vico { opacity: 1; }

/* 「收起侧栏」是 PC 独有功能：移动端没有侧栏，这个按钮也就不该存在 */
@media (max-width: 1023px) {
  .rail-toggle { display: none; }
}
