/* ====================================================================
 * 样式 · 中华典籍掌中宝
 * 视觉调性：竹简·暖黄——底色 #F4E8D0 竹简米黄 · 字色 #1A1A1A 墨黑
 *            点缀 #B33A2A 朱砂红 · 字体 思源宋体
 * ==================================================================== */

:root {
  --bg:        #F4E8D0;     /* 竹简米黄 主底 */
  --bg-card:   #EFE2C6;     /* 卡片底，略深一档 */
  --bg-deep:   #E8D8B5;     /* 次级背景 */
  --ink:       #1A1A1A;     /* 墨黑 主字色 */
  --ink-soft:  #4A3A2A;     /* 墨褐 次要字 */
  --ink-mute:  #7A6A55;     /* 极弱提示字 */
  --seal:      #B33A2A;     /* 朱砂红 点缀 */
  --seal-dark: #8C2A1E;     /* 朱砂深 按下/选中 */
  --line:      #C9B68E;     /* 边框/分割线 */
  --line-soft: #DCC9A0;     /* 弱分割 */
  --shadow:    0 1px 0 rgba(80,50,20,0.06), 0 2px 8px rgba(80,50,20,0.06);
}

/* 夜间模式：墨底朱字 */
body.theme-night {
  --bg:        #1C1814;
  --bg-card:   #251F1A;
  --bg-deep:   #2C2520;
  --ink:       #D9CFB8;
  --ink-soft:  #B8AC92;
  --ink-mute:  #8A7C66;
  --seal:      #C8553F;
  --seal-dark: #B33A2A;
  --line:      #4A3F32;
  --line-soft: #3A322A;
  --shadow:    0 1px 0 rgba(0,0,0,0.4), 0 2px 8px rgba(0,0,0,0.4);
}

/* ---------- 基础 ---------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Noto Serif SC", "Source Han Serif SC", "Source Han Serif CN",
               "Songti SC", "STSong", "SimSun", "思源宋体", serif;
  font-size: 16px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  /* 竹简纵向纹路 - 极淡 */
  background-image:
    repeating-linear-gradient(90deg,
      rgba(120,90,40,0.025) 0px,
      rgba(120,90,40,0.025) 1px,
      transparent 1px,
      transparent 22px);
}
body.theme-night {
  background-image:
    repeating-linear-gradient(90deg,
      rgba(255,255,255,0.015) 0px,
      rgba(255,255,255,0.015) 1px,
      transparent 1px,
      transparent 22px);
}
a { color: inherit; text-decoration: none; }
button {
  font-family: inherit;
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 0;
}

/* ---------- 字体尺寸变量（用户可调）---------- */
:root { --reader-size: 19px; }
body.size-s  { --reader-size: 16px; }
body.size-m  { --reader-size: 19px; }
body.size-l  { --reader-size: 22px; }
body.size-xl { --reader-size: 26px; }

/* ---------- 顶栏 ---------- */
.portal-back {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; height: 34px; padding: 0 14px;
  background: #2563EB; color: #fff; text-decoration: none;
  font-size: 13px; font-weight: 600; letter-spacing: .3px;
}
.portal-back:active { background: #1D4ED8; }
.app-header {
  position: sticky; top: 34px; z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: 14px 20px 12px;
  display: flex; align-items: center; gap: 12px;
}
.app-title {
  font-size: 20px; font-weight: 600; letter-spacing: 4px;
  color: var(--ink);
  display: flex; align-items: center; gap: 10px;
}
.app-title .seal {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  background: var(--seal); color: #F4E8D0;
  font-size: 16px; font-weight: 700; letter-spacing: 0;
  border-radius: 4px;
  font-family: "STKaiti", "KaiTi", "楷体", serif;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.15);
}
.app-title .name { display: flex; flex-direction: column; line-height: 1.1; }
.app-title .name .sub { font-size: 11px; color: var(--ink-mute); letter-spacing: 6px; font-weight: 400; }
.app-header .right { margin-left: auto; display: flex; gap: 8px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-soft);
  transition: background 0.15s;
}
.icon-btn:hover, .icon-btn:active { background: var(--bg-deep); color: var(--ink); }

/* ---------- 主内容区 ---------- */
.app-main {
  max-width: 720px; margin: 0 auto;
  padding: 16px 20px 100px;
}

/* ---------- 底部导航 ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  background: var(--bg);
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-around;
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
  box-shadow: 0 -2px 8px rgba(80,50,20,0.04);
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 0;
  color: var(--ink-mute); font-size: 12px; letter-spacing: 2px;
  transition: color 0.15s;
}
.tab svg { width: 22px; height: 22px; }
.tab.active { color: var(--seal); }
.tab.active svg path, .tab.active svg circle, .tab.active svg line { stroke: var(--seal); }

/* ---------- 首页 ---------- */
.hero {
  text-align: center;
  padding: 28px 0 24px;
  border-bottom: 1px dashed var(--line-soft);
  margin-bottom: 20px;
}
.hero .mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; background: var(--seal); color: #F4E8D0;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 30px; font-weight: 700;
  border-radius: 6px;
  box-shadow: 0 2px 0 var(--seal-dark), inset 0 0 0 1px rgba(255,255,255,0.15);
  margin-bottom: 14px;
}
.hero h1 {
  margin: 0 0 6px; font-size: 26px; font-weight: 600; letter-spacing: 8px;
}
.hero .sub { color: var(--ink-mute); font-size: 13px; letter-spacing: 4px; }

.search-bar {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 30px;
  padding: 10px 16px;
  margin-bottom: 24px;
  color: var(--ink-mute);
}
.search-bar input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--ink); font-family: inherit; font-size: 15px;
}
.search-bar input::placeholder { color: var(--ink-mute); }

.section-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; letter-spacing: 4px; color: var(--ink-soft);
  margin: 22px 0 14px;
  font-weight: 500;
}
.section-title::before, .section-title::after {
  content: ''; flex: 1; height: 1px; background: var(--line-soft);
}
.section-title::before { max-width: 30px; }
.section-title::after { max-width: 100%; }

.school-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  margin-bottom: 24px;
}
.school-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  aspect-ratio: 1 / 1;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 12px 6px;
  text-align: center;
  transition: transform 0.12s, box-shadow 0.12s;
}
.school-card:active { transform: scale(0.97); }
.school-card .ch {
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 36px; font-weight: 600;
  color: var(--seal);
  line-height: 1;
  margin-bottom: 6px;
}
.school-card .full {
  font-size: 12px; color: var(--ink-soft); letter-spacing: 2px;
}
.school-card .count {
  margin-top: 4px; font-size: 10px; color: var(--ink-mute); letter-spacing: 1px;
}

.banner {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--seal);
  border-radius: 4px;
  padding: 14px 16px;
  margin: 18px 0 24px;
}
.banner .ico {
  width: 36px; height: 36px;
  background: var(--seal); color: #F4E8D0;
  display: flex; align-items: center; justify-content: center;
  font-family: "STKaiti", "KaiTi", serif; font-size: 20px; font-weight: 600;
  border-radius: 4px;
}
.banner .text { flex: 1; }
.banner .t1 { font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.banner .t2 { font-size: 12px; color: var(--ink-mute); letter-spacing: 1px; }

/* 传世序列横幅（与三门九圣同款，紧凑排布） */
.banner-stack { margin: 16px 0 20px; }
.banner-stack .banner { margin: 10px 0; }
.banner-stack .banner:first-child { margin-top: 0; }
.banner-stack .banner:last-child { margin-bottom: 0; }
/* 未开序列：弱化显示 */
.banner.hold { border-left-color: var(--line); opacity: 0.75; }
.banner.hold .ico { background: var(--ink-mute); }

.recent-list { display: flex; flex-direction: column; gap: 10px; }
.recent-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 12px 14px;
  transition: background 0.12s;
}
.recent-item:active { background: var(--bg-deep); }
.recent-item .badge {
  font-family: "STKaiti", "KaiTi", serif; font-size: 18px; font-weight: 600;
  color: var(--seal); width: 30px; text-align: center;
}
.recent-item .info { flex: 1; min-width: 0; }
.recent-item .name { font-size: 15px; font-weight: 500; margin-bottom: 2px; }
.recent-item .meta { font-size: 12px; color: var(--ink-mute); }
.recent-item .arrow { color: var(--ink-mute); }

.empty-tip {
  text-align: center; padding: 40px 20px;
  color: var(--ink-mute); font-size: 13px; letter-spacing: 2px;
}

/* ---------- 分类页 ---------- */
.cat-tabs {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--line);
  margin: 0 -20px 20px;
  padding: 0 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tab {
  flex-shrink: 0;
  padding: 10px 16px;
  font-size: 15px; letter-spacing: 4px; color: var(--ink-mute);
  position: relative;
  transition: color 0.15s;
}
.cat-tab.active { color: var(--seal); font-weight: 600; }
.cat-tab.active::after {
  content: ''; position: absolute; left: 16px; right: 16px; bottom: -1px;
  height: 2px; background: var(--seal);
}

/* 编外序列（六部之外的时代分目）：虚线边框与六部主目区分 */
.school-card.extra { border-style: dashed; }
.cat-tab.extra { margin-left: 8px; border-left: 1px solid var(--line); padding-left: 12px; }

.search-meta {
  margin: -4px 2px 10px; font-size: 12px; color: var(--ink-mute); letter-spacing: 1px;
}
.book-card .hit-n {
  display: inline-block; margin-left: 6px; padding: 0 5px;
  font-size: 10px; font-weight: 400; color: #F4E8D0; background: var(--seal);
  border-radius: 3px; vertical-align: middle; letter-spacing: 0;
}
.intro .hl { color: var(--seal); font-weight: 600; background: rgba(179,58,42,0.08); }

.book-list { display: flex; flex-direction: column; gap: 10px; }
.book-card {
  display: flex; gap: 14px; align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 14px;
  transition: background 0.12s;
}
.book-card:active { background: var(--bg-deep); }
.book-card .seal-box {
  width: 50px; height: 64px; flex-shrink: 0;
  background: var(--seal); color: #F4E8D0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: "STKaiti", "KaiTi", serif;
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12);
}
.book-card .seal-box .sch { font-size: 22px; font-weight: 600; line-height: 1; }
.book-card .seal-box .nm  { font-size: 11px; margin-top: 4px; letter-spacing: 1px; }
.book-card .info { flex: 1; min-width: 0; }
.book-card .name { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.book-card .intro {
  font-size: 12px; color: var(--ink-mute);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; line-height: 1.6;
}
.book-card.coming { opacity: 0.55; }
.book-card .coming-tag {
  display: inline-block; font-size: 10px;
  border: 1px solid var(--seal); color: var(--seal);
  padding: 1px 6px; border-radius: 2px; letter-spacing: 1px;
  margin-top: 6px;
}

/* ---------- 书籍目录页 ---------- */
.toc-hero {
  text-align: center; padding: 22px 0 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}
.toc-hero .sch {
  display: inline-block; font-family: "STKaiti", "KaiTi", serif;
  font-size: 14px; color: var(--seal);
  border: 1px solid var(--seal); border-radius: 2px;
  padding: 2px 10px; letter-spacing: 4px; margin-bottom: 10px;
}
.toc-hero h2 { margin: 0 0 6px; font-size: 24px; letter-spacing: 6px; font-weight: 600; }
.toc-hero .au { font-size: 13px; color: var(--ink-mute); letter-spacing: 2px; }
.toc-hero .intro { font-size: 13px; color: var(--ink-soft); line-height: 1.8; max-width: 480px; margin: 14px auto 0; }
.toc-actions { display: flex; justify-content: center; gap: 10px; margin-top: 16px; }
.btn {
  border: 1px solid var(--line); color: var(--ink-soft);
  background: var(--bg-card);
  padding: 7px 18px; font-size: 13px; letter-spacing: 2px;
  border-radius: 2px; transition: all 0.12s;
}
.btn:active { transform: scale(0.97); }
.btn.btn-primary { background: var(--seal); border-color: var(--seal); color: #F4E8D0; }
.btn.btn-primary:active { background: var(--seal-dark); }

.chapter-list { display: flex; flex-direction: column; }
.ch-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 8px;
  border-bottom: 1px dashed var(--line-soft);
  transition: background 0.12s;
}
.ch-item:last-child { border-bottom: none; }
.ch-item:active { background: var(--bg-deep); }
.ch-item .n { color: var(--ink-mute); font-size: 13px; min-width: 30px; font-family: "STKaiti", "KaiTi", serif; }
.ch-item .t { flex: 1; font-size: 15px; }
.ch-item.read .t { color: var(--ink-mute); }
.ch-item .dot {
  width: 8px; height: 8px; border-radius: 50%;
  border: 1px solid var(--line);
}
.ch-item.read .dot { background: var(--seal); border-color: var(--seal); }

/* ---------- 阅读页 ---------- */
.reader-bar {
  position: sticky; top: 34px; z-index: 30;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: 10px 16px;
  display: flex; align-items: center; gap: 8px;
}
.reader-bar .back {
  color: var(--ink-soft); padding: 4px 8px; font-size: 18px;
  min-width: 32px; text-align: center;
}
.reader-bar .title {
  flex: 1; text-align: center; font-size: 14px; color: var(--ink-soft);
  letter-spacing: 2px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.reader-bar .action {
  color: var(--ink-soft); padding: 4px 8px;
  min-width: 32px; text-align: center; font-size: 14px; letter-spacing: 1px;
}

.reader-content {
  max-width: 640px; margin: 0 auto;
  /* 底部留出足够空间，避免被固定工具栏+章节导航遮挡；
     工具栏自身 padding 含 env(safe-area-inset-bottom)，故此处同步叠加 */
  padding: 30px 24px calc(200px + env(safe-area-inset-bottom));
}
.chapter-title {
  text-align: center; font-size: 22px; font-weight: 600;
  letter-spacing: 6px; margin: 10px 0 8px; color: var(--ink);
}
.chapter-deco {
  text-align: center; margin-bottom: 28px;
}
.chapter-deco::before {
  content: '·  ·  ·'; color: var(--ink-mute); letter-spacing: 8px; font-size: 12px;
}
.chapter-body {
  font-size: var(--reader-size);
  line-height: 2.05;
  color: var(--ink);
  white-space: pre-wrap;
  text-align: justify;
  text-justify: inter-ideograph;
  letter-spacing: 0.5px;
}

.reader-tools {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: var(--bg);
  border-top: 1px solid var(--line);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 12px;
  box-shadow: 0 -2px 10px rgba(80,50,20,0.06);
}
.tool-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tool-row .label { font-size: 12px; color: var(--ink-mute); letter-spacing: 2px; min-width: 36px; }
.size-picker { display: flex; gap: 6px; }
.size-picker button {
  width: 34px; height: 34px; border: 1px solid var(--line);
  background: var(--bg-card);
  border-radius: 4px;
  font-size: 14px; color: var(--ink-soft);
  transition: all 0.12s;
}
.size-picker button.active { background: var(--seal); border-color: var(--seal); color: #F4E8D0; }
.theme-toggle { display: flex; gap: 6px; margin-left: auto; }
.theme-toggle button {
  padding: 6px 12px; border: 1px solid var(--line);
  background: var(--bg-card);
  border-radius: 4px;
  font-size: 12px; color: var(--ink-soft); letter-spacing: 1px;
}
.theme-toggle button.active { background: var(--seal); border-color: var(--seal); color: #F4E8D0; }
.script-toggle { display: flex; gap: 6px; }
.script-toggle button {
  padding: 6px 12px; border: 1px solid var(--line);
  background: var(--bg-card);
  border-radius: 4px;
  font-size: 12px; color: var(--ink-soft); letter-spacing: 1px;
}
.script-toggle button.active { background: var(--seal); border-color: var(--seal); color: #F4E8D0; }
.nav-row { display: flex; gap: 10px; flex-wrap: wrap; }
.nav-row .btn { flex: 1 1 0; min-width: 68px; text-align: center; }
.nav-row .btn:disabled { opacity: 0.35; pointer-events: none; }

/* ---------- 我的 ---------- */
.me-hero {
  text-align: center; padding: 24px 0;
}
.me-hero .avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 64px; height: 64px; background: var(--seal); color: #F4E8D0;
  font-family: "STKaiti", "KaiTi", serif; font-size: 30px; font-weight: 600;
  border-radius: 50%; margin-bottom: 12px;
}
.me-hero .name { font-size: 18px; font-weight: 600; letter-spacing: 4px; }
.me-hero .sub  { font-size: 12px; color: var(--ink-mute); letter-spacing: 2px; margin-top: 4px; }

.stat-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  margin: 16px 0 24px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 16px 8px; text-align: center;
}
.stat-card .v { font-size: 24px; font-weight: 600; color: var(--seal); font-family: "STKaiti", "KaiTi", serif; }
.stat-card .l { font-size: 11px; color: var(--ink-mute); letter-spacing: 2px; margin-top: 4px; }

.me-list { background: var(--bg-card); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.me-list .row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--line-soft);
}
.me-list .row:last-child { border-bottom: none; }
.me-list .row:active { background: var(--bg-deep); }
.me-list .row .t { flex: 1; font-size: 15px; }
.me-list .row .arr { color: var(--ink-mute); }

.about-content {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 20px;
  font-size: 14px; line-height: 1.9;
  color: var(--ink-soft);
}
.about-content h3 { margin: 0 0 12px; font-size: 16px; color: var(--ink); letter-spacing: 4px; }
.about-content p { margin: 0 0 10px; }

/* ---------- 通用 ---------- */
.divider { height: 1px; background: var(--line-soft); margin: 16px 0; }

.toast {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: rgba(30,20,10,0.88); color: #F4E8D0;
  padding: 10px 18px; border-radius: 4px; font-size: 14px; letter-spacing: 1px;
  z-index: 100; opacity: 0; transition: opacity 0.2s; pointer-events: none;
}
.toast.show { opacity: 1; }

/* 较窄屏适配 */
@media (max-width: 380px) {
  .hero h1 { font-size: 22px; letter-spacing: 6px; }
  .school-card .ch { font-size: 30px; }
  /* 底部 padding 必须保留 200px+safe-area：固定工具栏高约 168px + 手势条，
     若压缩为小值，正文最后 2-3 行会永久被工具栏遮挡（2026-10-27 修复） */
  .reader-content { padding: 24px 18px calc(200px + env(safe-area-inset-bottom)); }
}

/* ---------- 三门九圣专题 ---------- */
.sage-school { margin-bottom: 24px; }
.sage-school-head { display: flex; align-items: center; gap: 10px; margin: 0 2px 10px; }
.sage-school-head .seal2 {
  width: 34px; height: 34px; flex: none;
  display: flex; align-items: center; justify-content: center;
  color: #F4E8D0; font-size: 17px; font-weight: 600;
  border-radius: 4px;
  box-shadow: 0 1px 0 rgba(0,0,0,0.25), inset 0 0 0 1px rgba(255,255,255,0.15);
}
.sage-school-head .t { min-width: 0; }
.sage-school-head .n  { font-size: 15px; font-weight: 600; letter-spacing: 2px; }
.sage-school-head .ds { font-size: 11px; color: var(--ink-mute); letter-spacing: 1px; margin-top: 1px; }
.sage-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sage-card {
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 14px 6px 12px;
  text-align: center;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.1s;
}
.sage-card:active { transform: scale(0.96); background: var(--bg-deep); }
.sage-card .glyph {
  width: 40px; height: 40px; margin: 0 auto 8px;
  display: flex; align-items: center; justify-content: center;
  color: #F4E8D0; font-size: 20px; font-weight: 600;
  border-radius: 6px;
  box-shadow: 0 1px 0 rgba(0,0,0,0.25), inset 0 0 0 1px rgba(255,255,255,0.15);
}
.sage-card .snm   { font-size: 15px; font-weight: 600; letter-spacing: 2px; }
.sage-card .stag  { font-size: 11px; color: var(--ink-mute); margin: 3px 0 7px; line-height: 1.5; }
.sage-card .sbook { font-size: 12px; color: var(--ink-soft); }
.sages-footnote {
  text-align: center; font-size: 12px; color: var(--ink-mute);
  letter-spacing: 2px; padding: 4px 0 20px;
}
@media (max-width: 380px) {
  .sage-card { padding: 12px 4px 10px; }
  .sage-card .stag { font-size: 10px; }
}

/* ====================================================================
 * 留存功能：每日一句 · 打卡（v13）
 * 沿用竹简暖黄配色，不引入新色系
 * ==================================================================== */

/* 顶栏「今日」入口 */
.today-entry {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 12px; border: 1px solid var(--line);
  border-radius: 999px; background: var(--bg-card);
  font-size: 13px; letter-spacing: 1px; color: var(--ink-soft);
  position: relative; white-space: nowrap;
}
.today-entry .te-sun { color: var(--seal); font-size: 14px; line-height: 1; }
.today-entry.active { background: var(--seal); color: #F4E8D0; border-color: var(--seal); }
.today-entry.active .te-sun { color: #F4E8D0; }
.today-entry .te-dot {
  position: absolute; top: -2px; right: -2px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--seal); border: 1.5px solid var(--bg);
}

/* 首页「每日一句」卡片 */
.daily-teaser {
  display: block; margin: 16px 16px 18px;
  padding: 14px 16px 13px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--seal);
  border-radius: 8px; box-shadow: var(--shadow);
}
.daily-teaser:active { background: var(--bg-deep); }
.dt-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dt-tag { font-size: 11px; letter-spacing: 3px; color: var(--seal); font-weight: 600; }
.dt-date { font-size: 11px; color: var(--ink-mute); letter-spacing: 1px; }
.dt-text {
  font-size: 15px; line-height: 1.9; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.dt-from { margin-top: 8px; font-size: 11px; color: var(--ink-mute); display: flex; justify-content: space-between; }
.dt-go { color: var(--seal); }

/* 今日页 */
.today-hero { text-align: center; padding: 26px 20px 10px; }
.th-date { font-size: 12px; color: var(--ink-mute); letter-spacing: 2px; }
.th-title { font-size: 24px; font-weight: 600; letter-spacing: 8px; margin: 6px 0 4px; }
.th-sub { font-size: 12px; color: var(--ink-mute); letter-spacing: 2px; }

.quote-card {
  margin: 16px; padding: 22px 20px 18px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow);
  position: relative; text-align: center;
}
.qc-text {
  font-size: 21px; line-height: 2; color: var(--ink);
  padding: 6px 4px 4px; letter-spacing: 1px;
}
.qc-from { margin: 14px 0 16px; font-size: 13px; color: var(--ink-soft); letter-spacing: 1px; }
.qc-read {
  padding: 7px 20px; border: 1px solid var(--seal);
  border-radius: 999px; color: var(--seal); background: transparent;
  font-size: 13px; letter-spacing: 2px;
}
.qc-read:active { background: var(--seal); color: #F4E8D0; }

.checkin-card {
  margin: 18px 16px; padding: 18px 18px 16px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow);
  text-align: center;
}
.ci-head { display: flex; align-items: baseline; justify-content: center; gap: 8px; flex-wrap: wrap; }
.ci-streak { display: inline-flex; align-items: baseline; gap: 4px; }
.ci-num { font-size: 34px; font-weight: 600; color: var(--seal); line-height: 1; }
.ci-unit { font-size: 13px; color: var(--ink-soft); }
.ci-hint { font-size: 12px; color: var(--ink-mute); }
.ci-week { display: flex; justify-content: space-between; margin: 18px 2px 16px; }
.ci-day { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.cid-box {
  width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: var(--bg-card);
}
.ci-day.done .cid-box { background: var(--seal); border-color: var(--seal); }
.ci-day.today .cid-box { box-shadow: 0 0 0 2px var(--seal); }
.cid-label { font-size: 11px; color: var(--ink-mute); }
.ci-day.today .cid-label { color: var(--seal); font-weight: 600; }
.ci-btn {
  width: 100%; padding: 11px 0;
  background: var(--seal); color: #F4E8D0;
  border-radius: 6px; font-size: 15px; letter-spacing: 3px;
}
.ci-btn:active { background: var(--seal-dark); }
.ci-btn.done { background: var(--bg-deep); color: var(--ink-mute); cursor: default; }
.ci-note { margin-top: 12px; font-size: 10px; color: var(--ink-mute); line-height: 1.6; }
.today-foot { text-align: center; font-size: 12px; color: var(--ink-mute); padding: 2px 0 28px; }
.today-foot b { color: var(--seal); font-size: 14px; }

/* 夜间模式微调 */
body.theme-night .cid-box { color: var(--bg-card); }
body.theme-night .daily-teaser, body.theme-night .quote-card, body.theme-night .checkin-card { box-shadow: none; }
