/* ── Header ──────────────────────────────────────────────── */
#header {
  flex: none;
  height: 96px;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 32px;
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 3;
}
.brand {
  display: flex;
  align-items: center;
  gap: 20px;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-align: left;
}
.brand img {
  width: 62px; height: 62px;
  object-fit: contain;
  background: #fff;
  border-radius: 10px;
  flex: none;
}
.brand .bn { display: flex; flex-direction: column; gap: 3px; }
.brand .b1 { font-size: 30px; font-weight: 600; }
/* ASIN 用等宽体、站点用正文字体，两种字体在同一字号下 ascent 不同，
   按盒子对齐会让文字差出 3px。改成按基线对齐。 */
.brand .b2 { font-size: 20px; color: var(--muted); display: flex; gap: 16px;
             align-items: baseline; }

.hist-chip {
  margin-left: 6px;
  font-size: 24px; font-weight: 600;
  padding: 9px 20px;
  border-radius: 999px;
  background: var(--yellow-soft);
  color: var(--yellow-ink);
  border: 0; cursor: pointer;
}

.head-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 20px;
}
.head-date { text-align: right; display: flex; flex-direction: column; gap: 3px; }
.head-date .d1 { font-size: 26px; font-family: var(--mono); }
.head-date .d2 { font-size: 19px; color: var(--muted); }

.dots { display: flex; gap: 6px; align-items: center; }
.dots button { border: 0; padding: 12px 4px; background: none; cursor: pointer; display: block; }
.dots i {
  display: block; height: 8px; border-radius: 4px;
  background: var(--de);
  width: 10px;
  transition: width .25s ease, background .25s ease;
}
.dots button.on i { width: 38px; background: var(--accent); }
#stage.hist .dots button.on i { background: var(--yellow); }

.btn-ghost {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  border-radius: 10px;
  padding: 9px 18px;
  font-size: 20px;
  cursor: pointer;
}
.btn-ghost.icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 52px; height: 48px; padding: 0; color: var(--ink-2);
}
.btn-ghost.icon:active { background: var(--accent-soft); color: var(--accent-ink); }

/* ── 横幅 ────────────────────────────────────────────────── */
#banners { flex: none; position: relative; z-index: 3; }
.banner {
  display: flex; align-items: center; gap: 20px;
  padding: 18px 32px;
  font-size: 26px;
  border-left: 6px solid var(--lv);
  background: var(--lv-soft);
  color: var(--lv-ink);
}
.banner b {
  font-size: 22px; font-weight: 700; letter-spacing: .08em;
  padding: 5px 14px; border-radius: 6px;
  background: var(--lv); color: var(--bg);
  flex: none;
}
.banner .tail { margin-left: auto; font-size: 22px; font-family: var(--mono); }

/* ── 屏幕容器与切屏动效 ──────────────────────────────────
   只动 transform / opacity，全部交给合成器，不触发重排。
   内容在切换前就渲染好了（见 app.js 的预渲染），
   所以动画期间主线程是空的，滑动才不会卡。 */
#screens {
  flex: 1; position: relative; min-height: 0;
  overflow: hidden;
  touch-action: pan-y;          /* 竖向交给浏览器滚清单，横向留给拖拽翻页 */
}
.screen {
  position: absolute; inset: 0;
  display: none;
  flex-direction: column;
  contain: layout paint;
  backface-visibility: hidden;
}

/* 参与本次切换的两屏才提升为合成层，切完就还回去，
   避免 9 屏 SVG 常驻 GPU 内存（安卓白板吃不消）。 */
.screen.anim {
  display: flex;
  will-change: transform, opacity;
  transition: transform var(--dur, 460ms) cubic-bezier(.22, .61, .25, 1),
              opacity calc(var(--dur, 460ms) * .55) linear;
}
.screen.on { display: flex; transform: translate3d(0, 0, 0); opacity: 1; }
.screen.dragging { display: flex; transition: none !important; will-change: transform, opacity; }

/* 入场起点 / 出场终点 */
.screen.from-right { transform: translate3d(100%, 0, 0); opacity: 0; }
.screen.from-left  { transform: translate3d(-100%, 0, 0); opacity: 0; }
.screen.exit-left  { transform: translate3d(-100%, 0, 0); opacity: 0; }
.screen.exit-right { transform: translate3d(100%, 0, 0); opacity: 0; }

/* 设置里可切成淡入淡出或直接硬切 */
#stage.tr-fade .screen.from-right,
#stage.tr-fade .screen.from-left,
#stage.tr-fade .screen.exit-left,
#stage.tr-fade .screen.exit-right { transform: none; opacity: 0; }
#stage.tr-none .screen.anim { transition: none; }

@media (prefers-reduced-motion: reduce) {
  .screen.anim { transition: opacity 120ms linear; }
  .screen.from-right, .screen.from-left,
  .screen.exit-left, .screen.exit-right { transform: none; }
}

.pad { flex: 1; padding: 26px 32px 30px; min-height: 0; display: flex; flex-direction: column; gap: 18px; }
.grid-s1 { flex: 1; display: grid; grid-template-columns: minmax(0,1fr) 660px; gap: 24px; min-height: 0; }
.grid-4  { flex: 1; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 22px; min-height: 0; }
.grid-2  { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 22px; min-height: 0; }
.col { display: flex; flex-direction: column; gap: 20px; min-height: 0; }

/* ── 边缘翻页热区（远看无痕，触控可用）─────────────────── */
.edge {
  position: absolute; top: 96px; bottom: 0;
  width: 7%;
  background: none; border: 0; cursor: pointer;
  z-index: 2; opacity: 0;
}
#edge-prev { left: 0; }
#edge-next { right: 0; }
/* 原来按下时闪一层白，墙上看着像脏印子，去掉。热区本来就该无形 */

/* ── Footer ──────────────────────────────────────────────── */
#footer {
  flex: none; height: 46px;
  display: flex; align-items: center; gap: 18px;
  padding: 0 32px;
  border-top: 1px solid var(--line-2);
  font-size: 19px; color: var(--muted);
  position: relative; z-index: 3;
}
#footer .sep { margin-left: auto; }

/* ── 底部滑出面板 ────────────────────────────────────────── */
.sheet-mask {
  position: absolute; inset: 0;
  background: rgba(7,12,16,.72);
  z-index: 10;
  border: 0; padding: 0; cursor: pointer;
}
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-radius: 20px 20px 0 0;
  padding: 28px 40px 36px;
  z-index: 11;
  display: flex; flex-direction: column; gap: 22px;
  animation: slideUp .28s cubic-bezier(.22,.72,.2,1);
}
.sheet.top {
  top: 0; bottom: auto;
  border-radius: 0 0 20px 20px;
  border-top: 0; border-bottom: 1px solid var(--line);
  animation: slideDown .28s cubic-bezier(.22,.72,.2,1);
}
@keyframes slideUp   { from { transform: translateY(100%); } to { transform: none; } }
@keyframes slideDown { from { transform: translateY(-100%); } to { transform: none; } }
.sheet-h { display: flex; align-items: baseline; gap: 18px; }
.sheet-h .t { font-size: 34px; font-weight: 600; }
.sheet-h .s { font-size: 21px; color: var(--muted); }
