/* ================================================================
   逃 · 逃出生天 —— 单本小说阅读器样式
   默认：纸张暖白（图2 那种舒服的阅读底）
   切换：夜间（深灰，低对比，不刺眼）
   ================================================================ */

:root {
  --paper:        #f6f3ec;
  --paper-edge:   #efe9de;
  --ink:          #2f2a25;
  --ink-soft:     #6a6157;
  --hint:         #9a9084;
  --rule:         #e3dccf;
  --echo:         #8a6a3a;
  --blood:        #8a2f2f;
  --fs:           18px;
}

body.night {
  --paper:        #121110;
  --paper-edge:   #1a1817;
  --ink:          #c8bfae;
  --ink-soft:     #8f8577;
  --hint:         #5f584e;
  --rule:         #26221e;
  --echo:         #b8996a;
  --blood:        #a84444;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { background: var(--paper-edge); }

body {
  background: var(--paper-edge);
  color: var(--ink);
  font-family: "宋体", "SimSun", "Noto Serif SC", "Source Han Serif SC", serif;
  -webkit-font-smoothing: antialiased;
  line-height: 2.5;
  font-size: var(--fs);
  transition: background .35s ease, color .35s ease;
}

/* ---------------- 阅读器主体 ---------------- */
.reader {
  max-width: 660px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--paper);
  padding: 56px 64px 140px;
  box-shadow: 0 0 40px rgba(0,0,0,.06);
}

body.night .reader { box-shadow: 0 0 40px rgba(0,0,0,.4); }

.reader-head {
  text-align: center;
  margin-bottom: 44px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--rule);
}

#chapter-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: .35em;
  color: var(--ink);
  text-indent: .35em;
}

.meta {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--hint);
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: .08em;
}

.meta-tip {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--echo);
  font-family: -apple-system, "PingFang SC", sans-serif;
  letter-spacing: .08em;
  opacity: 0;
  transition: opacity .3s;
  min-height: 1.4em;
}
.meta-tip.show { opacity: 1; }

/* ---------------- 正文 ---------------- */
#text p {
  text-indent: 2em;
  margin-bottom: 1.6em;
  font-size: var(--fs);
  line-height: 2.5;
  text-align: justify;
  letter-spacing: .02em;
  opacity: 0;
  transform: translateY(10px);
  animation: rise 1.5s ease forwards;
}
#text p:first-of-type { text-indent: 0; }

#text p.echo   { color: var(--echo); }
#text p.transit { color: var(--ink-soft); }
#text p.death  { color: var(--blood); text-indent: 0; }

@keyframes rise {
  to { opacity: 1; transform: translateY(0); }
}

.fade-out { animation: sink .7s ease forwards; }
@keyframes sink {
  to { opacity: 0; transform: translateY(-10px); }
}

/* ---------------- 选项（像正文里的岔路，不像按钮） ---------------- */
#choices {
  margin-top: 48px;
  padding-top: 26px;
  border-top: 1px dashed var(--rule);
}

#choices .choice-hint {
  text-indent: 0;
  color: var(--hint);
  font-style: italic;
  margin-bottom: 22px;
  opacity: 0;
  animation: rise 1.5s ease forwards;
  animation-delay: .1s;
}

#choices button {
  display: block;
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  color: var(--ink-soft);
  font-family: inherit;
  font-size: calc(var(--fs) - 0.5px);
  line-height: 2.3;
  padding: 14px 4px 14px 0;
  margin: 0;
  cursor: pointer;
  letter-spacing: .02em;
  opacity: 0;
  transform: translateY(8px);
  animation: rise 1.4s ease forwards;
  transition: color .35s ease, padding-left .35s ease;
}
#choices button:hover {
  color: var(--echo);
  padding-left: 10px;
}
#choices button.picked { color: var(--ink); font-weight: 600; }

#choices .opt-num {
  color: var(--hint);
  margin-right: 14px;
  font-size: calc(var(--fs) - 3px);
  font-family: -apple-system, "PingFang SC", serif;
}
#choices button:hover .opt-num { color: var(--echo); }

#choices button.retry {
  margin-top: 26px;
  color: var(--blood);
  border-top: 1px solid var(--rule);
  padding-top: 20px;
  border-radius: 0;
}
#choices button.retry:hover { color: var(--blood); }

/* ---------------- 右侧工具栏 ---------------- */
.toolbar {
  position: fixed;
  right: calc(44% - 600px / 2 + 14px);  /* 紧贴阅读区右边缘 */
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(255,255,255,.72);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 10px 6px;
  backdrop-filter: blur(8px);
  z-index: 100;
  box-shadow: 0 6px 20px rgba(0,0,0,.07);
}
body.night .toolbar {
  background: rgba(20,18,17,.72);
  border-color: var(--rule);
  box-shadow: 0 6px 20px rgba(0,0,0,.45);
}
.toolbar .tb-sep {
  height: 1px;
  background: var(--rule);
  margin: 5px 8px;
}
.toolbar button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink-soft);
  font-size: 16px;
  font-family: -apple-system, "PingFang SC", sans-serif;
  padding: 8px 10px;
  border-radius: 7px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: background .25s, color .25s;
  line-height: 1.1;
}
.toolbar button span { font-size: 10.5px; letter-spacing: .06em; color: var(--hint); }
.toolbar button:hover { background: var(--paper-edge); color: var(--echo); }
.toolbar button:hover span { color: var(--echo); }

/* ---------------- 手机 ---------------- */
@media (max-width: 860px) {
  .toolbar { right: 6px; padding: 8px 3px; gap: 2px; border-radius: 8px; }
  .toolbar button { font-size: 15px; padding: 7px 8px; }
  .toolbar button span { display: none; }
  .toolbar .tb-sep { margin: 4px 5px; }
}
@media (max-width: 640px) {
  .reader { padding: 32px 22px 100px; box-shadow: none; }
  #text p { line-height: 2.2; margin-bottom: 1.3em; }
}
