:root {
    --bg: #faf8f5;
    --fg: #2b2b2b;
    --muted: #888;
    --accent: #8a5a2b;
    --line: #e0d8cc;
  }
  body.night {
    --bg: #1a1a1a;
    --fg: #c9c9c9;
    --muted: #888;
    --accent: #c9a06a;
    --line: #333;
  }

  * { box-sizing: border-box; }

  body {
    margin: 0 auto;
    padding: 0 16px 40px;
    max-width: 720px;
    background: var(--bg);
    color: var(--fg);
    font: 18px/1.9 "Georgia", "Songti SC", "SimSun", serif;
    transition: background .3s, color .3s;
  }

  .icon {
    width: 1.4em;
    height: 1.4em;
    vertical-align: -0.15em;
    fill: currentColor;
    overflow: hidden;
}

@font-face {
    font-family: speak2;
    src: url(../fonts/YuWoErYanNiZuiKeAi-2.ttf);
}

  /* 顶部工具栏 */
  .toolbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding: 10px 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
  }
  .toolbar button {
    padding: 6px 12px;
    font-size: 14px;
    cursor: pointer;
    background: transparent;
    color: var(--fg);
    border: 1px solid var(--line);
    border-radius: 6px;
  }
  .toolbar button:hover { border-color: var(--accent); color: var(--accent); }

  h1 { font-size: 24px; margin: 24px 0 8px; }
  .subtitle { color: var(--muted); font-size: 14px; margin-bottom: 24px; }

  /* 目录 */
  #toc {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 70vh;
    overflow-y: auto;
  }
  #toc li {
    padding: 12px 8px;
    border-bottom: 1px solid var(--line);
    cursor: pointer;
    transition: background .2s, padding-left .2s;
  }
  #toc li:hover {
    background: rgba(138, 90, 43, .08);
    padding-left: 16px;
    color: var(--accent);
  }

  /* 阅读区 */
  #reader { padding-top: 16px; }
  #chapterTitle {
    font-size: 22px;
    margin: 8px 0 24px;
    text-align: center;
    color: var(--accent);
  }

  #content { animation: fadeIn .4s ease both; }
  @keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  /* ===== 正文排版：只保留行距 + 首行缩进 ===== */
  #content p {
    margin: 0 0 1em;       /* 段间距 */
    text-indent: 2em;      /* 首行缩进两字 */
    line-height: 1.9;      /* 行间距 */
    text-align: justify;   /* 两端对齐，阅读更整齐 */
    font-family: "speak2";
  }

  /* 底部翻页栏 */
  .bar {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    margin: 40px 0 0;
    padding-top: 20px;
    border-top: 1px solid var(--line);
  }
  .bar button {
    flex: 1;
    padding: 12px;
    font-size: 16px;
    cursor: pointer;
    background: transparent;
    color: var(--fg);
    border: 1px solid var(--line);
    border-radius: 8px;
    transition: all .2s;
  }
  .bar button:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(138, 90, 43, .06);
  }
  .bar button:disabled { opacity: .35; cursor: not-allowed; }

  .hidden { display: none !important; }

  @media (max-width: 600px) {
    body { font-size: 17px; padding: 0 14px 30px; }
  }