:root {
  --gold: #c9a227;
  --gold-soft: #f3e6b8;
  --gold-bg: #fff9e6;
  --ink: #3a3326;
  --ink-soft: #7a715c;
  --line: #e7dcc0;
  --red: #b3402f;
  --green: #3f7d52;
  --card: #ffffff;
  --shadow: 0 6px 20px rgba(120, 95, 30, .12);
  --radius: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #fffdf6 0%, #fbf3df 100%);
  min-height: 100dvh;
}

/* ---------- 顶部栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  background: var(--gold-bg);
  border-bottom: 2px solid var(--gold);
}
.brand { display: flex; align-items: center; gap: 8px; }
.brand-lotus { font-size: 22px; color: var(--gold); }
.brand-title { font-weight: 700; font-size: 16px; letter-spacing: .5px; }
.brand-manual {
  margin-left: 4px; font-size: 12px; font-weight: 700; text-decoration: none;
  color: #7a5c00; background: #fff; border: 1px solid var(--gold);
  border-radius: 999px; padding: 3px 10px; white-space: nowrap;
}
.brand-manual:hover { background: var(--gold); color: #fff; }
.topnav { display: flex; gap: 8px; }
.topnav button {
  border: 1px solid var(--gold);
  background: #fff; color: var(--ink);
  border-radius: 999px; padding: 6px 14px; font-size: 13px; cursor: pointer;
}
.topnav button.primary { background: var(--gold); color: #fff; border-color: var(--gold); }

/* ---------- 布局容器 ---------- */
.view { max-width: 760px; margin: 0 auto; padding: 16px 16px 120px; }
.hidden { display: none !important; }

h2 { font-size: 19px; margin: 4px 0 12px; }
h3.section-h { margin: 22px 0 10px; font-size: 16px; color: var(--ink-soft); }
.hint { color: var(--ink-soft); font-size: 13px; margin: 0 0 12px; }

/* ---------- 表单 ---------- */
label { display: block; font-size: 13px; color: var(--ink-soft); margin: 12px 0 4px; }
input, textarea, select {
  width: 100%; padding: 11px 12px; font-size: 15px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink);
}
input:focus, textarea:focus { outline: 3px solid var(--gold-soft); border-color: var(--gold); }
textarea { resize: vertical; }
.btn-primary {
  width: 100%; margin-top: 16px; padding: 13px; font-size: 16px; font-weight: 600;
  color: #fff; background: var(--gold); border: none; border-radius: 12px; cursor: pointer;
}
.btn-primary:active { transform: translateY(1px); }
.btn-ghost {
  padding: 10px 14px; font-size: 14px; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: 10px; cursor: pointer;
}
.form-msg { min-height: 18px; font-size: 13px; margin: 10px 0 0; }
.form-msg.err { color: var(--red); }
.form-msg.ok { color: var(--green); }

/* ---------- 登录/注册 ---------- */
.auth-view { display: flex; justify-content: center; align-items: flex-start; padding-top: 8vh; }
.auth-card {
  width: 100%; max-width: 400px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px;
}
.auth-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.auth-tab {
  flex: 1; padding: 10px; border: 1px solid var(--line); background: #faf6ea;
  border-radius: 10px; cursor: pointer; font-size: 14px; color: var(--ink-soft);
}
.auth-tab.active { background: var(--gold); color: #fff; border-color: var(--gold); }

/* ---------- 总览 ---------- */
.hero, .med-img {
  width: 100%; height: auto; border-radius: var(--radius);
  display: block; box-shadow: var(--shadow);
}
.overview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0; }
.ov-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px; text-align: center; box-shadow: var(--shadow);
}
.ov-num { display: block; font-size: 30px; font-weight: 800; color: var(--gold); }
.ov-label { font-size: 13px; color: var(--ink-soft); }
.quick-entry { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.qe-btn {
  padding: 18px 10px; font-size: 15px; border: 1px solid var(--line);
  background: var(--gold-bg); border-radius: 14px; cursor: pointer; color: var(--ink);
}
.qe-btn:active { background: var(--gold-soft); }
.today-date { text-align: center; color: var(--ink-soft); font-size: 13px; margin-top: 14px; }

/* ---------- 佛号 ---------- */
.buddha-stage {
  position: relative; width: 100%; max-width: 440px; margin: 0 auto;
}
.buddha-img {
  width: 100%; height: auto; display: block;
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.woodfish {
  position: absolute; left: 50%; transform: translateX(-50%);
  bottom: 9%; /* 阿弥陀佛脚下莲花座位置 */
  width: 128px; height: 128px; border-radius: 50%; border: none;
  background: radial-gradient(circle at 35% 30%, #f6e6a8, var(--gold));
  box-shadow: 0 6px 18px rgba(40,30,10,.35); cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding: 0;
  transition: transform .08s;
}
.woodfish:active { transform: translateX(-50%) scale(.94); }
.woodfish svg { width: 74%; height: 74%; }
.buddha-panel { max-width: 440px; margin: 14px auto 0; }
.buddha-today { text-align: center; font-size: 16px; margin: 6px 0 12px; }
.buddha-today strong { font-size: 24px; color: var(--gold); }
.buddha-input-row { display: flex; align-items: flex-end; justify-content: center; gap: 10px; flex-wrap: wrap; }
.buddha-input-row .inline { margin: 0; }
.buddha-input-row #buddha-set { margin-top: 0; }
.inline { display: flex; align-items: center; gap: 10px; }
.inline input { width: 120px; }

/* ---------- 列表（诵经/三福） ---------- */
.check-list { display: flex; flex-direction: column; gap: 10px; }
.check-item {
  display: flex; align-items: center; gap: 10px; background: var(--card);
  border: 1px solid var(--line); border-radius: 12px; padding: 12px;
}
.check-item input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--gold); }
.check-item .name { flex: 1; font-size: 15px; }
.check-item input[type=number] { width: 76px; }

/* ---------- 闻思 ---------- */
.creed { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.creed p { margin: 6px 0; font-size: 14px; }
.med-stage { position: relative; width: 100%; max-width: 460px; margin: 0 auto; }
.med-img { width: 100%; height: auto; display: block; border-radius: var(--radius); box-shadow: var(--shadow); }
.med-time {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  font-size: 68px; font-weight: 800; color: #fff;
  font-variant-numeric: tabular-nums; line-height: 1;
  text-shadow: 0 2px 10px rgba(0,0,0,.55), 0 0 24px rgba(0,0,0,.35);
  letter-spacing: 2px;
}
.med-controls {
  display: flex; gap: 10px; justify-content: center; margin-top: 16px;
  flex-wrap: wrap;
}
.btn-yellow {
  padding: 12px 18px; font-size: 16px; font-weight: 600; color: #5c4400;
  background: #f5c542; border: 2px solid #d99e1e; border-radius: 12px; cursor: pointer;
}
.btn-yellow:active { transform: scale(.96); background: #efb91f; }

/* ---------- 底部 Tab ---------- */
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
  background: var(--gold-bg); border-top: 2px solid var(--gold);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
}
.save-bar {
  display: block; width: 100%; margin-bottom: 6px;
  background: var(--gold); color: #fff; border: none; border-radius: 12px;
  padding: 13px; font-size: 16px; font-weight: 600; cursor: pointer;
}
.save-bar:active { transform: scale(.99); }
.bn-row { display: flex; justify-content: space-around; }
.bn-btn {
  flex: 1; border: none; background: none; color: var(--ink-soft);
  font-size: 12px; padding: 8px 2px; cursor: pointer; border-radius: 10px;
}
.bn-btn.active { background: var(--gold); color: #fff; }

/* ---------- 个人中心 ---------- */
.profile-nav {
  display: flex; gap: 6px; padding: 4px 0 12px; margin-bottom: 12px;
  border-bottom: 1px solid var(--line); overflow-x: auto;
}
.profile-nav .bn-btn {
  flex: 1; min-width: 56px; border: 1px solid var(--line); background: var(--gold-bg);
  border-radius: 10px; font-size: 12px; padding: 9px 4px; color: var(--ink-soft);
}
.profile-nav .bn-btn.active { background: var(--gold); color: #fff; }
.profile-card { text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 16px 0; }
.avatar { width: 72px; height: 72px; margin: 0 auto 10px; border-radius: 50%; background: var(--gold-bg); display: flex; align-items: center; justify-content: center; font-size: 36px; color: var(--gold); }
.profile-email, .profile-joined { color: var(--ink-soft); font-size: 13px; margin: 4px 0; }
.stat-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0; }
.stat-box { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 6px; text-align: center; box-shadow: var(--shadow); }
.stat-num { display: block; font-size: 30px; font-weight: 800; color: var(--gold); }
.stat-label { font-size: 13px; color: var(--ink-soft); }

/* ---------- 记录卡片 ---------- */
.record-list { display: flex; flex-direction: column; gap: 12px; }
.record-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; box-shadow: var(--shadow); }
.record-date { font-weight: 700; font-size: 15px; }
.record-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 8px 0; font-size: 13px; color: var(--ink-soft); }
.record-meta b { color: var(--ink); }
.record-note { font-size: 13px; color: var(--ink-soft); white-space: pre-wrap; }
.empty { text-align: center; color: var(--ink-soft); padding: 30px 0; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px;
  font-size: 14px; z-index: 30; box-shadow: var(--shadow);
}

/* ---------- 游客提示 ---------- */
.guest-tip {
  margin-top: 14px; padding: 14px;
  background: var(--gold-soft); border-radius: var(--radius);
  text-align: center; font-size: 13px; color: var(--ink-soft);
}
.guest-tip p { margin: 0 0 10px; }
.guest-tip button { padding: 8px 18px; font-size: 14px; }

/* ---------- 认证页返回 ---------- */
#auth-back {
  margin-bottom: 14px; font-size: 14px;
}

/* ---------- 桌面适配 ---------- */
@media (min-width: 720px) {
  .view { padding-bottom: 32px; }
  .bottomnav { position: static; border-radius: var(--radius); margin-top: 18px; box-shadow: var(--shadow); }
  .overview-grid, .quick-entry, .stat-row { grid-template-columns: repeat(4, 1fr); }
  .auth-view { padding-top: 6vh; }
}

/* ---------- 云端连接状态提示 ---------- */
.cloud-banner {
  text-align: center;
  font-size: 13px;
  padding: 8px 14px;
  margin: 0;
  border-bottom: 1px solid var(--line);
}
.cloud-banner.hidden { display: none; }
.cloud-banner.ok {
  background: #eaf6ee;
  color: var(--green);
}
.cloud-banner.warn {
  background: #fdf0e6;
  color: var(--red);
}

/* ---------- 注册/登录提示 ---------- */
.auth-hint { font-size: 12px; color: var(--ink-soft); margin: 10px 0 0; line-height: 1.6; }
.guest-link { width: 100%; margin-top: 14px; }

/* ---------- 底部站点说明 ---------- */
.site-footer {
  text-align: center;
  font-size: 12px;
  color: var(--ink-soft);
  padding: 16px 14px 28px;
  border-top: 1px solid var(--line);
  background: #fffdf6;
}

/* ---------- 个人中心：备份区 ---------- */
.backup-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 6px 0 10px; }
.backup-row .btn-primary, .backup-row .btn-ghost { flex: 1; min-width: 130px; }
.export-note {
  font-size: 13px; line-height: 1.7; color: var(--ink-soft);
  background: var(--gold-bg); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px; margin: 0 0 18px;
}
.export-note code { background: #fff; padding: 1px 5px; border-radius: 5px; font-size: 12px; color: var(--red); }
.export-note b { color: var(--ink); }

/* ============================================================
   音频播放器（本地 mp3）
   ============================================================ */
.audio-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 14px; margin: 12px 0 14px;
  box-shadow: var(--shadow);
}
.audio-controls { display: flex; align-items: center; gap: 12px; }
.audio-btn {
  width: 46px; height: 46px; border-radius: 50%; border: none;
  background: var(--gold); color: #fff; font-size: 15px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: background .15s, transform .15s;
}
.audio-btn:active { transform: scale(.94); background: #a8871d; }
.track-info { flex: 1; min-width: 0; }
.track-name {
  font-size: 14px; font-weight: 600; color: #8B6C00;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.track-select { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 7px; }
.track-chip {
  padding: 5px 11px; border-radius: 16px; border: 1px solid var(--line);
  background: var(--gold-bg); font-size: 12px; cursor: pointer; color: var(--ink-soft);
}
.track-chip.active { background: var(--gold-soft); border-color: var(--gold); color: #8B6C00; font-weight: 600; }
.volume { width: 84px; accent-color: var(--gold); flex-shrink: 0; }

/* ============================================================
   月历视图
   ============================================================ */
.month-nav { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 12px; }
.month-nav button {
  border: 1px solid var(--line); background: #fff; border-radius: 10px;
  width: 40px; height: 40px; font-size: 20px; cursor: pointer; color: #8B6C00; line-height: 1;
}
.month-nav button:active { background: var(--gold-bg); }
.month-label { font-size: 16px; font-weight: 700; color: #8B6C00; }
.month-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 5px; }
.month-weekdays span { text-align: center; font-size: 12px; color: var(--ink-soft); padding: 4px 0; }
.month-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.month-cell {
  min-height: 58px; border-radius: 10px; background: var(--gold-bg);
  border: 1px solid var(--line); display: flex; flex-direction: column;
  align-items: center; justify-content: center; font-size: 14px;
  color: var(--ink); cursor: pointer; position: relative; padding: 3px 1px;
  gap: 1px;
}
.month-cell .day-num { font-weight: 600; line-height: 1.1; }
.month-cell .lunar-txt { font-size: 9.5px; color: var(--ink-soft); line-height: 1.2; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.month-cell .festival-txt { font-size: 9px; color: var(--red); font-weight: 700; line-height: 1.2; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.month-cell .zhai-badge {
  position: absolute; top: 2px; right: 2px; font-size: 8.5px; line-height: 1;
  color: var(--green); border: 1px solid var(--green); border-radius: 6px; padding: 1px 3px;
  background: #eaf6ee;
}
.month-cell .rec-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); margin-top: 2px; }
.month-cell.has-record { background: var(--gold); color: #fff; border-color: #a8871d; font-weight: 700; }
.month-cell.has-record .lunar-txt { color: #fff3c4; }
.month-cell.has-record .festival-txt { color: #fff; }
.month-cell.has-record .rec-dot { background: #fff; }
.month-cell.today { box-shadow: 0 0 0 2px #8B6C00; }
.month-cell.sel { background: #8B6C00; color: #fff; border-color: #6b5300; }
.month-cell.sel .lunar-txt { color: #fff3c4; }
.month-cell.sel .festival-txt { color: #fff; }
.month-cell.sel .rec-dot { background: #fff; }
.month-cell.empty { background: transparent; border-color: transparent; cursor: default; }
.month-cell:active:not(.empty) { transform: scale(.94); }
.cal-legend { display: flex; flex-wrap: wrap; gap: 10px 14px; justify-content: center; margin: 12px 0 4px; font-size: 12px; color: var(--ink-soft); }
.lg-item { display: inline-flex; align-items: center; gap: 5px; }
.lg-zhai { font-size: 10px; color: var(--green); border: 1px solid var(--green); border-radius: 6px; padding: 1px 4px; background: #eaf6ee; }
.lg-fest { font-size: 10px; color: var(--red); font-weight: 700; }
.lg-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); display: inline-block; }
.cal-tip { text-align: center; font-size: 13px; color: var(--ink-soft); margin: 12px 0 14px; }

/* ============================================================
   净土法门实修全解（本地 CSS，无 CDN）
   ============================================================ */
.dharma { margin-top: 22px; }
.d-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.d-card.d-center { text-align: center; }
.d-title-card {
  background: linear-gradient(135deg, #FFF9E6 0%, #FFFFFF 100%);
  text-align: center; padding: 30px 18px;
}
.d-title { font-size: 27px; font-weight: 800; color: #4a3f22; margin-bottom: 8px; letter-spacing: 1px; }
.d-sub { font-size: 15px; color: var(--ink-soft); font-weight: 300; }
.d-head { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.d-ico { font-size: 21px; }
.d-h { font-size: 19px; font-weight: 700; color: #4a3f22; }
.d-center-h { text-align: center; display: block; margin-bottom: 16px; }
.d-text { font-size: 14.5px; line-height: 1.9; color: var(--ink); margin: 0; }

.g-green { color: #059669; }
.g-amber { color: #D97706; }
.g-purple {
  background: linear-gradient(90deg, #7C3AED, #8B5CF6);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.g-red { color: #DC2626; }

/* 三法纲宗 */
.three-row { display: flex; justify-content: space-around; gap: 8px; flex-wrap: wrap; }
.three-item { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; min-width: 84px; }
.three-ico {
  width: 58px; height: 58px; border-radius: 50%; background: var(--gold-bg);
  display: flex; align-items: center; justify-content: center; font-size: 26px;
}
.three-name { font-size: 20px; font-weight: 700; }
.three-desc { font-size: 12.5px; color: var(--ink-soft); }

/* 五经一论 */
.sutra-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.sutra-cell {
  background: var(--gold-bg); padding: 11px 13px; border-radius: 11px; border: 1px solid var(--line);
}
.sutra-t { font-size: 14px; font-weight: 600; color: #7C3AED; margin-bottom: 3px; }
.sutra-d { font-size: 12.5px; color: var(--ink-soft); line-height: 1.6; }

/* 典籍数量 */
.d-num-card { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.d-big { font-size: 54px; font-weight: 800; line-height: 1.1; }
.d-big-label { font-size: 17px; font-weight: 600; color: var(--ink); margin: 6px 0 3px; }
.d-big-sub { font-size: 12.5px; color: var(--ink-soft); }

/* 实修次第柱状图（纯 CSS 替代 Chart.js） */
.chart { display: flex; align-items: flex-end; gap: 10px; height: 170px; margin-bottom: 14px; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.chart-bar-wrap {
  flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center;
}
.chart-bar { width: 100%; max-width: 66px; border-radius: 8px 8px 0 0; min-height: 6px; }
.b-blue { background: rgba(59, 130, 246, .75); border: 1px solid #3B82F6; }
.b-green { background: rgba(16, 185, 129, .75); border: 1px solid #10B981; }
.b-amber { background: rgba(245, 158, 11, .75); border: 1px solid #F59E0B; }
.b-red { background: rgba(239, 68, 68, .75); border: 1px solid #EF4444; }
.chart-lb { font-size: 11.5px; color: var(--ink-soft); text-align: center; margin-top: 6px; line-height: 1.4; }
.chart-note { list-style: none; margin: 0; padding: 0; font-size: 13px; line-height: 1.9; color: var(--ink-soft); }
.chart-note li { margin-bottom: 3px; }
.chart-note b { color: var(--ink); }

/* 修证四步法 */
.steps { list-style: none; margin: 0; padding: 0; }
.steps li { display: flex; align-items: flex-start; gap: 11px; margin-bottom: 13px; }
.steps li:last-child { margin-bottom: 0; }
.step-n {
  width: 27px; height: 27px; border-radius: 50%; background: var(--gold-bg); color: #DC2626;
  display: flex; align-items: center; justify-content: center; font-weight: 700;
  font-size: 13px; flex-shrink: 0; margin-top: 1px; border: 1px solid var(--line);
}
.step-t { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.step-d { font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; line-height: 1.6; }

/* 桌面端：法门全解两列布局 */
@media (min-width: 760px) {
  .dharma { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .d-title-card { grid-column: 1 / -1; }
  .sutra-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 420px) {
  .volume { width: 62px; }
  .track-name { font-size: 13px; }
  .d-title { font-size: 23px; }
  .chart { height: 148px; }
}

/* ---------- 三福善行 每项说明 ---------- */
.check-item {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 8px; padding: 12px 10px; background: #fff;
  border: 1px solid var(--line); border-radius: 12px;
  margin-bottom: 8px; cursor: pointer;
}
.check-item input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--gold); flex-shrink: 0; }
.check-item .name { flex: 1; font-weight: 600; color: var(--ink); }
.check-item input[type="number"] { width: 76px; }
.check-item .desc { font-size: 12.5px; color: var(--ink-soft); flex-basis: 100%; padding-left: 28px; }
.check-item.compact { padding: 8px; margin-bottom: 6px; }
.check-item.compact .desc { padding-left: 26px; font-size: 12px; }

/* ---------- 木鱼 SVG ---------- */
.woodfish { display: flex; align-items: center; justify-content: center; }
.woodfish svg { width: 100%; height: 100%; }

/* ---------- 日历补录表单 ---------- */
.day-edit {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; margin: 14px 0 18px;
  box-shadow: var(--shadow);
}
.day-edit h3 { margin: 0 0 14px; font-size: 16px; color: #8B6C00; text-align: center; }
.day-edit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.day-edit label { display: block; font-size: 13px; color: var(--ink-soft); margin-bottom: 10px; }
.day-edit input[type="number"], .day-edit textarea {
  width: 100%; padding: 11px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 15px; background: #fff; color: var(--ink); font-family: inherit; margin-top: 6px;
}
.cal-edit-sec { margin-bottom: 12px; }
.cal-edit-sec-title { font-size: 14px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
#cal-save { width: 100%; margin-top: 6px; }

/* ---------- 静坐圆满弹窗 ---------- */
.med-modal {
  position: fixed; inset: 0; background: rgba(40,30,15,0.55);
  display: flex; align-items: center; justify-content: center; z-index: 200;
}
.med-modal.hidden { display: none; }
.med-modal-card {
  background: var(--card); border-radius: var(--radius);
  padding: 32px 28px; text-align: center; max-width: 300px; width: 86%;
  box-shadow: 0 12px 40px rgba(0,0,0,0.25); border: 1px solid var(--line);
  animation: scaleIn .25s ease;
}
@keyframes scaleIn { from { transform: scale(.85); opacity: .6; } to { transform: scale(1); opacity: 1; } }
.med-modal-ico { font-size: 46px; margin-bottom: 10px; }
.med-modal-card h2 { margin: 0 0 6px; font-size: 24px; color: #8B6C00; }
.med-modal-card p { margin: 0 0 18px; font-size: 16px; color: var(--ink-soft); }

/* 五经一论副标题 */
.d-subline { font-size: 13.5px; color: var(--ink-soft); margin: -4px 0 12px; }

@media (max-width: 420px) {
  .day-edit-grid { grid-template-columns: 1fr; }
  .check-item .desc { font-size: 12px; }
}

/* ---------- 各功课页顶部配图 ---------- */
.page-hero {
  width: 100%; max-height: 280px; object-fit: contain;
  background: var(--gold-bg); border-radius: var(--radius);
  display: block; margin: 0 0 16px; box-shadow: var(--shadow);
}

/* ---------- 读诵佛经：21:9 横幅 + 阅读按钮 ---------- */
.sutra-banner-wrap {
  width: calc(100% + 32px); margin: 0 -16px 16px;
  overflow: hidden; aspect-ratio: 21 / 9;
  background: var(--gold-bg);
}
.sutra-banner {
  width: 100%; height: 100%; object-fit: cover;
  display: block; box-shadow: var(--shadow);
}
.sutra-options { display: flex; flex-direction: column; gap: 14px; }
.sutra-option { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px; box-shadow: var(--shadow); }
.sutra-option .check-item { border: none; padding: 6px 2px; margin-bottom: 0; }
.btn-read-sutra {
  width: 100%; margin-top: 8px; padding: 10px;
  background: var(--gold-bg); color: var(--ink);
  border: 1px dashed var(--gold); border-radius: 10px;
  font-size: 14px; cursor: pointer;
}
.btn-read-sutra:active { background: var(--gold-soft); }

/* ---------- 三福善行：顶图全屏铺满 ---------- */
.good-hero-wrap {
  width: calc(100% + 32px); margin: 0 -16px 16px;
  background: transparent;
}
.good-hero {
  width: 100%; height: auto; display: block;
  box-shadow: var(--shadow); border-radius: 0;
}

/* ---------- 经文阅读器 ---------- */
#view-sutra { padding-bottom: 24px; }
#sutra-back { margin-bottom: 12px; }
#sutra-title { font-size: 22px; margin: 0 0 4px; }
#sutra-translator { margin: 0 0 14px; }
.sutra-scroll {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow);
}
.sutra-scroll p { font-size: 17px; line-height: 2.2; margin: 0 0 18px; text-align: justify; }
.sutra-scroll ruby { ruby-align: center; }
.sutra-scroll rt { font-size: 11px; color: var(--red); font-weight: 600; }
.sutra-scroll .variant { font-size: 12.5px; color: var(--ink-soft); }
.sutra-dedication {
  margin-top: 28px; padding-top: 20px; border-top: 2px solid var(--line);
  text-align: center;
}
.sutra-dedication h4 { font-size: 17px; color: #8B6C00; margin: 0 0 12px; }
.sutra-dedication p { font-size: 16px; line-height: 2; color: var(--ink); text-align: center; }

/* ---------- 三福善行：图片作背景底图 ---------- */
.good-stage {
  position: relative; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); margin-bottom: 6px; min-height: 420px;
}
.good-bg {
  position: absolute; inset: 0;
  background: url("莲花禅坐图.png") center/cover no-repeat;
}
.good-overlay {
  position: relative; margin: 14px; border-radius: 14px;
  background: rgba(255,255,255,.88); padding: 16px;
}
.good-overlay .check-list { margin-bottom: 12px; }

/* ---------- 净土法门实修全解 视频 ---------- */
.d-video-card { padding: 0; overflow: hidden; }
@media (min-width: 760px) {
  .d-video-card { grid-column: 1 / -1; }
}
.dharma-video {
  width: 100%; height: auto; display: block;
  border-radius: var(--radius) var(--radius) 0 0;
  background: #000;
}
.video-caption {
  text-align: center; font-size: 13px; color: var(--ink-soft);
  padding: 10px 14px; margin: 0;
}

/* ---------- 数据隐私提示条 ---------- */
.data-banner {
  position: sticky; top: 0; z-index: 25;
  background: linear-gradient(90deg, #fff3c4, #ffe08a);
  color: #5c4400; font-size: 13px; line-height: 1.5;
  padding: 9px 16px; text-align: center;
  border-bottom: 1px solid #e6c34d;
}
.data-banner b { color: #a85700; }

/* ---------- 联系页脚 ---------- */
.contact-footer {
  margin-top: 18px; text-align: center;
  font-size: 13px; color: var(--ink-soft);
  padding: 12px; border-top: 1px dashed var(--line);
}
.contact-footer a { color: var(--gold); text-decoration: none; font-weight: 600; }
.contact-footer a:hover { text-decoration: underline; }

/* ---------- 小净 AI 助手悬浮窗 ---------- */
.xj-fab {
  position: fixed; right: 18px; bottom: 90px; z-index: 60;
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, #f7d36b, #e0a92e);
  box-shadow: 0 8px 22px rgba(180, 130, 20, .4);
  cursor: pointer; user-select: none;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.xj-fab svg { width: 56px; height: 56px; display: block; }
.xj-fab:active { transform: scale(.94); }
.xj-panel {
  position: fixed; right: 18px; bottom: 158px; z-index: 61;
  width: 340px; max-width: calc(100vw - 28px);
  height: 460px; max-height: calc(100dvh - 180px);
  background: #fffaf0; border: 2px solid var(--gold);
  border-radius: 18px; box-shadow: 0 12px 40px rgba(120, 95, 30, .28);
  display: flex; flex-direction: column; overflow: hidden;
}
.xj-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; background: var(--gold); color: #fff; font-weight: 600;
}
.xj-title { display: flex; align-items: center; gap: 7px; font-size: 15px; }
.xj-avatar { font-size: 20px; }
.xj-close { background: none; border: none; color: #fff; font-size: 18px; cursor: pointer; }
.xj-messages { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.xj-msg {
  max-width: 88%; padding: 9px 12px; border-radius: 12px; font-size: 14px; line-height: 1.55;
  white-space: pre-wrap; word-break: break-word;
}
.xj-msg.user { align-self: flex-end; background: var(--gold); color: #fff; border-bottom-right-radius: 3px; }
.xj-msg.bot { align-self: flex-start; background: #fff; color: var(--ink); border: 1px solid var(--line); border-bottom-left-radius: 3px; }
.xj-input-row { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.xj-input-row textarea {
  flex: 1; resize: none; border: 1px solid var(--line); border-radius: 12px;
  padding: 9px 11px; font-size: 14px; font-family: inherit; color: var(--ink);
  background: #fff; max-height: 90px;
}
.xj-send {
  border: none; background: var(--gold); color: #fff; font-weight: 600;
  padding: 0 16px; border-radius: 12px; cursor: pointer; font-size: 14px;
}
.xj-send:active { transform: scale(.95); }
@media (max-width: 480px) {
  .xj-panel { right: 12px; left: 12px; width: auto; }
  .xj-fab { bottom: 80px; }
}

/* ============================================================
   大版本优化新增样式（2026-09）
   ============================================================ */

/* ---------- 总览：东林寺净土文库直达卡 ---------- */
.dlink-card {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(135deg, #fff9e6, #fdf0d5);
  border: 1.5px solid var(--gold); border-radius: 14px;
  padding: 14px 16px; margin: 14px 0 4px;
  text-decoration: none; color: var(--ink); box-shadow: var(--shadow);
}
.dlink-card:active { transform: scale(.985); }
.dlink-ico { font-size: 26px; flex-shrink: 0; }
.dlink-body { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dlink-body b { font-size: 15px; color: #8B6C00; }
.dlink-body span { font-size: 12.5px; color: var(--ink-soft); }
.dlink-arrow { font-size: 22px; color: var(--gold); font-weight: 700; flex-shrink: 0; }

/* 六道轮回模拟器入口：用紫调区分于东林寺文库卡 */
.dlink-card.dlink-liudao {
  background: linear-gradient(135deg, #f6f2ff, #ece4fb);
  border-color: #9b7fd4;
}
.dlink-card.dlink-liudao .dlink-body b { color: #5b3f96; }
.dlink-card.dlink-liudao .dlink-arrow { color: #7c5fc4; }

/* ---------- 五经一论可点击 ---------- */
.sutra-cell.clickable {
  width: 100%; text-align: left; font-family: inherit; cursor: pointer;
  transition: transform .1s, border-color .15s, background .15s;
}
.sutra-cell.clickable:hover, .sutra-cell.clickable:active {
  border-color: var(--gold); background: var(--gold-soft);
}
.sutra-cell.clickable:active { transform: scale(.97); }

/* ---------- 佛号页：手动记入卡片与明细 ---------- */
.buddha-input-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 14px; box-shadow: var(--shadow); margin-bottom: 12px;
}
.buddha-input-title, .cal-edit-sec-title { font-size: 14px; font-weight: 700; color: #8B6C00; margin-bottom: 10px; }
.buddha-input-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.buddha-input-row .inline { margin: 0; }
.buddha-input-row input[type="text"] { flex: 1; min-width: 140px; }
.buddha-input-row input[type="number"] { width: 86px; }
.buddha-input-card .btn-primary { margin-top: 10px; padding: 11px; font-size: 15px; }
.buddha-tip { font-size: 12px; color: var(--ink-soft); margin: 10px 0 0; line-height: 1.6; }
.inline.grow { flex: 1; }
.inline.grow input { width: 100%; }

.entry-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.entry-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--gold-bg); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 12px;
}
.entry-item .e-name { flex: 1; font-size: 14px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry-item .e-count { font-size: 13.5px; color: #8B6C00; font-weight: 700; white-space: nowrap; }
.entry-item .e-del {
  border: none; background: none; color: var(--red); font-size: 16px;
  cursor: pointer; padding: 2px 6px; border-radius: 8px; flex-shrink: 0;
}
.entry-item .e-del:active { background: #fdecea; }
.entry-empty { text-align: center; font-size: 13px; color: var(--ink-soft); padding: 10px 0; }
.buddha-list-wrap { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; box-shadow: var(--shadow); }

/* ---------- 诵经页：合计与自选经文 ---------- */
.sutra-total { text-align: center; font-size: 15px; margin: 0 0 14px; color: var(--ink); }
.sutra-total strong { font-size: 24px; color: var(--gold); }
.custom-sutra-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 14px; box-shadow: var(--shadow); margin-top: 16px;
}
.custom-sutra-card .btn-primary { margin-top: 10px; padding: 11px; font-size: 15px; }

/* ---------- 闻思页：自定义时长 + 图文说明 ---------- */
.med-custom-row {
  display: flex; gap: 12px; align-items: flex-end; justify-content: center;
  flex-wrap: wrap; margin-top: 12px;
}
.med-custom-row .inline { margin: 0; }
.med-custom-row input[type="number"] { width: 110px; }
.med-custom-row .btn-primary { width: auto; margin: 0; padding: 12px 26px; }
.med-hint { text-align: center; margin-top: 10px; }
.med-dharma { margin-top: 20px; }

/* ---------- 三福善行：净业三福三卡 ---------- */
.sanfu-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.sanfu-card.f1 { border-top: 4px solid #3f7d52; }
.sanfu-card.f2 { border-top: 4px solid #c9a227; }
.sanfu-card.f3 { border-top: 4px solid #b3402f; }
.sanfu-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.sanfu-ico {
  width: 46px; height: 46px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 23px;
}
.sanfu-card.f1 .sanfu-ico { background: #eaf6ee; }
.sanfu-card.f2 .sanfu-ico { background: var(--gold-bg); }
.sanfu-card.f3 .sanfu-ico { background: #fdecea; }
.sanfu-name { font-size: 16.5px; font-weight: 800; color: var(--ink); }
.sanfu-tag { font-size: 12px; color: var(--ink-soft); }
.sanfu-quote {
  font-size: 13.5px; font-weight: 700; color: #8B6C00;
  background: var(--gold-bg); border-left: 3px solid var(--gold);
  border-radius: 0 10px 10px 0; padding: 8px 12px; margin: 0 0 10px;
}
.sanfu-text { font-size: 13px; line-height: 1.85; color: var(--ink-soft); margin: 0 0 12px; }
.sanfu-text b { color: var(--ink); }
.sanfu-chips { display: flex; flex-direction: column; gap: 8px; }
.sanfu-chips .check-item { margin-bottom: 0; }

.good-note-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; margin-top: 4px; box-shadow: var(--shadow);
}

/* ---------- 日历功课弹窗 ---------- */
.day-modal-card {
  background: var(--card); border-radius: var(--radius);
  width: 94%; max-width: 560px; max-height: 88dvh;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,0.25); border: 1px solid var(--line);
  animation: scaleIn .25s ease; position: relative;
}
.day-modal-close {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  border: none; background: var(--gold-bg); color: #8B6C00;
  width: 32px; height: 32px; border-radius: 50%; font-size: 15px; cursor: pointer;
}
.day-modal-head {
  padding: 16px 18px 12px; text-align: center;
  background: linear-gradient(135deg, #fff9e6, #fdf0d5); border-bottom: 1px solid var(--line);
}
.day-modal-head h3 { margin: 0 0 4px; font-size: 17px; color: #8B6C00; }
.day-modal-lunar { margin: 0; font-size: 13px; color: var(--ink-soft); }
.day-modal-lunar .fest { color: var(--red); font-weight: 700; }
.day-modal-lunar .zhai { color: var(--green); font-weight: 700; }
.day-modal-body { overflow-y: auto; padding: 14px 16px 18px; }
.day-modal-body .cal-edit-sec { margin-bottom: 14px; }
.day-modal-body label { display: block; font-size: 13px; color: var(--ink-soft); margin: 8px 0 4px; }
.day-modal-body input, .day-modal-body textarea {
  width: 100%; padding: 10px 11px; border: 1px solid var(--line);
  border-radius: 10px; font-size: 15px; background: #fff; color: var(--ink); font-family: inherit;
}
.btn-add { width: 100%; margin-top: 8px; border-style: dashed; color: #8B6C00; }
.day-modal-body .btn-primary { margin-top: 6px; }

/* 旧三福背景容器弃用 */
.good-stage, .good-bg, .good-overlay { display: none; }

/* ============================================================
   v2.4 提示语（全站仅这几处，克制不啰嗦）
   ============================================================ */

/* 佛号页：专念阿弥陀佛提示（单行、轻量、不弹窗） */
.zhuan-note {
  background: var(--gold-bg);
  border-left: 3px solid var(--gold);
  border-radius: 0 10px 10px 0;
  padding: 8px 13px;
  margin: 0 0 14px;
  font-size: 13px;
  color: #7a5c00;
  line-height: 1.6;
}

/* 闻思页：静坐圣号开关（默认关闭） */
.med-audio-opt {
  display: flex; align-items: center; gap: 9px;
  margin: 12px auto 0; max-width: 460px;
  background: #fff; border: 1px solid var(--line);
  border-radius: 12px; padding: 11px 14px;
  font-size: 13.5px; color: var(--ink); cursor: pointer;
}
.med-audio-opt input[type="checkbox"] {
  width: 20px; height: 20px; accent-color: var(--gold); flex-shrink: 0; margin: 0;
}
.med-audio-opt span { line-height: 1.5; }
.med-custom-row #timer-stop { border: 1px solid var(--line); background: #fff; color: var(--red); }

/* 闻思页：静坐圣号曲目选择（居中，复用首页 chip 样式） */
.med-track-select {
  justify-content: center;
  margin: 10px auto 0;
  max-width: 460px;
}

/* ---------- 诵经页：汉文大藏经 · 查经入口 ---------- */
.cbeta-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px; margin-top: 16px;
}
.cbeta-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.cbeta-ico { font-size: 24px; flex-shrink: 0; }
.cbeta-title { font-size: 15.5px; font-weight: 800; color: var(--ink); }
.cbeta-sub { font-size: 12px; color: var(--ink-soft); margin-top: 2px; line-height: 1.5; }
.cbeta-search { display: flex; gap: 8px; }
.cbeta-search input {
  flex: 1; min-width: 0; padding: 11px 12px; border: 1px solid var(--line);
  border-radius: 10px; font-size: 14px; font-family: inherit; color: var(--ink); background: #fff;
}
.cbeta-search .btn-primary { width: auto; margin: 0; padding: 11px 18px; font-size: 14px; white-space: nowrap; }
.cbeta-links { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
.cbeta-links-label { font-size: 12px; color: var(--ink-soft); }
.cbeta-links a {
  font-size: 12.5px; color: #8B6C00; background: var(--gold-bg);
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; text-decoration: none;
}
.cbeta-links a:active { background: var(--gold-soft); }
.cbeta-note { font-size: 11.5px; color: var(--ink-soft); line-height: 1.75; margin: 10px 0 0; }
.cbeta-note a { color: var(--gold); font-weight: 600; text-decoration: none; }

/* ============================================================
   v2.5 站脚免责声明 + 右上角登录注册高亮
   ============================================================ */

/* 顶部：游客标识 与 高亮的登录 / 注册 */
.topnav .nav-guest {
  font-size: 12px; color: var(--ink-soft); background: #fff;
  border: 1px dashed var(--line); border-radius: 999px;
  padding: 5px 10px; white-space: nowrap;
}
.topnav button.nav-login {
  background: #fff; color: #8B6C00; border: 1.5px solid var(--gold);
  font-weight: 700;
}
.topnav button.nav-login:active { background: var(--gold-soft); }
.topnav button.primary {
  background: var(--gold); color: #fff; border-color: var(--gold);
  font-weight: 700; box-shadow: 0 3px 10px rgba(201, 162, 39, .38);
}

/* 站脚免责声明 */
.site-disclaimer {
  margin-top: 26px;
  background: #fffdf6;
  border: 1px solid var(--line);
  border-top: 3px solid var(--gold);
  border-radius: 12px;
  padding: 16px 18px 14px;
  text-align: center;
}
.sd-date {
  font-size: 12.5px; color: var(--ink-soft); line-height: 1.9;
  padding-bottom: 8px; border-bottom: 1px dashed var(--line); margin-bottom: 10px;
}
.sd-fest { color: #B85C00; font-weight: 700; }
.sd-brand { font-size: 13px; color: #8B6C00; font-weight: 700; margin-bottom: 8px; }
/* 简版声明（一行；详细说明见站内手册第九节） */
.sd-line {
  font-size: 11.5px; line-height: 1.8; color: var(--ink-soft);
  text-align: center; margin: 0;
}
.sd-line a { color: var(--gold); font-weight: 600; text-decoration: none; }
.sd-line a:hover { text-decoration: underline; }
.sd-text p {
  font-size: 12px; line-height: 1.85; color: var(--ink-soft);
  text-align: left; margin: 0 0 8px;
}
.sd-text p:last-child { margin-bottom: 0; }
.sd-text b { color: var(--ink); }
.sd-text a { color: var(--gold); font-weight: 600; text-decoration: none; }
.sd-text a:hover { text-decoration: underline; }
/* 回向文：固定两行居中，避免手机上换行错位 */
.sd-bottom {
  margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line);
  font-size: 12.5px; color: #8B6C00; line-height: 2;
  text-align: center; white-space: nowrap;
}
@media (max-width: 420px) {
  .sd-text p { font-size: 11.5px; }
  .sd-line { font-size: 11px; }
  .sd-bottom { font-size: 11.5px; }
  .site-disclaimer { padding: 14px 12px 12px; }
}
