/* ============================================================
   小说站样式表
   主题通过 <html data-theme="light|dark|sepia"> 切换，
   阅读参数（字号/行距/字体/页宽）通过 <html> 上的 data-* 属性驱动。
   ============================================================ */

:root {
  /* 三套中文字体栈，全部走系统字体，不加载任何外部字体文件 */
  --font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong",
                SimSun, Georgia, "Times New Roman", serif;
  --font-sans: "Noto Sans SC", "Source Han Sans SC", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", -apple-system,
               BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-kai: "Kaiti SC", "STKaiti", KaiTi, "Noto Serif SC", serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --reading-font: var(--font-serif);
  --reading-size: 19px;
  --reading-leading: 1.9;
  --reading-width: 40rem;
  --reading-indent: 2em;

  --radius: 10px;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 16px rgb(0 0 0 / 0.08);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- 日间：暖白纸感，不用纯白，长时间看不刺眼 ---------- */
:root,
:root[data-theme="light"] {
  --bg: #faf9f7;
  --surface: #ffffff;
  --surface-2: #f2f0ec;
  --text: #26221d;
  --text-soft: #4a443c;
  --muted: #857e74;
  --border: #e4e0d8;
  --border-strong: #d2ccc0;
  --accent: #8a5a2b;
  --accent-soft: #f0e6d8;
  --danger: #a33a2c;
  --ok: #3f7a4a;
  color-scheme: light;
}

/* ---------- 夜间：低对比暗底，正文不用纯白避免光晕 ---------- */
:root[data-theme="dark"] {
  --bg: #15171b;
  --surface: #1c1f25;
  --surface-2: #23272e;
  --text: #cfcabf;
  --text-soft: #b3aea4;
  --muted: #7d8189;
  --border: #2d323a;
  --border-strong: #3d434c;
  --accent: #c99a63;
  --accent-soft: #2a2620;
  --danger: #d97a6a;
  --ok: #7ab88a;
  color-scheme: dark;
}

/* ---------- 护眼：米黄纸色 ---------- */
:root[data-theme="sepia"] {
  --bg: #f2e9d8;
  --surface: #f8f1e3;
  --surface-2: #ebe0ca;
  --text: #443929;
  --text-soft: #5b4d39;
  --muted: #8a7a60;
  --border: #ddd0b6;
  --border-strong: #c9b997;
  --accent: #8a5a2b;
  --accent-soft: #e8dcc2;
  --danger: #a33a2c;
  --ok: #3f7a4a;
  color-scheme: light;
}

/* 没手动选过主题时跟随系统；一旦点了按钮，data-theme 就固定下来 */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #15171b;
    --surface: #1c1f25;
    --surface-2: #23272e;
    --text: #cfcabf;
    --text-soft: #b3aea4;
    --muted: #7d8189;
    --border: #2d323a;
    --border-strong: #3d434c;
    --accent: #c99a63;
    --accent-soft: #2a2620;
    --danger: #d97a6a;
    --ok: #7ab88a;
    color-scheme: dark;
  }
}

/* ---------- 阅读参数：由 <html> 上的 data-* 驱动 ---------- */
:root[data-size="s"]  { --reading-size: 17px; }
:root[data-size="m"]  { --reading-size: 19px; }
:root[data-size="l"]  { --reading-size: 21px; }
:root[data-size="xl"] { --reading-size: 24px; }
:root[data-size="xxl"]{ --reading-size: 28px; }

:root[data-leading="tight"]  { --reading-leading: 1.65; }
:root[data-leading="normal"] { --reading-leading: 1.9; }
:root[data-leading="loose"]  { --reading-leading: 2.2; }

:root[data-font="serif"] { --reading-font: var(--font-serif); }
:root[data-font="sans"]  { --reading-font: var(--font-sans); }
:root[data-font="kai"]   { --reading-font: var(--font-kai); }

:root[data-width="narrow"] { --reading-width: 34rem; }
:root[data-width="normal"] { --reading-width: 40rem; }
:root[data-width="wide"]   { --reading-width: 48rem; }

:root[data-indent="on"]  { --reading-indent: 2em; }
:root[data-indent="off"] { --reading-indent: 0; }

/* ------------------------------------------------------------ 基础 */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }

::selection { background: var(--accent-soft); color: var(--text); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.wrap { max-width: 62rem; margin: 0 auto; padding: 0 1.25rem; }
.wrap-narrow { max-width: 46rem; margin: 0 auto; padding: 0 1.25rem; }

/* 只给读屏软件看的内容 */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ------------------------------------------------------------ 页头 */

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(1.4) blur(8px);
}

.site-header .inner {
  max-width: 62rem;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; color: var(--accent); }

.nav { display: flex; gap: 1rem; align-items: center; margin-left: auto; }
.nav a { color: var(--text-soft); font-size: 0.9rem; }
.nav a:hover { color: var(--accent); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--accent); }

/* 主题切换按钮：三态循环 日→夜→护眼 */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text-soft);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  font-size: 0.82rem;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.theme-toggle:hover { background: var(--accent-soft); color: var(--text); }
.theme-toggle .icon { font-size: 0.95rem; line-height: 1; }

/* ------------------------------------------------------------ 页脚 */

.site-footer {
  margin-top: 4rem;
  padding: 2rem 1.25rem 3rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}
.site-footer a { color: var(--muted); text-decoration: underline; }

/* ------------------------------------------------------------ 书架 */

.page-head { padding: 3rem 0 2rem; text-align: center; }
.page-head h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  margin: 0 0 0.5rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.page-head p { color: var(--muted); margin: 0; }

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 1.25rem;
}

.book-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: border-color 0.15s var(--ease), transform 0.15s var(--ease),
              box-shadow 0.15s var(--ease);
}
.book-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}
.book-card h2 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  margin: 0 0 0.4rem;
  color: var(--text);
  font-weight: 600;
}
.book-card .byline { color: var(--muted); font-size: 0.85rem; margin: 0 0 0.75rem; }
.book-card .intro {
  color: var(--text-soft);
  font-size: 0.9rem;
  line-height: 1.7;
  margin: 0 0 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.book-card .meta {
  margin-top: auto;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.8rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.tag {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--border);
}
.tag.draft { background: transparent; color: var(--muted); }

.empty {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--muted);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}

/* ------------------------------------------------------------ 书籍详情 */

.book-hero {
  padding: 2.5rem 0 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}
.book-hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 4vw, 2rem);
  margin: 0 0 0.5rem;
  font-weight: 600;
}
.book-hero .byline { color: var(--muted); margin: 0 0 1rem; font-size: 0.95rem; }
.book-hero .intro {
  color: var(--text-soft);
  line-height: 1.85;
  white-space: pre-wrap;
  max-width: 44rem;
  font-size: 0.95rem;
}
.book-hero .stats {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 1rem;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 600;
  margin: 2rem 0 1rem;
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}
.section-title .count { color: var(--muted); font-size: 0.85rem; font-weight: 400; }

.toc {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 0.15rem 1.5rem;
}
.toc li { border-bottom: 1px dashed var(--border); }
.toc a {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
  padding: 0.6rem 0.25rem;
  color: var(--text-soft);
  font-size: 0.92rem;
}
.toc a:hover { color: var(--accent); background: var(--surface-2); text-decoration: none; }
.toc a .wc { color: var(--muted); font-size: 0.75rem; flex-shrink: 0; }
.toc a .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pager {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  align-items: center;
  margin: 2rem 0;
  flex-wrap: wrap;
}
.pager a, .pager span {
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-soft);
  font-size: 0.85rem;
}
.pager a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.pager .current { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }

/* ------------------------------------------------------------ 阅读页 */

.reader-shell { padding: 2rem 0 1rem; }

.chapter-crumb {
  max-width: var(--reading-width);
  margin: 0 auto 1.5rem;
  padding: 0 1.25rem;
  color: var(--muted);
  font-size: 0.85rem;
}
.chapter-crumb a { color: var(--muted); }
.chapter-crumb a:hover { color: var(--accent); }

article.chapter {
  max-width: var(--reading-width);
  margin: 0 auto;
  padding: 0 1.25rem;
  font-family: var(--reading-font);
  font-size: var(--reading-size);
  line-height: var(--reading-leading);
  color: var(--text);
  /* 中西文混排时自动加间隙，中文排版的关键一笔 */
  text-spacing-trim: space-all;
}

article.chapter > h1 {
  font-size: 1.35em;
  font-weight: 600;
  line-height: 1.5;
  margin: 0 0 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  text-align: center;
  letter-spacing: 0.02em;
}

.chapter-body p {
  margin: 0 0 1.15em;
  text-indent: var(--reading-indent);
  /* 中文两端对齐更像书，配合断字避免出现大空隙 */
  text-align: justify;
  text-justify: inter-ideograph;
  word-break: normal;
  overflow-wrap: break-word;
  hanging-punctuation: allow-end;
}
.chapter-body p:last-child { margin-bottom: 0; }

.chapter-body h2, .chapter-body h3, .chapter-body h4 {
  font-weight: 600;
  margin: 2em 0 0.8em;
  text-indent: 0;
  line-height: 1.5;
}
.chapter-body h2 { font-size: 1.2em; }
.chapter-body h3 { font-size: 1.08em; }
.chapter-body h4 { font-size: 1em; }

.chapter-body blockquote {
  margin: 1.5em 0;
  padding: 0.5em 0 0.5em 1.2em;
  border-left: 3px solid var(--border-strong);
  color: var(--text-soft);
}
.chapter-body blockquote p { text-indent: 0; }

.chapter-body ul, .chapter-body ol { padding-left: 1.6em; margin: 0 0 1.15em; }
.chapter-body li { margin-bottom: 0.4em; text-indent: 0; }

.chapter-body pre {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1em;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.85em;
  line-height: 1.6;
  text-indent: 0;
}
.chapter-body code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--surface-2);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}
.chapter-body pre code { background: none; padding: 0; }

.chapter-body img { display: block; margin: 1.5em auto; border-radius: 6px; }

.chapter-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.9em;
  text-indent: 0;
}
.chapter-body th, .chapter-body td {
  border: 1px solid var(--border);
  padding: 0.5em 0.75em;
  text-align: left;
}
.chapter-body th { background: var(--surface-2); font-weight: 600; }

.chapter-body hr { margin: 2.5em auto; width: 30%; }

/* 章末导航 */
.chapter-nav {
  max-width: var(--reading-width);
  margin: 3rem auto 0;
  padding: 1.5rem 1.25rem 0;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.75rem;
  align-items: stretch;
}
/* 只给直接子元素加框，否则里面的 .label / .title-line 也会被套上一层边框 */
.chapter-nav > a, .chapter-nav > span {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.88rem;
  color: var(--text-soft);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}
.chapter-nav > a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.chapter-nav .label { font-size: 0.75rem; color: var(--muted); }
.chapter-nav .title-line {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chapter-nav .to-next { text-align: right; }
.chapter-nav > .to-toc { flex: 0 0 auto; justify-content: center; align-items: center; }
.chapter-nav > .disabled { opacity: 0.4; }

/* 阅读设置面板 */
.settings-fab {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 60;
  width: 2.9rem;
  height: 2.9rem;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-soft);
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s var(--ease);
}
.settings-fab:hover { transform: scale(1.06); color: var(--accent); }

.settings-panel {
  position: fixed;
  right: 1.25rem;
  bottom: 4.6rem;
  z-index: 61;
  width: min(20rem, calc(100vw - 2.5rem));
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 1rem;
}
.settings-panel[hidden] { display: none !important; }
.settings-row { margin-bottom: 0.9rem; }
.settings-row:last-child { margin-bottom: 0; }
.settings-row > .label {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
  letter-spacing: 0.04em;
}
.seg {
  display: flex;
  gap: 0.25rem;
  background: var(--surface-2);
  border-radius: 8px;
  padding: 0.2rem;
}
.seg button {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--text-soft);
  border-radius: 6px;
  padding: 0.35rem 0.2rem;
  font-size: 0.82rem;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s var(--ease);
  white-space: nowrap;
}
.seg button:hover { background: var(--bg); }
.seg button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}
.settings-reset {
  width: 100%;
  margin-top: 0.25rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  border-radius: 6px;
  padding: 0.4rem;
  font-size: 0.8rem;
  cursor: pointer;
  font-family: inherit;
}
.settings-reset:hover { color: var(--danger); border-color: var(--danger); }

/* 阅读进度条 */
.progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  background: var(--accent);
  z-index: 70;
  width: 0;
  transition: width 0.1s linear;
}

/* ------------------------------------------------------------ 评论 */

.comments {
  max-width: var(--reading-width);
  margin: 3rem auto 0;
  padding: 0 1.25rem;
}
.comments.wide { max-width: 46rem; }

.comments h2 {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}
.comments h2 .count { color: var(--muted); font-size: 0.85rem; font-weight: 400; }

.comment-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1.5rem;
}
.comment-form textarea {
  width: 100%;
  min-height: 5.5rem;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.7rem;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.92rem;
  line-height: 1.7;
}
.comment-form textarea:focus { outline: none; border-color: var(--accent); }
.comment-form .row {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  margin-top: 0.6rem;
  flex-wrap: wrap;
}
.comment-form input[type="text"] {
  flex: 1;
  min-width: 8rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem 0.7rem;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
}
.comment-form input[type="text"]:focus { outline: none; border-color: var(--accent); }
.comment-form .hint { color: var(--muted); font-size: 0.78rem; margin: 0.5rem 0 0; }

/* 蜜罐字段：藏起来但不用 display:none，有些爬虫会跳过 none 的字段 */
.hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  border-radius: 6px;
  padding: 0.5rem 1.1rem;
  font-size: 0.88rem;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.15s var(--ease);
  text-decoration: none;
}
.btn:hover { opacity: 0.88; text-decoration: none; color: #fff; }
.btn.ghost {
  background: transparent;
  color: var(--text-soft);
  border-color: var(--border-strong);
}
.btn.ghost:hover { color: var(--accent); border-color: var(--accent); }
.btn.danger { background: var(--danger); border-color: var(--danger); }
.btn.small { padding: 0.3rem 0.7rem; font-size: 0.8rem; }

.comment-list { list-style: none; padding: 0; margin: 0; }
.comment-item {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}
.comment-item:last-child { border-bottom: 0; }
.comment-item .head {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
  flex-wrap: wrap;
}
.comment-item .who { font-size: 0.88rem; font-weight: 600; color: var(--text-soft); }
.comment-item .who.anon { font-weight: 400; color: var(--muted); font-style: italic; }
.comment-item .when { font-size: 0.78rem; color: var(--muted); }
.comment-item .body {
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  font-size: 0.93rem;
  line-height: 1.8;
  color: var(--text);
  margin: 0;
}
.comment-item .badge {
  font-size: 0.7rem;
  padding: 0.05rem 0.4rem;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border);
}

.flash {
  padding: 0.7rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.88rem;
  border: 1px solid var(--border);
}
.flash.ok { background: var(--accent-soft); color: var(--ok); border-color: var(--ok); }
.flash.err { background: transparent; color: var(--danger); border-color: var(--danger); }

/* ------------------------------------------------------------ 错误页 */

.error-page { text-align: center; padding: 6rem 1.25rem; }
.error-page .code {
  font-family: var(--font-serif);
  font-size: 4rem;
  color: var(--border-strong);
  margin: 0;
  line-height: 1;
}
.error-page h1 { font-family: var(--font-serif); font-size: 1.3rem; margin: 1rem 0 0.5rem; font-weight: 600; }
.error-page p { color: var(--muted); margin: 0 0 2rem; }

/* ------------------------------------------------------------ 响应式 */

@media (max-width: 640px) {
  .site-header .inner { padding: 0.6rem 1rem; gap: 0.6rem; }
  .brand { font-size: 1rem; }
  .nav { gap: 0.7rem; }
  .nav a { font-size: 0.82rem; }
  .theme-toggle { padding: 0.25rem 0.55rem; font-size: 0.75rem; }
  .theme-toggle .text { display: none; }

  .toc { grid-template-columns: 1fr; }
  .book-grid { grid-template-columns: 1fr; }
  .page-head { padding: 2rem 0 1.5rem; }

  article.chapter { padding: 0 1.1rem; }
  .chapter-nav { flex-wrap: wrap; }
  .chapter-nav > a, .chapter-nav > span { flex: 1 1 100%; }
  .chapter-nav .to-next { text-align: left; }

  .settings-fab { right: 1rem; bottom: 1rem; }
  .settings-panel { right: 1rem; bottom: 4.3rem; }
}

@media print {
  .site-header, .site-footer, .chapter-nav, .comments,
  .settings-fab, .settings-panel, .progress-bar { display: none !important; }
  body { background: #fff; color: #000; }
  article.chapter { max-width: none; font-size: 12pt; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* 本地开发实例的标记。线上（NODE_ENV=production）不会渲染这个元素，
   纯粹为了避免本机实例和线上站点在浏览器里长得一样而认错。 */
.env-badge {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  background: #b45309;
  color: #fff;
  border: 0;
  vertical-align: middle;
}
