/* ==========================================================================
   众妙之门 · Web 预览样式
   主题沿用 miniprogram/styles/theme.wxss 的低饱和马卡龙配色
   ==========================================================================
 * @author Ethan
 */

:root {
  --bg: #f7f5f1;
  --bg-soft: #fbf9f6;
  --card: #ffffff;

  --primary: #9b8cc4;
  --primary-deep: #7b6ba8;
  --primary-soft: #ede9f7;

  --accent: #d9ae83;
  --accent-soft: #f6eada;

  --mint: #9cc6bf;
  --mint-soft: #e4f1ef;
  --peach: #e6afa2;
  --peach-soft: #f9e8e3;
  --matcha: #b4c9a3;
  --matcha-soft: #ebf1e3;
  --sky: #a6c4de;
  --sky-soft: #e6eff7;

  --text: #46424f;
  --text-sub: #8b8695;
  --text-light: #b4afc0;
  --line: #eeeeef;

  --wx-mu: #7fa96b;
  --wx-huo: #d98a72;
  --wx-tu: #c9a96a;
  --wx-jin: #c7b79a;
  --wx-shui: #7f9cc0;

  --shadow: 0 4px 14px rgba(122, 108, 150, 0.08);
  --shadow-lg: 0 8px 28px rgba(122, 108, 150, 0.14);
  --radius: 14px;

  /* 导航栏高度：.nav-inner 46px + 下边框 1px。
     导航栏是 sticky（在文档流内占位），页面若有 min-height:100% 会把内容顶出去
     多出的这 47px 会让首个元素滑到导航栏底下，故统一用此变量扣减。 */
  --nav-h: 47px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: #eceef2;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB',
    'Microsoft YaHei', 'Helvetica Neue', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px;
  background:
    radial-gradient(1100px 520px at 12% -8%, #eef0f7 0%, rgba(238, 240, 247, 0) 62%),
    radial-gradient(900px 460px at 92% 6%, #f4f0ea 0%, rgba(244, 240, 234, 0) 60%),
    #eceef2;
}

/* --------------------------------------------------------------------------
   应用外壳
   这里就是应用本身的容器——不再有「展示用手机模型」和「说明侧栏」。
   桌面端呈现为一张居中的应用卡片；窄屏铺满全屏（见文件末尾媒体查询）。
   -------------------------------------------------------------------------- */
.app-shell {
  position: relative;
  width: 100%;
  max-width: 430px;
  height: min(880px, calc(100vh - 48px));
  min-height: 560px;
  background: var(--bg);
  border-radius: 22px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow:
    0 18px 48px rgba(46, 40, 66, 0.16),
    0 0 0 1px rgba(122, 108, 150, 0.07);
}

.app-body {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}
.app-body::-webkit-scrollbar { width: 0; }

/* --------------------------------------------------------------------------
   页面通用
   -------------------------------------------------------------------------- */
.page { padding: 0 14px 26px; }
.page > .card:first-child { margin-top: 12px; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.card-inline { padding: 12px 14px; }

.section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 1px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title::before {
  content: '';
  width: 3px;
  height: 13px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
}
.section-hint {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-light);
  font-weight: 400;
  letter-spacing: 0;
}
.section-hint::before { content: none; }

.tip {
  font-size: 11px;
  color: var(--text-light);
  line-height: 1.6;
  margin-top: 8px;
}
.hint { font-size: 11px; color: var(--text-light); }
.title-sm { font-size: 13px; color: var(--text); font-weight: 500; }

.disclaimer {
  font-size: 11px;
  line-height: 1.7;
  color: #a99a97;
  background: #fdf6f4;
  border: 1px dashed #eddedb;
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 4px;
}

/* --------------------------------------------------------------------------
   导航栏
   -------------------------------------------------------------------------- */
.nav-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(247, 245, 241, 0.92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid rgba(238, 234, 239, 0.9);
}
.nav-inner {
  height: 46px;
  display: flex;
  align-items: center;
  padding: 0 10px;
}
.nav-side { width: 62px; display: flex; align-items: center; gap: 6px; }
.nav-right { justify-content: flex-end; }
.nav-center { flex: 1; text-align: center; min-width: 0; }
.nav-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-subtitle { font-size: 10px; color: var(--text-light); letter-spacing: 1px; margin-top: -1px; }
.nav-back {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.nav-back:hover { background: var(--primary-soft); }
.nav-back-chevron {
  width: 9px; height: 9px;
  border-left: 2px solid var(--primary-deep);
  border-bottom: 2px solid var(--primary-deep);
  transform: rotate(45deg);
  margin-left: 3px;
}
.nav-clear { font-size: 12px; color: var(--primary-deep); cursor: pointer; }

/* --------------------------------------------------------------------------
   底部 tabBar
   -------------------------------------------------------------------------- */
.tabbar {
  flex: 0 0 auto;
  background: #fff;
  border-top: 1px solid var(--line);
  padding-bottom: 6px;
}
.tabbar.is-hidden { display: none; }
.tabbar-inner { display: flex; height: 52px; }
.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  position: relative;
  color: #9a94a8;
}
.tab-item.is-active { color: var(--primary-deep); }
.tab-label { font-size: 10px; letter-spacing: .5px; }

.tab-ico { width: 20px; height: 18px; position: relative; display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.ico-gua .gua-line { height: 2.5px; border-radius: 1px; background: currentColor; }
.ico-gua .gua-line--break { display: flex; gap: 3px; background: none; }
.ico-gua .gua-line--break .gua-seg { flex: 1; height: 2.5px; border-radius: 1px; background: currentColor; }
.ico-book .book-body {
  width: 15px; height: 13px;
  border: 1.8px solid currentColor;
  border-radius: 2px 4px 4px 2px;
  margin-left: 3px;
}
.ico-book .book-spine {
  position: absolute; left: 0; top: 2px;
  width: 4px; height: 13px;
  border: 1.8px solid currentColor;
  border-right: none;
  border-radius: 3px 0 0 3px;
}
.ico-user .user-head {
  width: 8px; height: 8px; border-radius: 50%;
  border: 1.8px solid currentColor;
  margin: 0 auto;
}
.ico-user .user-body {
  width: 15px; height: 7px;
  border: 1.8px solid currentColor;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  margin: 1px auto 0;
}
.tab-dot {
  position: absolute;
  top: 5px;
  width: 14px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  opacity: 0;
  transition: opacity .2s;
}
.tab-item.is-active .tab-dot { opacity: 1; }

/* --------------------------------------------------------------------------
   表单控件
   -------------------------------------------------------------------------- */
.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  border-bottom: 1px solid var(--line);
  gap: 12px;
}
.form-row--last { border-bottom: none; }
.form-label { font-size: 13px; color: var(--text-sub); flex: 0 0 auto; }
.form-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 14px;
  color: var(--text);
  text-align: right;
  font-family: inherit;
  min-width: 0;
}
.form-input::placeholder { color: var(--text-light); }
.form-input--num { flex: 0 0 70px; }
.form-picker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text);
  background: var(--bg-soft);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
}
.chevron {
  width: 6px; height: 6px;
  border-right: 1.6px solid var(--text-light);
  border-bottom: 1.6px solid var(--text-light);
  transform: rotate(-45deg);
  margin-bottom: 2px;
}
select.native, input.native {
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--bg-soft);
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 6px 8px;
  outline: none;
  cursor: pointer;
  max-width: 190px;
}
select.native:focus, input.native:focus { border-color: var(--primary); background: #fff; }

.seg {
  display: inline-flex;
  background: var(--bg-soft);
  border-radius: 9px;
  padding: 3px;
  gap: 2px;
}
.seg-item {
  padding: 5px 14px;
  font-size: 13px;
  color: var(--text-sub);
  border-radius: 7px;
  cursor: pointer;
  transition: all .18s;
  white-space: nowrap;
}
.seg-item.is-on {
  background: #fff;
  color: var(--primary-deep);
  font-weight: 600;
  box-shadow: 0 1px 5px rgba(122, 108, 150, .16);
}
.seg-block { display: flex; width: 100%; margin-bottom: 6px; }
.seg-block .seg-item { flex: 1; text-align: center; }

.switch {
  position: relative;
  width: 44px; height: 25px;
  flex: 0 0 44px;
  border-radius: 999px;
  background: #e3e0e9;
  transition: background .2s;
  cursor: pointer;
}
.switch::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 21px; height: 21px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .18);
  transition: transform .2s;
}
.switch.is-on { background: var(--primary); }
.switch.is-on::after { transform: translateX(19px); }

.pillars-grid { display: flex; gap: 8px; margin: 10px 0 4px; }
.pillar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.pillar-name { font-size: 11px; color: var(--text-light); }
.pillar-pick {
  width: 100%;
  text-align: center;
  font-size: 15px;
  color: var(--text);
  background: var(--bg-soft);
  border-radius: 8px;
  padding: 7px 0;
  cursor: pointer;
  font-family: 'STSong', 'Songti SC', serif;
}

.region-pick {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-soft);
  border-radius: 10px;
  padding: 11px 12px;
  cursor: pointer;
}
.region-text { font-size: 14px; color: var(--text); }

.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.col { display: flex; flex-direction: column; }

.btn {
  display: block;
  width: 100%;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  padding: 12px;
  transition: opacity .18s, transform .08s;
}
.btn:active { transform: scale(.99); }
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-deep) 100%);
  color: #fff;
  box-shadow: 0 6px 18px rgba(123, 107, 168, .26);
}
.btn-lg { font-size: 15px; letter-spacing: 3px; padding: 14px; margin-top: 4px; }
.btn-ghost { background: var(--bg-soft); color: var(--primary-deep); border: 1px solid var(--line); }
.btn-reset { text-align: center; font-size: 12px; color: var(--text-light); padding: 12px 0 4px; cursor: pointer; }

/* --------------------------------------------------------------------------
   排盘页主视觉
   -------------------------------------------------------------------------- */
.hero-paipan {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 4px 6px;
}
.hero-ring {
  width: 56px; height: 56px;
  border-radius: 50%;
  border: 1.5px solid var(--primary-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex: 0 0 56px;
  background: radial-gradient(circle at 30% 25%, #fff, var(--primary-soft));
}
.hero-ring::after {
  content: '';
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  border: 1px dashed rgba(155, 140, 196, .35);
}
.hero-trigram { display: flex; flex-direction: column; gap: 4px; width: 22px; }
.hero-trigram .tl { height: 3px; border-radius: 2px; background: var(--primary-deep); }
.hero-trigram .tl-break { display: flex; gap: 4px; background: none; }
.hero-trigram .tl-break .seg { flex: 1; height: 3px; border-radius: 2px; background: var(--primary-deep); }
.hero-title { font-size: 20px; font-weight: 600; letter-spacing: 3px; }
.hero-sub { font-size: 11px; color: var(--text-light); letter-spacing: .6px; }

/* --------------------------------------------------------------------------
   排盘结果
   -------------------------------------------------------------------------- */
.profile-card {
  background: linear-gradient(150deg, #ffffff 0%, #faf8fd 55%, #f7f2ea 100%);
}
.profile-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.profile-name { display: flex; align-items: baseline; gap: 8px; }
.pn-text { font-size: 18px; font-weight: 600; letter-spacing: 1px; }
.pn-gender {
  font-size: 11px;
  color: var(--primary-deep);
  background: var(--primary-soft);
  border-radius: 999px;
  padding: 1px 8px;
}
.copy-btn {
  font-size: 12px;
  color: var(--primary-deep);
  border: 1px solid var(--primary-soft);
  border-radius: 999px;
  padding: 3px 12px;
  cursor: pointer;
}
.profile-line { display: flex; gap: 10px; font-size: 12.5px; line-height: 1.9; }
.pl-key { flex: 0 0 32px; color: var(--text-light); }
.pl-val { color: var(--text); flex: 1; word-break: break-all; }
.pl-bazi {
  font-family: 'STSong', 'Songti SC', serif;
  font-size: 14px;
  letter-spacing: 1.5px;
  color: var(--primary-deep);
}

.bazi-table { border-radius: 10px; overflow: hidden; }
.bt-row {
  display: flex;
  border-bottom: 1px solid var(--line);
  align-items: stretch;
}
.bt-row--last { border-bottom: none; }
.bt-row--head { background: var(--bg-soft); }
.bt-label {
  flex: 0 0 44px;
  font-size: 11px;
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 0;
  background: #fbfafc;
  border-right: 1px solid var(--line);
}
.bt-row--head .bt-label { color: var(--text-sub); font-weight: 600; background: #f7f5fa; }
.bt-cell {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 7px 2px;
  font-size: 12px;
  color: var(--text);
  border-right: 1px solid var(--line);
}
.bt-cell:last-child { border-right: none; }
.bt-row--head .bt-cell { font-size: 11.5px; color: var(--text-sub); font-weight: 600; }

.gz-big {
  font-family: 'STSong', 'Songti SC', serif;
  font-size: 22px;
  line-height: 1.15;
  font-weight: 600;
}
.gz-tag { font-size: 10px; color: var(--text-light); }
.cell-multi { font-size: 11.5px; line-height: 1.45; text-align: center; font-family: 'STSong', 'Songti SC', serif; }
.cell-sub { color: var(--text-sub); font-size: 10.5px; }
.cell-text { font-size: 11.5px; color: var(--text); text-align: center; }
.cell-small { font-size: 10.5px; color: var(--text-sub); }
.cell-shensha { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; justify-content: center; }
.ss-tag {
  font-size: 9.5px;
  color: #a5824f;
  background: var(--accent-soft);
  border-radius: 4px;
  padding: 0 4px;
  white-space: nowrap;
  line-height: 1.5;
}
.ss-none { font-size: 11px; color: var(--text-light); }

.el-mu { color: var(--wx-mu); }
.el-huo { color: var(--wx-huo); }
.el-tu { color: var(--wx-tu); }
.el-jin { color: var(--wx-jin); }
.el-shui { color: var(--wx-shui); }

.extra-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}
.extra-item { font-size: 11.5px; color: var(--text-sub); background: var(--bg-soft); border-radius: 6px; padding: 3px 9px; }

.wuxing-bars { display: flex; flex-direction: column; gap: 9px; }
.wx-item { display: flex; align-items: center; gap: 10px; }
.wx-name { flex: 0 0 18px; font-size: 12.5px; color: var(--text-sub); font-family: 'STSong', 'Songti SC', serif; }
.wx-track { flex: 1; height: 8px; border-radius: 999px; background: #f2f0f5; overflow: hidden; }
.wx-fill { height: 100%; border-radius: 999px; transition: width .5s ease; }
.fill-mu { background: linear-gradient(90deg, #a8c79a, var(--wx-mu)); }
.fill-huo { background: linear-gradient(90deg, #eab5a3, var(--wx-huo)); }
.fill-tu { background: linear-gradient(90deg, #e0cda0, var(--wx-tu)); }
.fill-jin { background: linear-gradient(90deg, #ded3bd, var(--wx-jin)); }
.fill-shui { background: linear-gradient(90deg, #b3c8de, var(--wx-shui)); }
.wx-val { flex: 0 0 16px; font-size: 12px; color: var(--text-sub); text-align: right; }
.wx-missing { margin-top: 12px; font-size: 12px; color: var(--text-sub); }
.wx-missing .miss { color: var(--peach); font-weight: 600; }

.dayun-group { margin-bottom: 8px; }
.dayun-start { font-size: 11.5px; color: var(--text-light); }
.dayun-scroll {
  display: flex;
  overflow-x: auto;
  gap: 8px;
  padding: 2px 0 8px;
  scrollbar-width: none;
}
.dayun-scroll::-webkit-scrollbar { display: none; }
.dayun-track { display: flex; gap: 8px; }
.dayun-item {
  flex: 0 0 auto;
  min-width: 78px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--bg-soft);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .18s;
}
.dayun-item.is-on {
  background: var(--primary-soft);
  border-color: rgba(155, 140, 196, .5);
}
.dy-gz { font-size: 15px; font-family: 'STSong', 'Songti SC', serif; color: var(--text); }
.dayun-item.is-on .dy-gz { color: var(--primary-deep); font-weight: 600; }
.dy-age { font-size: 10px; color: var(--text-light); }
.dy-year { font-size: 9.5px; color: var(--text-light); }

.dayun-title-row { display: flex; align-items: center; gap: 8px; margin: 4px 0 10px; }
.dt-title { font-size: 13.5px; font-weight: 600; letter-spacing: .5px; font-family: 'STSong', 'Songti SC', serif; }
.tag { font-size: 10px; border-radius: 999px; padding: 1px 8px; }
.tag-primary { background: var(--primary-soft); color: var(--primary-deep); }

.liunian-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 6px; }
.ln-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 5px 2px;
  border-radius: 8px;
  background: var(--bg-soft);
  cursor: pointer;
  border: 1px solid transparent;
}
.ln-item.is-now { background: var(--accent-soft); border-color: rgba(217, 174, 131, .55); }
.ln-item.is-on { background: var(--primary-soft); border-color: rgba(155, 140, 196, .5); }
.ln-year { font-size: 10px; color: var(--text-light); }
.ln-gz { font-size: 12.5px; font-family: 'STSong', 'Songti SC', serif; color: var(--text); }
.ln-age { font-size: 9px; color: var(--text-light); }

.empty-inline { font-size: 12px; color: var(--text-light); text-align: center; padding: 12px 0; }

.today-meta { display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; color: var(--text); margin-bottom: 12px; }
.today-lunar { font-size: 11.5px; color: var(--text-sub); }
.today-pillars { display: flex; gap: 8px; margin-bottom: 12px; }
.tp {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  background: var(--bg-soft);
  border-radius: 10px;
  padding: 8px 0;
}
.tp-label { font-size: 10px; color: var(--text-light); }
.tp-gz { font-size: 17px; font-family: 'STSong', 'Songti SC', serif; line-height: 1.2; }
.today-yiji { display: flex; flex-direction: column; gap: 6px; }
.yiji-row { display: flex; gap: 10px; align-items: flex-start; }
.yiji-key {
  flex: 0 0 22px;
  height: 22px;
  border-radius: 6px;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.yiji-key.yi { background: var(--mint); }
.yiji-key.ji { background: var(--peach); }
.yiji-val { flex: 1; font-size: 12px; color: var(--text-sub); line-height: 1.6; }

/* 底部操作条 */
.action-bar {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 10px;
  padding: 10px 14px 14px;
  margin: 0 -14px;
  background: linear-gradient(180deg, rgba(247, 245, 241, 0) 0%, var(--bg) 26%);
}
.action-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 9px 4px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform .08s;
}
.action-btn:active { transform: scale(.985); }
.ab-title { font-size: 13.5px; font-weight: 600; letter-spacing: 1px; }
.ab-sub { font-size: 10px; opacity: .78; }
.action-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-deep) 100%);
  color: #fff;
  box-shadow: 0 6px 16px rgba(123, 107, 168, .26);
}
.action-ghost {
  background: #fff;
  color: var(--primary-deep);
  border: 1px solid var(--primary-soft);
  box-shadow: var(--shadow);
}
.action-spacer { height: 6px; }

/* --------------------------------------------------------------------------
   命局解析
   -------------------------------------------------------------------------- */
.subject-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: linear-gradient(135deg, #fff, #f9f6fd);
  border-radius: var(--radius);
  padding: 11px 14px;
  margin: 12px 0;
  box-shadow: var(--shadow);
}
.sb-left { display: flex; align-items: baseline; gap: 7px; }
.sb-name { font-size: 15px; font-weight: 600; }
.sb-gender { font-size: 11px; color: var(--primary-deep); background: var(--primary-soft); border-radius: 999px; padding: 1px 8px; }
.sb-bazi { font-family: 'STSong', 'Songti SC', serif; font-size: 13.5px; letter-spacing: 1px; color: var(--text-sub); }

.tabs {
  display: flex;
  background: #fff;
  border-radius: 12px;
  padding: 4px;
  gap: 3px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.tab {
  flex: 1;
  text-align: center;
  font-size: 13px;
  color: var(--text-sub);
  padding: 8px 0;
  border-radius: 9px;
  cursor: pointer;
  transition: all .18s;
}
.tab.is-on {
  background: linear-gradient(135deg, var(--primary-soft), #fff);
  color: var(--primary-deep);
  font-weight: 600;
  box-shadow: 0 1px 6px rgba(122, 108, 150, .12);
}

.liunian-title { margin-top: 14px; }
/* 冷却提示样式已随「切换限流取消」一并移除 */

.paywall { text-align: center; padding: 26px 18px; }
.pw-icon { font-size: 32px; color: var(--primary); margin-bottom: 8px; }
.pw-title { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.pw-desc { font-size: 12px; color: var(--text-sub); margin-bottom: 16px; }
.pw-plans { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.pw-plan {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--bg-soft);
  border-radius: 10px;
  padding: 9px 14px;
}
.pw-plan-name { font-size: 12px; color: var(--text); }
.pw-plan-price { font-size: 14px; color: var(--primary-deep); font-weight: 600; }
.pw-foot { margin-top: 14px; }

/* 专家报告 */
.er-loading { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 26px 0; }
.er-spinner {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 2px solid var(--primary-soft);
  border-top-color: var(--primary);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.er-loading-text { font-size: 12px; color: var(--text-light); }
.er-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.er-title { font-size: 15px; font-weight: 600; letter-spacing: .5px; }
.er-mode { font-size: 10px; color: #a5824f; background: var(--accent-soft); border-radius: 999px; padding: 1px 8px; }
.er-summary { font-size: 13px; color: var(--text-sub); margin-bottom: 12px; }
.er-section { margin-bottom: 14px; }
.er-section:last-child { margin-bottom: 0; }
.er-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-deep);
  margin-bottom: 5px;
  letter-spacing: .5px;
}
.er-section-body { font-size: 13px; line-height: 1.85; color: #56515f; white-space: pre-wrap; }

/* 说明 / 免责声明节：弱化渲染，内容不删减 */
.er-section.is-note {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--line, #ece8ef);
}
.er-section.is-note .er-section-title {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-light);
  letter-spacing: 1px;
}
.er-section.is-note .er-section-title::before { background: var(--line, #ded8e3); }
.er-section.is-note .er-section-body {
  font-size: 11.5px;
  color: var(--text-light);
  line-height: 1.75;
}
.er-empty { font-size: 12px; color: var(--text-light); text-align: center; padding: 18px 0; }

/* ---------------- 命局要点表（位于「总断」之后） ---------------- */
.er-facts { margin: 4px 0 18px; }
.er-facts-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 7px; flex-wrap: wrap; }
.er-facts-title {
  display: flex;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-deep);
  letter-spacing: .5px;
}
.er-facts-title::before {
  content: "";
  width: 3px;
  height: 13px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
  margin-right: 7px;
}
.er-facts-hint { font-size: 10.5px; color: var(--text-light); }

.er-facts-table { border: 1px solid var(--line, #ece8ef); border-radius: 10px; overflow: hidden; }
.ef-row { display: flex; align-items: stretch; border-bottom: 1px solid var(--line, #ece8ef); }
.ef-row:last-child { border-bottom: none; }
.ef-row:nth-child(odd) { background: #fcfbfe; }
.ef-k {
  flex: 0 0 86px;
  padding: 10px 8px 10px 11px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--primary-deep);
  line-height: 1.6;
  background: var(--primary-soft, #ede9f7);
}
.ef-v {
  flex: 1;
  min-width: 0;
  padding: 10px 11px;
  font-size: 11.5px;
  color: #56515f;
  line-height: 1.75;
  word-break: break-word;
}

.fade-in { animation: fadeIn .32s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

/* --------------------------------------------------------------------------
   AI 上师
   -------------------------------------------------------------------------- */
/* 扣掉导航栏占位，否则 100% + 47px 会让首个子元素滑到导航栏底下 */
.chat-page { display: flex; flex-direction: column; min-height: calc(100% - var(--nav-h)); }
/* 命盘上下文条：随页面滚动始终停在导航栏下方，
   让用户任何时候都能确认「上师说的就是我这盘」，不必重新翻回顶部核对 */
.ctx-bar {
  position: sticky;
  top: var(--nav-h);
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 7px 14px 8px;
  background: var(--primary-soft);
  border-bottom: 1px solid rgba(222, 214, 244, .9);
  font-size: 11.5px;
  flex-shrink: 0;
}
.ctx-row { display: flex; align-items: center; gap: 8px; }
.ctx-label { color: var(--primary-deep); flex: 0 0 auto; }
.ctx-bazi { font-family: 'STSong', 'Songti SC', serif; color: var(--text); letter-spacing: .8px; }
.ctx-name { margin-left: auto; color: var(--text-sub); }
.ctx-meta {
  font-size: 10.5px;
  color: var(--primary-deep);
  opacity: .78;
  letter-spacing: .2px;
  line-height: 1.5;
}

.msg-list { padding: 14px 14px 0; display: flex; flex-direction: column; gap: 14px; }
.msg { display: flex; gap: 8px; }
.msg-user { flex-direction: row-reverse; }
.avatar {
  flex: 0 0 30px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-size: 13px;
  font-family: 'STKaiti', 'KaiTi', serif;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(122, 108, 150, .24);
}
.bubble-wrap { max-width: 78%; }
.bubble {
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
}
.msg-assistant .bubble { background: #fff; color: var(--text); border-top-left-radius: 4px; box-shadow: var(--shadow); }
.msg-user .bubble {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-deep) 100%);
  color: #fff;
  border-top-right-radius: 4px;
}
.typing { display: flex; gap: 4px; padding: 4px 2px; }
.typing-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text-light);
  animation: blink 1.2s infinite;
}
.typing-dot:nth-child(2) { animation-delay: .2s; }
.typing-dot:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 60%, 100% { opacity: .3; } 30% { opacity: 1; } }
.msg-bottom-space { height: 8px; }

.suggest-wrap { padding: 8px 0 0; }
.suggest-scroll { display: flex; overflow-x: auto; padding: 0 14px 8px; scrollbar-width: none; }
.suggest-scroll::-webkit-scrollbar { display: none; }
.suggest-track { display: flex; gap: 8px; }
.suggest-chip {
  flex: 0 0 auto;
  font-size: 12px;
  color: var(--primary-deep);
  background: #fff;
  border: 1px solid var(--primary-soft);
  border-radius: 999px;
  padding: 5px 12px;
  cursor: pointer;
  white-space: nowrap;
}
.suggest-chip:hover { background: var(--primary-soft); }

.input-bar {
  position: sticky;
  bottom: 0;
  margin-top: auto;
  display: flex;
  /* 输入框会长高，按钮贴底对齐才不会跑到中间 */
  align-items: flex-end;
  gap: 8px;
  padding: 9px 14px 12px;
  background: rgba(247, 245, 241, .96);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
}
.suggest-toggle {
  width: 30px; height: 30px;
  flex: 0 0 30px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-deep);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-bottom: 1px;
}
/* 2026-11-05：由单行 input 改为自适应高度的 textarea。
   原来超长的问题会被截断成一行，只能左右滑，用户看不到自己写了什么。 */
.chat-input {
  flex: 1;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 18px;
  padding: 8px 14px;
  font-size: 13px;
  line-height: 1.5;
  font-family: inherit;
  outline: none;
  min-width: 0;
  resize: none;
  overflow-y: hidden;
  max-height: 132px;
  display: block;
  /* 单行时高度与原来一致（8+8 padding + 19.5 行高 ≈ 36px），不显突兀 */
  height: 36px;
  -webkit-appearance: none;
  box-sizing: border-box;
}
.chat-input.is-multi { border-radius: 14px; }
.chat-input:focus { border-color: var(--primary-soft); }
.chat-input::-webkit-scrollbar { width: 3px; }
.chat-input::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
.send-btn {
  flex: 0 0 auto;
  font-size: 12.5px;
  color: #fff;
  background: #cfc9dc;
  border-radius: 999px;
  padding: 7px 15px;
  cursor: default;
  transition: all .2s;
}
.send-btn.is-ready {
  background: linear-gradient(135deg, var(--primary), var(--primary-deep));
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(123, 107, 168, .28);
}

/* --------------------------------------------------------------------------
   藏经阁
   -------------------------------------------------------------------------- */
.gang-header { text-align: center; padding: 18px 0 14px; }
.gh-ornament { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 6px; }
.gh-line { width: 34px; height: 1px; background: linear-gradient(90deg, transparent, var(--primary)); }
.gh-line:last-child { background: linear-gradient(90deg, var(--primary), transparent); }
.gh-mark { font-family: 'STKaiti', 'KaiTi', serif; font-size: 17px; color: var(--primary-deep); }
.gh-title { font-size: 19px; font-weight: 600; letter-spacing: 6px; color: var(--text); }
.gh-sub { font-size: 11.5px; color: var(--text-light); letter-spacing: .6px; margin-top: 3px; }

/* --- Tab 切换（佛家 / 道家）--- */
.scripture-tabs { display: flex; gap: 0; margin: 10px 0 14px; border-bottom: 1px solid #ede8f2; }
.stab-item { flex: 1; text-align: center; padding: 9px 0 8px; position: relative; cursor: pointer; user-select: none; }
.stab-text { font-size: 14px; color: var(--text-sub); font-weight: 500; transition: color .2s; }
.stab-line { position: absolute; bottom: -1px; left: 50%; transform: translateX(-50%); width: 0; height: 3px; border-radius: 2px; background: var(--accent); transition: width .25s; }
.stab-on .stab-text { color: var(--text); font-weight: 700; }
.stab-on .stab-line { width: 28px; }
.stab-on.tao-on .stab-line { background: var(--matcha); }
.stab-on.tao-on .stab-text { color: var(--text); }

.sect { margin-bottom: 16px; }
.sect-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; padding: 0 2px; }
.sect-title { display: flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 600; letter-spacing: 1px; }
.sect-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }
.dot-buddha { background: var(--accent); }
.dot-tao { background: var(--mint); }
.sect-count { font-size: 11px; color: var(--text-light); }

.book-card {
  display: flex;
  gap: 12px;
  background: #fff;
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .12s, box-shadow .2s;
}
.book-card:active { transform: scale(.99); }
.book-card:hover { box-shadow: var(--shadow-lg); }
.book-cover {
  flex: 0 0 74px;
  width: 74px;
  height: 100px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--bg-soft);
  box-shadow: 0 3px 10px rgba(122, 108, 150, .16);
}
.book-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.book-title-row { display: flex; align-items: center; gap: 7px; }
.book-title { font-size: 15px; font-weight: 600; letter-spacing: 1px; }
.book-tag { font-size: 10px; color: #5f8b6f; background: var(--mint-soft); border-radius: 999px; padding: 0 7px; }
.book-full { font-size: 11px; color: var(--text-sub); }
.book-summary { font-size: 11.5px; color: var(--text-light); line-height: 1.6; }
.book-meta { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 5px; }
.bm-item { font-size: 11px; color: var(--text-light); }
.bm-open { font-size: 11.5px; color: var(--primary-deep); }

.placeholder-card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px dashed var(--line);
  padding: 26px 18px;
  text-align: center;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.ph-ring {
  width: 52px; height: 52px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: var(--bg-soft);
  display: flex;
  align-items: center;
  justify-content: center;
}
.ph-taiji { width: 26px; height: 26px; border-radius: 50%; overflow: hidden; display: flex; }
.pt-half { flex: 1; }
.pt-left { background: var(--text-sub); }
.pt-right { background: #fff; border: 1px solid var(--line); }
.ph-title { font-size: 13.5px; font-weight: 600; color: var(--text-sub); }
.ph-desc { font-size: 11.5px; color: var(--text-light); margin-top: 4px; }
.ph-tag {
  display: inline-block;
  margin-top: 10px;
  font-size: 11px;
  color: var(--text-light);
  background: var(--bg-soft);
  border-radius: 999px;
  padding: 2px 12px;
}

/* 目录页 */
.book-hero { position: relative; height: 168px; margin: 0 -14px 12px; overflow: hidden; }
/* 底衬：与小程序 .hero-bg 保持一致（blur 14rpx ≈ 7px、scale 1.15 防糊边、opacity .55）。
   底衬的职责是柔和衬底，清晰的主体是左侧 .hero-cover；不模糊会让封面原图的
   局部（如《道德经》中段那株古松）在横切裁切后变成一大块深色，压住标题。 */
.book-hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(7px);
  transform: scale(1.15);
  opacity: .55;
}
.hero-mask {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(38, 32, 48, .30) 0%, rgba(38, 32, 48, .72) 100%);
}
.hero-inner { position: relative; display: flex; gap: 13px; padding: 18px 14px 0; align-items: flex-start; }
.hero-cover {
  width: 82px; height: 112px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .34);
}
.hero-meta { flex: 1; min-width: 0; color: #fff; padding-top: 4px; }
.hero-title { font-size: 21px; font-weight: 600; letter-spacing: 3px; }
.hero-full { font-size: 12px; opacity: .86; letter-spacing: 1px; margin-top: 2px; }
.hero-trans { font-size: 11px; opacity: .72; margin-top: 2px; }
.hero-badge {
  display: inline-block;
  margin-top: 9px;
  font-size: 10.5px;
  background: rgba(255, 255, 255, .2);
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 999px;
  padding: 2px 10px;
}

.continue { display: flex; align-items: center; justify-content: space-between; cursor: pointer; }
.ct-label { font-size: 11px; color: var(--text-light); }
.ct-title { font-size: 14px; font-weight: 600; letter-spacing: .5px; margin-top: 2px; }
.ct-progress { display: flex; align-items: baseline; }
.ct-num { font-size: 20px; font-weight: 600; color: var(--primary-deep); }
.ct-slash { font-size: 12px; color: var(--text-light); }

.intro-card { padding: 14px 16px; }
.intro-p { font-size: 13px; line-height: 1.9; color: #56515f; margin-bottom: 10px; }
.intro-quote {
  font-family: 'STKaiti', 'KaiTi', serif;
  font-size: 15.5px;
  line-height: 1.85;
  color: #8a6b3f;
  background: linear-gradient(180deg, #fdf8ef, #fbf3e6);
  border-radius: 10px;
  padding: 10px 14px;
  margin: 12px 0;
  text-align: center;
  letter-spacing: 1px;
}
.intro-list { margin-bottom: 10px; }
.intro-li { display: flex; gap: 6px; font-size: 12.5px; color: var(--text-sub); line-height: 1.8; }
.li-dot { color: var(--accent); }
.intro-divider { display: flex; align-items: center; gap: 10px; margin: 16px 0; }
.id-line { flex: 1; height: 1px; background: var(--line); }
.id-mark { font-size: 13px; color: var(--primary); }

.catalog { padding: 4px 0; }
.cat-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background .16s;
}
.cat-item:hover { background: #fbfafd; }
.cat-item:last-child { border-bottom: none; }
.cat-no {
  flex: 0 0 30px;
  font-family: 'STSong', 'Songti SC', serif;
  font-size: 13px;
  color: var(--text-light);
}
.cat-item.is-read .cat-no { color: var(--mint); }
.cat-body { flex: 1; min-width: 0; }
.cat-name { font-size: 13.5px; font-weight: 600; letter-spacing: .5px; }
.cat-sub { font-size: 11px; color: var(--text-light); line-height: 1.5; margin-top: 1px; }
.cat-right { display: flex; align-items: center; gap: 7px; }
.cat-read { font-size: 10px; color: var(--mint); background: var(--mint-soft); border-radius: 999px; padding: 0 7px; }
.cat-arrow { font-size: 16px; color: var(--text-light); }

/* 章节正文 */
.chapter-page { background: #fdfcf9; min-height: calc(100% - var(--nav-h)); }
.ch-head { text-align: center; padding: 20px 14px 16px; }
.ch-ornament { display: flex; align-items: center; justify-content: center; gap: 12px; }
.co-line { width: 40px; height: 1px; background: linear-gradient(90deg, transparent, var(--accent)); }
.co-line:last-child { background: linear-gradient(90deg, var(--accent), transparent); }
.co-no { font-size: 11px; color: #a5824f; letter-spacing: 2px; }
.ch-name { font-family: 'STKaiti', 'KaiTi', serif; font-size: 24px; letter-spacing: 5px; margin-top: 7px; }
.ch-sub { font-size: 12px; color: var(--text-light); line-height: 1.6; margin-top: 5px; }

/* 正文按需加载时的等待态（正文 ≈1.6MB，独立 bundle，见 scripture-chapters.js）
   min-height 让它落在视觉中部，否则内容挤在顶部、下面一大片空 */
.ch-loading {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; min-height: 52vh; padding: 30px 0 80px;
}
.cl-dots { display: flex; gap: 9px; }
.cl-dots i {
  width: 6px; height: 6px; border-radius: 50%;
  background: #a5824f; opacity: .3;
  animation: clPulse 1.2s ease-in-out infinite;
}
.cl-dots i:nth-child(2) { animation-delay: .18s; }
.cl-dots i:nth-child(3) { animation-delay: .36s; }
@keyframes clPulse {
  0%, 100% { opacity: .18; transform: scale(.8); }
  50%      { opacity: .85; transform: scale(1); }
}
.cl-text { font-size: 12.5px; color: var(--text-light); letter-spacing: 2px; }

.ch-body { padding: 0 18px; }
.blk-img { width: 100%; border-radius: 10px; margin: 10px 0 18px; display: block; }
.blk-h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'STKaiti', 'KaiTi', serif;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: var(--text);
  margin: 22px 0 10px;
}
.h2-bar { width: 3px; height: 15px; border-radius: 2px; background: linear-gradient(180deg, var(--accent), var(--primary)); }
.blk-h3 { font-size: 14px; font-weight: 600; color: var(--primary-deep); margin: 16px 0 7px; letter-spacing: .5px; }
.blk-lead { font-size: 12px; color: var(--text-light); text-align: center; margin: 4px 0 14px; letter-spacing: 1px; }
.blk-quote {
  font-family: 'STKaiti', 'KaiTi', serif;
  font-size: 16px;
  line-height: 2;
  color: #6b5a3e;
  background: linear-gradient(180deg, #fdf8ef, #fbf3e6);
  border-left: 3px solid rgba(217, 174, 131, .6);
  border-radius: 0 10px 10px 0;
  padding: 12px 14px;
  margin: 12px 0;
}
.quote-para { margin-bottom: 6px; }
.quote-para:last-child { margin-bottom: 0; }
.blk-list { margin: 10px 0; }
.list-li { display: flex; gap: 8px; font-size: 13px; line-height: 1.85; color: #56515f; margin-bottom: 5px; }
.li-idx {
  flex: 0 0 18px;
  height: 18px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-deep);
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.blk-p { font-size: 14px; line-height: 1.95; color: #4a4653; margin-bottom: 12px; }
.p-para { margin-bottom: 8px; }
.p-para:last-child { margin-bottom: 0; }

/* 表格：优先换行把信息全部留在屏内，超长内容才横向滚动 */
.blk-table {
  margin: 12px 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid rgba(0, 0, 0, .06);
  border-radius: 10px;
  background: #fff;
}
.blk-table table {
  border-collapse: collapse;
  width: 100%;
  font-size: calc(var(--ch-fs, 14px) - 1.5px);
  line-height: 1.7;
}
.blk-table th,
.blk-table td {
  padding: 8px 11px;
  text-align: left;
  /* 一开始用 nowrap + 横滚，结果 320px 屏第 4 列被推出可视区，
     用户根本不知道还有一列。改成换行：多几行也比丢信息强。 */
  white-space: normal;
  word-break: break-word;
  border-bottom: 1px solid rgba(0, 0, 0, .05);
}
.blk-table th {
  background: var(--primary-soft);
  color: var(--primary-deep);
  font-weight: 600;
  letter-spacing: .5px;
  white-space: nowrap;          /* 表头短，保持一行更整齐 */
}
.blk-table tr:last-child td { border-bottom: 0; }

/* 320px 屏：让表格挤得下，也还读得下去。
   表头默认 nowrap 是为了整齐，但 5 列表（《坛经·般若品》「三般若」、《庄子·天下》
   「学派/判语/温度」）在 320px 下会被顶到 279px，可视区只有 254px —— 末列要表内横滑
   才看得见，用户极容易以为表格少一列。340px 以下放开表头换行。
   光放开表头还不够：5 列分 254px，窄列会被 auto 布局压成一字一行（实测「名称」只分到
   31px）。所以同时把字号降一档、内边距收到 5px，并给单元格 2.6em 下限。实测同一张
   「三般若」表：高度 409 → 223px，末列可见，没有一列只剩一个字。 */
@media (max-width: 340px) {
  .blk-table table {
    font-size: calc(var(--ch-fs, 14px) - 2.5px);
    line-height: 1.55;
  }
  .blk-table th { white-space: normal; }
  .blk-table th,
  .blk-table td {
    padding: 5px 5px;
    min-width: 2.6em;
  }
}

/* ASCII 图示（↓ → 对齐表）：只有等宽 + 保留空白才立得住 */
.blk-pre { margin: 12px 0; }
.blk-pre pre {
  margin: 0;
  padding: 12px 14px;
  overflow-x: auto;
  font-family: 'SF Mono', Menlo, Consolas, 'Courier New', monospace;
  font-size: calc(var(--ch-fs, 14px) - 2px);
  line-height: 1.8;
  color: #5a5461;
  background: #f8f6f2;
  border-radius: 10px;
  white-space: pre;
}

/* 行内强调 */
.blk-p strong,
.blk-list strong,
.blk-h3 strong,
.quote-para strong { color: var(--primary-deep); font-weight: 600; }

/* 字号档位 */
.font-lv0 { --ch-fs: 14px; }
.font-lv1 { --ch-fs: 16px; }
.font-lv2 { --ch-fs: 18px; }
.font-lv3 { --ch-fs: 12.5px; }
.blk-p { font-size: var(--ch-fs, 14px); }
.blk-quote { font-size: calc(var(--ch-fs, 14px) + 2px); }

.ch-nav { display: flex; gap: 10px; padding: 22px 18px 10px; }
.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: all .16s;
}
.nav-btn:hover { border-color: var(--primary-soft); background: #fbfafd; }
.nb-right { text-align: right; align-items: flex-end; }
.nb-dir { font-size: 11px; color: var(--text-light); }
.nb-name { font-size: 12.5px; color: var(--text); }
.nav-btn.is-off { opacity: .45; pointer-events: none; }
.ch-foot { text-align: center; padding: 8px 18px 26px; }
.cf-text { display: block; font-size: 11px; color: var(--text-light); }
.cf-tip { display: block; font-size: 10.5px; color: var(--text-light); opacity: .8; margin-top: 3px; }

.float-bar {
  position: sticky;
  bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 18px 14px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(70, 66, 79, .88);
  color: #fff;
  backdrop-filter: blur(10px);
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: all .26s ease;
  box-shadow: 0 8px 22px rgba(46, 40, 66, .3);
}
.float-bar.show { opacity: 1; transform: none; pointer-events: auto; }
.fb-progress { font-size: 11px; opacity: .8; padding-left: 6px; }
.fb-btn {
  margin-left: auto;
  font-size: 11.5px;
  padding: 3px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .16);
  cursor: pointer;
}
.fb-btn + .fb-btn { margin-left: 0; }
.fb-btn:hover { background: rgba(255, 255, 255, .28); }

/* --------------------------------------------------------------------------
   我的
   -------------------------------------------------------------------------- */
.user-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  padding: 15px;
  margin: 12px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #8f80bd 0%, #a99ad0 52%, #d3b48f 100%);
  box-shadow: 0 8px 22px rgba(122, 108, 150, .26);
}
.uc-glow {
  position: absolute;
  right: -34px; top: -46px;
  width: 132px; height: 132px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
}
.uc-avatar {
  position: relative; z-index: 1;
  flex: 0 0 auto;
  width: 54px; height: 54px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(255, 255, 255, .18);
  border: 2px solid rgba(255, 255, 255, .5);
  display: flex; align-items: center; justify-content: center;
}
.uc-avatar-ph { font-size: 22px; color: rgba(255, 255, 255, .85); }
/* 自定义头像：用 background-image 而不是 <img>，省一层尺寸约束；
   background-size:cover 保证裁成圆后不变形。 */
.uc-avatar-img {
  background-size: cover;
  background-position: center;
  cursor: pointer;
}
.uc-avatar { cursor: pointer; }
/* 头像右下角的「改」小标：告诉用户这里能点，不然没人会去点一张头像 */
.uc-avatar-edit {
  position: absolute; right: -2px; bottom: -2px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--primary-deep, #8a6d3b);
  color: #fff; font-size: 10px; line-height: 20px; text-align: center;
  border: 1.5px solid rgba(255, 255, 255, .85);
  pointer-events: none;
}
.uc-avatar-btn { position: relative; z-index: 1; flex: 0 0 auto; cursor: pointer; }
.uc-avatar-btn:hover .uc-avatar { border-color: rgba(255, 255, 255, .85); }
.uc-body { position: relative; z-index: 1; flex: 1 1 auto; min-width: 0; }
.uc-name { font-size: 16px; font-weight: 600; color: #fff; letter-spacing: .5px; }
.uc-id {
  display: flex; align-items: center; gap: 6px;
  font-size: 10.5px; color: rgba(255, 255, 255, .78); margin-top: 4px;
}
.uc-id-val { font-family: "SF Mono", ui-monospace, monospace; letter-spacing: .5px; word-break: break-all; }
.uc-copy {
  font-size: 9.5px; padding: 1px 7px; border-radius: 999px;
  background: rgba(255, 255, 255, .2);
  border: 1px solid rgba(255, 255, 255, .34);
  cursor: pointer;
}
.uc-copy:hover { background: rgba(255, 255, 255, .34); }
.uc-badge {
  display: inline-block; font-size: 9.5px; margin-top: 6px;
  color: rgba(255, 255, 255, .82);
  background: rgba(255, 255, 255, .16);
  border-radius: 999px; padding: 2px 8px;
}
.uc-badge.is-wx { color: #eaf7ef; background: rgba(122, 191, 148, .42); }
.uc-nick-input {
  font-size: 15px; font-weight: 600; color: #fff;
  background: transparent; border: none;
  border-bottom: 1px solid rgba(255, 255, 255, .35);
  height: 26px; line-height: 26px;
  width: 100%; outline: none;
  font-family: inherit;
}
.uc-nick-input::placeholder { color: rgba(255, 255, 255, .55); font-weight: 400; }
.uc-action {
  position: relative; z-index: 1; flex: 0 0 auto;
  font-size: 12px; color: #fff;
  background: rgba(255, 255, 255, .2);
  border: 1px solid rgba(255, 255, 255, .38);
  border-radius: 999px;
  padding: 4px 14px;
  cursor: pointer;
  white-space: nowrap;
}
.uc-action:hover { background: rgba(255, 255, 255, .34); }
.uc-action-main { background: #fff; color: #6e5f9b; font-weight: 600; border-color: #fff; }
.uc-action-main:hover { background: #f0edf7; }

.vip-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(135deg, #fbf6ef, #f6ecdd);
  border: 1px solid #f0e2cd;
  border-radius: var(--radius);
  padding: 13px 15px;
  margin-bottom: 12px;
  cursor: pointer;
}
.vip-card.is-vip { background: linear-gradient(135deg, #f7f0e2, #eddfc6); border-color: #e4d0ae; }
.vip-title { font-size: 14px; font-weight: 600; color: #8a6b3f; display: flex; align-items: center; gap: 5px; }
.vip-crown { color: var(--accent); }
.vip-desc { font-size: 11.5px; color: #a9946f; margin-top: 2px; }
.vip-btn {
  flex: 0 0 auto;
  font-size: 11.5px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #c99a6c);
  border-radius: 999px;
  padding: 5px 13px;
}

.stat-row {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: var(--radius);
  padding: 13px 0;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.stat-cell { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.stat-num { font-size: 17px; font-weight: 600; color: var(--primary-deep); }
.stat-label { font-size: 11px; color: var(--text-light); }
.stat-line { width: 1px; height: 22px; background: var(--line); }

.empty-card { background: #fff; border-radius: var(--radius); padding: 30px 22px; text-align: center; box-shadow: var(--shadow); }
.ec-ring {
  width: 58px; height: 58px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-soft), var(--accent-soft));
  display: flex;
  align-items: center;
  justify-content: center;
}
.ec-mark { font-family: 'STKaiti', 'KaiTi', serif; font-size: 24px; color: var(--primary-deep); }
.ec-title { font-size: 14px; font-weight: 600; }
.ec-desc { font-size: 12px; color: var(--text-light); line-height: 1.75; margin-top: 6px; }
.ec-btn {
  display: inline-block;
  margin-top: 16px;
  font-size: 13px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-deep));
  border-radius: 999px;
  padding: 7px 22px;
  cursor: pointer;
}

#view { scroll-behavior: smooth; }
.rec-anchor { display: block; height: 1px; }
.rec-group { margin-bottom: 14px; }
.group-head { display: flex; align-items: center; gap: 7px; padding: 0 2px 6px; }
.gh-letter {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary-deep);
  letter-spacing: 1px;
}
.group-head.is-pin .gh-letter { color: var(--accent); }
.gh-count { font-size: 10px; color: var(--text-light); }
.rec-list { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.rec-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background .16s;
}
.rec-item:hover { background: #fbfafd; }
.rec-item:last-child { border-bottom: none; }
.rec-avatar {
  flex: 0 0 36px;
  width: 36px; height: 36px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--primary-soft), #fff);
  color: var(--primary-deep);
  font-family: 'STKaiti', 'KaiTi', serif;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(155, 140, 196, .22);
}
.av-pin { background: linear-gradient(135deg, var(--accent-soft), #fff); color: #a5824f; border-color: rgba(217, 174, 131, .4); }
.rec-body { flex: 1; min-width: 0; }
.rec-line1 { display: flex; align-items: center; gap: 7px; }
.rec-name { font-size: 14px; font-weight: 600; }
.rec-gender { font-size: 10px; color: var(--text-sub); background: var(--bg-soft); border-radius: 999px; padding: 0 7px; }
.rec-pin { font-size: 10px; color: #a5824f; background: var(--accent-soft); border-radius: 999px; padding: 0 7px; }
.rec-bazi {
  font-family: 'STSong', 'Songti SC', serif;
  font-size: 12.5px;
  color: var(--primary-deep);
  letter-spacing: 1px;
  margin: 2px 0;
}
.rec-line3 { display: flex; justify-content: space-between; gap: 8px; font-size: 10.5px; color: var(--text-light); }
.rec-more {
  flex: 0 0 26px;
  text-align: center;
  font-size: 16px;
  color: var(--text-light);
  cursor: pointer;
  border-radius: 8px;
  padding: 4px 0;
}
.rec-more:hover { background: var(--bg-soft); color: var(--primary-deep); }

.letter-bar {
  position: sticky;
  bottom: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(10px);
  border-radius: 999px;
  padding: 5px 10px;
  margin: 10px 0 4px;
  box-shadow: var(--shadow);
}
.lb-item {
  font-size: 10.5px;
  color: var(--text-sub);
  padding: 2px 6px;
  border-radius: 6px;
  cursor: pointer;
}
.lb-item:hover { background: var(--primary-soft); color: var(--primary-deep); }
.lb-item.is-active { background: var(--primary-deep); color: #fff; }

.foot-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.fa-btn {
  text-align: center;
  font-size: 13px;
  color: var(--text-sub);
  background: #fff;
  border-radius: 11px;
  padding: 11px;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.fa-btn:hover { color: var(--primary-deep); }
.fa-danger { color: #c08a80; }
/* 关于 / 用户协议 / 隐私政策 三个并排（2026-10-30 用户要求）：
   .fa-btn 不带宽度，靠 flex:1 均分；min-width:0 防止「关于众妙之门」把这一行撑破。 */
.foot-row { display: flex; gap: 8px; }
.foot-row .fa-btn { flex: 1 1 0; min-width: 0; padding: 11px 4px; white-space: nowrap; }

/* 版本更新（2026-10-30）：左边「版本更新」、右边当前版本号，整行可点。
   右侧号数用等宽数字，1.1 与 1.10 不会因为字宽跳动。 */
.ver-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-sub);
  background: #fff;
  border-radius: 11px;
  padding: 11px 14px;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.ver-row:hover { color: var(--primary-deep); }
.ver-num {
  font-size: 12px;
  color: var(--text-sub);
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}

/* 公告条（远端下发，可关闭）。
   ⚠️ 类名不能用 .notice-card —— 那是 first-run.js 首启隐私告知层的容器名，
   两者混用会让告知层被这里的 flex 布局改掉（告知层是商店硬性要求，不能碰）。 */
.mine-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px 13px;
  border-radius: 12px;
  background: var(--primary-soft);
  border: 1px solid rgba(155, 140, 196, .28);
}
.mn-body { flex: 1 1 auto; min-width: 0; }
.mn-text {
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--primary-deep);
  white-space: pre-wrap;
  word-break: break-word;
}
.mn-more { margin-top: 4px; font-size: 12px; color: var(--primary-deep); opacity: .8; }
.mn-close {
  flex: 0 0 auto;
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  color: var(--text-sub);
  border-radius: 50%;
  background: rgba(255, 255, 255, .7);
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   UI 层（toast / loading / modal / sheet）
   -------------------------------------------------------------------------- */
.ui-layer { position: fixed; inset: 0; z-index: 9999; pointer-events: none; }
.ui-layer > * { pointer-events: auto; }

.ui-toast {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  max-width: 62vw;
  background: rgba(48, 44, 58, .88);
  color: #fff;
  font-size: 13px;
  line-height: 1.6;
  border-radius: 10px;
  padding: 10px 16px;
  text-align: center;
  backdrop-filter: blur(6px);
  transition: opacity .28s;
}
.ui-toast.is-out { opacity: 0; }

.ui-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.ui-loading-box {
  background: rgba(48, 44, 58, .86);
  border-radius: 12px;
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  backdrop-filter: blur(6px);
}
.ui-spinner {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .26);
  border-top-color: #fff;
  animation: spin .8s linear infinite;
}
.ui-loading-text { font-size: 12px; color: #fff; }

.ui-mask {
  position: absolute;
  inset: 0;
  background: rgba(36, 32, 44, .38);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
  animation: fadeIn .16s ease;
}
.ui-mask--sheet { align-items: flex-end; }
.ui-dialog {
  width: 276px;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: popIn .2s ease;
}
@keyframes popIn { from { transform: scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }
.ui-dialog-title { font-size: 14px; font-weight: 600; text-align: center; padding: 16px 16px 6px; }
.ui-dialog-body {
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--text-sub);
  text-align: center;
  padding: 4px 18px 14px;
  white-space: pre-wrap;
  max-height: 40vh;
  overflow-y: auto;
}
/* 长文改左对齐（「关于众妙之门」这类多段落说明）；标题不受影响，仍居中 */
.ui-dialog-body.is-left { text-align: left; }
.ui-dialog-foot { display: flex; border-top: 1px solid var(--line); }
.ui-dialog-btn {
  flex: 1;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--text-sub);
  padding: 12px 0;
  cursor: pointer;
}
.ui-dialog-btn + .ui-dialog-btn { border-left: 1px solid var(--line); }
.ui-dialog-btn.is-primary { color: var(--primary-deep); font-weight: 600; }
.ui-dialog-btn:hover { background: #faf9fc; }

.ui-sheet {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 16px 16px 0 0;
  overflow: hidden;
  padding-bottom: 8px;
  animation: slideUp .22s ease;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: none; } }
.ui-sheet-item {
  display: block;
  width: 100%;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.ui-sheet-item:last-child { border-bottom: none; }
.ui-sheet-item:hover { background: #faf9fc; }
.ui-sheet-item.is-cancel { color: var(--text-light); margin-top: 6px; border-top: 6px solid #f4f2f6; }

/* --------------------------------------------------------------------------
   神煞一览 / 五行三口径 / 大运到月 / 流月详情
   -------------------------------------------------------------------------- */
.section-hint { font-size: 11px; color: var(--text-light); font-weight: 400; margin-left: 6px; }

.ss-legend {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--bg-soft);
}
.ssl-head { display: flex; align-items: center; justify-content: space-between; cursor: pointer; }
.ssl-title { font-size: 12.5px; font-weight: 600; color: var(--text); }
.ssl-toggle { font-size: 11px; color: var(--primary-deep); }
.ssl-list { margin-top: 8px; }
.ssl-item { padding: 7px 0; border-top: 1px dashed var(--line); }
.ssl-item:first-child { border-top: none; }
.ssl-line { display: flex; align-items: center; gap: 6px; }
.ssl-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary-deep);
  background: var(--primary-soft);
  border-radius: 5px;
  padding: 0 7px;
}
.ssl-pillars { font-size: 10.5px; color: var(--text-light); }
.ssl-desc { margin-top: 3px; font-size: 11px; color: var(--text-sub); line-height: 1.6; }

.wx-group { margin-bottom: 12px; }
.wx-group:last-of-type { margin-bottom: 0; }
.wg-title { display: flex; align-items: baseline; gap: 7px; margin-bottom: 6px; }
.wg-name { font-size: 12px; font-weight: 600; color: var(--text); }
.wg-note { font-size: 10px; color: var(--text-light); }
.wx-missing-sub { color: var(--text-light); }

.dy-range { font-size: 9px; color: var(--text-light); letter-spacing: -.2px; }
.dayun-item.is-on .dy-range { color: var(--primary-deep); opacity: .8; }

.det-label { display: flex; align-items: center; gap: 7px; margin: 12px 0 7px; }
.det-label--gap { margin-top: 15px; }
.det-label > span:first-child { font-size: 13px; font-weight: 600; color: var(--text); }
.det-hint { font-size: 10.5px; color: var(--text-light); }

.det-card {
  border: 1px solid var(--primary-soft);
  border-radius: 11px;
  padding: 11px 12px;
  background: linear-gradient(150deg, #ffffff 0%, #faf7fd 100%);
}
.det-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--line);
}
.det-gz {
  flex: 0 0 auto;
  display: flex;
  gap: 2px;
  font-family: 'STSong', 'Songti SC', serif;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.1;
}
.det-meta { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.det-title { font-size: 13px; font-weight: 600; color: var(--text); }
.det-sub { font-size: 10.5px; color: var(--text-light); }

.det-grid { display: flex; flex-wrap: wrap; padding-top: 7px; }
.dg-item { flex: 0 0 50%; display: flex; align-items: baseline; gap: 5px; padding: 4px 0; }
.dg-wide { flex: 0 0 100%; }
.dg-k { flex: 0 0 30px; font-size: 10.5px; color: var(--text-light); }
.dg-v { flex: 1; font-size: 11.5px; color: var(--text); line-height: 1.6; word-break: break-all; }
.dg-dot { color: var(--text-light); }
.dg-none { color: var(--text-light); }

.liuyue-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; }
.ly-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 6px 2px;
  border-radius: 7px;
  background: var(--bg-soft);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .18s;
}
.ly-item.is-on { background: var(--primary-soft); border-color: rgba(155, 140, 196, .5); }
.ly-m { font-size: 9.5px; color: var(--text-light); }
.ly-gz { font-size: 12px; font-family: 'STSong', 'Songti SC', serif; color: var(--text); }
.ly-item.is-on .ly-gz { color: var(--primary-deep); font-weight: 600; }

/* 五行着色优先级高于默认文本色 */
.dy-gz.el-mu, .ln-gz.el-mu, .ly-gz.el-mu, .det-gz .el-mu { color: var(--wx-mu); }
.dy-gz.el-huo, .ln-gz.el-huo, .ly-gz.el-huo, .det-gz .el-huo { color: var(--wx-huo); }
.dy-gz.el-tu, .ln-gz.el-tu, .ly-gz.el-tu, .det-gz .el-tu { color: var(--wx-tu); }
.dy-gz.el-jin, .ln-gz.el-jin, .ly-gz.el-jin, .det-gz .el-jin { color: var(--wx-jin); }
.dy-gz.el-shui, .ln-gz.el-shui, .ly-gz.el-shui, .det-gz .el-shui { color: var(--wx-shui); }

/* ==========================================================================
   新增：可点击栏目 / 三宫行 / 流月日期 / 术语释义弹窗
   ========================================================================== */
.bt-tap { color: var(--primary-deep); cursor: pointer; }
.bt-i {
  font-style: normal;
  font-size: 9px;
  color: var(--primary);
  margin-left: 1px;
  opacity: .75;
}
.bt-row--gong { background: #fcfbfe; }
.bt-merged {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 7px 4px;
}
.bm-gz {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  font-family: 'STSong', 'Songti SC', serif;
  letter-spacing: 1px;
}
.bm-na { font-size: 10.5px; color: var(--text-light); }

.ly-d { font-size: 9px; color: var(--text-light); }
.ly-item.is-on .ly-d { color: var(--primary-deep); opacity: .85; }
.ln-partial { font-size: 8.5px; color: var(--accent); }
.ln-item.is-on .ln-partial { color: var(--primary-deep); opacity: .85; }

.info-mask {
  position: fixed;
  left: 0; right: 0; top: 0; bottom: 0;
  background: rgba(46, 42, 60, .42);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.info-panel {
  width: 100%;
  max-width: 430px;
  max-height: 78vh;
  background: var(--card);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  padding: 16px 18px 14px;
  box-shadow: var(--shadow-lg);
}
.info-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.info-title { font-size: 15px; font-weight: 700; color: var(--text); }
.info-close { cursor: pointer; color: var(--text-light); font-size: 14px; padding: 0 4px; }
.info-body { flex: 1; overflow-y: auto; }
.info-intro {
  font-size: 11.5px;
  color: var(--text-sub);
  line-height: 1.82;
  background: var(--bg-soft);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
}
.info-values { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.iv-item {
  display: flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
  background: #fff;
}
.iv-k { font-size: 10px; color: var(--text-light); }
.iv-v { font-size: 11px; color: var(--text); font-weight: 600; }
.info-item { padding: 9px 10px; border-top: 1px dashed var(--line); border-radius: 8px; }
.info-item.is-hit {
  border-top-color: transparent;
  background: linear-gradient(100deg, var(--primary-soft), rgba(237, 233, 247, 0));
}
.ii-head { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.ii-name { font-size: 12.5px; font-weight: 600; color: var(--text); }
.ii-hit {
  font-size: 9.5px;
  color: var(--primary-deep);
  background: #fff;
  border-radius: 999px;
  padding: 1px 8px;
}
.ii-meta { font-size: 9.5px; color: var(--text-light); }
.ii-text { font-size: 11.5px; color: var(--text-sub); line-height: 1.75; }
.info-foot {
  margin-top: 12px;
  height: 38px;
  line-height: 38px;
  text-align: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-deep));
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   窄屏适配
   应用在手机上铺满全屏：不留外边距、不留圆角、不投阴影。
   断点取 520px —— 比外壳 max-width(430px) 留出余量，避免 430~520 之间
   出现「卡片贴合窗口边缘但仍有圆角」的尴尬中间态。
   -------------------------------------------------------------------------- */
@media (max-width: 520px) {
  body {
    padding: 0;
    background: var(--bg);
  }
  .app-shell {
    max-width: none;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    border-radius: 0;
    box-shadow: none;
  }
}

/* --------------------------------------------------------------------------
   藏经阁 · 无封面书籍的兜底主视觉（如《道德经》）
   -------------------------------------------------------------------------- */
.book-hero-plain {
  background: linear-gradient(135deg, #4A4453 0%, #6E6288 48%, #9A8CB8 100%);
}
/* 道家经典分两层，勿混用：
   · book-hero-tao       → 仅换遮罩色（暖褐）。默认的紫灰渐变压在赭黄水墨上会发浑
                           偏脏，暖褐才留得住古意；透明度沿用默认档位，白字仍够对比。
                           有封面时也生效。
   · book-hero-tao-plain → 墨绿渐变底，只在无封面兜底时铺；有封面时若仍铺，
                           会透过半透明底图混出浑浊的橄榄色 */
.book-hero-tao-plain {
  background: linear-gradient(135deg, #2F4A3E 0%, #4F7A5E 50%, #7FA88C 100%);
}
.book-hero-tao .hero-mask {
  background: linear-gradient(180deg, rgba(40, 32, 24, .30) 0%, rgba(40, 32, 24, .74) 100%);
}
.hero-seal {
  width: 82px;
  height: 112px;
  flex: 0 0 82px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .13);
  border: 1px solid rgba(255, 255, 255, .42);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .22);
}
.hero-seal-txt {
  font-family: "STKaiti", "KaiTi", "Songti SC", serif;
  font-size: 44px;
  color: #fff;
  opacity: .93;
}
.book-cover-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(150deg, #6E6288, #9A8CB8);
}
.book-cover-tao { background: linear-gradient(150deg, #47675A, #7FA88C); }
.bcp-txt {
  font-family: "STKaiti", "KaiTi", "Songti SC", serif;
  font-size: 30px;
  color: #fff;
  opacity: .94;
}
.book-tag-tao { color: #4F7A5E; background: var(--matcha-soft); }

/* --------------------------------------------------------------------------
   合盘解析（services/hepan.js 的展示层）
   -------------------------------------------------------------------------- */

/* 排盘页双按钮：开始排盘 + 合盘解析 */
.btn-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
  margin-top: 4px;
}
.btn-row .btn {
  width: auto;
  margin-top: 0;
  letter-spacing: 2px;
}
.btn-row #btn-start { flex: 1.32; }
.btn-row #btn-hepan { flex: 1; }
/* 排盘页三按钮（开始排盘 / 双人合盘 / 今日运势）：三等分并排，尺寸完全一致。
   窄屏 375px 下每格约 107px，4 个汉字 14px + 1px 字距刚好放得下，
   字号或字距再放大就会换行，别动。 */
.btn-row--three {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.btn-row--three .btn {
  font-size: 14px;
  letter-spacing: 1px;
  padding: 13px 2px;
}
.btn-row--three #btn-start,
.btn-row--three #btn-hepan,
.btn-row--three #btn-today { flex: none; }

/* 按钮数可变（远端配置可以临时下线「双人合盘」或「今日运势」）：
   1 个时占满整行，2 个时主按钮略宽，样式与三等分一致，不要各写一套。 */
.btn-row--two {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 8px;
}
.btn-row--one .btn { flex: 1; }
.btn-row--two .btn,
.btn-row--one .btn {
  font-size: 14px;
  letter-spacing: 1px;
  padding: 13px 2px;
}
.btn-row--two .btn,
.btn-row--one .btn { flex: none; }
.btn-outline {
  background: var(--card);
  color: var(--primary-deep);
  border: 1px solid var(--line);
  box-shadow: 0 2px 8px rgba(123, 107, 168, .07);
}

/* 页头 */
.hp-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 4px 2px 2px;
}
.hp-hero-ring {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 50%;
  border: 1.5px solid rgba(155, 140, 196, .42);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 20px;
  color: var(--primary-deep);
  background: linear-gradient(150deg, #fff, var(--primary-soft));
  box-shadow: 0 4px 14px rgba(123, 107, 168, .12);
}
.hp-hero-title {
  font-family: "STKaiti", "KaiTi", "Songti SC", serif;
  font-size: 21px;
  letter-spacing: 4px;
  color: var(--text);
}
.hp-hero-sub {
  font-size: 11.5px;
  color: var(--text-light);
  letter-spacing: .5px;
  margin-top: 3px;
}

/* 甲方带入卡 */
.hp-side-a { border: 1px solid rgba(155, 140, 196, .22); }
.hp-side-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.hp-side-tag {
  font-size: 10.5px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-deep);
  letter-spacing: 1px;
}
.hp-side-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}
.hp-side-gender {
  font-size: 11px;
  color: var(--text-light);
  margin-left: 6px;
  font-weight: 400;
}
.hp-side-edit {
  font-size: 12px;
  color: var(--primary-deep);
  cursor: pointer;
  padding: 3px 10px;
  border-radius: 8px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
}
.hp-side-edit:active { opacity: .7; }

/* 四柱展示 */
.hp-bazi {
  display: flex;
  gap: 7px;
  margin-bottom: 9px;
}
.hp-gz {
  flex: 1;
  text-align: center;
  font-family: "STSong", "Songti SC", serif;
  font-size: 17px;
  color: var(--text);
  background: linear-gradient(180deg, #fff, var(--bg-soft));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 0;
  letter-spacing: 1px;
}
.hp-bazi--sm { margin-bottom: 6px; gap: 4px; }
.hp-bazi--sm .hp-gz { font-size: 13px; padding: 4px 0; }
.hp-side-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: 11.5px;
  color: var(--text-sub);
}

/* 评分卡 */
.hp-score-card {
  background: var(--card);
  border-radius: 16px;
  padding: 20px 18px 18px;
  box-shadow: var(--shadow);
  text-align: center;
}
.hp-score-wrap {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 6px;
}
.hp-ring { width: 120px; height: 120px; display: block; }
.hp-score-num {
  position: absolute;
  left: 0;
  right: 0;
  top: 34px;
  font-size: 34px;
  font-weight: 600;
  color: var(--text);
  font-family: "STSong", "Songti SC", serif;
  line-height: 1;
}
.hp-score-unit {
  position: absolute;
  left: 0;
  right: 0;
  top: 74px;
  font-size: 11px;
  color: var(--text-light);
  letter-spacing: 2px;
}
.hp-score-grade {
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 19px;
  letter-spacing: 3px;
  color: var(--primary-deep);
  margin-bottom: 6px;
}
.hp-score-desc {
  font-size: 12.5px;
  color: var(--text-sub);
  line-height: 1.75;
  text-align: left;
  padding: 0 2px;
}
.hp-tone-excellent .hp-score-grade { color: #8a6d3b; }
.hp-tone-weak .hp-score-grade,
.hp-tone-hard .hp-score-grade { color: #a8756a; }

/* 两盘对照 */
.hp-pair {
  display: flex;
  gap: 10px;
}
.hp-pair-item {
  flex: 1;
  min-width: 0;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 9px;
}
.hp-pair-tag {
  font-size: 10px;
  color: var(--text-light);
  letter-spacing: 1px;
  margin-bottom: 5px;
}
.hp-pair-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 7px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hp-pair-gender {
  font-size: 10.5px;
  color: var(--text-light);
  font-weight: 400;
  margin-left: 4px;
}
.hp-pair-day { font-size: 11px; color: var(--text-sub); margin-top: 2px; }

/* 六维条 */
.hp-dims { display: flex; flex-direction: column; gap: 14px; }
.hp-dim-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 6px;
  cursor: pointer;
}
.hp-dim-name { font-size: 13px; color: var(--text); }
.hp-dim-val {
  font-size: 13px;
  color: var(--primary-deep);
  font-weight: 600;
}
.hp-dim-val i { font-style: normal; font-size: 10.5px; color: var(--text-light); font-weight: 400; }
.hp-dim-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}
.hp-dim-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--primary) 100%);
  transition: width .5s cubic-bezier(.22, .8, .3, 1);
}
.hp-dim-note {
  display: none;
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.8;
  margin-top: 7px;
  padding: 9px 10px;
  background: var(--bg-soft);
  border-radius: 9px;
  border-left: 2px solid var(--primary-soft);
}
.hp-dim-note.is-open { display: block; }

/* 关系清单 */
.hp-links { display: flex; flex-direction: column; gap: 8px; }
.hp-link {
  display: flex;
  align-items: baseline;
  gap: 9px;
  padding: 8px 11px;
  border-radius: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  font-size: 12px;
}
.hp-link-label {
  flex: 0 0 auto;
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 999px;
  letter-spacing: .5px;
}
.hp-link-detail { color: var(--text-sub); line-height: 1.65; }
.hp-link--good .hp-link-label { background: var(--matcha-soft); color: #4F7A5E; }
.hp-link--warn .hp-link-label { background: var(--peach-soft); color: #a8756a; }
.hp-link--neutral .hp-link-label { background: var(--primary-soft); color: var(--primary-deep); }

/* 解读段落 */
.hp-notes { display: flex; flex-direction: column; gap: 14px; }
.hp-note-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--primary-deep);
  letter-spacing: 1px;
  margin-bottom: 5px;
}
.hp-note-body {
  font-size: 12.5px;
  color: var(--text-sub);
  line-height: 1.9;
}
.hp-note.is-note .hp-note-body {
  font-size: 11.5px;
  color: var(--text-light);
  line-height: 1.8;
}

/* 建议 */
.hp-advice {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hp-advice li {
  font-size: 12.5px;
  color: var(--text-sub);
  line-height: 1.85;
  padding-left: 2px;
}
.hp-advice li::marker { color: var(--accent); font-weight: 600; }

/* 建议分组 */
.hp-adv-group + .hp-adv-group {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
}
.hp-adv-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--primary-deep);
  letter-spacing: .5px;
  margin-bottom: 9px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.hp-adv-title::before {
  content: '';
  width: 3px;
  height: 12px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), var(--primary));
}

/* 大运流年 */
.hp-yun-lead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--line);
}
.hp-yun-year {
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 15px;
  color: var(--text);
  letter-spacing: 1px;
}
.hp-yun-pair {
  font-size: 11.5px;
  color: var(--primary-deep);
  background: var(--primary-soft);
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.hp-yun-list { display: flex; flex-direction: column; gap: 12px; }
.hp-yun-row {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 13px;
  background: #fff;
}
.hp-yun-row.hp-yun--up { border-color: rgba(139, 168, 122, .45); background: linear-gradient(180deg, #fbfdf8, #fff); }
.hp-yun-row.hp-yun--down { border-color: rgba(200, 150, 140, .45); background: linear-gradient(180deg, #fdf9f8, #fff); }
.hp-yun-head {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
}
.hp-yun-tag {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-deep);
  letter-spacing: .5px;
}
.hp-yun-name { font-size: 13.5px; font-weight: 600; color: var(--text); flex: 1; }
.hp-yun-state {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  color: var(--text-sub);
  background: var(--bg-soft);
}
.hp-yun--up .hp-yun-state { color: #4F7A5E; background: var(--matcha-soft); }
.hp-yun--down .hp-yun-state { color: #a8756a; background: var(--peach-soft); }
.hp-yun--good .hp-yun-state { color: #4F7A5E; background: var(--matcha-soft); }
.hp-yun--mixed .hp-yun-state { color: #9a7b3f; background: #f6efe1; }

.hp-yun-cols {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}
.hp-yun-col {
  flex: 1;
  background: var(--bg-soft);
  border-radius: 9px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hp-yun-k { font-size: 10px; color: var(--text-light); letter-spacing: 1px; }
.hp-yun-v {
  font-family: "STSong", "Songti SC", serif;
  font-size: 15px;
  color: var(--text);
  letter-spacing: 1px;
}
.hp-yun-x { font-size: 10.5px; color: var(--text-light); }
.hp-yun-read {
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.75;
}
.hp-yun-mark {
  margin-top: 8px;
  font-size: 11.5px;
  line-height: 1.7;
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--text-sub);
  background: var(--bg-soft);
}
.hp-yun-mark--good { color: #4F7A5E; background: var(--matcha-soft); }
.hp-yun-mark--warn { color: #a8756a; background: var(--peach-soft); }

/* 双方视角（按类目合并） */
.hp-cats { display: flex; flex-direction: column; }
.hp-cat { padding: 13px 0; border-bottom: 1px dashed var(--line); }
.hp-cat:first-child { padding-top: 2px; }
.hp-cat:last-child { border-bottom: 0; padding-bottom: 0; }
.hp-cat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary-deep);
  letter-spacing: .5px;
  margin-bottom: 9px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.hp-cat-label::before {
  content: '';
  width: 3px;
  height: 11px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), var(--primary));
}
.hp-cat-cells { display: flex; flex-direction: column; gap: 10px; }
.hp-cat-cells.is-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}
.hp-cat-cell {
  background: var(--bg-soft);
  border-radius: 10px;
  padding: 9px 10px;
}
.hp-cat-who {
  font-size: 10.5px;
  color: var(--text-light);
  letter-spacing: .5px;
  margin-bottom: 3px;
}
.hp-cat-val {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--primary-deep);
  margin-bottom: 4px;
}
.hp-cat-note {
  font-size: 11.5px;
  color: var(--text-sub);
  line-height: 1.72;
  word-break: break-word;
}
.hp-cat-text {
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.85;
}
.hp-cat-foot {
  margin-top: 9px;
  font-size: 11.5px;
  line-height: 1.75;
  color: var(--primary-deep);
  background: var(--primary-soft);
  border-radius: 8px;
  padding: 8px 10px;
}

.hp-actions { display: flex; gap: 10px; }
.hp-actions .btn { width: auto; flex: 1; font-size: 13.5px; padding: 12px; }

/* ==========================================================================
   App 内隐私政策覆盖层
   只在 Capacitor 壳里出现（入口按 isNative() 渲染），网页版无此元素。
   ========================================================================== */
.privacy-mask {
  position: fixed;
  inset: 0;
  /* 高于首次启动告知层（1000）：可从告知层直接打开隐私政策 */
  z-index: 1001;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

.privacy-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  /* 可点即退（桌面网页版没有触摸屏）；不放按钮，避免与「左右滑动返回」两条路打架 */
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.privacy-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

/* 只给一句提示，不做成按钮：pointer-events 关掉，点在它身上等于点在顶栏上 */
.privacy-hint {
  font-size: 11.5px;
  color: var(--text-light);
  pointer-events: none;
}

.privacy-frame {
  flex: 1 1 auto;
  width: 100%;
  border: 0;
  background: var(--card);
}

/* ==========================================================================
   App 首次启动：隐私与内容性质告知
   只在 Capacitor 壳内、且未同意过时出现（网页版不设阻断）。
   ========================================================================== */
.notice-mask {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  background: rgba(70, 66, 79, 0.42);
  backdrop-filter: blur(2px);
}

.notice-card {
  width: 100%;
  max-width: 340px;
  background: var(--card);
  border-radius: 18px;
  padding: 22px 20px 16px;
  box-shadow: 0 12px 40px rgba(122, 108, 150, 0.18);
}

.notice-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
  text-align: center;
}

.notice-body {
  font-size: 13px;
  line-height: 1.85;
  color: var(--text-sub);
  max-height: 46vh;
  overflow-y: auto;
}

.notice-body p { margin: 0 0 10px; }
.notice-body b { color: var(--text); font-weight: 600; }

.notice-link {
  color: var(--primary-deep);
  border-bottom: 1px solid currentColor;
}

.notice-foot {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.notice-btn {
  flex: 1;
  padding: 12px;
  border-radius: 12px;
  font-size: 14px;
  border: 0;
}

.notice-btn-ghost {
  background: var(--bg);
  color: var(--text-sub);
  border: 1px solid var(--line);
}

.notice-btn-primary {
  background: var(--primary);
  color: #fff;
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   版本受限页（update-gate.js）
   复用 .notice-mask / .notice-card 的容器样式，这里只补三件事：
   · 层级要压过首启告知（1000）但低于 .ui-layer（9999，toast/弹窗）；
   · 正文里的 <br> 换行要正常显示；
   · 拿不到下载地址时按钮置灰。
   这一页**故意不提供关闭按钮**——它是页面不是弹窗，用户可以点「退出应用」
   或按系统返回键离开（工信部 26 号文要求的是「弹窗可关闭」，不是「不许有
   受限页」；详见 docs/26）。
   -------------------------------------------------------------------------- */
.update-gate { z-index: 1100; }
.update-gate .notice-body b { display: inline; }
.notice-btn:disabled {
  cursor: default;
  opacity: 0.5;
}

/* ==========================================================================
   账号体系（2026-10-28）
   登录页 / 账号与安全 / 门禁卡 / 额度
   ========================================================================== */

.is-hidden { display: none !important; }

/* --------------------------------------------------------------------------
   门禁卡（未登录 / 次数用完）
   -------------------------------------------------------------------------- */
.gate-card {
  text-align: center;
  padding: 26px 18px 20px;
  margin-top: 12px;
}
.gate-icon {
  width: 54px; height: 54px; margin: 0 auto 12px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; color: var(--primary-deep);
  background: var(--primary-soft);
  box-shadow: 0 0 0 6px rgba(155, 140, 196, .08);
}
.gate-title { font-size: 15.5px; font-weight: 600; color: var(--text); letter-spacing: .3px; }
.gate-desc {
  font-size: 12.5px; color: var(--text-sub); line-height: 1.75;
  margin: 8px auto 0; max-width: 300px;
}
.gate-actions { margin-top: 18px; display: flex; flex-direction: column; gap: 9px; }
.gate-btn {
  padding: 12px; border-radius: 12px; font-size: 14px;
  color: var(--primary-deep); background: var(--bg-soft);
  border: 1px solid var(--line); cursor: pointer;
}
.gate-btn:active { transform: scale(.99); }
.gate-btn-main {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-deep) 100%);
  color: #fff; border: 0; font-weight: 500; letter-spacing: 1px;
  box-shadow: 0 6px 16px rgba(123, 107, 168, .22);
}
.gate-foot {
  margin-top: 14px; font-size: 11.5px; color: var(--text-light); line-height: 1.7;
}

.gate-inline {
  font-size: 12.5px; color: var(--text-sub); line-height: 1.9;
  padding: 14px 4px; text-align: center;
}
.gate-inline-btn {
  display: inline-block; margin-left: 8px; padding: 4px 12px;
  border-radius: 20px; font-size: 12px; color: var(--primary-deep);
  background: var(--primary-soft); cursor: pointer;
}

/* --------------------------------------------------------------------------
   登录页
   -------------------------------------------------------------------------- */
.login-page { padding-top: 8px; }

.login-hero { text-align: center; padding: 22px 0 18px; }
.login-mark {
  width: 56px; height: 56px; margin: 0 auto 12px;
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-deep) 100%);
  box-shadow: 0 10px 24px rgba(123, 107, 168, .26);
}
.login-title { font-size: 17px; font-weight: 600; color: var(--text); letter-spacing: 1px; }
.login-sub { font-size: 12px; color: var(--text-light); margin-top: 5px; }

.login-card {
  background: var(--card); border-radius: var(--radius);
  padding: 6px 16px 18px; box-shadow: var(--shadow);
}
.login-tabs {
  display: flex; gap: 6px; margin: 0 -4px 14px;
  border-bottom: 1px solid var(--line);
}
.login-tab {
  flex: 1; text-align: center; padding: 12px 4px 11px;
  font-size: 13.5px; color: var(--text-light); cursor: pointer;
  position: relative;
}
.login-tab.is-on { color: var(--primary-deep); font-weight: 600; }
.login-tab.is-on::after {
  content: ''; position: absolute; left: 50%; bottom: -1px;
  width: 28px; height: 2px; margin-left: -14px;
  border-radius: 2px; background: var(--primary);
}

.lf-row {
  display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid var(--line); padding: 5px 0;
}
.lf-prefix {
  font-size: 13.5px; color: var(--text-sub); flex: 0 0 auto;
  padding-right: 8px; border-right: 1px solid var(--line);
}
.lf-input {
  flex: 1 1 auto; min-width: 0;
  border: 0; outline: 0; background: transparent;
  font-size: 14.5px; color: var(--text);
  padding: 10px 0; font-family: inherit;
}
.lf-input::placeholder { color: var(--text-light); font-size: 13.5px; }
.lf-input--sm { font-size: 13.5px; padding: 5px 0; text-align: right; }
.lf-code {
  flex: 0 0 auto; border: 0; background: transparent;
  font-size: 12.5px; color: var(--primary-deep);
  padding: 8px 0 8px 10px; cursor: pointer; font-family: inherit;
}
.lf-code.is-off, .lf-code:disabled { color: var(--text-light); cursor: default; }

.lf-invite { padding: 9px 0 2px; }
.lf-invite-toggle { font-size: 12px; color: var(--text-light); cursor: pointer; }
.lf-invite-input { border-bottom: 1px solid var(--line); }

.lf-hint {
  font-size: 11.5px; color: var(--text-light);
  text-align: center; margin-top: 10px; line-height: 1.7;
}

.lf-agree {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 16px 6px 0;
}
.lf-checkbox {
  flex: 0 0 auto; width: 16px; height: 16px; margin-top: 1px;
  border-radius: 50%; border: 1.5px solid var(--text-light);
  cursor: pointer; position: relative; transition: all .15s;
}
.lf-checkbox.is-on {
  border-color: var(--primary); background: var(--primary);
}
.lf-checkbox.is-on::after {
  content: ''; position: absolute; left: 4.5px; top: 1.5px;
  width: 4px; height: 8px;
  border: solid #fff; border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}
.lf-agree-text { font-size: 11.5px; color: var(--text-sub); line-height: 1.7; }
.lf-agree-text a { color: var(--primary-deep); text-decoration: none; }

.login-foot {
  text-align: center; font-size: 11.5px; color: var(--text-light);
  padding: 20px 0 6px;
}

/* --------------------------------------------------------------------------
   账号与安全
   -------------------------------------------------------------------------- */
.acct-page { padding-top: 10px; }

.acct-head {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border-radius: var(--radius);
  padding: 14px; margin-bottom: 12px; box-shadow: var(--shadow);
}
.acct-avatar {
  position: relative;
  flex: 0 0 auto; width: 46px; height: 46px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-deep) 100%);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
/* 有自定义头像时贴图，字母不显示（图片由内联 style 给） */
.acct-avatar--img {
  background-size: cover;
  background-position: center;
  background-color: var(--line);
}
.acct-avatar-edit {
  position: absolute;
  right: -4px;
  bottom: -4px;
  font-size: 9px;
  line-height: 1;
  padding: 3px 4px;
  border-radius: 6px;
  color: #fff;
  background: rgba(70, 66, 79, 0.72);
}
.acct-head-body { flex: 1 1 auto; min-width: 0; }
.acct-name { font-size: 15px; font-weight: 600; color: var(--text); }
.acct-id { font-size: 11.5px; color: var(--text-light); margin-top: 2px; }
.acct-id b { color: var(--text-sub); font-weight: 500; letter-spacing: .3px; }
.acct-badge {
  flex: 0 0 auto; font-size: 11px; color: var(--primary-deep);
  background: var(--primary-soft); padding: 4px 9px; border-radius: 20px;
}

.acct-row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 0; border-bottom: 1px solid var(--line);
}
.acct-row:last-of-type { border-bottom: 0; }
.acct-k { flex: 0 0 62px; font-size: 13px; color: var(--text-sub); }
.acct-v { flex: 1 1 auto; min-width: 0; font-size: 13.5px; color: var(--text); }
.acct-v--input { display: flex; }
.acct-v--input .lf-input { text-align: left; }
.acct-tag {
  flex: 0 0 auto; font-size: 10.5px; color: var(--text-light);
  border: 1px solid var(--line); padding: 2px 6px; border-radius: 6px;
}
.acct-link {
  flex: 0 0 auto; font-size: 12.5px; color: var(--primary-deep);
  padding: 4px 2px 4px 8px; cursor: pointer;
}
.acct-hint {
  font-size: 11.5px; color: var(--text-light); line-height: 1.75;
  margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line);
}
.acct-act {
  text-align: center; padding: 12px; margin-top: 10px;
  border-radius: 11px; font-size: 13.5px;
  color: var(--text-sub); background: var(--bg-soft);
  border: 1px solid var(--line); cursor: pointer;
}
.acct-act:active { transform: scale(.995); }
.acct-act--danger { color: #b5675c; border-color: rgba(181, 103, 92, .25); background: rgba(249, 232, 227, .5); }
/* 退出登录 / 注销账号 并排（2026-10-30 用户要求）：
   两个都是「离开」类动作，放一行省一张卡，也避免注销被单独供在最底下看着像主操作。 */
.acct-btn-row { display: flex; gap: 10px; }
.acct-btn-row .acct-act { flex: 1 1 0; min-width: 0; }
/* 登录密码后面可能同时挂「修改」和「重置」，两者之间要留缝，否则点错 */
.acct-acts { display: flex; align-items: center; flex: 0 0 auto; }
.acct-v--dim { color: var(--text-light); font-size: 12px; }
.acct-row--last { border-bottom: 0; }
/* 「匿名使用统计」六个字在 62px 里会折成两行，单独放宽 */
.acct-k--wide { flex: 0 0 84px; }

.card-danger { border: 1px solid rgba(181, 103, 92, .16); }
.acct-danger-desc {
  font-size: 12px; color: var(--text-sub); line-height: 1.8; margin-top: 8px;
}
.acct-danger-desc b { color: #b5675c; }

/* --------------------------------------------------------------------------
   额度与邀请
   -------------------------------------------------------------------------- */
.q-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px;
}
.q-item {
  display: flex; align-items: center; justify-content: space-between;
  gap: 6px; padding: 9px 11px; border-radius: 10px;
  background: var(--primary-soft);
  border: 1px solid rgba(155, 140, 196, .14);
}
.q-name { font-size: 12.5px; color: var(--text); }
.q-val {
  font-size: 12.5px; font-weight: 600; color: var(--primary-deep);
  font-variant-numeric: tabular-nums;
}
.q-item.is-none { background: var(--bg-soft); border-color: var(--line); }
.q-item.is-none .q-val { color: var(--text-light); }
.q-item.is-locked { background: var(--bg-soft); border-color: var(--line); }
.q-item.is-locked .q-val { color: var(--text-light); }
.q-bonus {
  margin-top: 9px; font-size: 12px; color: var(--accent);
  background: var(--accent-soft); border-radius: 9px;
  padding: 7px 11px;
}
.q-bonus b { font-weight: 700; }

.stats-card {
  background: var(--card); border-radius: var(--radius);
  padding: 14px; margin-bottom: 12px; box-shadow: var(--shadow);
}
.qk-head { display: flex; align-items: baseline; justify-content: space-between; }
.qk-title { font-size: 13.5px; font-weight: 600; color: var(--text); }
.qk-sub { font-size: 11px; color: var(--text-light); }
.qk-invite {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-top: 11px; padding-top: 11px;
  border-top: 1px dashed var(--line);
}
.qk-invite-text { font-size: 11.5px; color: var(--text-light); line-height: 1.6; }
.qk-invite-btn {
  flex: 0 0 auto; font-size: 12px; color: var(--primary-deep);
  background: var(--primary-soft); padding: 5px 14px; border-radius: 20px;
  cursor: pointer;
}

.inv-box {
  margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line);
}
.inv-head { display: flex; align-items: baseline; justify-content: space-between; }
.inv-title { font-size: 13px; color: var(--text); font-weight: 500; }
.inv-sub { font-size: 11.5px; color: var(--text-light); }
.inv-row {
  display: flex; align-items: center; gap: 10px; margin-top: 9px;
  background: var(--bg-soft); border: 1px dashed var(--line);
  border-radius: 11px; padding: 10px 13px;
}
.inv-code {
  flex: 1 1 auto; font-size: 18px; font-weight: 600;
  letter-spacing: 4px; color: var(--primary-deep);
  font-family: ui-monospace, Menlo, monospace;
}
.inv-copy {
  flex: 0 0 auto; font-size: 12px; color: #fff;
  background: var(--primary); padding: 5px 13px; border-radius: 20px;
  cursor: pointer;
}
.inv-tip { font-size: 11.5px; color: var(--text-light); line-height: 1.7; margin-top: 8px; }
.inv-tip b { color: var(--primary-deep); }
.inv-tip--dim { color: var(--text-light); opacity: .85; }
.inv-redeem {
  display: flex; align-items: center; gap: 8px; margin-top: 10px;
  border-bottom: 1px solid var(--line); padding-bottom: 2px;
}
.inv-redeem .lf-input { text-align: left; }

/* --------------------------------------------------------------------------
   弹层（设置密码 / 注销）
   -------------------------------------------------------------------------- */
.dlg-mask {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(46, 40, 66, .42);
  display: flex; align-items: center; justify-content: center;
  padding: 22px;
  animation: dlgFade .16s ease-out;
}
@keyframes dlgFade { from { opacity: 0; } to { opacity: 1; } }

.dlg-card {
  width: 100%; max-width: 360px;
  background: var(--card); border-radius: 18px;
  padding: 20px 18px 16px;
  box-shadow: 0 20px 50px rgba(46, 40, 66, .3);
  animation: dlgRise .2s cubic-bezier(.2, .8, .3, 1);
  max-height: 86vh; overflow-y: auto;
}
@keyframes dlgRise { from { transform: translateY(14px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }

.dlg-title { font-size: 15.5px; font-weight: 600; color: var(--text); text-align: center; }
.dlg-tip {
  font-size: 12px; color: var(--text-sub); line-height: 1.85;
  margin: 9px 0 6px;
}
.dlg-card .lf-input {
  border-bottom: 1px solid var(--line); font-size: 14px;
}
.dlg-row { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); }
.dlg-row .lf-input { border-bottom: 0; }
/* 弹层里的独立输入行（原密码 / 新密码 / 再输一次）
   —— 必须显式 display:block + 下边框，否则它们会挤在同一行，
   用户看到的是一个「原密码 新密码 再输一次」连在一起的怪条（2026-10-30 第 10 条）。 */
.dlg-input {
  display: block; width: 100%;
  border-bottom: 1px solid var(--line);
}
.dlg-actions { display: flex; gap: 10px; margin-top: 18px; }
/* .btn 是 width:100% 的块级元素，直接塞进 flex 会把按钮行撑破，第二个按钮被挤出可视区，
   结果是「确定」按钮点不到。这里必须显式收回 flex-basis。 */
.dlg-actions .btn { flex: 1 1 0; width: auto; min-width: 0; }
.dlg-btn-danger {
  background: #c47a6d; color: #fff; border: 0; font-weight: 500;
}
.dlg-card--danger { border-top: 3px solid #c47a6d; }

/* ==========================================================================
   邀请码页（2026-10-29）
   上半是引流图，下半三个按钮。图是深墨底的海报，放在浅色页面里像相册里
   夹了一张图，刻意保留这个对比，不要给它套浅色底框。
   ========================================================================== */
.invite-page { padding-bottom: 28px; }

.promo-stage {
  display: flex;
  justify-content: center;
  padding: 12px 0 0;
}
/* 以高度定尺寸：手机屏窄，若按宽度铺满 100%，9:16 的图会有 660px 高，
   三个按钮就被挤到首屏之外了。56vh 是实测能同时露出三个按钮的上限。 */
.promo-canvas {
  height: 56vh;
  width: auto;
  max-width: 100%;
  display: block;
  border-radius: 14px;
  background: #14110d;
  box-shadow: 0 10px 30px rgba(26, 23, 18, .26);
}

.promo-tabs {
  display: flex;
  justify-content: center;
  gap: 7px;
  flex-wrap: wrap;
  margin: 12px 0 14px;
}
.promo-tab {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--text-sub);
  background: var(--card);
  border: 1px solid var(--line);
  transition: all .16s ease;
}
.promo-tab.is-on {
  color: #fff;
  background: #1a1712;
  border-color: #1a1712;
}

.inv-acts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin: 0 0 14px;
}
.inv-act {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 13px 4px 11px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  font-family: inherit;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .16s ease;
}
.inv-act:active { transform: scale(.975); box-shadow: none; }
.inv-act.is-busy { opacity: .55; pointer-events: none; }
.inv-act-ico {
  font-size: 17px;
  line-height: 1;
  color: var(--accent);
}
.inv-act-txt { font-size: 12px; color: var(--text); }

.inv-stats {
  text-align: center;
  font-size: 12px;
  color: var(--text-sub);
  margin: 0 0 16px;
}
.inv-stats b { color: var(--primary-deep); font-weight: 600; }

.inv-rules {
  background: var(--card);
  border-radius: var(--radius);
  padding: 15px 16px 6px;
  box-shadow: var(--shadow);
}
.inv-rule-h {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
}
.inv-rule {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.inv-rule:first-of-type { border-top: 0; }
.inv-rule-k {
  flex: 0 0 56px;
  font-size: 11.5px;
  color: var(--text-light);
  padding-top: 1px;
}
.inv-rule-v {
  flex: 1 1 auto;
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.7;
}
/* 中文可在任意汉字处断行，「1 把钥匙」很容易被拆成「1 把钥 / 匙」。
   额度单位是产品口径，拆开读着别扭，所以加粗的那一小段整体不让断。 */
.inv-rule-v b { color: var(--primary-deep); font-weight: 600; white-space: nowrap; }
/* 功能名单独占一行，避免和「各免费 1 把钥匙」挤在同一行尾被拆开 */
.inv-rule-list { display: block; }

/* 弹层里的大号邀请码 */
.inv-code-big {
  margin: 14px 0 4px;
  text-align: center;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: .2em;
  text-indent: .2em;      /* 抵消最后一个字的字距，视觉上才是真居中 */
  color: var(--primary-deep);
  font-variant-numeric: tabular-nums;
}

/* 填写邀请码的输入框：居中、大字、拉开字距，6 位一眼看清 */
.dlg-card .inv-input {
  text-align: center;
  font-size: 22px;
  letter-spacing: .22em;
  text-indent: .22em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
  padding: 12px 0 10px;
}

.dlg-err {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.6;
  color: #c0564a;
  background: rgba(196, 86, 74, .08);
  border-radius: 9px;
  padding: 8px 11px;
}
.dlg-err.is-hidden { display: none; }

/* 「我的」页功能菜单（邀请码入口）。做成一整块卡而不是加进 .foot-actions，
   因为底部那列是杂项（关于/协议/清空），功能入口混进去会被忽略。 */
.act-menu {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 14px;
  overflow: hidden;
}
.am-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 15px;
  cursor: pointer;
}
.am-item:active { background: var(--bg-soft); }
.am-ico {
  width: 20px;
  text-align: center;
  font-size: 15px;
  color: var(--accent);
}
.am-body { flex: 1 1 auto; min-width: 0; }
.am-title { font-size: 13.5px; color: var(--text); }
.am-sub {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 3px;
  line-height: 1.5;
}
.am-arrow {
  flex: 0 0 auto;
  font-size: 18px;
  line-height: 1;
  color: var(--text-light);
}

/* ==========================================================================
   钥匙与购买（2026-10-29）
   配色走金色系，和紫色主色区分开：钥匙是「花钱的东西」，不该和导航、按钮
   混成一个色，否则用户扫一眼分不清哪块是功能、哪块是账。
   ========================================================================== */

/* ---- 我的页：头像下方的钥匙条 ---- */
.uc-keys {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 7px 10px;
  border-radius: 10px;
  background: linear-gradient(135deg, #fdf6e7, #f8eed8);
  border: 1px solid #f0e2c4;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.uc-keys:active { transform: scale(0.99); }
.uck-ico { font-size: 11px; color: #c9a227; }
.uck-num { font-size: 16px; font-weight: 700; color: #a9821f; font-family: var(--font-num, inherit); line-height: 1; }
.uck-unit { font-size: 11.5px; color: #a9946f; }
.uck-buy {
  margin-left: auto;
  font-size: 11.5px;
  color: #b8912e;
  font-weight: 600;
}
.uc-keys.is-guest { background: #f7f5f1; border-color: var(--line); }
.uc-keys.is-guest .uck-ico { color: var(--text-light); }
.uc-keys.is-guest .uck-unit { color: var(--text-sub); }
.uc-keys.is-guest .uck-buy { color: var(--primary-deep); }

/* ---- 购买页 ---- */
.buy-page { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }

.key-wallet {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  /* 顶到导航栏底下会显得被「切」了一下；与 .page > .card:first-child 的 12px 对齐 */
  margin-top: 12px;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #fdf7e9 0%, #f7ecd4 100%);
  border: 1px solid #f0e0bd;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}
.kw-label { font-size: 11.5px; color: #a9946f; letter-spacing: 0.5px; }
.kw-num { display: flex; align-items: baseline; gap: 3px; margin-top: 3px; }
.kw-num b { font-size: 30px; font-weight: 700; color: #a9821f; line-height: 1; }
.kw-num span { font-size: 12px; color: #a9946f; }
.kw-right { text-align: right; font-size: 11.5px; color: #a9946f; line-height: 1.6; }
.kw-sub { color: #bda98a; }

.buy-cont {
  font-size: 12px;
  color: #a9821f;
  background: #fdf6e7;
  border: 1px dashed #ecd9ae;
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: 12px;
  text-align: center;
}

/* 套餐：2 × 2 */
.pkg-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.pkg-card {
  position: relative;
  padding: 14px 12px 12px;
  border-radius: 12px;
  background: var(--card);
  border: 1.5px solid var(--line);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.pkg-card.is-on {
  border-color: #d9b45c;
  background: linear-gradient(160deg, #fffdf8, #fdf4e2);
  box-shadow: 0 2px 10px rgba(201, 162, 39, 0.12);
}
.pkg-tag {
  position: absolute;
  top: -1px;
  right: -1px;
  font-size: 10px;
  color: #fff;
  background: linear-gradient(135deg, #d9b45c, #c9a227);
  padding: 2px 7px;
  border-radius: 0 11px 0 10px;
  line-height: 1.5;
}
.pkg-keys { display: flex; align-items: baseline; justify-content: center; gap: 2px; }
.pkg-keys b { font-size: 24px; font-weight: 700; color: var(--text); line-height: 1.1; }
.pkg-keys span { font-size: 11px; color: var(--text-sub); }
.pkg-price { font-size: 15px; font-weight: 600; color: #a9821f; margin-top: 4px; }
.pkg-unit { font-size: 10.5px; color: var(--text-light); margin-top: 1px; }

/* 支付方式 */
.pay-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.pay-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--card);
  border: 1.5px solid var(--line);
  cursor: pointer;
}
.pay-item.is-on { border-color: #d9b45c; background: #fffdf8; }
.pay-item.is-off { opacity: 0.6; cursor: default; }
.pay-ico {
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  background: var(--bg);
  font-size: 12px;
  color: var(--text-sub);
  flex: 0 0 auto;
}
.pay-item.is-on .pay-ico { background: #fdf3de; color: #a9821f; }
.pay-name { font-size: 13.5px; color: var(--text); }
.pay-on { margin-left: auto; color: #c9a227; font-size: 14px; }

.buy-btn {
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #d9b45c, #c19a2c);
  box-shadow: 0 4px 14px rgba(201, 162, 39, 0.28);
  cursor: pointer;
  font-family: inherit;
  margin-bottom: 10px;
}
.buy-btn:active { transform: translateY(1px); box-shadow: 0 2px 8px rgba(201, 162, 39, 0.24); }
.buy-btn.is-off {
  background: #e8e5df;
  color: var(--text-light);
  box-shadow: none;
  cursor: default;
}
.buy-tip {
  font-size: 11.5px;
  color: var(--text-sub);
  text-align: center;
  line-height: 1.7;
  margin-bottom: 14px;
}
.buy-retry {
  text-align: center;
  font-size: 13px;
  color: var(--primary-deep);
  padding: 10px;
  cursor: pointer;
}

/* 兑换说明 */
.unit-list { display: flex; flex-direction: column; }
.unit-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.unit-row:last-child { border-bottom: 0; }
.unit-ico {
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 7px;
  background: var(--primary-soft);
  color: var(--primary-deep);
  font-size: 11px;
  flex: 0 0 auto;
}
.unit-name { font-size: 13px; color: var(--text); }
.unit-worth { margin-left: auto; font-size: 12px; color: #a9821f; font-weight: 500; }

.buy-terms {
  font-size: 11.5px;
  color: var(--text-sub);
  line-height: 1.9;
}

/* ---- 今日运势：朦胧玻璃 ---- */
.glass-veil {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  top: var(--nav-h);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 26px;
  background: rgba(247, 245, 241, 0.42);
  backdrop-filter: blur(13px) saturate(140%);
  -webkit-backdrop-filter: blur(13px) saturate(140%);
  animation: veil-in 0.22s ease-out;
}
@keyframes veil-in { from { opacity: 0; } to { opacity: 1; } }
.veil-card {
  width: 100%;
  max-width: 300px;
  padding: 22px 20px 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(240, 226, 196, 0.9);
  box-shadow: 0 12px 40px rgba(122, 108, 150, 0.18);
  text-align: center;
}
.veil-ico {
  font-size: 20px;
  color: #c9a227;
  margin-bottom: 8px;
}
.veil-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.5;
}
.veil-desc {
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.7;
  margin-top: 6px;
}
.veil-actions { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.veil-btn {
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  font-size: 14px;
  color: var(--text-sub);
  background: var(--bg);
  cursor: pointer;
}
.veil-btn-main {
  color: #fff;
  font-weight: 600;
  background: linear-gradient(135deg, #d9b45c, #c19a2c);
  box-shadow: 0 3px 12px rgba(201, 162, 39, 0.26);
}

/* 付费前的骨架占位（今日运势玻璃层背后用） */
.sk-report { padding: 6px 0 8px; }
.sk-line {
  height: 11px;
  border-radius: 6px;
  background: #eceaf0;
  margin-bottom: 11px;
}
