/* ebook/style.css —— 阅读友好，浅色主题 */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #2b2b2b; background: #f5f3ee; line-height: 1.7;
}
.hidden { display: none !important; }
.view { min-height: 100vh; }

/* 动态水印 */
#watermark {
  position: fixed; inset: 0; z-index: 9999; pointer-events: none;
  display: none; overflow: hidden; opacity: .08;
}
#watermark span {
  position: absolute; white-space: nowrap; font-size: 14px; color: #000;
  transform: rotate(-24deg);
}
#watermark span:nth-child(6n+1){ top: 4%;  left: 2%; }
#watermark span:nth-child(6n+2){ top: 18%; left: 30%; }
#watermark span:nth-child(6n+3){ top: 32%; left: 60%; }
#watermark span:nth-child(6n+4){ top: 50%; left: 12%; }
#watermark span:nth-child(6n+5){ top: 66%; left: 45%; }
#watermark span:nth-child(6n+6){ top: 82%; left: 70%; }

/* 登录 */
.login-card {
  max-width: 340px; margin: 12vh auto; background: #fff; padding: 32px 28px;
  border-radius: 12px; box-shadow: 0 6px 24px rgba(0,0,0,.08); text-align: center;
}
.login-card h1 { font-size: 22px; }
.login-card .sub { color: #888; margin: 6px 0 22px; font-size: 13px; }
.login-card input {
  width: 100%; padding: 12px 14px; margin-bottom: 14px; border: 1px solid #ddd;
  border-radius: 8px; font-size: 15px;
}
.login-card button {
  width: 100%; padding: 12px; background: #8a1f1f; color: #fff; border: 0;
  border-radius: 8px; font-size: 15px; cursor: pointer;
}
.login-card .msg { color: #c0392b; font-size: 13px; margin-top: 12px; min-height: 18px; }

/* 登录码卡 */
.login-card .btn-ghost {
  width: 100%; margin-bottom: 14px; padding: 10px; background: #fff; color: #8a1f1f;
  border: 1px solid #8a1f1f; border-radius: 8px; font-size: 14px; cursor: pointer;
}
.login-card .btn-ghost:hover { background: #8a1f1f; color: #fff; }
.codecard { margin-bottom: 14px; text-align: left; }
.codecard-tip { color: #666; font-size: 12px; margin-bottom: 8px; }
.codecard-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.code-chip {
  width: 100%; padding: 10px 0; background: #faf6ef; color: #8a1f1f; border: 1px solid #e0d6c4;
  border-radius: 6px; font-size: 15px; font-weight: 600; letter-spacing: 2px; cursor: pointer;
}
.code-chip:hover { background: #8a1f1f; color: #fff; }
.codecard-remaining { color: #999; font-size: 12px; margin-top: 8px; }

/* 顶栏 */
.topbar {
  display: flex; align-items: center; gap: 14px; padding: 12px 18px;
  background: #fff; border-bottom: 1px solid #e7e3da; position: sticky; top: 0; z-index: 50;
}
.topbar .brand, .topbar .reader-title { font-weight: 600; }
.topbar .reader-title { flex: 1; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-tag { color: #888; font-size: 13px; }
.link {
  background: none; border: 0; color: #8a1f1f; cursor: pointer; font-size: 14px; padding: 4px 8px;
}
.reader-tools { display: flex; gap: 4px; margin-left: auto; }

/* 书架 */
.shelf { max-width: 880px; margin: 0 auto; padding: 20px; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 16px; }
.book { display: flex; gap: 14px; background: #fff; padding: 14px; border-radius: 10px; cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,.05); transition: transform .15s; }
.book:hover { transform: translateY(-2px); }
.book-cover { width: 56px; height: 78px; border-radius: 6px; background: #8a1f1f; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 30px; background-size: cover; background-position: center; flex-shrink: 0; }
.book-meta h3 { font-size: 16px; }
.book-meta .author { color: #999; font-size: 12px; margin: 2px 0; }
.book-meta .intro { color: #666; font-size: 12px; }
.empty { color: #999; text-align: center; padding: 40px; }

/* 阅读区 */
.reader {
  max-width: 720px; margin: 0 auto; padding: 32px 24px 80px;
  font-size: 18px; background: #fff; min-height: 60vh; user-select: none; -webkit-user-select: none;
}
.reader h1, .reader h2, .reader h3 { margin: 1.2em 0 .6em; line-height: 1.4; }
.reader p { margin: 1em 0; text-indent: 2em; }
.reader img { max-width: 100%; height: auto; display: block; margin: 1em auto; }
.loading { text-align: center; color: #999; padding: 30px; }

/* 青格心理·诗意人生（诗体内容，em 单位以兼容字号调节） */
.ebk-intro { background:#fffdf8; border:1px solid #e3d9c7; border-left:3px solid #b08d4f;
  padding:16px 20px; border-radius:4px; color:#5c5349; line-height:2; margin:6px 0 22px; }
.ebk-intro p { margin:0 0 10px; text-indent:0; }
.ebk-intro p:last-child { margin:0; }
.ebk-poem { padding:30px 0 4px; border-bottom:1px dashed #e3d9c7; }
.ebk-poem-title { font-size:1.45em; letter-spacing:.06em; margin:.4em 0 .8em; font-weight:600; color:#2b2620; }
.ebk-poem-title::before { content:"❧"; color:#b08d4f; font-size:.7em; margin-right:10px; vertical-align:2px; }
.ebk-poem-body { line-height:2.25; letter-spacing:.03em; color:#2b2620; }
.ebk-poem-body p { margin:0; text-indent:0; }
.ebk-blank { height:.8em; }
.ebk-xinyu { margin:18px 0 0; padding:14px 18px; background:rgba(176,141,79,.08);
  border-radius:6px; font-size:.88em; line-height:1.95; color:#5c5349; }
.ebk-xinyu-lbl { font-size:.72em; letter-spacing:.3em; color:#8a5a3b; display:block; margin-bottom:6px; }
.ebk-xinyu p { margin:0 0 6px; text-indent:0; }
.ebk-xinyu p:last-child { margin:0; }
/* 章首页标题（卷首 / 各章导语页） */
.ebk-chapter-title { font-size:1.8em; letter-spacing:.12em; color:#8a5a3b; text-align:center; margin:.4em 0 .6em; }

/* 心理咨询师（初级版）教科书排版 */
.ebk-section-title { font-size:1.5em; letter-spacing:.04em; color:#7a3b1f; text-align:center; margin:.3em 0 .9em; font-weight:600; }
.ebk-sub { font-size:1.18em; color:#333; margin:1.4em 0 .5em; font-weight:600; }
.ebk-sub2 { font-size:1.05em; color:#5a4a3a; margin:1.1em 0 .4em; font-weight:600; }
.ebk-num { text-indent:0; padding-left:1.4em; margin:.6em 0; color:#3a3a3a; }
.ebk-table { width:100%; border-collapse:collapse; margin:1.2em 0; font-size:.92em; background:#fff; }
.ebk-table th, .ebk-table td { border:1px solid #d9cfbd; padding:8px 10px; text-align:left; vertical-align:top; }
.ebk-table th { background:#f3ece0; color:#6b4a2a; font-weight:600; }
.ebk-table tbody tr:nth-child(even) { background:#faf6ef; }
.ebk-list { list-style:none; margin:1em 0; padding:0; }
.ebk-list li { position:relative; padding-left:1.4em; margin:.7em 0; line-height:1.9; }
.ebk-list li::before { content:"▪"; color:#b08d4f; position:absolute; left:0; }
.ebk-label { display:inline-block; font-weight:700; color:#8a1f1f; margin-right:.4em; }
