/* ==========================================================
   版式：纸色底、墨色字、一点朱砂。
   少用方框：只有需要操作的地方（记数面板、设置、管理）用卡片，
   其余用留白和细线分隔。标题与数字用宋体，其余用系统黑体。
   ========================================================== */
:root {
  --bg: #f7f4ee; --bg2: #f0ebe2; --card: #fdfbf7; --ink: #1f1a16; --ink2: #574d44; --muted: #a0958a;
  --line: #e9e2d6; --hair: rgba(31,26,22,.08);
  --accent: #8e3b2c; --accent2: #8e3b2c; --on-accent: #fbf7f0; --accent-soft: rgba(142,59,44,.07);
  --gold: #a8894f; --gold-soft: #efe5d0; --bead: #e4dccd; --danger: #a5432f; --green: #6f9a72;
  --r: 14px;
  --serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", serif;
  --sans: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12100e; --bg2: #1c1915; --card: #1a1714; --ink: #ebe4d8; --ink2: #bfb3a3; --muted: #7f7568;
    --line: #2a2520; --hair: rgba(235,228,216,.08);
    --accent: #cf7a60; --accent2: #cf7a60; --on-accent: #16120e; --accent-soft: rgba(207,122,96,.12);
    --gold: #c3a46a; --gold-soft: #332b20; --bead: #2e2822; --danger: #d7826c; --green: #7cb183;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #12100e; --bg2: #1c1915; --card: #1a1714; --ink: #ebe4d8; --ink2: #bfb3a3; --muted: #7f7568;
  --line: #2a2520; --hair: rgba(235,228,216,.08);
  --accent: #cf7a60; --accent2: #cf7a60; --on-accent: #16120e; --accent-soft: rgba(207,122,96,.12);
  --gold: #c3a46a; --gold-soft: #332b20; --bead: #2e2822; --danger: #d7826c; --green: #7cb183;
  color-scheme: dark;
}

/* ---------- 基础 ---------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); min-height: 100vh;
  font: 15px/1.65 var(--sans); -webkit-font-smoothing: antialiased;
}
body.has-nav { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
a { color: var(--accent); text-decoration: none; }
main { max-width: 520px; margin: 0 auto; padding: 0 20px 32px; }
.muted { color: var(--muted); }
.small, small { font-size: 13px; }
.center { text-align: center; margin: 40px 0; }
.hero-num, .total-num, .stat-total, .streak b, .mini-stats b, .count input, .rank .cnt b, .records b, .stat-split b, .goal-head b {
  font-family: var(--serif); font-variant-numeric: tabular-nums lining-nums; font-weight: 500;
}

/* ---------- 顶栏 ---------- */
.top {
  max-width: 520px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center;
  padding: 18px 20px 6px; padding-top: calc(18px + env(safe-area-inset-top));
}
.top .date { font-family: var(--serif); font-size: 14px; color: var(--ink2); letter-spacing: .08em; }
.online { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); letter-spacing: .04em; }
.online i { width: 5px; height: 5px; border-radius: 50%; background: var(--green); }
.online b { color: var(--ink2); font-weight: 500; }

.flash { background: var(--card); border: 1px solid var(--line); color: var(--ink2);
  padding: 11px 16px; border-radius: var(--r); margin: 8px 0 16px; font-size: 14px; }
.flash.error { border-color: color-mix(in srgb, var(--danger) 45%, transparent); color: var(--danger); }

/* ---------- 表单 ---------- */
input, button, select, textarea { font: inherit; color: inherit; }
input {
  width: 100%; min-width: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--muted); }
input:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 16%, transparent); }
button { padding: 10px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); cursor: pointer; transition: opacity .15s, background .15s, transform .1s; }
button:active { transform: scale(.98); }
button.primary { background: var(--accent); color: var(--on-accent); border: none; font-weight: 500; letter-spacing: .06em; }
button.primary.big { width: 100%; height: 52px; padding: 0; font-size: 17px; font-family: var(--serif); letter-spacing: .3em; padding-left: .3em; border-radius: 12px; margin-top: 8px; }
button.link { background: none; border: none; padding: 4px 6px; color: var(--accent); font-size: 14px; }
button.link.danger { color: var(--danger); }
button:disabled { opacity: .5; }
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; }
input[type=number] { -moz-appearance: textfield; }
textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); resize: vertical; }
.chk { display: inline-flex; align-items: center; gap: 5px; flex: none; white-space: nowrap; color: var(--muted); cursor: pointer; }
.chk input[type=checkbox] { width: auto; padding: 0; margin: 0; accent-color: var(--accent); }

/* ---------- 分类切换：文字 + 短下划线 ---------- */
.tabs { display: flex; gap: 24px; overflow-x: auto; margin: 0 -20px; padding: 12px 20px 4px; scrollbar-width: none; }
.tabs.overflow { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent); }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; position: relative; }
.tab input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; pointer-events: none; }
.tab span { display: block; position: relative; padding: 6px 0 10px; font-size: 16px; color: var(--muted); white-space: nowrap; cursor: pointer; user-select: none; transition: color .2s; }
.tab input:checked + span, a.tab.on span { color: var(--ink); font-weight: 600; }
.tab input:checked + span::after, a.tab.on span::after {
  content: ""; position: absolute; left: 50%; bottom: 2px; width: 14px; height: 2px; margin-left: -7px; background: var(--accent); border-radius: 1px; }
.tab input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }

/* 小分段：累计 / 本月 / 上月；外观 */
.seg { display: inline-flex; gap: 2px; background: var(--bg2); border-radius: 999px; padding: 3px; }
.seg a, .seg button { border: none; background: none; padding: 4px 16px; border-radius: 999px; color: var(--muted); font-size: 13px; letter-spacing: .04em; line-height: 1.6; }
.seg a.on, .seg button.on { background: var(--card); color: var(--ink); font-weight: 500; box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 0 0 1px var(--hair); }
.seg.theme { margin: 0; }
.seg.theme button { padding: 4px 12px; }

/* ---------- 首页：念珠圈 ---------- */
.hero { position: relative; width: min(256px, 66vw); aspect-ratio: 1; margin: 22px auto 26px; }
.mala { width: 100%; height: 100%; display: block; }
.mala .bead { fill: var(--bead); transition: fill .5s; }
.mala .bead.lit { fill: var(--accent); }
.mala .guru { fill: var(--gold); }
.hero-in { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.hero-label { font-size: 12px; color: var(--muted); letter-spacing: .3em; padding-left: .3em; }
.hero-num { font-size: 64px; line-height: 1.15; color: var(--ink); }
.hero-sub { font-size: 13px; color: var(--ink2); letter-spacing: .1em; }

/* 记数面板 */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 20px; }
.panel-title { text-align: center; color: var(--muted); font-size: 12px; letter-spacing: .3em; padding-left: .3em; margin-bottom: 6px; }
.stepper { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bead-btn { width: 48px; height: 48px; border-radius: 50%; padding: 0; flex: none; display: grid; place-items: center;
  background: none; border: 1px solid var(--line); color: var(--ink2); font-size: 22px; font-weight: 300; line-height: 1; }
.bead-btn:active { background: var(--bg2); }
.count { display: flex; flex-direction: column; align-items: center; flex: 1; min-width: 0; }
.count input { width: 100%; max-width: 160px; border: none; background: none; text-align: center; padding: 0; font-size: 52px; line-height: 1.15; color: var(--ink); }
.count input:focus { box-shadow: none; }
.count span { font-size: 12px; color: var(--muted); letter-spacing: .2em; }
.quick { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin: 16px 0 2px; padding-top: 14px; border-top: 1px solid var(--hair); }
.quick button { padding: 6px 0; font-size: 15px; border: none; border-radius: 999px; background: none; color: var(--muted); font-family: var(--serif); font-variant-numeric: tabular-nums; }
.quick button.on { background: var(--ink); color: var(--bg); }
.more { margin: 6px 0 8px; }
.more summary { color: var(--muted); font-size: 13px; cursor: pointer; padding: 6px 0; text-align: center; list-style: none; letter-spacing: .04em; }
.more summary::-webkit-details-marker { display: none; }
.more summary::after { content: ""; display: inline-block; width: 5px; height: 5px; margin: 0 0 3px 8px; border: solid currentColor; border-width: 0 1.2px 1.2px 0; transform: rotate(45deg); transition: transform .2s; }
.more[open] summary::after { transform: rotate(-135deg); margin-bottom: 0; }
.row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin-top: 6px; }
.row2 label { display: block; min-width: 0; }
.row2 label span, .row2-one span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.row2 input, .row2-one input { background: var(--bg); padding: 10px 12px; }
.suixi-note { display: block; margin: 6px 0 4px; padding: 10px 14px; border-radius: 12px; background: var(--accent-soft);
  color: var(--accent); font-size: 14px; text-align: center; }

/* ---------- 区块与列表：细线分隔，不套框 ---------- */
.section { margin-top: 40px; }
.section h2, .page-title { font-family: var(--serif); font-weight: 500; color: var(--ink); }
.section h2 { font-size: 17px; letter-spacing: .08em; margin: 0 0 6px; display: flex; align-items: baseline; gap: 10px; }
.section h2 small { font-family: var(--sans); font-weight: normal; color: var(--muted); font-size: 12px; letter-spacing: 0; }
.page-title { font-size: 26px; letter-spacing: .06em; line-height: 1.35; margin: 14px 0 22px; }
.records, .rank, .invites, .admin-list, .plist { list-style: none; margin: 0; padding: 0; }
.records li { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--hair); min-height: 52px; }
.records .day { color: var(--muted); font-size: 12px; width: 44px; flex: none; font-variant-numeric: tabular-nums; }
.records .m { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink2); }
.records .note { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.records b { font-size: 16px; white-space: nowrap; }
.records form { margin: 0; }
.del { border: none; background: none; padding: 0; width: 28px; height: 28px; display: grid; place-items: center; margin-right: -6px; opacity: .6; }
.del svg { width: 14px; height: 14px; stroke: var(--muted); stroke-width: 1.8; fill: none; stroke-linecap: round; }

/* ---------- 我的 ---------- */
.streak { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; padding: 6px 0 22px; border-bottom: 1px solid var(--hair); }
.streak div + div { border-left: 1px solid var(--hair); }
.streak b { display: block; font-size: 30px; line-height: 1.25; color: var(--ink); }
.streak span { font-size: 12px; color: var(--muted); letter-spacing: .08em; }
.streak-hint { color: var(--gold); margin: 12px 0 0; text-align: center; }
.stat-cards { display: grid; gap: 0; }
.stat-card { padding: 26px 0 26px; border-bottom: 1px solid var(--hair); }
.stat-name { font-family: var(--serif); font-size: 16px; color: var(--ink2); letter-spacing: .06em; }
.stat-total { font-size: 46px; line-height: 1.2; color: var(--ink); margin-top: 6px; }
.stat-total small { font-family: var(--sans); font-size: 14px; margin-left: 6px; color: var(--muted); }
.stat-rounds { color: var(--muted); font-size: 13px; }
.stat-split { display: grid; grid-template-columns: 1fr 1fr; margin-top: 16px; }
.stat-split span { display: block; font-size: 12px; color: var(--muted); letter-spacing: .08em; }
.stat-split b { font-size: 18px; }
.trend-box { margin-top: 18px; }
.trend-head { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 8px; min-height: 18px; letter-spacing: .04em; }
.trend-tip { color: var(--ink2); font-variant-numeric: tabular-nums; }
.trend { display: block; width: 100%; height: 56px; overflow: visible; }
.trend .hit { fill: transparent; cursor: pointer; }
.trend .bar { fill: var(--accent); opacity: .8; }
.trend .zero { fill: var(--line); }
.trend g.on .bar { opacity: 1; }
.trend g.on .zero { fill: var(--muted); }
.goal { margin-top: 18px; }
.goal-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--ink2); }
.goal-head b { color: var(--accent); font-size: 15px; }
.goal-bar { height: 3px; border-radius: 2px; background: var(--line); margin: 8px 0; overflow: hidden; }
.goal-bar i { display: block; height: 100%; background: var(--accent); border-radius: 2px; transition: width .6s; }
.goal-note { color: var(--muted); }
.goal-set { margin-top: 12px; }
.goal-set summary { font-size: 13px; color: var(--accent); cursor: pointer; list-style: none; }
.goal-set summary::-webkit-details-marker { display: none; }
.goal-set form { margin-top: 8px; }

.settings { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin-top: 10px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--hair); margin: 0; }
.settings > :first-child { border-top: none; }
details.setting-row { display: block; }
details.setting-row summary { text-align: left; color: var(--ink); font-size: 15px; padding: 0; }
.switch { width: 46px; height: 28px; border-radius: 999px; padding: 3px; border: none; background: var(--line); flex: none; position: relative; }
.switch span { display: block; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .2s; }
.switch.on { background: var(--accent); }
.switch.on span { transform: translateX(18px); }
.stack { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }

/* ---------- 排行榜 ---------- */
.total { text-align: center; padding: 22px 0 28px; }
.total .seg { margin-bottom: 28px; }
.total-label { font-size: 12px; color: var(--muted); letter-spacing: .3em; padding-left: .3em; }
.total-num { font-size: 54px; line-height: 1.2; color: var(--ink); margin: 2px 0; }
.total-num small { font-family: var(--sans); font-size: 14px; color: var(--muted); margin-left: 6px; }
.total-sub { font-size: 13px; color: var(--muted); }
.ggoal { text-align: left; margin: 24px auto 0; max-width: 360px; }
.rank { border-top: 1px solid var(--hair); }
.rank li { display: flex; align-items: center; gap: 12px; padding: 14px 6px; border-bottom: 1px solid var(--hair); }
.rank .no { width: 22px; flex: none; text-align: center; font-family: var(--serif); font-size: 16px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rank .r1 .no, .rank .r2 .no, .rank .r3 .no { color: var(--accent); }
.rank .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; }
.rank .name em { font-style: normal; font-size: 11px; color: var(--accent); margin-left: 8px; letter-spacing: .1em; }
.rank .cnt { text-align: right; line-height: 1.25; }
.rank .cnt b { display: block; font-size: 18px; }
.rank .cnt small { color: var(--muted); font-size: 11px; }
.rank li.me { background: var(--accent-soft); border-radius: 10px; border-bottom-color: transparent; }
.sx { flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 56px; padding: 5px 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); border-radius: 999px; background: none; color: var(--accent); font-size: 12px; letter-spacing: .06em; cursor: pointer; }
.sx b { font-weight: 500; font-variant-numeric: tabular-nums; }
.sx b:empty { display: none; }
.sx.done { border-color: transparent; color: var(--muted); cursor: default; }
.sx.mine { border: none; color: var(--muted); cursor: default; }
.rank-me { margin-top: 16px; padding: 12px 16px; border-radius: 12px; background: var(--accent-soft); color: var(--ink2); font-size: 14px; text-align: center; }

/* ---------- 修法列表 ---------- */
.plist { border-top: 1px solid var(--hair); }
.plist li { border-bottom: 1px solid var(--hair); }
.plist a { display: block; position: relative; padding: 22px 32px 22px 0; color: var(--ink); }
.plist a:active { opacity: .6; }
.p-name { display: block; font-family: var(--serif); font-size: 19px; font-weight: 500; letter-spacing: .06em; line-height: 1.4; }
.p-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; font-size: 12px; color: var(--muted); }
.p-meta:empty { display: none; }
.p-audio { display: inline-flex; align-items: center; gap: 4px; }
.p-audio svg, .chev, .back svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.p-audio svg { width: 13px; height: 13px; }
.chev { position: absolute; right: 0; top: 50%; margin-top: -8px; color: var(--muted); }
.back { display: inline-flex; align-items: center; gap: 2px; color: var(--muted); font-size: 13px; margin-top: 8px; margin-left: -4px; }
.back + .page-title { margin-top: 6px; }

/* ---------- 播放器：上标题、中字幕、下进度和控制 ---------- */
.audios { display: grid; grid-template-columns: minmax(0, 1fr); margin-bottom: 30px; }
.audio { padding: 0 0 8px; }
.audio + .audio { border-top: 1px solid var(--hair); padding-top: 22px; margin-top: 14px; }
.audio-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.audio-title { font-size: 13px; color: var(--muted); letter-spacing: .04em; line-height: 1.5; overflow-wrap: anywhere; }
.seek { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 20px; margin: 16px 0 0; padding: 0; border: none; background: transparent; cursor: pointer; }
.seek:focus { box-shadow: none; outline: none; }
.seek::-webkit-slider-runnable-track { height: 3px; border-radius: 2px; background: linear-gradient(90deg, var(--ink) var(--p, 0%), var(--line) var(--p, 0%)); }
.seek::-moz-range-track { height: 3px; background: var(--line); border-radius: 2px; }
.seek::-moz-range-progress { height: 3px; background: var(--ink); border-radius: 2px; }
.seek::-webkit-slider-thumb { -webkit-appearance: none; width: 11px; height: 11px; margin-top: -4px; border-radius: 50%; background: var(--ink); border: none; }
.seek::-moz-range-thumb { width: 11px; height: 11px; border-radius: 50%; background: var(--ink); border: none; }
.audio-time { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.audio-ctl { display: grid; grid-template-columns: 1fr auto auto auto 1fr; align-items: center; gap: 22px; margin-top: 6px; }
.audio-ctl > :first-child { justify-self: start; }
.audio-ctl > :last-child { justify-self: end; }
.ic { width: 44px; height: 44px; padding: 0; border: none; background: none; color: var(--ink2); display: grid; place-items: center; border-radius: 50%; }
.ic svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.ic text { fill: currentColor; stroke: none; font: 600 7px var(--sans); }
.play { width: 62px; height: 62px; border-radius: 50%; padding: 0; border: none; flex: none; display: grid; place-items: center; background: var(--ink); }
.play svg { width: 22px; height: 22px; fill: var(--bg); }
.play .i-play { margin-left: 3px; }
.play .i-pause, .audio.playing .play .i-play { display: none; }
.audio.playing .play .i-pause { display: block; }
.audio.buffering .play { animation: nzbuf 1.2s ease-in-out infinite; }
@keyframes nzbuf { 50% { opacity: .45; } }
.speed, .ly-toggle { min-width: 46px; padding: 3px 9px; font-size: 12px; border-radius: 999px; background: none; border: 1px solid var(--line); color: var(--ink2); }
.speed { font-variant-numeric: tabular-nums; }
.ly-toggle { color: var(--muted); letter-spacing: .1em; }
.ly-toggle[aria-pressed="true"] { color: var(--ink); border-color: color-mix(in srgb, var(--ink) 40%, transparent); }
.ctl-spacer { min-width: 46px; }

/* 字幕（歌词式） */
.lyrics { position: relative; height: min(44vh, 400px); min-height: 220px; overflow-y: auto; margin: 6px -20px 0; padding: 0 24px;
  scrollbar-width: none; -webkit-mask-image: linear-gradient(transparent 0, #000 18%, #000 66%, transparent 100%);
  mask-image: linear-gradient(transparent 0, #000 18%, #000 66%, transparent 100%); }
.lyrics::-webkit-scrollbar { display: none; }
.ly-in { padding: calc(min(44vh, 400px) / 3) 0 calc(min(44vh, 400px) * 2 / 3); }
.ly { margin: 0; padding: 8px 4px; text-align: center; font-family: var(--serif); font-size: 17px; line-height: 1.65; letter-spacing: .05em;
  color: var(--ink); opacity: .24; cursor: pointer; transform-origin: center;
  transition: opacity .5s ease, transform .5s ease; }
.ly.on { opacity: 1; transform: scale(1.1); }
.ly:hover { opacity: .5; }
.ly.on:hover { opacity: 1; }

/* 修法页：记一笔 + 小统计 */
.prec { margin-top: 4px; }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 24px; text-align: center; }
.mini-stats > div + div { border-left: 1px solid var(--hair); }
.mini-stats span { display: block; font-size: 12px; color: var(--muted); letter-spacing: .06em; }
.mini-stats b { display: block; font-size: 24px; color: var(--ink); line-height: 1.35; }
.mini-stats small { font-size: 11px; color: var(--muted); }

/* 一起听 */
.live { display: inline-flex; align-items: center; gap: 5px; color: var(--green); font-size: 12px; white-space: nowrap; }
.live[hidden] { display: none; }
.live i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); animation: livepulse 2s infinite; }
@keyframes livepulse { 0%,100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--green) 50%, transparent); } 50% { box-shadow: 0 0 0 5px transparent; } }

/* ---------- 底栏 ---------- */
nav.bottom {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; justify-content: center;
  background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--hair); padding-bottom: env(safe-area-inset-bottom);
}
nav.bottom a { flex: 1; max-width: 120px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 0 7px; color: var(--muted); font-size: 10px; letter-spacing: .12em; }
nav.bottom svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
nav.bottom svg .f { fill: currentColor; }
nav.bottom a.on { color: var(--ink); }
nav.bottom a.on svg { stroke-width: 1.7; }

/* ---------- 登录注册 ---------- */
.auth { max-width: 340px; margin: 0 auto; padding-top: calc(56px + env(safe-area-inset-top)); }
.auth-head { text-align: center; margin-bottom: 28px; }
.auth-head .mala { width: 88px; height: 88px; margin: 0 auto; }
.auth-head .mala .bead { fill: var(--accent); opacity: .75; }
.auth-head h1 { font-family: var(--serif); font-size: 24px; font-weight: 500; margin: 18px 0 0; letter-spacing: .2em; padding-left: .2em; }
.auth input { height: 50px; }
.auth .primary { height: 50px; padding: 0; font-size: 16px; margin-top: 6px; border-radius: 10px; letter-spacing: .2em; }
.auth p { text-align: center; line-height: 1.9; font-size: 13px; color: var(--muted); margin: 0 0 4px; }
.auth p:last-child { margin-top: 18px; }

/* ---------- 管理 ---------- */
.section > form.row, .section > .row { margin-top: 12px; }
.row { display: flex; gap: 8px; align-items: center; margin: 0; flex: 1; min-width: 0; }
.row button { flex: none; white-space: nowrap; }
.row .sort { width: 60px; flex: none; text-align: center; padding-left: 6px; padding-right: 6px; }
.admin-list { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin-top: 8px; }
.admin-list li { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--hair); }
.admin-list li:first-child { border-top: none; }
.admin-list li form { margin: 0; }
.admin-list .row input { background: var(--bg); padding: 9px 10px; }
.admin-list .row button { padding: 9px 12px; flex: none; }
.admin-list .name { flex: 1; }
.admin-list li.inactive .row input { opacity: .5; }
.admin-list form.row, .pa > form.row { flex-wrap: wrap; row-gap: 8px; }
.admin-list form.row input[name=name], .pa > form.row input[name=name] { flex: 1 1 150px; }
.admin-list form.row .goal-in, .pa > form.row .goal-in { flex: 1 1 90px; width: auto !important; }
.section p.small { margin: 10px 0; }
.invites { margin-top: 8px; }
.invites li { display: flex; align-items: center; gap: 8px; padding: 10px 0; flex-wrap: wrap; border-bottom: 1px solid var(--hair); }
.invites li form { margin: 0; }
.invites code { font-size: 15px; letter-spacing: .12em; background: var(--card); border: 1px solid var(--line); padding: 3px 10px; border-radius: 8px; font-family: ui-monospace, Menlo, monospace; }
.section details.more summary { text-align: left; }
.pa { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; margin-bottom: 10px; }
.pa.inactive { opacity: .6; }
.pa .row input { background: var(--bg); padding: 9px 10px; }
.unit { width: 64px !important; flex: none; text-align: center; }
.goal-in { width: 92px !important; flex: none; }
.pa .goal-in { width: 64px !important; }
.alist { list-style: none; margin: 8px 0 0; padding: 0 0 0 12px; border-left: 2px solid var(--gold-soft); }
.alist li { display: flex; align-items: center; gap: 6px; padding: 4px 0; flex-wrap: wrap; }
.alist li form { margin: 0; }
.alist .row { flex: 1 1 220px; }
.alist .row input { font-size: 14px; padding: 7px 8px; }
.alist .row button { padding: 7px 10px; font-size: 14px; }
.upload { margin: 10px 0 0; }
.filebtn input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.filebtn span { display: block; text-align: center; padding: 10px; border: 1px dashed var(--gold); border-radius: 10px; color: var(--accent); cursor: pointer; font-size: 14px; }
.filebtn input:focus-visible + span { outline: 2px solid var(--gold); }
.progress { position: relative; height: 34px; background: var(--bg); border-radius: 10px; overflow: hidden; }
.progress .bar { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--gold-soft); transition: width .2s; }
.progress .ptext { position: relative; display: block; line-height: 34px; padding: 0 12px; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pa-foot { margin: 6px 0 0; text-align: right; }

/* 校对字幕 */
.sub-player { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 8px 0; }
.sub-player audio { width: 100%; }
.sub-bar { display: flex; gap: 16px; margin-top: 4px; }
.sub-list { list-style: none; margin: 8px 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.sub-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 8px 10px; border-top: 1px solid var(--hair); transition: background .3s; }
.sub-row:first-child { border-top: none; }
.sub-row .t { flex: none; width: 58px; font-variant-numeric: tabular-nums; font-size: 13px; color: var(--accent); text-align: left; }
.sub-row .tx { flex: 1 1 200px; padding: 7px 9px; font-size: 15px; background: var(--bg); }
.sub-row .ops { display: flex; gap: 10px; align-items: center; flex: none; margin-left: auto; font-size: 13px; }
.sub-row.on { background: var(--accent-soft); }
.sub-row.doubt .tx { border-color: var(--accent); }
.sub-row.flash { background: color-mix(in srgb, var(--accent) 18%, var(--card)); }
.only-doubt .sub-row:not(.doubt) { display: none; }
.sub-save { position: sticky; bottom: calc(64px + env(safe-area-inset-bottom)); display: flex; justify-content: flex-end; align-items: center; gap: 12px;
  background: var(--bg); padding: 10px 0; border-top: 1px solid var(--line); }

/* ==========================================================
   极简（第三版）：一屏一个焦点；近乎单色，朱砂只留给念珠和进度；
   去掉图标、线框和多余说明，用字号和留白分层。
   ========================================================== */
body.has-nav { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
main { padding-top: 8px; }

/* 顶栏只在首页：一行小字居中 */
.top { justify-content: center; gap: 14px; padding-top: calc(22px + env(safe-area-inset-top)); }
.top .date { font-family: var(--sans); font-size: 12px; color: var(--muted); letter-spacing: .12em; }
.online { font-size: 12px; }
.online b { color: var(--muted); font-weight: 400; }

/* 底栏：只有文字 */
nav.bottom { background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; border-top: 1px solid var(--hair); }
nav.bottom a { padding: 17px 0 15px; font-size: 13px; letter-spacing: .3em; padding-left: .3em; color: var(--muted); gap: 0; }
nav.bottom a.on { color: var(--ink); font-weight: 500; }

/* 标题：页面标题宋体；区块标题改成小号灰字 */
.page-title { font-size: 24px; margin: 28px 0 28px; }
.back { margin-top: 20px; }
.back + .page-title { margin-top: 10px; }
.section { margin-top: 48px; }
.section h2 { font-family: var(--sans); font-size: 12px; font-weight: 400; color: var(--muted); letter-spacing: .2em; margin-bottom: 4px; }
.section h2 small { display: none; }

/* 按钮：墨色，不用红 */
button.primary { background: var(--ink); color: var(--bg); }
button.primary.big { height: 54px; border-radius: 999px; font-size: 16px; letter-spacing: .4em; padding-left: .4em; margin-top: 18px; }

/* 首页：念珠圈是唯一焦点，下面不套卡片 */
.tabs { justify-content: center; }
.tabs.overflow { justify-content: flex-start; }
.hero { width: min(272px, 70vw); margin: 30px auto 34px; }
.hero-label { display: none; }
.hero-num { font-size: 72px; font-weight: 400; }
.hero-sub { color: var(--muted); }
.panel { background: none; border: none; border-radius: 0; padding: 0; }
.panel-title { margin-bottom: 0; }
.bead-btn { border: none; color: var(--muted); font-size: 30px; width: 56px; height: 56px; }
.count input { font-size: 44px; font-weight: 400; }
.quick { border-top: none; padding-top: 0; margin-top: 14px; }
.quick button { position: relative; height: 36px; font-size: 15px; color: var(--muted); }
.quick button.on { background: none; color: var(--ink); }
.quick button.on::after { content: ""; position: absolute; left: 50%; bottom: 2px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--accent); }
.more summary { font-size: 12px; }
.suixi-note { background: none; color: var(--muted); font-size: 12px; padding: 4px 0; margin: 0; letter-spacing: .06em; }

/* 列表数字不用衬线大号，安静一些 */
.records b { font-family: var(--sans); font-size: 14px; font-weight: 400; color: var(--ink2); }
.records .m { color: var(--ink); }

/* 我的：统计不加竖线 */
.streak, .mini-stats > div + div, .streak div + div { border: none; }
.streak { padding-bottom: 8px; }
.streak b { font-weight: 400; }
.stat-card { padding: 32px 0; }
.stat-total { font-weight: 400; }
.stat-split b { font-family: var(--sans); font-size: 15px; font-weight: 400; }
.settings { background: none; border: none; border-radius: 0; margin-top: 0; border-top: 1px solid var(--hair); }
.setting-row { padding: 16px 0; border-top: none; border-bottom: 1px solid var(--hair); }
.setting-row.go { color: var(--ink); }
.setting-row.go span { color: var(--muted); }
.setting-row .link { padding: 0; color: var(--muted); }

/* 共修 */
.total { padding-top: 12px; }
.total-num { font-size: 60px; font-weight: 400; }
.rank { border-top: none; }
.rank li { padding: 16px 0; }
.rank li.me { background: none; border-radius: 0; border-bottom-color: var(--hair); }
.rank li.me .name { font-weight: 600; }
.rank .name em { display: none; }
.rank .r1 .no, .rank .r2 .no, .rank .r3 .no { color: var(--ink); }
.rank .cnt b { font-weight: 400; }
/* 随喜一栏定宽，各行数字右缘才能对齐 */
.sx { border: none; padding: 5px 0; width: 76px; min-width: 0; box-sizing: border-box; justify-content: flex-end; white-space: nowrap; color: var(--accent); }
.rank-me { background: none; color: var(--muted); font-size: 13px; }
.goal-bar i { background: var(--ink); }
.goal-head b { color: var(--ink); }

/* 修法列表 */
.plist { border-top: none; }
.plist a { padding: 24px 28px 24px 0; }
.p-audio svg { display: none; }

/* 播放器：只留进度条、时间、播放键 */
.speed, .ly-toggle { border: none; color: var(--muted); padding: 3px 0; min-width: 40px; }
.ly-toggle[aria-pressed="true"] { color: var(--ink); border: none; }
.audio-title { font-size: 12px; letter-spacing: .1em; }
.prec { margin-top: 12px; padding-top: 28px; border-top: 1px solid var(--hair); }
.mini-stats b { font-weight: 400; font-size: 22px; }
.mini-stats { margin-top: 36px; }
main { padding-top: calc(8px + env(safe-area-inset-top)); }
.top + main { padding-top: 0; }
.switch.on { background: var(--ink); }
.switch.on span { background: var(--bg); }
.goal-set summary { color: var(--ink2); }
.trend .bar { fill: var(--ink2); opacity: .55; }
.trend g.on .bar { fill: var(--ink); opacity: 1; }

/* ---------- 发愿（原「好事」） ---------- */
nav.bottom a { letter-spacing: .2em; padding-left: .2em; }
.deed-form { margin-top: 28px; }
.deed-ask { font-family: var(--serif); font-weight: 400; font-size: 24px; letter-spacing: .08em; text-align: center; margin: 24px 0 26px; }
.deed-form textarea { background: none; border: none; border-bottom: 1px solid var(--hair); border-radius: 0; padding: 4px 2px 12px;
  font-family: var(--serif); font-size: 17px; line-height: 1.9; resize: none; min-height: 150px; }
.deed-form textarea:focus { box-shadow: none; border-bottom-color: var(--ink2); }
.deed-private { margin-top: 14px; font-size: 13px; }
.deed-hint { text-align: center; color: var(--muted); font-size: 12px; letter-spacing: .06em; margin: 14px 0 0; }
.deed-note { text-align: center; color: var(--muted); font-size: 13px; line-height: 1.9; margin: 28px 0 0; }
.gift { text-align: center; padding: 48px 0 8px; }
.gift-label { color: var(--muted); font-size: 12px; letter-spacing: .3em; padding-left: .3em; }
.gift .deed-body { font-size: 19px; line-height: 2; margin: 28px 0 24px; text-align: left; }
.gift-foot { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 12px; }
.gift-next { display: inline-block; margin-top: 40px; color: var(--ink2); font-size: 13px; letter-spacing: .2em; padding-left: .2em; }
.deeds { list-style: none; margin: 0; padding: 0; }
.deeds li { padding: 18px 0 12px; border-bottom: 1px solid var(--hair); }
.deed-body { font-family: var(--serif); font-size: 16px; line-height: 1.9; color: var(--ink); margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.deed-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 8px; color: var(--muted); font-size: 12px; min-height: 28px; }
.deed-meta form, .gift-foot form { margin: 0; }
.deed-sx { border: none; background: none; padding: 4px 0; color: var(--accent); font-size: 13px; letter-spacing: .1em; }
.deed-sx.on, .deed-sx:disabled { color: var(--muted); opacity: 1; }
.deed-act { display: flex; align-items: center; gap: 14px; }
.deed-act form { margin: 0; }
.deed-act .link { color: var(--muted); padding: 0; font-size: 13px; }
.deed-ok { border: none; background: var(--ink); color: var(--bg); border-radius: 999px; padding: 5px 16px; font-size: 13px; }
.deed-admin { display: block; text-align: center; color: var(--muted); font-size: 12px; margin-top: 32px; letter-spacing: .06em; }
.deed-admin-row { margin-bottom: 8px; }
.deeds .link { color: var(--muted); padding: 0; font-size: 13px; }
.vow-lead { text-align: center; color: var(--ink2); font-size: 13px; line-height: 1.9; letter-spacing: .04em; margin: -10px 0 22px; }
.vow-streak { float: right; font-weight: 400; color: var(--muted); font-size: 12px; letter-spacing: .06em; }

/* ---------- 180天修法 ---------- */
.course-line { display: flex; justify-content: space-between; gap: 12px; margin: 6px 0 2px; padding: 10px 0; border-bottom: 1px solid var(--hair);
  color: var(--ink2); font-size: 13px; letter-spacing: .04em; }
.course-line span:last-child { color: var(--muted); }
.c-lead { color: var(--ink2); line-height: 1.9; margin: 0 0 10px; }
.c-start { margin-top: 28px; }
.c-start label span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.c-start input { width: 100%; }
.c-pos { margin-top: 18px; color: var(--muted); font-size: 12px; letter-spacing: .2em; }
.c-title { margin: 6px 0 10px; }
.c-weeknav { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; font-size: 12px; color: var(--muted);
  padding-bottom: 12px; border-bottom: 1px solid var(--hair); }
.c-weeknav a { color: var(--ink2); }
.c-weeknav a:last-child { text-align: right; }
.c-weeknav > span:nth-child(2) { text-align: center; white-space: nowrap; }
.center-s { text-align: center; margin: 14px 0; }
.c-items { list-style: none; margin: 0; padding: 0; }
.c-items > li { border-bottom: 1px solid var(--hair); scroll-margin-top: 20px; }
.c-items summary { list-style: none; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; column-gap: 12px;
  padding: 15px 0 13px; cursor: pointer; }
.c-items summary::-webkit-details-marker { display: none; }
.c-name { color: var(--ink); font-size: 15px; }
.c-name small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.c-num { font-family: var(--serif); font-size: 17px; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.c-num small { font-family: var(--sans); font-size: 12px; color: var(--muted); }
.c-num.done { color: var(--accent); }
.c-bar { grid-column: 1 / -1; display: block; height: 2px; background: var(--line); border-radius: 1px; margin-top: 10px; overflow: hidden; }
.c-bar b { display: block; height: 100%; background: var(--accent); }
.c-add { display: flex; align-items: center; gap: 8px; padding: 2px 0 14px; }
.c-add input[type=number] { width: 96px; flex: none; text-align: right; background: var(--bg); padding: 9px 10px; }
.c-unit { color: var(--muted); font-size: 13px; flex: none; }
.c-add select { flex: 1; min-width: 0; padding: 9px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); font-size: 13px; color: var(--ink2); }
.c-add button { flex: none; padding: 9px 16px; }
.c-recs { margin: -6px 0 8px; }
.c-recs li { min-height: 40px; padding: 6px 0; border-bottom: none; }
.c-recs b { flex: 1; font-size: 14px; color: var(--ink2); }
.c-read { list-style: none; margin: 0; padding: 0; }
.c-read form { margin: 0; }
.c-chk { display: flex; gap: 12px; align-items: flex-start; width: 100%; text-align: left; border: none; border-bottom: 1px solid var(--hair);
  border-radius: 0; background: none; padding: 13px 0; color: var(--ink2); line-height: 1.6; }
.c-chk:active { transform: none; opacity: .6; }
.c-chk i { flex: none; width: 16px; height: 16px; margin-top: 3px; border: 1.2px solid var(--muted); border-radius: 4px; position: relative; }
.c-chk.on { color: var(--muted); }
.c-chk.on i { background: var(--accent); border-color: var(--accent); }
.c-chk.on i::after { content: ""; position: absolute; left: 4.5px; top: 1px; width: 4px; height: 8px; border: solid var(--on-accent); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.c-go { display: flex; justify-content: space-between; margin-top: 28px; padding: 14px 0; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); color: var(--ink); }
.c-go span { color: var(--muted); font-size: 13px; }
.c-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 12px; }
.c-grid a { aspect-ratio: 1; display: grid; place-items: center; border-radius: 8px; background: var(--bg2); color: var(--muted);
  font-size: 12px; font-variant-numeric: tabular-nums; }
.c-grid a.part { background: var(--accent-soft); color: var(--ink2); }
.c-grid a.ok { background: var(--accent); color: var(--on-accent); }
.c-grid a.cur { box-shadow: inset 0 0 0 1.5px var(--gold); }
.c-grid a.view { font-weight: 700; color: var(--ink); }
.c-grid a.ok.view { color: var(--on-accent); }
.c-grid + .c-go { margin-top: 18px; }
.c-setting { margin-top: 28px; }
.c-setting form { margin-top: 8px; }
.c-setting input { flex: 1; min-width: 0; }
.c-back { display: inline-block; margin-top: 16px; color: var(--muted); font-size: 13px; }
.c-sub { font-family: var(--serif); font-weight: 500; font-size: 15px; color: var(--muted); letter-spacing: .2em; margin: 0 0 4px; }
.c-q { display: block; margin: 0 0 22px; }
.c-q span { display: flex; gap: 8px; color: var(--ink); line-height: 1.7; margin-bottom: 8px; }
.c-q span b { flex: none; font-family: var(--serif); color: var(--accent); font-weight: 500; }
.c-q textarea { background: var(--card); font-size: 15px; line-height: 1.8; min-height: 72px; resize: none; overflow: hidden; }
.c-quit { margin: 18px 0 0; text-align: center; }
.c-quit .link { font-size: 13px; }
.c-hint { margin: -8px 0 12px; color: var(--muted); font-size: 12px; }
