/* ============================================================================
   HCS · 穆斯林生活助手 V2 —— 设计系统
   ---------------------------------------------------------------------------
   方向：暖白书页 ＋ 深青绿 ＋ 少量古金。
   规则来源：V2 执行命令 §三（唯一视觉方向）／R5 触摸目标／R6 WCAG。
   结构：1 令牌 → 2 基础 → 3 布局 → 4 组件 → 5 页面 → 6 响应式 → 7 无障碍
   ========================================================================== */

/* ======================== 1. 令牌 ======================== */
:root {
  /* 浅色（默认） */
  --bg: #F6F5F0;
  --surface: #FFFFFF;
  --surface-2: #F1F0E9;
  --ink: #202B28;
  --ink-2: #4E5C55;          /* 原 #596760 在白底 4.9→5.6，正文辅助更稳 */
  --ink-3: #6B7A72;
  --accent: #176B5B;
  --accent-ink: #FFFFFF;
  --accent-weak: #E6F0EC;
  --line: #DDE4DE;
  --gold: #8A6A34;           /* 仅装饰与徽章文字，白底 5.1:1 */
  --ok: #1F7A54;
  --warn: #8A5A00;
  --danger: #A33A2B;
  --shadow: 0 4px 18px rgba(20, 40, 30, .06);

  /* 阅读（纸色） */
  --paper: #F4ECD9;
  --paper-ink: #2E3028;

  /* 尺寸 */
  --r-card: 16px;
  --r-ctl: 12px;
  --r-pill: 999px;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px;
  --pad-x: 16px;
  --nav-h: 64px;
  --appbar-h: 52px;

  /* 字号 */
  --fs-title: 28px;
  --fs-h2: 20px;
  --fs-body: 16px;
  --fs-sm: 14px;
  --fs-xs: 12.5px;
  --fs-nav: 12.5px;
  --read-zh: 18px;
  --read-lh: 1.8;
  --read-ar: 32px;
  --read-ar-lh: 1.9;

  --font-zh: -apple-system, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-ar: "Amiri", "Scheherazade New", "Noto Naskh Arabic", "Traditional Arabic", serif;
  --ease: cubic-bezier(.2, .7, .3, 1);
}

html[data-theme="dark"] {
  --bg: #101815;
  --surface: #19241F;
  --surface-2: #1E2B25;
  --ink: #F1F5F2;
  --ink-2: #B2C0B8;
  --ink-3: #93A29A;
  --accent: #7BCDB4;
  --accent-ink: #0C1512;
  --accent-weak: #1E3A31;
  --line: #33483E;
  --gold: #D1B274;
  --ok: #7BD3A8;
  --warn: #E0B464;
  --danger: #E58A79;
  --shadow: 0 1px 0 rgba(255, 255, 255, .04);
}

/* 纸色阅读（仅阅读页） */
html[data-read="paper"] {
  --bg: #F4ECD9;
  --surface: #FBF6E9;
  --surface-2: #F0E7D3;
  --ink: #2E3028;
  --ink-2: #555A4D;
  --line: #E0D5BC;
}

/* ======================== 2. 基础 ======================== */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font: var(--fs-body)/1.6 var(--font-zh);
  font-feature-settings: "tnum" 0;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
body.no-scroll { overflow: hidden; }
a { color: var(--accent); text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
.num, time, .tnum { font-variant-numeric: tabular-nums; }
[dir="rtl"], .ar {
  font-family: var(--font-ar);
  direction: rtl;
  unicode-bidi: isolate;
  letter-spacing: 0;
  line-height: var(--read-ar-lh);
  font-size: var(--read-ar);
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ======================== 3. 布局 ======================== */
#app { min-height: 100vh; display: flex; flex-direction: column; }
.appbar {
  position: sticky; top: 0; z-index: 30;
  height: calc(var(--appbar-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) var(--pad-x) 0;
  display: flex; align-items: center; gap: 8px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.2) blur(14px);
  -webkit-backdrop-filter: saturate(1.2) blur(14px);
  border-bottom: 1px solid transparent;
}
.appbar.is-stuck { border-bottom-color: var(--line); }
.appbar h1 { font-size: 17px; font-weight: 650; letter-spacing: .01em; flex: 1 1 auto; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appbar .ab-sub { font-size: var(--fs-xs); color: var(--ink-2); font-weight: 400; margin-inline-start: 6px; }
.appbar-actions { display: flex; gap: 4px; flex: none; }
#view {
  flex: 1 1 auto; width: 100%; max-width: 760px; margin: 0 auto;
  padding: 4px var(--pad-x) calc(var(--nav-h) + env(safe-area-inset-bottom) + 24px);
}
body[data-route="read"] #view { max-width: 780px; }

/* 底部导航 */
.tabbar {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 40;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.3) blur(18px);
  -webkit-backdrop-filter: saturate(1.3) blur(18px);
  border-top: 1px solid var(--line);
}
.tab {
  appearance: none; border: 0; background: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--ink-3); font-size: var(--fs-nav); padding: 0; min-height: 48px;
}
.tab svg { width: 24px; height: 24px; }
/* 200% 缩放与 320px 重排：网格子项允许收缩，不撑破容器 */
.prays > *, .quick > *, .grid-tools > *, .form-grid > *, .form-2 > *, .row > *, .row-between > * { min-width: 0; }
.tab[aria-current="page"] { color: var(--accent); font-weight: 600; }
.tab[aria-current="page"] .tab-dot { opacity: 1; }
.tab-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--accent); opacity: 0; }

/* 桌面侧栏 */
.sidebar { display: none; }

/* ======================== 4. 组件 ======================== */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-card); box-shadow: var(--shadow);
}
.card--flat { box-shadow: none; }
.pad { padding: var(--sp-4); }
.stack > * + * { margin-top: var(--sp-3); }
.stack-4 > * + * { margin-top: var(--sp-4); }
.stack-5 > * + * { margin-top: var(--sp-5); }
.row { display: flex; align-items: center; gap: var(--sp-3); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.grow { flex: 1 1 auto; min-width: 0; }
.muted { color: var(--ink-2); }
.dim { color: var(--ink-3); }
.small { font-size: var(--fs-sm); }
.xs { font-size: var(--fs-xs); }
.sec-title { font-size: var(--fs-h2); font-weight: 650; margin: var(--sp-5) 0 var(--sp-3); letter-spacing: .01em; }
.sec-title:first-child { margin-top: var(--sp-2); }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; margin: var(--sp-5) 0 var(--sp-3); }
.sec-head h2 { font-size: var(--fs-h2); font-weight: 650; }
.link { color: var(--accent); font-size: var(--fs-sm); background: none; border: 0; padding: 12px 8px; margin: -12px -8px; cursor: pointer; min-height: 48px; display: inline-flex; align-items: center; }

.btn {
  appearance: none; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); border-radius: var(--r-ctl); min-height: 48px; padding: 0 18px;
  font-size: var(--fs-body); font-weight: 560; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background 120ms var(--ease), transform 120ms var(--ease);
}
.btn:active { transform: scale(.98); }
.btn--primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn--quiet { background: transparent; border-color: transparent; color: var(--accent); }
.btn--sm { min-height: 48px; padding: 0 12px; font-size: var(--fs-sm); }
.btn--block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.iconbtn {
  appearance: none; border: 0; background: none; cursor: pointer;
  width: 48px; height: 48px; min-width: 48px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center; color: var(--ink-2);
}
.iconbtn:active { background: var(--surface-2); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  appearance: none; border: 1px solid var(--line); background: var(--surface);
  border-radius: var(--r-pill); padding: 0 14px; min-height: 48px; white-space: nowrap;
  font-size: var(--fs-sm); color: var(--ink-2); cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--accent-weak); border-color: color-mix(in srgb, var(--accent) 40%, transparent); color: var(--accent); font-weight: 600; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  border-radius: var(--r-pill); padding: 2px 9px; font-size: 12px; line-height: 1.7;
  border: 1px solid var(--line); color: var(--ink-2); background: var(--surface-2);
}
.badge--ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, transparent); background: color-mix(in srgb, var(--ok) 10%, transparent); }
.badge--warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, transparent); background: color-mix(in srgb, var(--warn) 12%, transparent); }
.badge--danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); background: color-mix(in srgb, var(--danger) 10%, transparent); }
.badge--gold { color: var(--gold); border-color: color-mix(in srgb, var(--gold) 30%, transparent); }

.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; }
.list > * + * { border-top: 1px solid var(--line); }
.li {
  appearance: none; width: 100%; border: 0; background: none; text-align: start;
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 14px var(--sp-4); min-height: 56px; cursor: pointer; color: var(--ink);
}
.li:active { background: var(--surface-2); }
.li-t { display: block; font-size: var(--fs-body); font-weight: 520; }
.li-s { display: block; font-size: var(--fs-sm); color: var(--ink-2); margin-top: 2px; }
.chev { color: var(--ink-3); flex: none; }

.divider { height: 1px; background: var(--line); margin: var(--sp-4) 0; border: 0; }

.seg { display: inline-flex; background: var(--surface-2); border-radius: var(--r-ctl); padding: 3px; gap: 2px; }
.seg button {
  appearance: none; border: 0; background: none; border-radius: 9px; cursor: pointer;
  min-height: 48px; padding: 0 12px; font-size: var(--fs-sm); color: var(--ink-2);
}
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.06); }

.field { display: block; }
.field > span.lbl { display: block; font-size: var(--fs-sm); color: var(--ink-2); margin-bottom: 6px; }
.input {
  width: 100%; min-height: 48px; padding: 10px 14px; font: inherit; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-ctl);
}
.input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
textarea.input { min-height: 96px; resize: vertical; }

/* 底部浮层（仅筛选/设置/短操作） */
.sheet-wrap { position: fixed; inset: 0; z-index: 60; display: none; }
.sheet-wrap[data-open="1"] { display: block; }
.sheet-bd { position: absolute; inset: 0; background: rgba(12, 22, 18, .38); }
.sheet {
  position: absolute; inset-inline: 0; bottom: 0; max-height: 82vh; overflow: auto;
  background: var(--surface); border-radius: 20px 20px 0 0; padding: 8px var(--pad-x) calc(20px + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 40px rgba(0,0,0,.18);
}
.sheet-grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 6px auto 10px; }
.sheet h2 { font-size: 17px; font-weight: 650; margin-bottom: 4px; }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px); z-index: 80;
  background: var(--ink); color: var(--bg); font-size: var(--fs-sm);
  padding: 10px 16px; border-radius: var(--r-pill); max-width: 86vw;
  opacity: 0; pointer-events: none; transition: opacity 160ms var(--ease);
}
.toast[data-open="1"] { opacity: 1; }

.skel { background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px; }
@keyframes sk { from { background-position: 180% 0; } to { background-position: -20% 0; } }
.empty { text-align: center; color: var(--ink-2); padding: 28px 16px; font-size: var(--fs-sm); }
.error-box { border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent); background: color-mix(in srgb, var(--danger) 8%, transparent); color: var(--danger); border-radius: var(--r-ctl); padding: 12px 14px; font-size: var(--fs-sm); }

/* ======================== 5. 页面 ======================== */
/* 今日：头部 */
.today-head { padding: 10px 2px 4px; }
.today-date { font-size: 15px; font-weight: 600; }
.today-date span { color: var(--ink-2); font-weight: 400; }
.city-btn { appearance: none; border: 0; background: none; color: var(--ink-2); font-size: var(--fs-sm); padding: 6px 0; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; min-height: 44px; }

/* 下一次礼拜 */
.next-card {
  position: relative; overflow: hidden; color: var(--ink);
  background: radial-gradient(120% 130% at 88% 0%, color-mix(in srgb, var(--accent) 12%, var(--surface)) 0%, var(--surface) 58%);
  border: 1px solid var(--line); border-radius: 20px; padding: 18px;
}
.next-k { font-size: var(--fs-sm); color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.next-main { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-top: 8px; }
.next-t { font-size: 46px; line-height: 1.05; font-weight: 660; letter-spacing: -.02em; }
.next-n { font-size: 17px; font-weight: 600; }
.next-rem { margin-top: 6px; font-size: var(--fs-sm); color: var(--ink-2); }
.next-bar { height: 4px; border-radius: 2px; background: var(--line); margin-top: 14px; overflow: hidden; }
.next-bar i { display: block; height: 100%; background: var(--accent); width: 0; border-radius: 2px; }
.next-foot { display: flex; justify-content: space-between; margin-top: 10px; font-size: var(--fs-xs); color: var(--ink-3); }
.wx { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--ink-2); }
.wx svg { display: block; }

/* 五时行 */
.prays { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: var(--sp-3); }
.pray {
  appearance: none; border: 1px solid transparent; background: var(--surface);
  border-radius: 12px; padding: 10px 4px; cursor: pointer; text-align: center;
  display: flex; flex-direction: column; gap: 2px; min-height: 64px; justify-content: center;
}
.pray b { font-size: var(--fs-sm); font-weight: 560; }
.pray time { font-size: 15px; font-weight: 620; }
.pray[data-state="next"] { background: var(--accent-weak); border-color: color-mix(in srgb, var(--accent) 35%, transparent); color: var(--accent); }
.pray[data-state="past"] { color: var(--ink-3); background: var(--surface-2); }

/* 快捷入口 4 格 */
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.quick button {
  appearance: none; border: 1px solid var(--line); background: var(--surface);
  border-radius: 14px; padding: 12px 6px; min-height: 84px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  font-size: 13px; color: var(--ink);
}
.quick svg { color: var(--accent); }

/* 书库 */
.searchbar { position: relative; margin: 8px 0 10px; }
.searchbar svg { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.searchbar .input { padding-inline-start: 40px; }
.bk-row { display: flex; gap: 14px; align-items: flex-start; width: 100%; text-align: start; border: 0; background: none; cursor: pointer; padding: 14px 0; }
.bk-row + .bk-row { border-top: 1px solid var(--line); }
.bk-cover { width: 72px; height: 104px; border-radius: 6px; overflow: hidden; flex: none; background: var(--surface-2); box-shadow: 0 2px 8px rgba(20,40,30,.10); }
.bk-cover img { width: 100%; height: 100%; object-fit: cover; }
.bk-cover.ph { display: flex; align-items: center; justify-content: center; text-align: center; padding: 6px; font-size: 11px; color: var(--ink-2); line-height: 1.35; }
.bk-t { display: block; font-size: 16px; font-weight: 600; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bk-s { display: block; font-size: var(--fs-sm); color: var(--ink-2); margin-top: 3px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bk-badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }

/* 详情 */
.hero-book { display: flex; gap: 16px; align-items: flex-start; }
.hero-book .bk-cover { width: 96px; height: 138px; }
.meta-list { display: grid; grid-template-columns: 84px 1fr; gap: 10px 12px; font-size: var(--fs-sm); }
.meta-list dt { color: var(--ink-2); }
.meta-list dd { margin: 0; color: var(--ink); }

/* 阅读器 */
.reader-head { position: sticky; top: calc(var(--appbar-h) + env(safe-area-inset-top)); z-index: 20;
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid transparent; }
.reader-head.is-stuck { border-bottom-color: var(--line); }
.reader-body { padding: 14px 0 40px; }
.ayah { padding: 14px 0; }
.ayah + .ayah { border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.ayah-ar { text-align: right; margin: 0 0 10px; font-size: var(--read-ar); line-height: var(--read-ar-lh); }
.ayah-zh { font-size: var(--read-zh); line-height: var(--read-lh); color: var(--ink); }
.ayah-n {
  display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px;
  border-radius: 50%; border: 1px solid var(--line); font-size: 12px; color: var(--ink-2);
  margin-inline-end: 8px; font-variant-numeric: tabular-nums;
}
body[data-mode="ar"] .ayah-zh { display: none; }
body[data-mode="zh"] .ayah-ar { display: none; }
.chap-title { font-size: 22px; font-weight: 650; margin: 6px 0 2px; line-height: 1.45; }
.chap-sub { font-size: var(--fs-sm); color: var(--ink-2); margin-bottom: 12px; }

/* 拜时 */
.times-list { }
.time-row { display: flex; align-items: baseline; gap: 12px; padding: 13px 0; }
.time-row + .time-row { border-top: 1px solid var(--line); }
.time-row .tr-n { width: 74px; flex: none; font-weight: 560; }
.time-row .tr-t { font-size: 20px; font-weight: 620; font-variant-numeric: tabular-nums; }
.time-row[data-state="next"] { color: var(--accent); }
.month-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.month-table th, .month-table td { padding: 9px 4px; text-align: center; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.month-table th { color: var(--ink-2); font-weight: 500; font-size: 12px; }
.month-table tr.is-today td { background: var(--accent-weak); color: var(--accent); font-weight: 600; }

/* 发现网格 */
.grid-tools { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.tool {
  appearance: none; border: 1px solid var(--line); background: var(--surface); border-radius: 14px;
  padding: 14px; text-align: start; cursor: pointer; min-height: 88px;
  display: flex; flex-direction: column; gap: 6px; justify-content: center;
}
.tool svg { color: var(--accent); }
.tool b { font-size: 15px; font-weight: 600; }
.tool span { font-size: 12.5px; color: var(--ink-2); line-height: 1.45; }

/* 内容阅读排版（赞词/故事/祈祷词） */
.prose-ar { direction: rtl; text-align: right; font-family: var(--font-ar);
  font-size: var(--read-ar); line-height: var(--read-ar-lh); margin: 10px 0 12px; }
.prose-zh { font-size: var(--read-zh); line-height: var(--read-lh); }
.prose-zh p + p { margin-top: 12px; }
.note { font-size: var(--fs-sm); color: var(--ink-2); border-inline-start: 3px solid var(--line); padding-inline-start: 10px; }

/* 表单 */
.form-grid { display: grid; gap: 14px; }
.form-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.result-box { border-radius: var(--r-card); border: 1px solid var(--line); background: var(--surface); padding: 16px; }
.result-num { font-size: 30px; font-weight: 660; letter-spacing: -.01em; }
.hint { font-size: 12.5px; color: var(--ink-3); }

/* 直播卡 */
.live-card { display: flex; align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--line); background: var(--surface); border-radius: 14px; }
.live-ico { width: 52px; height: 52px; border-radius: 12px; background: var(--accent-weak); display: flex; align-items: center; justify-content: center; font-size: 26px; flex: none; }
.live-card b { display: block; font-size: 15px; }
.live-card .st { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--ink-2); margin-top: 3px; }
.st-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); }
.st-dot.ok { background: var(--ok); }
.st-dot.warn { background: var(--warn); }

/* 我的 */
.me-head { display: flex; align-items: center; gap: 14px; padding: 14px 0 6px; }
.avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--accent-weak); color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-weight: 650; font-size: 20px; }
.group-label { font-size: 12.5px; color: var(--ink-3); margin: 22px 4px 8px; letter-spacing: .04em; }

/* ======================== 6. 响应式 ======================== */
@media (max-width: 359px) {
  :root { --pad-x: 14px; --fs-title: 25px; }
  .prays { gap: 4px; }
  .pray time { font-size: 14px; }
  .next-t { font-size: 40px; }
}
@media (min-width: 900px) {
  :root { --pad-x: 24px; }
  .tabbar { display: none; }
  #app { display: grid; grid-template-columns: 248px 1fr; }
  .sidebar {
    display: flex; flex-direction: column; gap: 4px; padding: 22px 14px;
    border-inline-end: 1px solid var(--line); position: sticky; top: 0; height: 100vh;
    background: var(--surface);
  }
  .sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font-weight: 680; font-size: 16px; }
  .sb-tab {
    display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 12px;
    border: 0; background: none; border-radius: 10px; cursor: pointer; color: var(--ink-2); font-size: 15px;
  }
  .sb-tab[aria-current="page"] { background: var(--accent-weak); color: var(--accent); font-weight: 600; }
  .sidebar .sb-foot { margin-top: auto; font-size: 12px; color: var(--ink-3); padding: 10px; }
  .appbar { position: sticky; }
  #view { max-width: 820px; padding-bottom: 40px; }
  body[data-route="read"] #view { max-width: 780px; }
  .toast { bottom: 24px; }
}

/* —— 长指南：有序步骤 / 要点清单 / 键值表 —— */
.steps { list-style: none; margin: 12px 0 0; padding: 0; counter-reset: st; }
.steps > li {
  counter-increment: st; position: relative; padding: 10px 0 10px 40px;
  border-bottom: 1px solid var(--line);
}
.steps > li:last-child { border-bottom: 0; }
.steps > li::before {
  content: counter(st); position: absolute; inset-inline-start: 0; top: 12px;
  width: 26px; height: 26px; border-radius: 999px; background: var(--accent-weak);
  color: var(--accent); font-size: 13px; font-weight: 640; line-height: 26px; text-align: center;
}
.steps > li > b { display: block; font-weight: 620; font-size: 15.5px; }
.steps > li > span { display: block; margin-top: 4px; color: var(--ink-2); font-size: 15px; line-height: 1.75; }
.notes { margin: 10px 0 0; padding-inline-start: 20px; color: var(--ink-2); font-size: 15px; line-height: 1.78; }
.notes > li { margin: 6px 0; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 14px; margin: 0; }
.kv > dt { color: var(--ink-2); font-size: 14px; }
.kv > dd { margin: 0; font-size: 15px; line-height: 1.7; }

/* ======================== 7. 动效与无障碍 ======================== */@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .btn:active { transform: none; }
}
/* 不支持 backdrop-filter：实色兜底 */
@supports not ((backdrop-filter: blur(4px)) or (-webkit-backdrop-filter: blur(4px))) {
  .appbar, .tabbar, .reader-head { background: var(--bg); }
}
@media (prefers-reduced-transparency: reduce) {
  .appbar, .tabbar, .reader-head { background: var(--bg); backdrop-filter: none; }
}
/* 200% 文字：容器自然增高，不裁字 */
@media (min-resolution: 1dppx) { }

/* —— 分窗加载占位 —— */
.chunk-more { padding: 14px 0 6px; text-align: center; }
.chunk-more .btn { width: 100%; }

/* —— 跳到正文（键盘/读屏） —— */
.skip-link {
  position: absolute; inset-inline-start: 8px; top: -64px; z-index: 60;
  background: var(--accent); color: var(--accent-ink); padding: 10px 14px;
  border-radius: var(--r-ctl); font-size: 14px; text-decoration: none;
}
.skip-link:focus { top: 8px; }

/* —— 直播播放器（M100：应用内播放，失败可见可重试） —— */
button.live-card {
  width: 100%; text-align: start; font: inherit; cursor: pointer;
  min-height: 72px; color: inherit;
}
button.live-card:active { transform: scale(.995); }
.live-wrap {
  position: relative; background: #0B1412; border-radius: 14px; overflow: hidden;
  aspect-ratio: 16 / 9; display: flex; align-items: center; justify-content: center;
}
.live-video { width: 100%; height: 100%; display: block; background: #0B1412; }
.live-msg {
  position: absolute; inset-inline: 0; bottom: 0; padding: 10px 12px;
  font-size: 13px; line-height: 1.6; color: #E8F0EC; background: rgba(6, 18, 15, .72);
  text-align: center;
}
.live-msg:empty { display: none; }
@media (prefers-reduced-motion: reduce) { button.live-card:active { transform: none; } }
