/* Kindle 风格：电子墨水般的灰度配色、无圆角阴影动画、分页式阅读状态栏 */
:root {
  /* 纸白，外侧略深一档，竖线才看得出是一页纸的边 */
  --page: #e6e4db;
  --bg: #f4f3ee;
  --text: #111111;
  --muted: #6b6b66;
  --line: #cfcdc4;
  --soft: #e7e5dd;
  --reading-size: 16px;
  --sheet: 640px;
  --pad: 24px;
  --pager-h: 56px;
  --chrome: var(--pager-h);
  /* 界面字体：思源黑体 */
  --ui: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  /* 正文字体：monospace */
  --read: monospace;
  /* 引用字体：楷体，一眼能和正文分开 */
  --quote: "KaiTi", "Kaiti SC", "STKaiti", "AR PL UKai CN", "Noto Serif SC", "Songti SC", serif;
}
[data-theme="sepia"] {
  --page: #e3d2b0;
  --bg: #f1e7d0;
  --text: #2c2416;
  --muted: #7a6b55;
  --line: #d6c8a8;
  --soft: #e6d9bb;
}
[data-theme="dark"] {
  --page: #000000;
  --bg: #121212;
  --text: #d6d6d6;
  --muted: #8a8a8a;
  --line: #333333;
  --soft: #1a1a1a;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: var(--ui);
  line-height: 1.7;
  min-height: 100vh;
}
.sheet {
  width: 100%; max-width: var(--sheet); min-height: 100vh; margin: 0 auto;
  display: flex; flex-direction: column;
  background: var(--bg);
  border-left: 1px solid var(--line); border-right: 1px solid var(--line);
}
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: 8px var(--pad);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.brand { font-size: 16px; font-weight: 600; letter-spacing: 0.02em; }
.tools { display: flex; align-items: center; gap: 2px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: none; color: var(--text); font-size: 18px; line-height: 1;
  width: 36px; height: 36px; padding: 0; cursor: pointer;
}
.icon-btn:hover { background: var(--soft); }

.search-bar { padding: 12px var(--pad) 4px; }
.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%; padding: 8px var(--pad) 28px; }
body.reading .container { padding-bottom: calc(var(--chrome) + 24px); }

/* 列表：像 Kindle 书库，一行一本 */
.list-title { font-size: 12px; color: var(--muted); margin: 0 0 6px; padding-bottom: 6px; border-bottom: 1px solid var(--text); }
.card { display: flex; align-items: center; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.card-main { flex: 1; min-width: 0; }
.thumb {
  flex: none; width: 64px; height: 64px; object-fit: cover;
  border: 1px solid var(--line); background: var(--soft);
}
.card:hover .card-top h2 { text-decoration: underline; }
.card-top { display: flex; align-items: baseline; gap: 10px; }
.card-top h2 { margin: 0; font-size: 14px; font-weight: 600; 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: 12px; 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: 22px 0 30px; }
.article-head h1 { font-size: 24px; font-weight: 700; margin: 0; 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: 0; 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.85; }
.article-body p { margin: 0 0 .8em; text-indent: 2em; text-align: justify; }
/* 引用：摘录他人作品等，用楷体、浅底色和左侧竖线与正文区分 */
.article-body blockquote.quote {
  margin: 1.5em 0; padding: .9em 1.1em 1em;
  background: var(--soft); border-left: 3px solid var(--muted);
  font-family: var(--quote); font-size: .95em; line-height: 1.9; color: var(--text);
}
.article-body blockquote.quote p { margin: 0 0 .6em; text-indent: 0; text-align: left; }
.article-body blockquote.quote p:last-of-type { margin-bottom: 0; }
.article-body blockquote.quote cite {
  display: block; margin-top: .8em; text-align: right; font-style: normal;
  font-family: var(--ui); font-size: .85em; color: var(--muted);
}
/* 小标题 */
.article-body h2.sub {
  margin: 1.9em 0 .8em; font-family: var(--ui); font-size: 1.12em; font-weight: 700; line-height: 1.5;
}
/* 分隔线 */
.article-body .rule { margin: 2em 0; text-align: center; color: var(--muted); line-height: 1; }
.article-body .rule::before { content: "·  ·  ·"; letter-spacing: .5em; }
.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 .figure { margin: 1.4em 0; text-align: center; }
.article-body .figure img {
  display: block; width: auto; height: auto; margin: 0 auto;
  max-width: min(400px, 100%); max-height: 280px; object-fit: contain;
  border: 1px solid var(--line); background: var(--soft);
}
.article-body .figure figcaption {
  margin-top: .5em; color: var(--muted); font-family: var(--ui); font-size: 12px; line-height: 1.5;
}
.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; }

.share { position: relative; }
.share[hidden] { display: none; }
.share-btn[aria-expanded="true"] { background: var(--soft); }
.share-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 30;
  width: 188px; padding: 4px;
  background: var(--bg); border: 1px solid var(--line);
}
.share-menu[hidden] { display: none; }
.share-menu a, .share-menu button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 7px 8px; border: none; background: none; color: var(--text);
  font: inherit; font-size: 13px; text-align: left; text-decoration: none; cursor: pointer;
}
.share-menu a:hover, .share-menu button:hover { background: var(--soft); }
.share-menu .mark {
  flex: none; width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); font-size: 11px; color: var(--muted);
}

.pager {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); z-index: 49;
  box-sizing: border-box; width: 100%; max-width: var(--sheet); height: var(--pager-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 var(--pad); background: var(--bg); line-height: 1.3;
  border-left: 1px solid var(--line); border-right: 1px solid var(--line);
}
.pager a { flex: 1; min-width: 0; font-size: 14px; }
.pager a span { display: block; font-size: 12px; color: var(--muted); }
.pager a b { display: block; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pager a:hover b { text-decoration: underline; }
.pager a.next { text-align: right; }

.site-footer { margin-top: auto; text-align: center; color: var(--muted); font-size: 12px; letter-spacing: 0.08em; padding: 16px var(--pad) 20px; border-top: 1px solid var(--line); }
.site-footer p { margin: 2px 0; }
body.reading .site-footer { display: none; }

/* 阅读进度线：贴在上一篇/下一篇栏上方，阅读页才显示 */
body:not(.reading) .progress-track { display: none; }
.progress-track {
  position: fixed; left: 50%; bottom: var(--pager-h); transform: translateX(-50%); z-index: 51;
  width: 100%; max-width: var(--sheet); height: 1px; background: var(--line); pointer-events: none;
}
.progress { height: 100%; width: 0; background: var(--text); }

/* 手机端：界面字号和触摸目标略放大，列表标题不挤 */
@media (max-width: 600px) {
  :root { --pad: 16px; }
  .brand { font-size: 15px; }
  .article-head { margin: 16px 0 24px; }
  .article-head h1 { font-size: 21px; }
  .back, .epigraph { font-size: 14px; }
  .icon-btn { width: 40px; height: 40px; font-size: 20px; }
  .text-btn { font-size: 14px; padding: 3px 10px; }
  .card { padding: 13px 0; }
  .card-top h2 { font-size: 15px; }
  .card-top .date { font-size: 12px; }
  .card .excerpt { font-size: 13px; }
  .thumb { width: 56px; height: 56px; }
  .share-menu { width: 208px; }
  .share-menu a, .share-menu button { font-size: 14px; padding: 9px 8px; }
  .pager a { font-size: 15px; }
  .pager a span { font-size: 12px; }
}
