:root {
  --bg: #F4F6F8;
  --card: #FFFFFF;
  --text: #111827;
  --muted: #9AA1AC;
  --line: #EDF0F3;
  --green: #10B981;
  --green-dark: #0E9F6E;
  --danger: #E24B4A;
  --card-border: #ECF0F4;
  --shadow-card: 0 4px 14px rgba(17, 24, 39, 0.05);
  --shadow-green: 0 10px 24px rgba(16, 185, 129, 0.18);
  /* 经文正文专用：宋体（仅阅读页 .rd-v / .rd-h 使用，不影响全站） */
  --font-script: SimSun, "宋体", "Songti SC", STSong, "SimSun-ExtB", "Noto Serif CJK SC",
    "AR PL UMing CN", serif;
  --tabbar-h: 52px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
}

body {
  background:
    radial-gradient(120% 55% at 50% 0%, rgba(16, 185, 129, 0.06) 0%, rgba(16, 185, 129, 0) 62%),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

/* ---------- 登录 ---------- */
#loginView {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 24px;
}

.login-box {
  width: 100%;
  max-width: 320px;
  text-align: center;
}

.login-title {
  font-size: 26px;
  font-weight: 600;
  margin: 0 0 6px;
  letter-spacing: 1px;
}

.login-sub {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 24px;
}

.input {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 14px;
  font-size: 16px;
  font-family: inherit;
  background: #fff;
  margin-bottom: 10px;
  outline: none;
  color: var(--text);
}

.input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}

.btn-primary {
  width: 100%;
  height: 46px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #2DD4A0 0%, #10B981 100%);
  color: #fff;
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.26);
  font-size: 16px;
  font-weight: 500;
  font-family: inherit;
  margin-top: 6px;
  cursor: pointer;
}

.btn-primary:active {
  background: var(--green-dark);
}

.btn-primary:disabled {
  opacity: 0.6;
}

.error {
  color: var(--danger);
  font-size: 14px;
  min-height: 18px;
  margin: 8px 0 0;
}

/* ---------- 骨架 ---------- */
/* 视图容器必须先撑满视口，否则 .shell 的 height:100% 失去参照，
   页面会退化成「内容多高就多高」，垂直居中随之失效 */
.view {
  height: 100%;
}

.shell {
  height: 100%;
  padding-bottom: calc(var(--tabbar-h) + 22px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

/* 三个页面都撑满剩余空间并整体垂直居中，内容不会挤在顶部 */
.page {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 10px 14px 6px;
  flex: 1;
  /* 双保险：即使祖先高度链某处失效，页面自身也至少铺满视口，
     居中的参照系因此永远是「可视区 - 底部导航」，而不是内容自身高度 */
  min-height: calc(100vh - var(--tabbar-h) - 22px);
  min-height: calc(100dvh - var(--tabbar-h) - 22px);
  display: flex;
  flex-direction: column;
  /* safe：内容比视口高时自动退回顶部对齐，避免居中把顶部的标题挤出屏幕 */
  justify-content: center;
  justify-content: safe center;
}

/* 矮屏（手机横屏）放不下时退回顶部对齐并放开滚动，避免内容被裁掉 */
@media (max-height: 560px) {
  html,
  body {
    overflow: auto;
  }

  .page {
    justify-content: flex-start;
  }
}

/* ---------- 标题行 ---------- */
.head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 0;
  text-align: center;
}

.head-date {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.4px;
  line-height: 1.3;
}

.head-meta {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* ---------- 打卡圆 + 阅读圆 ----------
   双圆并排：左 = 今日阅读，右 = 今日打卡 */
.daily-bar {
  margin: 10px 0 0;
  padding: 11px 12px;
  border: 1px solid #C7F0DF;
  border-radius: 14px;
  background: #F2FBF6;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  text-align: center;
}

.daily-bar b {
  font-size: 16px;
}

.daily-bar b {
  color: var(--green-dark);
}

.ring-row {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 36px;
  margin-top: 14px;
}

.ring-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.ring {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 2.5px solid var(--green);
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 7px rgba(16, 185, 129, 0.06), var(--shadow-green);
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  transition: background-color 0.28s, box-shadow 0.28s, transform 0.12s;
}

.ring:active {
  transform: scale(0.96);
}

.ring.done {
  background: linear-gradient(135deg, #2DD4A0 0%, #10B981 100%);
  box-shadow: 0 0 0 7px rgba(16, 185, 129, 0.1), 0 12px 26px rgba(16, 185, 129, 0.32);
}

@keyframes pop {
  0% { transform: scale(1); }
  42% { transform: scale(1.07); }
  100% { transform: scale(1); }
}

.ring.pop {
  animation: pop 0.46s ease;
}

/* 未打卡时，圆圈本身就是按钮，只写四个字 */
.ring-cta {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 1px;
  color: var(--green-dark);
}

/* 已打卡：对勾 + 今日已打卡，两者默认隐藏，由 .ring.done 切换 */
.ring-ok,
.ring-done {
  display: none;
}

.ring-ok svg {
  display: block;
}

.ring.done .ring-cta {
  display: none;
}

.ring.done .ring-ok {
  display: block;
  color: #FFFFFF;
}

.ring.done .ring-done {
  display: block;
  font-size: 13px;
  line-height: 1.2;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.94);
  margin-top: 3px;
}

.undo {
  display: block;
  margin: 12px auto 0;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 13px;
  font-family: inherit;
  text-decoration: underline;
  padding: 4px 10px;
  cursor: pointer;
}

/* ---------- 统计 ---------- */
.stats {
  display: flex;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 10px 0;
  margin-top: 10px;
  box-shadow: var(--shadow-card);
}

.stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.stat b {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
}

/* 可点击的统计格（目前只有「最长连续打卡」）：
   虚线下划线 + 绿色小箭头，让人一眼看出这格能点 */
.stat.clickable {
  cursor: pointer;
}

.stat.clickable:active {
  opacity: 0.55;
}

.stat.clickable span {
  text-decoration: underline dotted;
  text-decoration-color: #B9C2CC;
  text-underline-offset: 3px;
}

.stat-chev {
  font-style: normal;
  font-weight: 600;
  color: var(--green-dark);
  margin-left: 1px;
}

/* 四格布局后标签变长（6 个字），禁止换行，避免撑高统计条 */
.stat span {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

/* 超窄屏（≤360px）再收一档，四格才排得开 */
@media (max-width: 360px) {
  .stat b {
    font-size: 17px;
  }

  .stat span {
    font-size: 10px;
  }
}

.stat-sep {
  width: 1px;
  height: 24px;
  background: #EFF1F4;
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 12px 14px;
  margin-top: 10px;
  box-shadow: var(--shadow-card);
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 9px;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
}

.card-sub {
  font-size: 12px;
  color: var(--muted);
}

/* ---------- 网格 ---------- */
.grid-head {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 5px;
}

.grid-head span {
  text-align: center;
  font-size: 12px;
  line-height: 1;
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cell {
  aspect-ratio: 1 / 1;
  min-height: 18px;
  max-height: 34px;
  border-radius: 6px;
  background: #F1F3F6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
  color: #B0B6BE;
  transition: background-color 0.2s;
}

.cell.on {
  background: linear-gradient(135deg, #2DD4A0, #10B981);
  color: #FFFFFF;
}

.cell.today {
  box-shadow: inset 0 0 0 2px var(--green-dark);
}

.cell.future {
  background: transparent;
  color: #DDE1E6;
}

/* ---------- 全队进度 ---------- */
.progress-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 2px 8px;
}

.progress {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: #EDF0F3;
  overflow: hidden;
}

.week-note {
  flex: none;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  color: var(--muted);
}

.progress i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 3px;
  background: linear-gradient(90deg, #34D399, #10B981);
  transition: width 0.3s;
}

/* ---------- 列表 ---------- */
/* 三个页面统一走 .page 的垂直居中：整块内容（含翻页条）落在可视区正中 */
.list {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 2px 14px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  min-height: 0;
}

/* ---------- 翻页 ---------- */
/* 跟随列表一起走，不再钉底；整块内容由 .page 统一居中 */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 10px 0 0;
  flex: none;
}

.pg {
  border: 1px solid #D8DDE3;
  background: #fff;
  border-radius: 18px;
  padding: 7px 0;
  min-width: 84px;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  color: var(--text);
  box-shadow: 0 1px 3px rgba(17, 24, 39, 0.1);
  cursor: pointer;
}

.pg:active {
  background: #ECFDF5;
  border-color: var(--green);
  color: var(--green-dark);
}

.pg:disabled {
  color: #C9CDD3;
  background: #FAFBFC;
  border-color: #F0F2F4;
  box-shadow: none;
}

.pg-info {
  font-size: 12px;
  color: var(--muted);
  min-width: 46px;
  text-align: center;
}

.team-row,
.record {
  display: flex;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #F5F6F8;
  font-size: 15px;
}

.team-row:last-child,
.record:last-child {
  border-bottom: none;
}

.team-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr;
  column-gap: 4px;
}

/* flex:1 吸收剩余宽度，分组/今日打卡两列才能推到与表头相同的位置 */
.team-name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 累计打卡列 */
.team-total {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

/* 四列均分网格：表头与行共用同一套列定义，天然对齐 */
.team-head,
.team-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr;
  align-items: center;
  column-gap: 4px;
}

.team-head {
  padding: 9px 0 7px;
  border-bottom: 1px solid #F0F2F5;
  font-size: 12px;
  line-height: 1;
  color: var(--muted);
}

.th {
  text-align: center;
  cursor: pointer;
  user-select: none;
}

.th:first-child {
  text-align: left;
}

.th:active {
  opacity: 0.6;
}

.th.sorted {
  color: var(--green-dark);
  font-weight: 600;
}

.sort-arrow {
  font-style: normal;
  font-size: 9px;
  margin-left: 1px;
}

/* 分组列 */
.team-group {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

.team-tag {
  justify-self: center;
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 20px;
}

.team-tag.done {
  color: var(--green-dark);
  background: rgba(16, 185, 129, 0.1);
}

.team-tag.wait {
  color: #B0B6BE;
  background: #F4F6F8;
}

.record-week {
  font-size: 12px;
  color: var(--muted);
  margin-left: 8px;
}

.record-dot {
  margin-left: auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  flex: none;
}

.empty {
  text-align: center;
  color: #C3C8CF;
  font-size: 13px;
  padding: 24px 0;
}

/* 两行：当前用户：xxx（上），切换用户（下） */
.footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 14px 0 4px;
}

.footer-user {
  font-size: 12px;
  line-height: 1.3;
  color: #6B7280;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 13px;
  font-family: inherit;
  text-decoration: underline;
  padding: 8px;
  cursor: pointer;
}

/* ---------- 底部导航 ---------- */
.tabbar {
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: calc(10px + env(safe-area-inset-bottom));
  margin: 0 auto;
  max-width: calc(520px - 28px);
  display: flex;
  height: var(--tabbar-h);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.14);
  z-index: 20;
}

.tab {
  flex: 1;
  border: 1px solid var(--card-border);
  background: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: #5B6472;
  cursor: pointer;
  padding: 9px 0;
  margin: 7px 5px;
  border-radius: 14px;
  box-shadow: 0 1px 4px rgba(17, 24, 39, 0.06);
  transition: background-color 0.2s, color 0.2s, box-shadow 0.2s;
}

.tab.active {
  background: linear-gradient(135deg, #2DD4A0 0%, #10B981 100%);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}

/* ---------- 提示 ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 76px;
  transform: translateX(-50%);
  background: rgba(17, 24, 39, 0.88);
  color: #fff;
  font-size: 14px;
  padding: 9px 16px;
  border-radius: 18px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s;
  white-space: nowrap;
  z-index: 99;
}

.toast.show {
  opacity: 1;
}

/* ---------- 矮屏适配 ----------
   5 周网格在小屏上会超出，把格子和圆圈一起压小，尽量保住「一屏不滚动」 */
@media (max-height: 740px) {
  .cell {
    max-height: 28px;
  }

  .ring {
    width: 110px;
    height: 110px;
  }

  .ring-cta {
    font-size: 17px;
  }

  .ring-area {
    padding: 10px 0 2px;
  }
}

@media (max-height: 660px) {
  .cell {
    max-height: 22px;
  }

  .ring {
    width: 96px;
    height: 96px;
    border-width: 2px;
  }

  .ring-cta {
    font-size: 15px;
  }

  .ring-done {
    font-size: 12px;
  }

  .ring-ok svg {
    width: 24px;
    height: 24px;
  }

  .head-date {
    font-size: 18px;
  }
}

/* ---------- 弹框 ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.4);
  backdrop-filter: blur(2px);
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 300px;
  background: var(--card);
  border-radius: 16px;
  padding: 18px 18px 14px;
  box-shadow: 0 12px 40px rgba(17, 24, 39, 0.22);
}

.modal-title {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
}

.modal-body {
  max-height: 40vh;
  overflow-y: auto;
}

.range-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 2px;
  border-bottom: 1px solid #F5F6F8;
  font-size: 14px;
}

.range-row:last-child {
  border-bottom: none;
}

.range-days {
  flex: none;
  color: var(--green-dark);
  font-weight: 600;
}

.modal-close {
  display: block;
  width: 100%;
  margin-top: 12px;
  height: 40px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #2DD4A0 0%, #10B981 100%);
  color: #fff;
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
}

.modal-close:active {
  background: var(--green-dark);
}
/* 弹框里的鼓励文案（最长连续只有 1 天时） */
.modal-hint {
  margin: 20px 0;
  text-align: center;
  font-size: 15px;
  line-height: 1.5;
  color: #6B7280;
}

/* ---------- 论坛 ---------- */
.bbs-row {
  padding: 8px 0;
}

.bbs-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 3px;
}

/* 留言者名字：胶囊形，底色/字色由 JS 按名字哈希分配 */
.bbs-name {
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 10px;
}

.bbs-del {
  border: none;
  background: none;
  color: #C9CDD3;
  font-size: 15px;
  line-height: 1;
  font-family: inherit;
  cursor: pointer;
  padding: 0 2px;
}

.bbs-del:active {
  color: var(--danger);
}

/* 留言内容：inline-block 让背景只包住文字本身 */
.bbs-content {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  word-break: break-word;
}

.composer {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.bbs-input {
  flex: 1;
  min-width: 0;
  height: 40px;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 0 12px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  background: #fff;
  color: var(--text);
}

.bbs-input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}

.bbs-send {
  flex: none;
  width: 76px;
  height: 40px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #2DD4A0 0%, #10B981 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
}

.bbs-send:disabled {
  opacity: 0.5;
}

/* ---------- 论坛：话题列表 ---------- */
/* 返回话题列表：整宽按钮条，醒目好点 */
.bbs-back {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  margin: 2px 0 0;
  padding: 9px 12px;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  background: #fff;
  color: var(--green-dark);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
}

.bbs-back:active {
  background: #ECFDF5;
  border-color: var(--green);
}

.topic-row {
  padding: 9px 0;
  border-bottom: 1px solid #F5F6F8;
  cursor: pointer;
}

.topic-row:active {
  background: #FAFBFC;
}

.topic-row:last-child {
  border-bottom: none;
}

.topic-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 3px;
  word-break: break-word;
}

.topic-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.topic-meta .bbs-del {
  margin-left: auto;
}

/* ---------- 阅读（三级：卷目录 → 章列表 → 章内阅读） ---------- */
#page-read {
  justify-content: flex-start;
  padding-top: 12px;
}

.rd-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 8px;
}

.rd-back {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  margin: 2px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--card-border);
  border-radius: 14px;
  background: #fff;
  color: var(--green-dark);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(17, 24, 39, 0.07);
  transition: background 0.15s, border-color 0.15s, transform 0.1s, box-shadow 0.15s;
  touch-action: manipulation;
}

.rd-back:active {
  background: #ECFDF5;
  border-color: var(--green);
  transform: scale(0.985);
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.05);
}

@media (hover: hover) {
  .rd-back:hover {
    border-color: var(--green);
    background: #F6FEFB;
  }
}

.rd-books {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 10px 0 16px;
}

.rd-book {
  border: 1px solid var(--card-border);
  border-radius: 16px;
  background: #fff;
  padding: 13px 6px;
  text-align: center;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(17, 24, 39, 0.06);
  transition: transform 0.12s, box-shadow 0.15s, border-color 0.15s, background 0.15s;
  touch-action: manipulation;
}

.rd-book b {
  display: block;
  font-size: 18px;
  font-weight: 600;
  color: var(--green-dark);
  line-height: 1.25;
}

.rd-book span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 第二行「N 章 M 节」作为次级信息，弱化处理让卷名更突出 */
.rd-book span:last-of-type {
  margin-top: 5px;
  font-size: 12px;
  color: #A8AFB8;
  letter-spacing: 0.2px;
}

.rd-book:active {
  background: #ECFDF5;
  border-color: var(--green);
  transform: scale(0.955);
  box-shadow: 0 1px 2px rgba(16, 185, 129, 0.12);
}

@media (hover: hover) {
  .rd-book:hover {
    border-color: var(--green);
    box-shadow: 0 3px 10px rgba(16, 185, 129, 0.14);
  }
}

.rd-chaps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  padding: 10px 0 16px;
}

.rd-chap {
  height: 50px;
  border: 1px solid var(--card-border);
  border-radius: 14px;
  background: #fff;
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(17, 24, 39, 0.06);
  transition: transform 0.12s, box-shadow 0.15s, border-color 0.15s, background 0.15s, color 0.15s;
  touch-action: manipulation;
}

.rd-chap:active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
  transform: scale(0.93);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.28);
}

@media (hover: hover) {
  .rd-chap:hover {
    border-color: var(--green);
    color: var(--green-dark);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.16);
  }
}

.rd-reader {
  padding: 8px 2px 28px;
}

.rd-h {
  margin: 20px 0 6px;
  font-size: calc(var(--rd-fs, 15px) - 1px);
  font-weight: 600;
  text-align: center;
  color: var(--green-dark);
  font-family: var(--font-script);
}

.rd-h:first-child {
  margin-top: 4px;
}

.rd-v {
  margin: 0 0 10px;
  font-size: var(--rd-fs, 15px);
  line-height: 1.95;
  letter-spacing: 0.3px;
  color: var(--text);
  font-family: var(--font-script);
}

.rd-v b {
  color: var(--green-dark);
  font-size: 11px;
  margin-right: 5px;
  font-weight: 600;
  position: relative;
  top: -2px;
}

/* 阅读页：每卷「引言」入口与正文（v1.22.6） */
.rd-chap.rd-intro {
  grid-column: span 2;
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

@media (hover: hover) {
  .rd-chap.rd-intro:hover {
    background: var(--green-dark);
    border-color: var(--green-dark);
    color: #fff;
  }
}

.rd-intro-body p {
  margin: 0 0 14px;
  font-size: var(--rd-fs, 15px);
  line-height: 1.95;
  letter-spacing: 0.3px;
  color: var(--text);
  text-align: justify;
}

.rd-intro-body p:last-child {
  margin-bottom: 0;
}

.rd-intro-body h4 {
  margin: 18px 0 8px;
  font-size: calc(var(--rd-fs, 15px) - 1px);
  font-weight: 600;
  color: var(--green-dark);
}

.rd-intro-body b,
.rd-intro-body strong {
  font-weight: 600;
}

/* 目录分组头：旧约 / 新约 */
.rd-divider {
  grid-column: 1 / -1;
  margin: 14px 0 8px;
  padding: 6px 2px;
  border-bottom: 2px solid var(--green);
  font-size: 17px;
  font-weight: 600;
  color: var(--green-dark);
  text-align: center;
}

.rd-divider:first-child {
  margin-top: 4px;
}

.rd-divider-sub {
  font-style: normal;
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  margin-left: 8px;
}

/* ---------- 我的（hub）---------- */
.hub-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
  margin-top: 12px;
  padding: 18px 16px;
  border: 1px solid var(--card-border);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  font-family: inherit;
  text-align: center;
}

.hub-btn b {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.hub-btn span {
  font-size: 12px;
  color: var(--muted);
}

.hub-btn:active {
  background: #ECFDF5;
  border-color: var(--green);
}

/* ---------- 阅读记录 ---------- */
.rl-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 8px;
}

.rl-book {
  margin-bottom: 16px;
}

.rl-book-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 7px;
}

.rl-book-head b {
  font-size: 15px;
  color: var(--green-dark);
}

.rl-book-head span {
  font-size: 12px;
  color: var(--muted);
}

.rl-book-count {
  margin-left: auto;
}

.rl-chips {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
}

.rl-chip {
  height: 34px;
  border: 1px solid var(--card-border);
  border-radius: 9px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
}

.rl-chip.on {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
  font-weight: 600;
}

/* 「我的数据」页版本号 */
.mine-version {
  display: block;
  margin: 18px 0 4px;
  font-size: 11px;
  color: #C9CDD3;
  text-align: center;
}

/* 阅读记录顶部统计行 */
.rl-summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
  padding: 10px 0 4px;
}

.rl-clear-all {
  border: none;
  background: none;
  color: var(--danger);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  padding: 0 2px;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}

.rl-clear-all:active {
  opacity: 0.6;
}

/* 章内阅读底部：上一章 / 下一章 */
.rd-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.rd-nav .pg-info {
  flex: 1;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

/* 清除某卷阅读记录 */
.rl-clear {
  border: none;
  background: none;
  color: var(--muted);
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  padding: 0 2px;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}

.rl-clear:active {
  color: var(--danger);
}

/* 阅读进度条 */
.rl-bar {
  height: 6px;
  border-radius: 3px;
  background: #EDEFF2;
  overflow: hidden;
  margin: 2px 0 6px;
}

.rl-bar i {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #34D399, #10B981);
  transition: width 0.4s;
}

/* 论坛话题：聊天式滚动容器 */
.bbs-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* 阅读圆未完成时轻一点，弱于打卡圆 */
#readRing:not(.done) {
  box-shadow: 0 0 0 7px rgba(16, 185, 129, 0.04), 0 6px 16px rgba(16, 185, 129, 0.1);
}

/* 小组打卡页列表：内容少，自然高度即可 */
#page-group .list {
  min-height: 0;
}

/* 自己的留言：微信式靠右，底色只包住文字 */
.bbs-row.mine {
  padding-left: 22%;
  text-align: right;
}

/* 自己的留言：信息顺序保持 用户名→分组→时间→删除，整体靠右 */
.bbs-row.mine .bbs-meta {
  justify-content: flex-end;
}

/* 气泡本身靠右由 .bbs-row.mine 的 text-align 定位；
   但气泡内文字始终左对齐，避免最后一行短句被推到右边 */
.bbs-row.mine .bbs-content {
  text-align: left;
}

/* 公共论坛下方的小组论坛入口卡（独立卡片） */
.bbs-entry {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  width: 100%;
  margin: 12px 0 0;
  padding: 14px 16px;
  border: 1px solid var(--card-border);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  position: relative;
}

.bbs-entry b {
  font-size: 16px;
  color: var(--green-dark);
}

.bbs-entry b {
  font-size: 15px;
  color: var(--green-dark);
}

.bbs-entry span {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 85%;
}

.bbs-entry-chev {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-style: normal;
  font-size: 20px;
  color: var(--green-dark);
}

.bbs-entry:active {
  background: #ECFDF5;
}

.bbs-entry:active {
  background: #E7F8F0;
}

/* ---------- 补卡 ---------- */
.makeup-bar {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

.makeup-bar b {
  color: var(--green-dark);
}

.cell.makeup {
  border: 1.5px dashed var(--green);
  background: #fff;
  color: var(--green-dark);
  cursor: pointer;
}

.cell.makeup:active {
  background: #ECFDF5;
}

/* ---------- 通用确认弹框 ---------- */
.cfm-text {
  margin: 4px 0 16px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  text-align: center;
}

.cfm-btns {
  display: flex;
  gap: 10px;
}

.cfm-cancel {
  flex: 1;
  height: 40px;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  background: #fff;
  color: var(--muted);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
}

.cfm-cancel:active {
  background: #F3F4F6;
}

.cfm-ok {
  flex: 1.4;
  height: 40px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #2DD4A0 0%, #10B981 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
}

.cfm-ok:active {
  background: var(--green-dark);
}

/* 章间导航：可用按钮绿色显示，明确可点 */
.rd-nav .pg:not(:disabled) {
  color: var(--green-dark);
  border-color: var(--green);
  background: #fff;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(17, 24, 39, 0.08);
  transition: transform 0.12s, background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
  touch-action: manipulation;
}

.rd-nav .pg:not(:disabled):active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
  transform: scale(0.955);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.28);
}

@media (hover: hover) {
  .rd-nav .pg:not(:disabled):hover {
    background: #F6FEFB;
  }
}

/* 到头 / 到底：用灰阶而非半透明，禁用状态更明确 */
.rd-nav .pg:disabled {
  color: #B8BEC6;
  background: #F7F8FA;
  border-color: #ECEFF2;
  box-shadow: none;
  cursor: not-allowed;
}

/* 上一章 / 下一章 加方向箭头，跳转方向一眼可辨 */
#rdPrevCh::before {
  content: "‹";
  margin-right: 3px;
  font-size: 18px;
  line-height: 1;
}

#rdNextCh::after {
  content: "›";
  margin-left: 3px;
  font-size: 18px;
  line-height: 1;
}

/* 字号 +/- 属次级操作，用中性灰与主导航（绿色）区分层级 */
.rd-nav .pg.rd-fs-btn:not(:disabled) {
  flex: none;
  min-width: 0;
  width: 62px;
  font-size: 13px;
  padding: 0;
  color: var(--muted);
  border-color: #D8DDE3;
  background: #fff;
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.05);
}

.rd-nav .pg.rd-fs-btn:not(:disabled):active {
  background: #F0F2F4;
  border-color: #C9CDD3;
  color: var(--text);
  transform: scale(0.93);
  box-shadow: none;
}

@media (hover: hover) {
  .rd-nav .pg.rd-fs-btn:not(:disabled):hover {
    border-color: #C9CDD3;
    color: var(--text);
  }
}

/* ---------- 全站字号整体上调（覆盖上方规则；紧凑屏适配在最后重新声明） ---------- */
.head-date { font-size: 24px; }
.head-meta { font-size: 14px; }
.login-title { font-size: 28px; }
.login-sub { font-size: 15px; }
.stat b { font-size: 22px; }
.stat span { font-size: 13px; }
.card-title { font-size: 15px; }
.card-sub { font-size: 13px; }
.grid-head span { font-size: 13px; }
.cell { font-size: 13px; }
.week-note { font-size: 13px; }
.ring-cta { font-size: 20px; }
.ring-done { font-size: 14px; }
.daily-bar { font-size: 16px; }
.daily-bar b { font-size: 17px; }
.makeup-bar { font-size: 13px; }
.team-row,
.record { font-size: 16px; }
.team-head .th { font-size: 13px; }
.team-total { font-size: 13px; }
.team-group { font-size: 13px; }
.team-tag { font-size: 13px; }
.record-week { font-size: 13px; }
.hub-btn b { font-size: 17px; }
.hub-btn span { font-size: 13px; }
.rd-back { font-size: 14px; }
.rd-divider { font-size: 19px; }
.rd-divider-sub { font-size: 12px; }
.rd-book b { font-size: 18px; }
.rd-book span { font-size: 13px; }
.rd-chap { font-size: 16px; }
.tab { font-size: 15px; }
.bbs-meta { font-size: 13px; }
.bbs-del { font-size: 13px; }
.topic-title { font-size: 16px; }
.topic-meta { font-size: 13px; }
.bbs-entry b { font-size: 17px; }
.bbs-entry span { font-size: 13px; }
.rl-book-head b { font-size: 16px; }
.rl-book-head span { font-size: 13px; }
.rl-summary { font-size: 13px; }
.rl-chip { font-size: 13px; }
.toast { font-size: 15px; }
.pg { font-size: 15px; }
.link { font-size: 14px; }
.undo { font-size: 14px; }
.mine-version { font-size: 12px; }
.modal-title { font-size: 17px; }
.range-row { font-size: 15px; }
.modal-hint { font-size: 16px; }
.modal-close { font-size: 16px; }
.cfm-text { font-size: 15px; }
.cfm-cancel,
.cfm-ok { font-size: 15px; }
.rd-nav .rd-fs-btn { font-size: 13px; }
.hub-btn b { font-size: 17px; }

/* 紧凑屏重新声明，保证小屏缩放逻辑不被上面的覆盖打断 */
@media (max-width: 360px) {
  .stat b { font-size: 19px; }
  .stat span { font-size: 11px; }
}

@media (max-height: 740px) {
  .ring-cta { font-size: 18px; }
}

@media (max-height: 660px) {
  .head-date { font-size: 20px; }
  .ring-cta { font-size: 17px; }
  .ring-done { font-size: 13px; }
}

/* 清除全部按钮覆盖块后的字号微调 */
.rl-summary { font-size: 13px; }
.rl-clear-all { font-size: 12px; }

/* 置顶话题：列表内 sticky，滚动时保持可见 */
.topic-row.pin {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #F2FBF6;
  border-radius: 0 0 10px 10px;
  border-bottom: 1px solid #D8F3E6;
}

.topic-row.pin:active {
  background: #E7F8F0;
}

.pin-tag {
  font-style: normal;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  background: var(--green);
  border-radius: 6px;
  padding: 1px 6px;
  margin-right: 6px;
  vertical-align: 2px;
}

/* 小组论坛里的话题所属组标签（观察员视角区分各组同名置顶） */
.gtag {
  font-style: normal;
  font-size: 10px;
  color: var(--green-dark);
  background: #E7F8F0;
  border-radius: 6px;
  padding: 1px 6px;
}

/* ---------- 祈祷经文 ---------- */
.pray-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.pray-text {
  font-size: 22px;
  line-height: 2.2;
  color: var(--text);
  text-align: center;
  padding: 14px 4px 26px;
}

/* ---------- 思高版注释角标与弹框 ---------- */
.rd-v sup.ann {
  color: var(--green-dark);
  font-size: .7em;
  font-weight: 700;
  margin-left: 2px;
  cursor: pointer;
  vertical-align: super;
  -webkit-tap-highlight-color: transparent;
}
.rd-v sup.ann:hover { text-decoration: underline; }

.ann-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
  padding: 20px;
}
.ann-modal.hidden { display: none; }

.ann-mask {
  position: absolute;
  inset: 0;
}
.ann-card {
  background: #fff;
  max-width: 560px;
  width: 100%;
  border-radius: 14px;
  padding: 20px 22px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .25);
  position: relative;
  max-height: 80vh;
  overflow: auto;
}
.ann-title {
  margin: 0 0 10px;
  color: var(--green-dark);
  font-size: 17px;
}
.ann-text {
  margin: 0;
  line-height: 1.9;
  font-size: 16px;
  color: var(--text);
  white-space: pre-wrap;
}
.ann-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: none;
  background: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--muted);
  line-height: 1;
}
.ann-close:hover { color: var(--text); }
