/* Kindle 风格：电子墨水般的灰度配色、无圆角阴影动画、分页式阅读状态栏 */
:root {
  /* 纸白 */
  --bg: #f4f3ee;
  --text: #111111;
  --muted: #6b6b66;
  --line: #cfcdc4;
  --soft: #e7e5dd;
  --reading-size: 16px;
  /* 界面字体：思源黑体 */
  --ui: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  /* 正文字体：monospace */
  --read: monospace;
}
[data-theme="sepia"] {
  --bg: #f1e7d0;
  --text: #2c2416;
  --muted: #7a6b55;
  --line: #d6c8a8;
  --soft: #e6d9bb;
}
[data-theme="dark"] {
  --bg: #000000;
  --text: #d6d6d6;
  --muted: #8a8a8a;
  --line: #333333;
  --soft: #1a1a1a;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--ui);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body.reading { padding-bottom: 34px; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; color: inherit; }

/* 顶栏 */
.site-header {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 22px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.brand { font-size: 17px; font-weight: 700; letter-spacing: .25em; }
.tools { display: flex; gap: 2px; }
.icon-btn {
  background: none; border: none; color: var(--text); font-size: 19px;
  width: 36px; height: 36px; cursor: pointer;
}
.icon-btn:hover { background: var(--soft); }

.search-bar { padding: 12px 22px 0; max-width: 640px; margin: 0 auto; width: 100%; }
.search-bar input {
  width: 100%; padding: 8px 12px; font: inherit; font-size: 14px;
  border: 1px solid var(--text); border-radius: 0; background: transparent; color: var(--text);
  outline: none;
}

.container { flex: 1; width: 100%; max-width: 640px; margin: 0 auto; padding: 14px 22px 40px; }

/* 列表：像 Kindle 书库，一行一本 */
.list-title { font-size: 13px; color: var(--muted); margin: 0 0 6px; padding-bottom: 6px; border-bottom: 1px solid var(--text); }
.card { display: block; padding: 11px 0; border-bottom: 1px solid var(--line); }
.card:hover .card-top h2 { text-decoration: underline; }
.card-top { display: flex; align-items: baseline; gap: 10px; }
.card-top h2 { margin: 0; font-size: 16px; font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-top .date { font-size: 12px; color: var(--muted); flex: none; }
.card .excerpt { margin: 1px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta { display: flex; gap: 12px; align-items: center; font-size: 12px; color: var(--muted); }
.tag { color: var(--muted); font-size: 12px; flex: none; }
.tag::before { content: "["; }
.tag::after { content: "]"; }
.empty { text-align: center; color: var(--muted); padding: 60px 0; }

/* 阅读页 */
.header-left { display: flex; align-items: center; min-height: 36px; }
.back { color: var(--muted); font-size: 14px; }
.back:hover { color: var(--text); text-decoration: underline; }
.article-head { text-align: center; margin: 10px 0 26px; }
.article-head h1 { font-size: 24px; font-weight: 700; margin: 12px 0 10px; line-height: 1.4; }
.article-head .meta { justify-content: center; }
.epigraph { color: var(--muted); margin-top: 14px; font-size: 14px; }

.font-tools { display: flex; gap: 4px; margin-right: 4px; }
.font-tools[hidden] { display: none; }
.text-btn {
  border: 1px solid var(--text); background: transparent;
  padding: 1px 8px; border-radius: 3px; cursor: pointer; font-size: 13px; line-height: 1.5;
}
.text-btn:hover { background: var(--soft); }

.article-body { font-family: var(--read); font-size: var(--reading-size); line-height: 1.75; }
.article-body p { margin: 0 0 .5em; text-indent: 2em; text-align: justify; }
.article-body p.moral {
  text-indent: 0; text-align: center; color: var(--muted);
  margin-top: 2em; padding-top: 1.2em; border-top: 1px solid var(--line);
}
.article-body p.source { text-indent: 0; text-align: right; color: var(--muted); font-size: .85em; }
.end-mark { text-align: center; color: var(--muted); letter-spacing: .5em; margin: 30px 0; font-size: 13px; }

.pager { display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid var(--text); padding-top: 14px; }
.pager a { flex: 1; font-size: 14px; }
.pager a span { display: block; font-size: 12px; color: var(--muted); }
.pager a b { font-weight: 700; }
.pager a:hover b { text-decoration: underline; }
.pager a.next { text-align: right; }

.site-footer { text-align: center; color: var(--muted); font-size: 12px; padding: 20px 0 26px; border-top: 1px solid var(--line); }
.site-footer p { margin: 2px 0; }
body.reading .site-footer { display: none; }

/* 底部状态栏：页码 + 百分比（阅读页才显示） */
.progress { position: fixed; left: 0; bottom: 30px; height: 2px; width: 0; background: var(--text); z-index: 51; }
.status {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; height: 30px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px; background: var(--bg); border-top: 1px solid var(--line);
  font-size: 12px; color: var(--muted);
}
.status[hidden] { display: none; }

@media (max-width: 600px) {
  .site-header { padding: 8px 14px; }
  .container { padding: 12px 16px 36px; }
  .article-head h1 { font-size: 21px; }
  .status { padding: 0 16px; }
}
