:root {
  --deep: #08203f;
  --blue: #123f7a;
  --gold: #e2c07f;
  --gold-lt: #f6e9d2;
  --ink: #12365f;
  --stage: 480px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--deep);
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
}

img { border-style: none; }

/* ============ 开屏 ============ */
.splash {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
  background: var(--deep) center/cover no-repeat;
  transition: opacity .65s ease;
}
.splash.is-hide { opacity: 0; pointer-events: none; }

.splash__book {
  width: 46vw;
  max-width: 200px;
  aspect-ratio: 592 / 781;
  background: center/contain no-repeat;
  animation: bookIn 1.5s cubic-bezier(.2, .85, .2, 1) both;
}
@keyframes bookIn {
  from { opacity: 0; transform: translateY(46px) scale(.82) rotateZ(-4deg); }
  to   { opacity: 1; transform: none; }
}

.splash__tip {
  font-size: 13px;
  letter-spacing: 3px;
  color: rgba(255, 255, 255, .68);
  animation: fade 1.8s ease-in-out infinite;
}
@keyframes fade { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }

/* ============ 翻页容器 ============ */
.deck {
  position: relative;
  width: 100%;
  max-width: var(--stage);
  margin: 0 auto;
  height: 100vh;
  height: 100dvh;
  /* 只能点底部按钮翻页：这里关掉用户滑动，JS 仍可用 scrollTo 定位 */
  overflow: hidden;
  scrollbar-width: none;
  box-shadow: 0 0 60px rgba(0, 0, 0, .6);
}
.deck::-webkit-scrollbar { display: none; }

.page {
  position: relative;
  height: 100vh;
  height: 100dvh;
  background: var(--blue) center/cover no-repeat;
  overflow: hidden;
}

/* ============ 封面入口层：盖在翻页容器之上，必须点按钮才进入 ============ */
.gate {
  position: fixed;
  inset: 0;
  z-index: 45;
  width: 100%;
  max-width: var(--stage);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
  padding: 0 24px calc(env(safe-area-inset-bottom) + 40px);
  background: var(--blue) center/cover no-repeat;
  transition: opacity .5s ease, visibility .5s ease;
}
.gate.is-hide { opacity: 0; visibility: hidden; }

.gate__book {
  width: 60%;
  max-width: 250px;
  animation: coverFloat 5s ease-in-out infinite;
}
.gate__book img {
  display: block;
  width: 100%;
}
@keyframes coverFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}

.gate__meta { text-align: center; }
.gate__issue {
  font-size: 17px;
  letter-spacing: 2px;
  color: var(--gold-lt);
}
.gate__issue b {
  font-size: 26px;
  margin: 0 4px;
  color: var(--gold);
}
.gate__range {
  margin-top: 10px;
  font-size: 15px;
  letter-spacing: 4px;
  color: rgba(255, 255, 255, .72);
}

.gate__btn {
  margin-top: 4px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.gate__btn img {
  display: block;
  width: 216px;
  max-width: 68vw;
  height: auto;
}
.gate__btn:active { transform: scale(.96); }


/* ============ 本期概要页：金框 + 居中文字 + 点击查看 ============ */
.brief {
  position: fixed;
  inset: 0;
  z-index: 44;
  width: 100%;
  max-width: var(--stage);
  margin: 0 auto;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
  /* 左右收窄，给放大后的正文腾出宽度，避免 9 字一句被折行 */
  padding: calc(env(safe-area-inset-top) + 54px) 20px calc(env(safe-area-inset-bottom) + 42px);
  background: var(--blue) center/cover no-repeat;
  transition: opacity .5s ease, visibility .5s ease;
  overflow-y: auto;
}
.brief.is-show { display: flex; }
.brief.is-hide { opacity: 0; visibility: hidden; }

/* 框高度跟着文字走，不再撑满整屏；上边距给骑在线上的日期留位置 */
.brief__box {
  width: 100%;
  margin-top: 18px;
}

/* 顶边由两侧短线 + 中间日期组成。head 高度归零，
   两条线才会正好落在 body 顶边的位置，与左右竖边框接上 */
.brief__head {
  display: flex;
  align-items: center;
  height: 0;
}
.brief__head i {
  flex: 1;
  min-width: 16px;
  height: 1px;
  background: rgba(226, 192, 127, .55);
}
.brief__date {
  padding: 0 14px;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: 1px;
  white-space: nowrap;
  color: #fff;
}

.brief__body {
  padding: 30px 12px 32px;
  border: 1px solid rgba(226, 192, 127, .55);
  border-top: 0;
  border-radius: 0 0 10px 10px;
  text-align: center;
}
.brief__line {
  margin: 0 0 14px;
  font-size: 23px;
  line-height: 1.45;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, .95);
}
.brief__line:last-child { margin-bottom: 0; }
.brief__dots {
  margin: 4px 0 16px;
  font-size: 19px;
  letter-spacing: 5px;
  color: rgba(255, 255, 255, .55);
}

.brief__btn {
  flex: none;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.brief__btn img {
  display: block;
  width: 150px;
  max-width: 48vw;
  height: auto;
}
.brief__btn:active { transform: scale(.96); }

/* ============ 书记选择页：点名条进各自的详情页 ============ */
.roster {
  position: fixed;
  inset: 0;
  z-index: 43;
  width: 100%;
  max-width: var(--stage);
  margin: 0 auto;
  display: none;
  flex-direction: column;
  padding: calc(env(safe-area-inset-top) + 52px) 34px calc(env(safe-area-inset-bottom) + 26px) 18px;
  background: var(--blue) center/cover no-repeat;
  transition: opacity .5s ease, visibility .5s ease;
}
.roster.is-show { display: flex; }
.roster.is-hide { opacity: 0; visibility: hidden; }

.roster__list {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.roster__list::-webkit-scrollbar { display: none; }

/* 名条：金色斜切姓名 + 蓝底职务，整条可点 */
.roster__item {
  flex: none;
  display: flex;
  align-items: stretch;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 6px;
  overflow: hidden;
  background: none;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .28);
}
.roster__item:active { transform: scale(.985); }

.roster__name {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 104px;
  padding: 13px 28px 13px 18px;
  margin-right: -15px;
  background: linear-gradient(135deg, #f8eedb, #e0c69c);
  color: var(--ink);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 2px;
  clip-path: polygon(0 0, 100% 0, calc(100% - 15px) 100%, 0 100%);
}
.roster__title {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 11px 16px 11px 26px;
  background: linear-gradient(96deg, #17417a, #3d82c8);
  color: #fff;
  font-size: 17px;
  line-height: 1.35;
  letter-spacing: 1px;
}
/* 长职务均分两行，避免末行只剩一个字（不支持的浏览器按普通换行，无副作用） */
.roster__title b {
  font-weight: 400;
  text-wrap: balance;
}

/* 后台传了名条图就整条用图，不再套金色/蓝色底。
   手机上整条铺满偏大，收窄 60px 并居中 */
.roster__item--img {
  width: calc(100% - 60px);
  align-self: center;
  border-radius: 0;
  box-shadow: none;
}
.roster__item--img img { display: block; width: 100%; height: auto; }

.roster__end {
  flex: none;
  align-self: center;
  margin: 20px 0 4px;
  padding: 9px 32px;
  border: 1px solid rgba(226, 192, 127, .75);
  border-radius: 6px;
  background: rgba(255, 255, 255, .06);
  color: var(--gold-lt);
  font-size: 17px;
  letter-spacing: 3px;
  cursor: pointer;
}
.roster__end:active { background: rgba(226, 192, 127, .2); }

.roster__tip {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  writing-mode: vertical-rl;
  font-size: 12px;
  letter-spacing: 3px;
  color: rgba(255, 255, 255, .5);
  pointer-events: none;
}

/* ============ 内页 ============ */
.sheet {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  /* 长图铺满，只在下方留出翻页按钮的位置 */
  padding: 0;
}

/* 长图直接铺满，不再套金色边框 */
.shot {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  padding: 0;
  border-radius: 0;
  background: none;
}
/* 长图在框内可滚动，滚到底再滑就会继续翻页，所以不锁滚动链 */
.shot__scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: rgba(6, 26, 54, .4);
  scrollbar-width: none;
}
.shot__scroll::-webkit-scrollbar { display: none; }
.shot__scroll img {
  display: block;
  width: 100%;
  min-height: 120px;
  /* 长图整体上移，顶部这段不在框内显示（点「看大图」仍是完整原图） */
  margin-top: -50px;
  opacity: 0;
  transition: opacity .45s ease;
}
.shot__scroll img.is-loaded { opacity: 1; }

.shot__zoom {
  position: absolute;
  right: 12px;
  /* 顶部右侧，避开刘海/状态栏 */
  top: calc(env(safe-area-inset-top) + 12px);
  transition: opacity .3s ease;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(8, 28, 58, .68);
  border: 1px solid rgba(226, 192, 127, .45);
  color: var(--gold-lt);
  font-size: 11px;
  letter-spacing: 1px;
  pointer-events: none;
}

/* 同一位书记有多张图时，左上角标一下这是第几张 */
.shot__seq {
  position: absolute;
  left: 12px;
  top: calc(env(safe-area-inset-top) + 12px);
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(8, 28, 58, .68);
  border: 1px solid rgba(226, 192, 127, .45);
  color: var(--gold-lt);
  font-size: 11px;
  letter-spacing: 1px;
  pointer-events: none;
}

.sheet__empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  /* sheet 已经没有内边距了，这里自己撑开 */
  margin: calc(env(safe-area-inset-top) + 52px) 18px 18px;
  border: 1px dashed rgba(226, 192, 127, .5);
  border-radius: 16px;
  text-align: center;
}
.sheet__empty p { margin: 0; font-size: 19px; }
.sheet__empty span { font-size: 13px; color: rgba(255, 255, 255, .6); }

/* ============ 详情页底部：上一位 / 目录 / 下一位 ============ */
/* 底部这条给纯色底：真机上屏幕比例各不相同，长图下方这段会露出页面的
   装饰背景图，纹理压在按钮后面很杂。铺一层深色把它盖掉 */
.nav {
  flex: none;
  display: flex;
  align-items: stretch;
  gap: 7px;
  padding: 10px 12px calc(env(safe-area-inset-bottom) + 12px);
  background: var(--deep);
  /* 收起时整条压平，上面的长图就能占满整屏 */
  max-height: 130px;
  overflow: hidden;
  transition: opacity .3s ease, max-height .3s ease, padding .3s ease;
}

/* 三秒没动作就把上下两处控件收起来，点一下页面再出来 */
body.is-bare .nav {
  opacity: 0;
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  pointer-events: none;
}
body.is-bare .shot__zoom { opacity: 0; }
.nav__side {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 9px 4px;
  border: 1px solid rgba(226, 192, 127, .5);
  border-radius: 8px;
  background: rgba(8, 28, 58, .72);
  color: var(--gold-lt);
  /* 一排显示，不换行 */
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
}
.nav__side em {
  flex: none;
  font-style: normal;
  font-size: 16px;
  line-height: 1;
  opacity: .8;
}
/* 文案再长也宁可省略号，不要硬裁掉半个字 */
.nav__side span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav__side:active { background: rgba(226, 192, 127, .22); }
/* 没有上一位/下一位时只作提示，不可点 */
.nav__side.is-off {
  opacity: .5;
  border-style: dashed;
  cursor: default;
}

.nav__menu {
  flex: none;
  padding: 9px 14px;
  border: 1px solid rgba(226, 192, 127, .85);
  border-radius: 8px;
  background: rgba(226, 192, 127, .2);
  color: var(--gold-lt);
  font-size: 14px;
  letter-spacing: 1px;
  white-space: nowrap;
  cursor: pointer;
}
.nav__menu:active { background: rgba(226, 192, 127, .3); }

/* 320 类窄屏：三个按钮挤在一排会差几个像素，收紧留白和字号 */
@media (max-width: 359px) {
  .nav { gap: 5px; padding: 8px 8px calc(env(safe-area-inset-bottom) + 10px); }
  .nav__side { font-size: 10px; padding: 9px 3px; }
  .nav__side em { font-size: 14px; }
  .nav__menu { padding: 9px 11px; font-size: 13px; }
}

/* ============ 结尾页 ============ */
.end {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 0 28px calc(env(safe-area-inset-bottom) + 60px);
  text-align: center;
}
.end__line {
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.end__title { margin: 0; font-size: 25px; letter-spacing: 3px; }
.end__sub { margin: 0; font-size: 14px; color: rgba(255, 255, 255, .68); }

.end__btn {
  margin-top: 8px;
  padding: 11px 34px;
  border: 1px solid rgba(226, 192, 127, .8);
  border-radius: 999px;
  color: var(--gold-lt);
  font-size: 15px;
  letter-spacing: 2px;
  text-decoration: none;
}
.end__btn:active { background: rgba(226, 192, 127, .16); }

.end__back {
  margin: 22px 0 0;
  font-size: 13px;
  color: rgba(255, 255, 255, .5);
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ============ 悬浮控件 ============ */
.hud {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 12px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  width: min(100%, var(--stage));
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
  transition: opacity .4s ease, visibility .4s ease;
}
.hud__bgm {
  width: 34px;
  height: 34px;
  padding: 7px;
  border: 0;
  border-radius: 50%;
  background: rgba(8, 28, 58, .5);
  pointer-events: auto;
}
.hud__bgm img { width: 100%; height: 100%; filter: brightness(0) invert(1); opacity: .85; }
.hud__bgm.is-on img { animation: spin 4s linear infinite; }
.hud__bgm.is-off img { opacity: .4; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ 大图查看 ============ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  background: rgba(3, 12, 26, .96);
}
.lightbox.is-open { display: block; }
.lightbox__inner {
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.lightbox__inner img {
  display: block;
  width: 100%;
  max-width: var(--stage);
  margin: 0 auto;
}
.lightbox__close {
  position: absolute;
  top: calc(env(safe-area-inset-top) + 10px);
  right: 14px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  font-size: 22px;
  line-height: 1;
}
.lightbox__tip {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(env(safe-area-inset-bottom) + 14px);
  text-align: center;
  font-size: 11px;
  color: rgba(255, 255, 255, .45);
  pointer-events: none;
}

/* ============ 往期列表 / 提示页 ============ */
.simple {
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  max-width: var(--stage);
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 36px) 20px 40px;
  background: linear-gradient(170deg, #2f6fb5, #123f7a 55%, #08203f);
}
.simple__title { margin: 0 0 6px; font-size: 22px; letter-spacing: 2px; }
.simple__sub { margin: 0 0 26px; font-size: 13px; color: rgba(255, 255, 255, .6); }
.simple__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 16px;
  margin-bottom: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .1);
  color: #fff;
  text-decoration: none;
}
.simple__row b { font-size: 16px; white-space: nowrap; }
/* 期号后面跟本期标题。标题长了就整段换到下一行，不截字 */
.simple__row-main {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 3px 8px;
}
.simple__row-title {
  min-width: 0;
  font-style: normal;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255, 255, 255, .78);
}
.simple__row-date { flex: none; font-size: 12px; color: rgba(255, 255, 255, .6); }
/* 白色边线、胶囊形、内部镂空 */
.simple__link {
  display: inline-block;
  margin-top: 22px;
  padding: 10px 30px;
  border: 1px solid rgba(255, 255, 255, .85);
  border-radius: 999px;
  background: transparent;
  color: #fff;
  font-size: 14px;
  letter-spacing: 2px;
  text-decoration: none;
}
.simple__link:active { background: rgba(255, 255, 255, .16); }
.simple__note {
  margin-top: 30px;
  padding: 16px;
  border: 1px dashed rgba(255, 255, 255, .25);
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.9;
  color: rgba(255, 255, 255, .72);
}
.simple__note code {
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, .3);
  font-size: 12px;
}

/* 未发布期数的预览标记，要压在所有蒙层之上 */
.draft-flag {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 10px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  max-width: 88vw;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(196, 62, 46, .92);
  color: #fff;
  font-size: 11px;
  line-height: 1.5;
  white-space: nowrap;
  pointer-events: none;
}

.demo-flag {
  position: fixed;
  left: 12px;
  bottom: calc(env(safe-area-inset-bottom) + 14px);
  z-index: 40;
  max-width: 62vw;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(226, 192, 127, .92);
  color: #3b2a08;
  font-size: 10.5px;
  line-height: 1.5;
}
