/* 墨水屏优先：纯黑白、大字号、高对比、少动效、无阴影渐变 */
* { -webkit-box-sizing: border-box; box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #fff;
  color: #000;
  font-family: "Noto Serif CJK SC", "Source Han Serif SC", "Songti SC", Georgia, serif;
  font-size: 19px;
  line-height: 1.75;
  -webkit-text-size-adjust: 100%;
}

#app { height: 100%; }

.view { display: none; height: 100%; -webkit-box-orient: vertical; -webkit-box-direction: normal; -webkit-flex-direction: column; flex-direction: column; }
.view.active { display: -webkit-box; display: -webkit-flex; display: flex; }

.bar {
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-box-align: center; align-items: center;
  border-bottom: 1px solid #000;
  padding: 8px 10px;
  background: #fff;
}
.bar h1 { font-size: 20px; margin: 0; -webkit-box-flex: 1; -webkit-flex: 1; flex: 1; }
.bar .reader-title {
  -webkit-box-flex: 1; -webkit-flex: 1; flex: 1;
  text-align: center;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 16px;
}
.bar-actions { display: -webkit-box; display: -webkit-flex; display: flex; }

.btn {
  display: inline-block;
  border: 1px solid #000;
  background: #fff;
  color: #000;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.4;
  padding: 6px 12px;
  margin: 2px;
  cursor: pointer;
  border-radius: 0;
}
.btn:active { background: #000; color: #fff; }
.btn.primary { background: #000; color: #fff; }
.btn[disabled] { border-color: #999; color: #999; background: #fff; }

/* 书架 */
.empty { padding: 48px 20px; text-align: center; }
.empty .hint { font-size: 15px; color: #444; }

.shelf { list-style: none; margin: 0; padding: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.shelf li {
  border-bottom: 1px solid #bbb;
  padding: 14px 14px;
  cursor: pointer;
}
.shelf li:active { background: #eee; }
.shelf .book-name { font-size: 18px; }
.shelf .book-meta { font-size: 14px; color: #444; margin-top: 4px; }
.shelf .book-del { float: right; font-size: 14px; border: 1px solid #000; padding: 2px 8px; }

/* 阅读区 */
.reader-body {
  -webkit-box-flex: 1; -webkit-flex: 1; flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 18px 20px 60px;
}
.chapter { max-width: 40em; margin: 0 auto; word-wrap: break-word; }
.chapter p { text-indent: 2em; margin: 0 0 0.9em; }
.chapter h1, .chapter h2, .chapter h3 { text-indent: 0; line-height: 1.4; margin: 1.2em 0 0.6em; }
.chapter img { max-width: 100%; height: auto; display: block; margin: 1em auto; }
.chapter blockquote { margin: 1em 0; padding: 0 0 0 1em; border-left: 3px solid #000; }
.chapter a { color: #000; text-decoration: underline; }

/* 已存在批注的高亮：墨水屏上用下划线而非底色 */
mark.anno { background: transparent; border-bottom: 2px solid #000; color: #000; padding: 0; }

.pager {
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-box-align: center; align-items: center;
  -webkit-box-pack: justify; justify-content: space-between;
  max-width: 40em; margin: 32px auto 0;
  border-top: 1px solid #bbb;
  padding-top: 14px;
}
.pager .pos { font-size: 15px; }

/* 选中文本操作条 */
.selection-bar {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: #fff;
  border-top: 1px solid #000;
  padding: 6px;
  text-align: center;
  z-index: 30;
}
.selection-bar.show { display: block; }

/* 抽屉 */
.drawer {
  position: fixed;
  top: 0; bottom: 0; right: 0;
  width: 86%;
  max-width: 420px;
  background: #fff;
  border-left: 1px solid #000;
  z-index: 40;
  display: none;
  -webkit-box-orient: vertical; -webkit-box-direction: normal; -webkit-flex-direction: column; flex-direction: column;
  -webkit-transform: translateX(100%); -ms-transform: translateX(100%); transform: translateX(100%);
}
.drawer.show { display: -webkit-box; display: -webkit-flex; display: flex; -webkit-transform: translateX(0); -ms-transform: translateX(0); transform: translateX(0); }
.drawer-head { display: -webkit-box; display: -webkit-flex; display: flex; -webkit-box-align: center; align-items: center; border-bottom: 1px solid #000; padding: 8px 10px; }
.drawer-head h2 { -webkit-box-flex: 1; -webkit-flex: 1; flex: 1; font-size: 18px; margin: 0; }
.drawer-body { -webkit-box-flex: 1; -webkit-flex: 1; flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 10px; }

.mask { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.25); z-index: 35; display: none; }
.mask.show { display: block; }

.toc-item, .mark-item { border-bottom: 1px solid #ccc; padding: 10px 6px; cursor: pointer; }
.mark-item .quote { font-size: 15px; color: #000; border-left: 3px solid #000; padding-left: 8px; margin: 0 0 6px; }
.mark-item .body { font-size: 16px; margin: 0 0 6px; }
.mark-item .meta { font-size: 13px; color: #444; }
.mark-item .reply { font-size: 14px; border-top: 1px dotted #999; margin-top: 6px; padding-top: 6px; white-space: pre-wrap; }
.mark-item .ops { margin-top: 6px; }
.kind { font-size: 12px; border: 1px solid #000; padding: 0 5px; margin-right: 6px; }

/* 弹窗 */
.dialog {
  display: none;
  position: fixed;
  left: 50%; top: 50%;
  width: 92%;
  max-width: 480px;
  -webkit-transform: translate(-50%, -50%); -ms-transform: translate(-50%, -50%); transform: translate(-50%, -50%);
  background: #fff;
  border: 2px solid #000;
  z-index: 50;
}
.dialog.show { display: block; }
.dialog-head { border-bottom: 1px solid #000; padding: 8px 12px; font-size: 18px; }
.dialog-body { padding: 12px; max-height: 60vh; overflow-y: auto; }
.dialog-foot { border-top: 1px solid #000; padding: 8px 12px; text-align: right; }
.quote { font-size: 15px; border-left: 3px solid #000; padding-left: 8px; margin: 0 0 12px; }
.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: 15px; margin-bottom: 4px; }
.field input[type=text], .field textarea {
  width: 100%;
  border: 1px solid #000;
  background: #fff;
  color: #000;
  font-family: inherit;
  font-size: 17px;
  padding: 8px;
  border-radius: 0;
}
.field.check { display: block; }
.field.check span { display: inline; }

/* 提示条 */
.toast {
  position: fixed;
  left: 50%; bottom: 24px;
  -webkit-transform: translateX(-50%); -ms-transform: translateX(-50%); transform: translateX(-50%);
  background: #000; color: #fff;
  font-size: 16px;
  padding: 10px 18px;
  max-width: 90%;
  display: none;
  z-index: 60;
}
.toast.show { display: block; }

@media (min-width: 700px) {
  .reader-body { padding: 28px 40px 80px; }
}

/* ---- 环境提示条（缺特性时常驻在书架页顶部） ---- */
.notice {
  display: none;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 2px solid #000;
  font-size: 14px;
  line-height: 1.55;
}

.notice.show { display: block; }

.notice.warn { border-style: solid; }

.notice .notice-title { font-weight: bold; }

.notice ul { margin: 6px 0 0; padding-left: 20px; }

.notice li { margin: 2px 0; }

/* 阅读页图片懒加载中：给未就绪的图占个位，避免正文跳动 */
#chapter img { max-width: 100%; height: auto; }
