/* 六爻占卜 H5 样式 —— 参考热卜排盘布局 */

:root {
  --bg: #f2ede3;
  --paper: #fffdf8;
  --ink: #2e2620;
  --ink-light: #5c5147;
  --red: #b5342b;
  --red-soft: #d4665c;
  --gold: #9c7a3c;
  --gold-light: #c9a961;
  --gray: #8b7f70;
  --line: #ddd3c0;
  --line-dark: #c4b79e;
  --teal: #1f9e8f;
  --shadow: rgba(90, 70, 40, 0.09);
  --shadow-deep: rgba(90, 70, 40, 0.16);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  min-height: 100%;
  background: var(--bg);
  background-image:
    radial-gradient(circle at 20% 10%, rgba(201, 169, 97, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(181, 52, 43, 0.05) 0%, transparent 40%);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}

.app {
  max-width: 480px;
  margin: 0 auto;
  padding: 12px;
  padding-bottom: 60px;
}

/* ===== 头部 ===== */
header {
  text-align: center;
  padding: 22px 0 14px;
  position: relative;
}

header h1 {
  font-size: 1.65rem;
  color: var(--ink);
  letter-spacing: 6px;
  font-weight: 700;
  text-indent: 6px;
}

header h1::after {
  content: "";
  display: block;
  width: 48px;
  height: 2px;
  margin: 10px auto 0;
  background: linear-gradient(90deg, transparent, var(--gold-light), transparent);
}

header p {
  color: var(--gray);
  font-size: 0.78rem;
  margin-top: 8px;
  letter-spacing: 1px;
}

/* ===== 登录入口（文件头右上角） ===== */
.user-bar {
  position: absolute;
  top: 6px;
  right: 0;
  z-index: 10;
}
.user-btn {
  border: 1px solid var(--gold-light, #c9a86a);
  background: transparent;
  color: var(--gold, #a8844b);
  font-size: 0.72rem;
  padding: 4px 12px;
  border-radius: 14px;
  cursor: pointer;
  letter-spacing: 1px;
  transition: all 0.2s;
}
.user-btn:hover {
  background: var(--gold-light, #c9a86a);
  color: #fff;
}
.user-btn.is-login {
  color: var(--ink, #3a3a3a);
  border-color: var(--gray, #999);
}

/* ===== 版本徽章（绝对定位，不占文档流，避免推挤内容） ===== */
.version-badge {
  position: absolute;
  right: 0;
  bottom: -2px;
  font-size: 0.6rem;
  color: var(--gray, #999);
  letter-spacing: 1px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  padding: 1px 8px;
  opacity: 0.75;
}

/* ===== 标签页 ===== */
.tabs {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 14px 0 18px;
  background: rgba(255, 253, 248, 0.7);
  padding: 5px;
  border-radius: 26px;
  border: 1px solid var(--line);
}

.tab-btn {
  flex: 1;
  padding: 9px 4px;
  border: none;
  background: transparent;
  color: var(--gray);
  border-radius: 22px;
  font-size: 0.86rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
}

.tab-btn.active {
  background: linear-gradient(145deg, #b5342b, #8f2820);
  color: #fff;
  box-shadow: 0 3px 10px rgba(181, 52, 43, 0.3);
}

.panel {
  display: none;
}

.panel.active {
  display: block;
  animation: fadeUp 0.3s ease;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== 卡片 ===== */
.card {
  background: var(--paper);
  border-radius: 14px;
  padding: 18px 16px;
  margin-bottom: 14px;
  box-shadow: 0 2px 8px var(--shadow), 0 1px 2px rgba(0,0,0,0.02);
  border: 1px solid rgba(221, 211, 192, 0.6);
}

.card-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  letter-spacing: 0.5px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.card-title::before {
  content: "";
  width: 3px;
  height: 15px;
  background: linear-gradient(180deg, var(--red), var(--gold));
  border-radius: 2px;
}

/* ===== 铜钱动画 ===== */
.coin-stage {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 26px;
  height: 130px;
  perspective: 900px;
  margin: 18px 0;
}

.coin {
  width: 74px;
  height: 74px;
  position: relative;
  transform-style: preserve-3d;
  border-radius: 50%;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.coin.spinning {
  animation: coinToss 0.36s linear infinite;
}

.coin.front { transform: rotateY(0deg); }
.coin.back { transform: rotateY(180deg); }

.coin-face {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.coin-face svg {
  width: 100%;
  height: 100%;
  display: block;
}

.coin-face.coin-back {
  transform: rotateY(180deg);
}

/* 抛掷感：快速翻转 + 上下弹跳 + 轻微侧摆，落定前有「颠簸」的实物感 */
@keyframes coinToss {
  0%   { transform: translateY(0)    rotateY(0deg)   rotateX(0deg); }
  25%  { transform: translateY(-16px) rotateY(180deg) rotateX(9deg); }
  50%  { transform: translateY(0)    rotateY(360deg) rotateX(0deg); }
  75%  { transform: translateY(-9px) rotateY(540deg) rotateX(-7deg); }
  100% { transform: translateY(0)    rotateY(720deg) rotateX(0deg); }
}

.action-bar {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 16px 0 0;
}

.btn {
  min-width: 118px;
  padding: 13px 24px;
  border: none;
  border-radius: 26px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s, opacity 0.2s, box-shadow 0.2s;
  font-family: inherit;
  letter-spacing: 1px;
}

.btn:active { transform: scale(0.96); }

.btn-primary {
  background: linear-gradient(145deg, #c0392b, #96271d);
  color: #fff;
  box-shadow: 0 4px 12px rgba(181, 52, 43, 0.32);
}

.btn-primary:disabled {
  opacity: 0.42;
  box-shadow: none;
}

.btn-secondary {
  background: linear-gradient(145deg, #4a4038, #2e2620);
  color: #f5efe2;
  box-shadow: 0 4px 12px rgba(46, 38, 32, 0.26);
}

.btn-secondary:disabled {
  opacity: 0.42;
  box-shadow: none;
}

.round-info {
  text-align: center;
  color: var(--ink-light);
  font-size: 0.85rem;
  margin-top: 14px;
  min-height: 22px;
  line-height: 1.5;
}

.round-info b {
  color: var(--red);
  font-size: 0.95rem;
}

.round-progress {
  text-align: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--red);
  margin-top: 8px;
  letter-spacing: 1px;
}

/* ===== 逐爻实时显示 ===== */
.live-panel {
  margin: 16px 0 4px;
  border: 1px solid var(--line-dark);
  border-radius: 10px;
  overflow: hidden;
  background: #fffefb;
}

.live-title {
  font-size: 0.74rem;
  color: var(--gold);
  background: linear-gradient(180deg, #faf6ec, #f3ecdc);
  padding: 7px 12px;
  border-bottom: 1px solid var(--line);
  letter-spacing: 1.5px;
  font-weight: 700;
}

.live-yaos {
  padding: 4px 0;
}

.live-yao {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 12px;
  min-height: 32px;
}

.live-yao + .live-yao {
  border-top: 1px dashed rgba(221, 211, 192, 0.7);
}

.live-yao-name {
  flex: 0 0 34px;
  font-size: 0.72rem;
  color: var(--gray);
  letter-spacing: 1px;
}

.live-yao-gua {
  flex: 0 0 68px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 14px;
}

.live-yao-gua.pop {
  animation: popIn 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
  0% { transform: scale(0.4); opacity: 0; }
  70% { transform: scale(1.12); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.live-empty {
  color: var(--line-dark);
  font-size: 0.9rem;
  line-height: 1;
}

.live-line-yang {
  display: block;
  width: 62px;
  height: 8px;
  background: linear-gradient(180deg, #3e342a, #1f1913);
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.live-line-yin {
  display: flex;
  justify-content: space-between;
  gap: 9px;
  width: 62px;
}

.live-line-yin span {
  flex: 1 1 0;
  height: 8px;
  background: linear-gradient(180deg, #3e342a, #1f1913);
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.live-yao-tag {
  flex: 1;
  font-size: 0.72rem;
  color: var(--gray);
  text-align: right;
  letter-spacing: 0.3px;
}

.live-yao-tag.is-dong {
  color: var(--red);
  font-weight: 700;
}

/* 自动摇卦按钮 */
.btn-auto {
  min-width: 190px;
  background: linear-gradient(145deg, #c9a961, #a8873c);
  color: #fff;
  box-shadow: 0 4px 12px rgba(168, 135, 60, 0.32);
  letter-spacing: 1.5px;
}

.btn-auto:disabled {
  opacity: 0.5;
  box-shadow: none;
}

/* ===== 手动输入 ===== */
.manual-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 14px 0;
}

.yao-input label {
  display: block;
  font-size: 0.74rem;
  color: var(--gray);
  margin-bottom: 5px;
  text-align: center;
  font-weight: 500;
}

.yao-select {
  width: 100%;
  padding: 11px 6px;
  border: 1px solid var(--line-dark);
  border-radius: 9px;
  background: #fffefb;
  font-size: 0.85rem;
  text-align: center;
  font-family: inherit;
  color: var(--ink);
  appearance: none;
  transition: border-color 0.2s;
}

.yao-select:focus {
  outline: none;
  border-color: var(--red-soft);
}

/* ===== 排盘：信息栏 ===== */
.pan-info {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line-dark);
  margin-bottom: 16px;
  background: #fffefb;
}

.pan-info-row {
  display: flex;
  border-bottom: 1px solid var(--line);
  min-height: 40px;
}

.pan-info-row:last-child { border-bottom: none; }

.pan-info-label {
  flex: 0 0 58px;
  background: linear-gradient(180deg, #faf6ec, #f3ecdc);
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--line);
  letter-spacing: 2px;
  writing-mode: horizontal-tb;
}

.pan-info-value {
  flex: 1;
  padding: 9px 12px;
  font-size: 0.8rem;
  color: var(--ink-light);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 10px;
  line-height: 1.5;
}

.pan-info-value .hl {
  color: var(--red);
  font-weight: 600;
}

.pan-info-value .dim {
  color: var(--gray);
  font-size: 0.76rem;
}

/* ===== 排盘：主盘 ===== */
.pan-main {
  border: 1px solid var(--line-dark);
  border-radius: 10px;
  overflow: hidden;
  background: #fffefb;
}

.pan-head {
  display: grid;
  grid-template-columns: 38px 1fr 1fr;
  background: linear-gradient(180deg, #faf6ec, #f3ecdc);
  border-bottom: 1px solid var(--line-dark);
}

.pan-head-cell {
  padding: 10px 6px;
  text-align: center;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 1px;
}

.pan-head-cell:first-child {
  border-right: 1px solid var(--line-dark);
}

.pan-head-cell .gong {
  font-size: 0.72rem;
  color: var(--gold);
  font-weight: 500;
  margin-left: 3px;
}

/* 爻行：本卦 | 变卦 */
.yao-line {
  display: grid;
  grid-template-columns: 38px 1fr 1fr;
  border-bottom: 1px solid var(--line);
  position: relative;
  min-height: 46px;
}

.yao-line:last-child { border-bottom: none; }

.yao-line.yao-dong {
  background: linear-gradient(90deg, rgba(181, 52, 43, 0.06), rgba(181, 52, 43, 0.02) 48%, rgba(181, 52, 43, 0.06));
}

.yao-half {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 6px 9px 8px;
  font-size: 0.75rem;
  position: relative;
  min-width: 0;
}

.yao-half.right {
  border-left: 1px solid var(--line);
  padding-left: 10px;
  justify-content: flex-start;
}

/* 六神 */
.yao-shen {
  flex: 0 0 25px;
  color: var(--red);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0;
}

/* 六亲 + 纳甲 */
.yao-ganzhi {
  flex: 0 0 auto;
  color: var(--ink-light);
  font-size: 0.72rem;
  line-height: 1.2;
  white-space: nowrap;
  font-family: "Songti SC", "SimSun", serif;
  letter-spacing: 0.2px;
}

/* 变卦栏的六亲纳甲（仅动爻显示），靠右留白 */
.yao-ganzhi.bian {
  width: 44px;
  text-align: left;
  color: var(--red);
}
.yao-ganzhi.bian .liuqin { display: block; }

.yao-ganzhi .liuqin {
  color: var(--gold);
  font-weight: 600;
}

.yao-ganzhi.dim-empty {
  color: var(--line-dark);
}

/* 卦画 */
.yao-gua-wrap {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 0 2px;
}

.yao-gua {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
}

.gua-line-yang {
  height: 9px;
  width: 100%;
  max-width: 58px;
  background: linear-gradient(180deg, #3e342a, #1f1913);
  border-radius: 2px;
  box-shadow: 0 1.5px 3px rgba(0,0,0,0.22);
}

.gua-line-yin-pair {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  max-width: 58px;
}

.gua-line-yin-pair span {
  flex: 1 1 0;
  min-width: 0;
  height: 9px;
  background: linear-gradient(180deg, #3e342a, #1f1913);
  border-radius: 2px;
  box-shadow: 0 1.5px 3px rgba(0,0,0,0.22);
}

/* 动爻标记 */
.dong-tag {
  flex: 0 0 auto;
  color: var(--red);
  font-weight: 800;
  font-size: 0.86rem;
  margin: 0 1px;
  animation: dongPulse 1.8s ease-in-out infinite;
}

@keyframes dongPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

/* 世应标签 */
.shi-ying {
  flex: 0 0 auto;
  font-size: 0.62rem;
  font-weight: 700;
  color: #fff;
  background: var(--red);
  border-radius: 3px;
  padding: 1px 4px;
  line-height: 1.35;
  letter-spacing: 0;
}

.shi-ying.ying {
  background: var(--gold);
}

/* 伏神 */
.fu-shen-tag {
  display: block;
  font-size: 0.66rem;
  color: var(--gray);
  padding: 2px 8px 4px;
  border-bottom: 1px dashed var(--line);
  background: rgba(240, 235, 222, 0.5);
}

.fu-shen-tag b {
  color: var(--gold);
  font-weight: 600;
}

/* 底部标签 */
.pan-foot {
  display: grid;
  grid-template-columns: 38px 1fr 1fr;
  background: linear-gradient(180deg, #faf6ec, #f3ecdc);
  border-top: 1px solid var(--line-dark);
}

.pan-foot-cell {
  padding: 8px;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 2px;
}

.pan-foot-cell:first-child {
  border-right: 1px solid var(--line-dark);
}

/* ===== 卦辞 ===== */
.guaci-block {
  margin-bottom: 16px;
}

.guaci-block:last-child { margin-bottom: 0; }

.guaci-label {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(145deg, var(--gold-light), var(--gold));
  padding: 2px 10px;
  border-radius: 4px;
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.guaci-text {
  font-size: 0.87rem;
  line-height: 1.85;
  color: var(--ink-light);
  white-space: pre-wrap;
  padding-left: 10px;
  border-left: 2px solid var(--line);
}

.guaci-yao {
  font-size: 0.85rem;
  line-height: 1.8;
  color: var(--ink-light);
  padding: 7px 10px;
  border-radius: 6px;
  margin-bottom: 5px;
  background: #fbf8f1;
  border-left: 2px solid var(--line);
  transition: all 0.2s;
}

.guaci-yao.is-dong {
  background: linear-gradient(90deg, rgba(181, 52, 43, 0.09), rgba(181, 52, 43, 0.02));
  border-left: 3px solid var(--red);
  color: var(--ink);
  font-weight: 500;
}

.guaci-yao .mark {
  display: inline-block;
  font-size: 0.7rem;
  color: #fff;
  background: var(--red);
  border-radius: 3px;
  padding: 0 5px;
  margin-right: 6px;
  vertical-align: 1px;
}

/* 爻辞折叠按钮 */
.yao-toggle {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 9px;
  border: 1px dashed var(--line-dark);
  border-radius: 7px;
  background: #fbf8f1;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
  letter-spacing: 0.5px;
}

.yao-toggle:active {
  background: #f3ecdc;
}

.yaoci-rest {
  margin-top: 6px;
  animation: fadeUp 0.25s ease;
}

/* ===== AI 解卦 ===== */
.question-input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line-dark);
  border-radius: 10px;
  font-size: 0.88rem;
  margin-bottom: 12px;
  resize: vertical;
  min-height: 68px;
  font-family: inherit;
  background: #fffefb;
  color: var(--ink);
  transition: border-color 0.2s;
}

.question-input:focus {
  outline: none;
  border-color: var(--red-soft);
}

.ai-loading {
  text-align: center;
  color: var(--gray);
  padding: 24px;
  font-size: 0.88rem;
}

.ai-loading::before {
  content: "";
  display: block;
  width: 24px;
  height: 24px;
  margin: 0 auto 10px;
  border: 2px solid var(--line-dark);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.ai-content {
  font-size: 0.89rem;
  line-height: 1.9;
  color: var(--ink-light);
}

.ai-content h2,
.ai-content h3,
.ai-content h4 {
  color: var(--ink);
  font-size: 0.95rem;
  margin: 14px 0 8px;
  padding-left: 9px;
  border-left: 3px solid var(--gold);
}

.ai-content p { margin-bottom: 9px; }

.ai-content strong {
  color: var(--red);
  font-weight: 600;
}

.ai-content li {
  margin-left: 18px;
  margin-bottom: 4px;
}

/* ===== 响应式 ===== */
@media (max-width: 360px) {
  .coin { width: 62px; height: 62px; }
  .coin-stage { gap: 16px; }
  .coin-face { font-size: 1.25rem; }
  .yao-ganzhi { min-width: 54px; font-size: 0.7rem; }
  .yao-shen { flex-basis: 23px; font-size: 0.7rem; }
  .app { padding: 8px; }
  .card { padding: 14px 12px; }
  .pan-info-label { flex-basis: 50px; font-size: 0.74rem; }
}


/* ===== 窄屏（<380px）压缩六爻盘 ===== */
@media (max-width: 380px) {
  .yao-shen { flex: 0 0 20px; font-size: 0.66rem; }
  .yao-ganzhi { width: 34px; font-size: 0.66rem; }
  .yao-ganzhi.bian { width: 38px; }
  .gua-line-yang, .gua-line-yin-pair { max-width: 46px; }
  .live-line-yang, .live-line-yin { width: 52px; }
  .coin { width: 64px; height: 64px; }
  .coin-stage { gap: 18px; height: 112px; }
}

/* ============================================================
   底部固定导航 / 页面路由
   ============================================================ */
.page { display: none; }
.page.active { display: block; }

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  display: flex;
  background: rgba(255, 253, 248, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -3px 14px var(--shadow);
  z-index: 90;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.nav-item {
  flex: 1;
  border: none;
  background: transparent;
  padding: 7px 0 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  color: var(--gray);
  font-family: inherit;
  transition: color .18s, transform .18s;
}
.nav-item .nav-icon { font-size: 1.28rem; line-height: 1; }
.nav-item .nav-label { font-size: 0.7rem; letter-spacing: .5px; }
.nav-item.active { color: var(--red); }
.nav-item.active .nav-icon { transform: translateY(-1px) scale(1.06); }
.nav-item:active { transform: scale(.96); }

/* 给底部导航留出空间 */
.app { padding-bottom: 84px; }

/* ============================================================
   八字排盘 / 解析
   ============================================================ */
.bz-field { margin-bottom: 14px; }
.bz-label {
  display: block;
  font-size: 0.8rem;
  color: var(--ink-light);
  margin-bottom: 6px;
  font-weight: 600;
}
.bz-hint { color: var(--teal); font-weight: 400; font-size: 0.72rem; margin-left: 6px; }

.bz-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
  color: var(--ink);
  font-size: 0.92rem;
  font-family: inherit;
  outline: none;
  transition: border-color .18s;
  min-height: 42px;
  -webkit-appearance: none;
  appearance: none;
}
.bz-input:focus { border-color: var(--gold-light); }
select.bz-input {
  background-image: linear-gradient(45deg, transparent 50%, var(--gray) 50%),
                    linear-gradient(135deg, var(--gray) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 30px;
}
.bz-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.bz-radio-row { display: flex; gap: 18px; }
.bz-radio {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.9rem; cursor: pointer; color: var(--ink-light);
}
.bz-radio input { accent-color: var(--red); width: 16px; height: 16px; }

.bz-switch {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.84rem; color: var(--ink-light); cursor: pointer;
}
.bz-switch input { accent-color: var(--red); width: 16px; height: 16px; flex: none; }

.bz-note {
  font-size: 0.72rem;
  color: var(--gray);
  line-height: 1.5;
  margin-top: 5px;
}
.bz-echo {
  margin-top: 10px;
  padding: 8px 11px;
  background: rgba(156, 122, 60, 0.07);
  border-left: 3px solid var(--gold-light);
  border-radius: 5px;
  font-size: 0.78rem;
  color: var(--ink-light);
  min-height: 33px;
}

/* ---- 模式切换 ---- */
.bz-tabs {
  display: flex;
  gap: 6px;
  margin: 14px 0 10px;
  background: rgba(221, 211, 192, 0.4);
  padding: 4px;
  border-radius: 10px;
}
.bz-tab-btn {
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px 0;
  border-radius: 7px;
  font-size: 0.85rem;
  font-family: inherit;
  color: var(--ink-light);
  cursor: pointer;
  transition: all .18s;
}
.bz-tab-btn.active {
  background: var(--paper);
  color: var(--red);
  font-weight: 600;
  box-shadow: 0 1px 4px var(--shadow);
}

/* ---- 五行配色 ---- */
.wx-mu   { color: #2f7d4f; }
.wx-huo  { color: #c0392b; }
.wx-tu   { color: #a1781f; }
.wx-jin  { color: #b8860b; }
.wx-shui { color: #1f6f9e; }

.bz-legend {
  display: flex; gap: 14px; justify-content: center;
  margin-top: 10px; font-size: 0.8rem; font-weight: 600;
}

/* ---- 基本信息 ---- */
.bz-info-grid { font-size: 0.84rem; }
.bz-info-row {
  display: flex;
  padding: 5px 0;
  border-bottom: 1px dashed rgba(221, 211, 192, 0.7);
}
.bz-info-row:last-child { border-bottom: none; }
.bz-info-k {
  flex: none; width: 76px; color: var(--gray); font-size: 0.78rem;
}
.bz-info-v { flex: 1; color: var(--ink); }

/* ---- 四柱表 ---- */
.bz-pan-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.bz-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  min-width: 320px;
}
.bz-table th {
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--ink-light);
  padding: 6px 4px;
  border-bottom: 1.5px solid var(--line-dark);
}
.bz-table td {
  text-align: center;
  padding: 5px 3px;
  border-bottom: 1px solid rgba(221, 211, 192, 0.55);
}
.bz-table tbody td:first-child,
.bz-table thead th:first-child {
  width: 46px;
  font-size: 0.72rem;
  color: var(--gray);
  text-align: left;
  padding-left: 2px;
  background: rgba(242, 237, 227, 0.5);
}
.bz-r-gan td, .bz-r-zhi td { padding: 7px 3px; }
.bz-big {
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 1px;
}
.bz-small { font-size: 0.72rem; color: var(--ink-light); line-height: 1.4; }
.bz-r-shishen em { font-style: normal; color: var(--red); font-weight: 600; }
.bz-cg { display: inline-flex; flex-direction: column; align-items: center; margin: 0 1px; font-size: 0.86rem; line-height: 1.15; }
.bz-cg i { font-style: normal; font-size: 0.6rem; color: var(--gray); }
.bz-ss { line-height: 1.45; }
.bz-desc { font-size: 0.82rem; color: var(--ink-light); line-height: 1.65; }

.bz-table-sm { min-width: 260px; }
.bz-table-sm .bz-big { font-size: 1.2rem; }

.bz-sub-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: .6px;
  margin: 16px 0 8px;
  padding-left: 8px;
  border-left: 3px solid var(--gold-light);
}
.bz-block {
  background: rgba(255, 253, 248, 0.75);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 12px;
  font-size: 0.84rem;
  margin-bottom: 4px;
}
.bz-block p { margin-bottom: 4px; }
.bz-block p:last-child { margin-bottom: 0; }
.bz-dy-head { background: rgba(156, 122, 60, 0.06); }

/* ---- 旺相休囚死 ---- */
.bz-ws-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.bz-ws-cell {
  border-radius: 8px;
  padding: 7px 3px;
  text-align: center;
  background: rgba(255, 253, 248, 0.85);
  border: 1px solid var(--line);
}
.bz-ws-name { display: block; font-size: 1.05rem; font-weight: 700; }
.bz-ws-val { display: block; font-size: 0.68rem; color: var(--gray); }
.bz-ws-num { display: block; font-size: 0.68rem; color: var(--ink-light); font-weight: 600; margin-top: 1px; }

/* ---- 五行条形 ---- */
.bz-bars { display: flex; flex-direction: column; gap: 6px; }
.bz-bar-row { display: flex; align-items: center; gap: 8px; font-size: 0.78rem; }
.bz-bar-name { flex: none; width: 20px; font-weight: 700; text-align: center; }
.bz-bar-track {
  flex: 1; height: 9px; border-radius: 5px;
  background: rgba(221, 211, 192, 0.5);
  overflow: hidden;
}
.bz-bar-fill { display: block; height: 100%; border-radius: 5px; background: currentColor; opacity: .75; }
.bz-bar-num { flex: none; width: 30px; text-align: right; color: var(--ink-light); }

/* ---- 大运 / 流年 横向滚动 ---- */
.bz-dy-scroll, .bz-ln-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 253, 248, 0.75);
}
.bz-dy-table, .bz-ln-table { min-width: 100%; }
.bz-dy-table td, .bz-ln-table td {
  white-space: nowrap;
  padding: 5px 8px;
  border-bottom: 1px solid rgba(221, 211, 192, 0.45);
  border-right: 1px solid rgba(221, 211, 192, 0.35);
  font-size: 0.9rem;
}
.bz-ln-table td { font-size: 0.86rem; }
.bz-dy-table tbody td:first-child,
.bz-ln-table tbody td:first-child {
  position: sticky; left: 0; z-index: 2;
  background: #f7f2e8;
  width: auto; min-width: 42px;
  text-align: center;
  color: var(--gray);
  font-size: 0.72rem;
}
.bz-dy-lead { font-weight: 600; }

/* 大运「交运」行：每步大运起始的精确月/日 */
.bz-dy-jiao {
  color: #a8801f;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ---- 十神分布 ---- */
.bz-ss-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.bz-ss-cell {
  display: flex; flex-direction: column; align-items: center;
  padding: 6px 2px;
  border-radius: 7px;
  background: rgba(255, 253, 248, 0.85);
  border: 1px solid var(--line);
}
.bz-ss-k { font-size: 0.68rem; color: var(--gray); }
.bz-ss-v { font-size: 0.95rem; font-weight: 700; color: var(--gold); }
.bz-err { color: var(--red); font-size: 0.84rem; }

/* ---- AI 结果排版 ---- */
#bzAiContent h2, #bzAiContent h3, #bzAiContent h4, #bzAiContent h5 {
  font-size: 0.92rem;
  color: var(--red);
  margin: 13px 0 6px;
  padding-left: 8px;
  border-left: 3px solid var(--red-soft);
}
#bzAiContent p { font-size: 0.86rem; line-height: 1.8; margin-bottom: 8px; color: var(--ink); }
#bzAiContent li { font-size: 0.86rem; line-height: 1.75; margin-left: 18px; color: var(--ink); }
#bzAiContent strong { color: var(--gold); }

/* ---- 窄屏适配 ---- */
@media (max-width: 360px) {
  .bz-big { font-size: 1.4rem; }
  .bz-ss-grid { grid-template-columns: repeat(4, 1fr); }
  .bz-ws-grid { grid-template-columns: repeat(5, 1fr); gap: 4px; }
  .bz-ws-name { font-size: 0.95rem; }
}

/* ---- 格局取用（子平真诠） ---- */
.bz-ge-block { border-left: 3px solid var(--gold-light); }
.bz-ge-head {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  margin-bottom: 7px !important;
}
.bz-ge-name { font-size: 1rem; color: var(--red); letter-spacing: .5px; }
.bz-ge-tag {
  font-size: 0.68rem; color: var(--ink-light);
  background: rgba(156, 122, 60, 0.09);
  padding: 2px 7px; border-radius: 4px;
}
.bz-ge-verdict {
  font-size: 0.7rem; font-weight: 700;
  padding: 2px 8px; border-radius: 4px; margin-left: auto;
}
.bz-ge-ok  { color: #2f7d4f; background: rgba(47, 125, 79, 0.11); }
.bz-ge-bad { color: var(--red); background: rgba(181, 52, 43, 0.1); }
.bz-ge-shen {
  display: flex; flex-wrap: wrap; gap: 14px;
  margin-top: 7px; padding-top: 7px;
  border-top: 1px dashed rgba(221, 211, 192, 0.8);
  font-size: 0.75rem;
}
.bz-ge-xi { color: #2f7d4f; }
.bz-ge-ji { color: var(--red-soft); }
.bz-ge-note { font-size: 0.74rem !important; color: var(--gold) !important; margin-top: 6px !important; }

/* ---- 调候用神（穷通宝鉴） ---- */
.bz-th-block { border-left-color: var(--teal); }
.bz-th-mid { color: #a1781f; background: rgba(161, 120, 31, 0.12); }
.bz-th-grid {
  margin-top: 8px; padding-top: 8px;
  border-top: 1px dashed rgba(221, 211, 192, 0.8);
  display: flex; flex-direction: column; gap: 5px;
}
.bz-th-row { display: flex; align-items: flex-start; gap: 8px; font-size: 0.78rem; }
.bz-th-k {
  flex: none; width: 34px; font-size: 0.7rem; font-weight: 600;
  padding-top: 1px; text-align: center;
  border-radius: 3px;
}
.bz-th-yong { color: #1f6f9e; background: rgba(31, 111, 158, 0.09); }
.bz-th-xi   { color: #2f7d4f; background: rgba(47, 125, 79, 0.09); }
.bz-th-ji   { color: var(--red-soft); background: rgba(181, 52, 43, 0.08); }
.bz-th-v { flex: 1; display: flex; flex-wrap: wrap; gap: 10px; }
.bz-th-item { display: inline-flex; align-items: baseline; gap: 3px; font-weight: 700; }
.bz-th-item i { font-style: normal; font-size: 0.62rem; font-weight: 400; }
.bz-th-item i.is-tou  { color: #1f6f9e; }
.bz-th-item i.is-cang { color: var(--ink-light); }
.bz-th-item i.is-none { color: #b8b0a4; }

/* ============================================================
   六爻断卦卡片（《增删卜易》《卜筮正宗》断卦体系）
   ============================================================ */

.ly-lei-wrap {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 4px;
}
.ly-lei-btn {
  font-family: inherit; font-size: 0.74rem;
  color: var(--ink-light);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 5px 11px;
  cursor: pointer;
  transition: all .18s;
  -webkit-tap-highlight-color: transparent;
}
.ly-lei-btn.active {
  color: #fff;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  border-color: var(--gold);
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(156, 122, 60, .25);
}

.ly-card { border-left: 3px solid var(--gold-light); }
.ly-card-verdict { border-left-color: var(--red); }
.ly-card-narr { border-left-color: var(--teal); }

.ly-src {
  font-size: 0.62rem; color: var(--gray); font-weight: 400;
  margin-left: 6px; letter-spacing: .02em;
}
.ly-level, .ly-horizon {
  float: right; font-size: 0.68rem; font-weight: 700;
  padding: 2px 9px; border-radius: 4px;
}
.lv-wang  { color: #1f6f9e; background: rgba(31, 111, 158, .12); }
.lv-wang2 { color: #2f7d4f; background: rgba(47, 125, 79, .11); }
.lv-mid   { color: #a1781f; background: rgba(161, 120, 31, .12); }
.lv-weak  { color: #c07a2a; background: rgba(192, 122, 42, .12); }
.lv-dead  { color: var(--red); background: rgba(181, 52, 43, .11); }

/* ---- 取用神 ---- */
.ly-pick { margin-bottom: 8px; }
.ly-pick-main {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px;
  margin-bottom: 6px;
}
.ly-pick-qin {
  font-size: 1.12rem; font-weight: 700; color: var(--red);
  letter-spacing: .06em;
}
.ly-pick-pos { font-size: 0.86rem; font-weight: 600; color: var(--ink); }
.ly-tag {
  font-size: 0.62rem; color: var(--ink-light);
  background: rgba(156, 122, 60, .1);
  padding: 2px 7px; border-radius: 4px;
}
.ly-tag-fu { color: #7a5aa8; background: rgba(122, 90, 168, .12); }

.ly-note {
  font-size: 0.76rem !important; line-height: 1.75 !important;
  color: var(--ink-light) !important; margin-bottom: 5px !important;
}
.ly-note-warn { color: #a1781f !important; }
.ly-note-q { color: var(--gray) !important; }
.ly-note-hint {
  margin-top: 7px !important; padding-top: 6px;
  border-top: 1px dashed rgba(221, 211, 192, .8);
  color: var(--gray) !important; font-size: 0.72rem !important;
}

.ly-roles { display: flex; flex-wrap: wrap; gap: 8px; }
.ly-role {
  font-size: 0.72rem; padding: 3px 9px; border-radius: 4px;
  display: inline-flex; align-items: baseline; gap: 4px;
}
.ly-role b { font-weight: 600; opacity: .85; }
.ly-role-yuan  { color: #2f7d4f; background: rgba(47, 125, 79, .1); }
.ly-role-ji    { color: var(--red-soft); background: rgba(181, 52, 43, .09); }
.ly-role-chou  { color: #a1781f; background: rgba(161, 120, 31, .1); }
.ly-role-xie   { color: var(--gray); background: rgba(139, 127, 112, .1); }

/* ---- 旺衰 ---- */
.ly-ws-bar {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px;
  margin-bottom: 8px;
}
.ly-ws-cell {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: rgba(201, 169, 97, .07);
  border-radius: 6px; padding: 7px 3px;
}
.ly-ws-k { font-size: 0.62rem; color: var(--gray); }
.ly-ws-v { font-size: 0.78rem; font-weight: 700; color: var(--ink); }

.ly-flags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 7px; }
.ly-flag {
  font-size: 0.66rem; font-weight: 600;
  padding: 2px 8px; border-radius: 4px;
}
.ly-flag-ok  { color: #2f7d4f; background: rgba(47, 125, 79, .11); }
.ly-flag-bad { color: var(--red); background: rgba(181, 52, 43, .1); }
.ly-flag-mid { color: #8a6d2f; background: rgba(160, 120, 40, .12); }

/* 三合局卡 */
.ly-card-sanhe { border-left-color: #6b5b95; }
.ly-sh-item {
  padding: 8px 0; border-bottom: 1px dashed rgba(0, 0, 0, .07);
}
.ly-sh-item:last-child { border-bottom: none; }
.ly-sh-head {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 5px;
}
.ly-sh-name {
  font-size: 0.82rem; font-weight: 600; color: var(--ink);
}

.ly-list {
  list-style: none; display: flex; flex-direction: column; gap: 4px;
}
.ly-list li {
  font-size: 0.75rem; line-height: 1.7; color: var(--ink-light);
  padding-left: 11px; position: relative;
}
.ly-list li::before {
  content: ''; position: absolute; left: 2px; top: 9px;
  width: 3px; height: 3px; border-radius: 50%;
  background: var(--line-dark);
}
.ly-list-tight li { font-size: 0.73rem; }

/* 互卦 · 纳音卡 */
.ly-card-hu { border-left-color: #7a6a4f; }
.ly-hu-block { padding: 7px 0; border-bottom: 1px dashed rgba(0, 0, 0, .07); }
.ly-hu-block:last-of-type { border-bottom: none; }
.ly-hu-head {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 5px;
}
.ly-hu-label {
  font-size: 0.72rem; color: var(--ink-light);
  background: rgba(122, 106, 79, .1); padding: 1px 6px; border-radius: 3px;
}
.ly-hu-name { font-size: 0.82rem; font-weight: 600; color: var(--ink); }
.ly-hu-yaos { display: flex; flex-direction: column; gap: 2px; }
.ly-hu-yao {
  display: flex; align-items: baseline; gap: 6px;
  font-size: 0.75rem; line-height: 1.6; color: var(--ink);
}
.ly-hu-yao em {
  font-style: normal; font-size: 0.7rem; color: var(--ink-light);
}
.ly-hu-yao i {
  font-style: normal; font-size: 0.68rem; color: #8a7a5c;
  background: rgba(122, 106, 79, .08); padding: 0 4px; border-radius: 2px;
}

/* 相刑卡 */
.ly-card-xing { border-left-color: #8a5a4a; }
.ly-xing-list { display: flex; flex-direction: column; gap: 5px; margin-bottom: 7px; }
.ly-xing-item {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  padding: 5px 0; border-bottom: 1px dashed rgba(0, 0, 0, .07);
}
.ly-xing-item:last-child { border-bottom: none; }
.ly-xing-name { font-size: 0.8rem; font-weight: 600; color: var(--ink); }
.ly-xing-who { font-size: 0.72rem; color: var(--ink-light); }

/* 六神卡 */
.ly-card-liushen { border-left-color: #5a6a7a; }
.ly-ls-block {
  padding: 7px 0; border-bottom: 1px dashed rgba(0, 0, 0, .07);
}
.ly-ls-block:last-of-type { border-bottom: none; }
.ly-ls-head {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 4px;
}
.ly-ls-title { font-size: 0.72rem; color: var(--ink-light); }
.ly-ls-wx { font-size: 0.7rem; color: var(--ink-light); }
.ly-ls-extra {
  font-size: 0.68rem; color: #8a5a4a;
  background: rgba(138, 90, 74, .1); padding: 1px 6px; border-radius: 3px;
}
.ly-ls-desc { font-size: 0.78rem; line-height: 1.7; color: var(--ink); margin: 0 0 2px; }
.ly-ls-note { font-size: 0.73rem; line-height: 1.65; color: var(--ink-light); margin: 0; }

/* 神煞卡 */
.ly-card-shensha { border-left-color: #6a5a7a; }
.ly-ss-item {
  padding: 6px 0; border-bottom: 1px dashed rgba(0, 0, 0, .07);
}
.ly-ss-item:last-child { border-bottom: none; }
.ly-ss-head {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 3px;
}
.ly-ss-zhi { font-size: 0.78rem; font-weight: 600; color: var(--ink); }
.ly-ss-who { font-size: 0.72rem; color: var(--ink-light); }
.ly-ss-desc { font-size: 0.73rem; line-height: 1.65; color: var(--ink-light); margin: 0; }

/* 卦身 · 游归卡 */
.ly-card-guashen { border-left-color: #4a6a5a; }

/* ---- 生克 ---- */
.ly-role-row {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 7px 0;
  border-bottom: 1px dashed rgba(221, 211, 192, .7);
}
.ly-role-row:last-child { border-bottom: none; }
.ly-role-name {
  flex: none; width: 44px; text-align: center;
  font-size: 0.68rem; font-weight: 700;
  padding: 3px 0; border-radius: 4px;
}
.ly-role-yaos { flex: 1; display: flex; flex-wrap: wrap; gap: 6px; }
.ly-role-yao {
  font-size: 0.72rem; color: var(--ink);
  background: rgba(201, 169, 97, .08);
  border-radius: 4px; padding: 3px 8px;
  display: inline-flex; align-items: baseline; gap: 4px;
}
.ly-role-lv { font-style: normal; font-size: 0.6rem; color: var(--gray); }
.ly-m-dong, .ly-m-kong, .ly-m-po, .ly-m-shi {
  font-style: normal; font-size: 0.58rem; font-weight: 700;
  padding: 0 3px; border-radius: 2px;
}
.ly-m-dong { color: #fff; background: var(--gold); }
.ly-m-kong { color: var(--gray); background: rgba(139, 127, 112, .18); }
.ly-m-po   { color: var(--red); background: rgba(181, 52, 43, .12); }
.ly-m-shi  { color: #fff; background: var(--teal); }

/* ---- 动变 ---- */
.ly-dong-item {
  padding: 8px 0;
  border-bottom: 1px dashed rgba(221, 211, 192, .7);
}
.ly-dong-item:last-child { border-bottom: none; }
.ly-dong-head {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 7px;
  margin-bottom: 6px;
}
.ly-dong-pos {
  font-size: 0.7rem; font-weight: 700; color: #fff;
  background: var(--gold); border-radius: 4px; padding: 2px 7px;
}
.ly-dong-flow { font-size: 0.82rem; font-weight: 700; color: var(--ink); }
.ly-arrow { font-style: normal; color: var(--gold-light); margin: 0 4px; }
.ly-dong-qin { font-size: 0.7rem; color: var(--gray); }

/* ---- 世应 ---- */
.ly-sy-bar {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px;
}
.ly-sy-cell {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: rgba(201, 169, 97, .07);
  border-radius: 6px; padding: 8px 4px;
}
.ly-sy-k { font-size: 0.62rem; color: var(--gray); }
.ly-sy-v { font-size: 0.9rem; font-weight: 700; color: var(--ink); }
.ly-sy-q { font-size: 0.62rem; color: var(--gray); }
.ly-sy-mid { flex: none; }
.ly-sy-rel {
  font-size: 0.68rem; font-weight: 700;
  padding: 4px 9px; border-radius: 12px;
  color: var(--ink-light); background: rgba(139, 127, 112, .1);
  white-space: nowrap;
}
.ly-sy-rel.is-ok  { color: #2f7d4f; background: rgba(47, 125, 79, .12); }
.ly-sy-rel.is-bad { color: var(--red); background: rgba(181, 52, 43, .11); }

/* ---- 吉凶 ---- */
.ly-verdict {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 11px 13px; border-radius: 8px; margin-bottom: 8px;
}
.ly-verdict-name { font-size: 1.28rem; font-weight: 700; letter-spacing: .1em; }
.ly-verdict-score { font-size: 0.72rem; opacity: .8; }
.gv-daji      { color: #1a6b45; background: linear-gradient(135deg, rgba(26,107,69,.15), rgba(26,107,69,.07)); }
.gv-ji        { color: #2f7d4f; background: rgba(47, 125, 79, .11); }
.gv-xiaoji    { color: #5a8a3f; background: rgba(90, 138, 63, .1); }
.gv-ping      { color: var(--ink-light); background: rgba(139, 127, 112, .1); }
.gv-xiaoxiong { color: #c07a2a; background: rgba(192, 122, 42, .11); }
.gv-xiong     { color: var(--red-soft); background: rgba(212, 102, 92, .12); }
.gv-daxiong   { color: var(--red); background: rgba(181, 52, 43, .14); }

.ly-verdict-desc {
  font-size: 0.78rem !important; line-height: 1.78 !important;
  color: var(--ink) !important; margin-bottom: 9px !important;
}
.ly-reasons {
  padding-top: 8px;
  border-top: 1px dashed rgba(221, 211, 192, .8);
}
.ly-reasons-title {
  font-size: 0.68rem; font-weight: 700; color: var(--gold);
  letter-spacing: .08em; margin-bottom: 5px;
}
.ly-reason {
  font-size: 0.72rem; line-height: 1.7; color: var(--ink-light);
  padding-left: 11px; position: relative;
}
.ly-reason::before {
  content: '·'; position: absolute; left: 2px; color: var(--gold-light);
}

/* ---- 应期 ---- */
.ly-yq-list { display: flex; flex-direction: column; gap: 8px; }
.ly-yq-item {
  display: flex; align-items: flex-start; gap: 8px;
}
.ly-yq-rule {
  flex: none; width: 58px; text-align: center;
  font-size: 0.66rem; font-weight: 700; color: #1f6f9e;
  background: rgba(31, 111, 158, .1);
  border-radius: 4px; padding: 3px 0;
}
.ly-yq-body { flex: 1; }
.ly-yq-when {
  font-size: 0.75rem !important; line-height: 1.7 !important;
  color: var(--ink) !important; font-weight: 600; margin-bottom: 2px !important;
}
.ly-yq-desc {
  font-size: 0.7rem !important; line-height: 1.65 !important;
  color: var(--gray) !important;
}
.ly-yq-cand { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.ly-yq-chip {
  font-size: 0.66rem; color: var(--gold);
  background: rgba(201, 169, 97, .13);
  border-radius: 10px; padding: 3px 9px;
}

/* ---- 综断 ---- */
.ly-narr { display: flex; flex-direction: column; gap: 7px; }
.ly-narr-row { display: flex; align-items: flex-start; gap: 8px; }
.ly-narr-k {
  flex: none; width: 34px; text-align: center;
  font-size: 0.66rem; font-weight: 700;
  color: #fff; background: var(--teal);
  border-radius: 4px; padding: 3px 0;
}
.ly-narr-v {
  flex: 1; font-size: 0.74rem; line-height: 1.75; color: var(--ink-light);
}

@media (max-width: 360px) {
  .ly-ws-cell { padding: 6px 2px; }
  .ly-ws-v { font-size: 0.72rem; }
  .ly-yq-rule { width: 52px; font-size: 0.62rem; }
}

/* ---- 断卦总览横幅 ---- */
.ly-banner { border-left-color: var(--red); padding-top: 12px; }
.ly-banner-top {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px;
  margin-bottom: 9px;
}
.ly-banner-lei {
  font-size: 0.78rem; font-weight: 700; color: var(--ink);
}
.ly-banner-yong {
  font-size: 0.72rem; color: var(--gold);
  background: rgba(201, 169, 97, .13);
  border-radius: 4px; padding: 2px 8px;
}
.ly-banner-verdict {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 10px 13px; border-radius: 8px;
}
.ly-banner-name { font-size: 1.5rem; font-weight: 700; letter-spacing: .14em; }
.ly-banner-ws { font-size: 0.7rem; opacity: .82; }

/* ===== 登录 / 历史 / 弹窗 ===== */
.modal-mask {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(20, 16, 12, 0.5);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-card {
  background: #fffdf8;
  width: 100%; max-width: 360px;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,0.2);
  animation: modalIn .18s ease;
}
.modal-card-wide { max-width: 400px; max-height: 82vh; display: flex; flex-direction: column; }
@keyframes modalIn { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid rgba(0,0,0,0.06);
}
.modal-title { font-size: 1rem; font-weight: 700; color: var(--ink); letter-spacing: 1px; }
.modal-close { border: none; background: none; font-size: 1.4rem; color: var(--gray); cursor: pointer; line-height: 1; }
.modal-body { padding: 16px; overflow-y: auto; }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.auth-tab {
  flex: 1; border: 1px solid rgba(0,0,0,0.08); background: transparent;
  padding: 8px 0; border-radius: 8px; cursor: pointer;
  font-size: 0.85rem; color: var(--gray); letter-spacing: 1px;
}
.auth-tab.active { background: var(--gold); color: #fff; border-color: var(--gold); }
.auth-input {
  width: 100%; box-sizing: border-box; margin-bottom: 10px;
  padding: 10px 12px; border: 1px solid rgba(0,0,0,0.12); border-radius: 8px;
  font-size: 0.9rem; background: #fff;
}
.auth-input:focus { outline: none; border-color: var(--gold); }
.auth-err { color: var(--red); font-size: 0.78rem; min-height: 18px; margin-bottom: 4px; }

.menu-user { font-size: 0.9rem; color: var(--ink); margin-bottom: 14px; padding: 10px; background: rgba(201,169,97,0.1); border-radius: 8px; }

.history-list { display: flex; flex-direction: column; gap: 8px; }
.history-item {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid rgba(0,0,0,0.07); border-radius: 10px; padding: 10px 12px;
  background: #fff;
}
.history-main { flex: 1; cursor: pointer; min-width: 0; }
.history-title { font-size: 0.9rem; font-weight: 700; color: var(--ink); }
.history-sub { font-size: 0.72rem; color: var(--gray); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-del {
  border: 1px solid rgba(180,52,43,0.25); background: transparent; color: var(--red);
  border-radius: 6px; padding: 4px 9px; font-size: 0.72rem; cursor: pointer; flex-shrink: 0;
}

.btn-danger { background: transparent; color: var(--red); border: 1px solid rgba(180,52,43,0.3); border-radius: 8px; padding: 10px 0; font-size: 0.85rem; cursor: pointer; letter-spacing: 1px; }

.toast {
  display: none; position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%);
  background: rgba(30,26,20,0.92); color: #fff; padding: 9px 18px;
  border-radius: 20px; font-size: 0.82rem; z-index: 2000; letter-spacing: 1px;
  max-width: 80%; text-align: center;
}
.dim { color: var(--gray); }

/* ===== 古籍阅览 ===== */
.guji-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: linear-gradient(135deg, #2e2620, #4a3b28);
  color: #fff; cursor: pointer;
  border-radius: 12px; padding: 14px 16px; margin-bottom: 14px;
}
.guji-banner-text { flex: 1; min-width: 0; }
.guji-banner-title { font-size: 0.95rem; font-weight: 700; letter-spacing: 1px; }
.guji-banner-sub { font-size: 0.72rem; opacity: 0.8; margin-top: 4px; line-height: 1.4; }
.guji-banner-btn { flex-shrink: 0; width: auto; padding: 8px 16px; margin: 0; }

.guji-book-list { display: flex; flex-direction: column; gap: 12px; }
.guji-book {
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.guji-book:active { transform: scale(.98); }
.guji-book-title { font-size: 1.05rem; font-weight: 700; color: var(--ink); letter-spacing: 2px; }
.guji-book-author { font-size: 0.72rem; color: var(--gold); margin-top: 4px; }
.guji-book-desc { font-size: 0.8rem; color: var(--gray); margin-top: 8px; line-height: 1.6; }
.guji-book-meta { font-size: 0.7rem; color: var(--gray); margin-top: 10px; opacity: 0.8; }

.guji-crumb {
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
  padding: 0 2px;
}
.guji-back {
  border: 1px solid rgba(0,0,0,0.1); background: #fff; color: var(--ink);
  border-radius: 16px; padding: 4px 12px; font-size: 0.78rem; cursor: pointer;
}
.guji-crumb-title { font-size: 0.82rem; color: var(--gray); font-weight: 700; letter-spacing: 1px; }

.guji-chapter-list { display: flex; flex-direction: column; gap: 8px; }
.guji-chapter {
  display: flex; align-items: center; justify-content: space-between;
  border: 1px solid rgba(0,0,0,0.07); border-radius: 10px; padding: 12px 14px;
  background: #fff; cursor: pointer;
}
.guji-chapter:active { background: #faf6ee; }
.guji-chapter-title { font-size: 0.88rem; color: var(--ink); font-weight: 600; }
.guji-chapter-count { font-size: 0.68rem; color: var(--gray); flex-shrink: 0; margin-left: 8px; }

.guji-reader-title {
  font-size: 1.15rem; font-weight: 700; color: var(--ink);
  letter-spacing: 2px; padding: 16px 16px 12px; border-bottom: 1px solid rgba(0,0,0,0.06);
}
.guji-reader-body {
  padding: 14px 16px; font-size: 0.9rem; line-height: 1.85; color: #3a322b;
}
.guji-reader-body p { margin: 0 0 12px; text-align: justify; }

/* ===== 古籍分类 + 电子书阅读器 ===== */
.guji-cat { margin-bottom: 20px; }
.guji-cat-name {
  font-size: 0.82rem; font-weight: 700; color: var(--gold);
  letter-spacing: 2px; margin-bottom: 10px; padding-left: 10px;
  border-left: 3px solid var(--gold);
}
.guji-book {
  cursor: pointer; background: #fff; border: 1px solid rgba(0,0,0,0.07);
  border-radius: 12px; padding: 14px 16px; margin-bottom: 10px;
  transition: transform .15s, box-shadow .15s;
}
.guji-book:active { transform: scale(.98); }
.guji-book-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.guji-book-title { font-size: 1.02rem; font-weight: 700; color: var(--ink); letter-spacing: 1px; }
.guji-book-domain {
  flex-shrink: 0; font-size: 0.66rem; color: var(--red);
  border: 1px solid rgba(180,52,43,0.3); border-radius: 8px; padding: 1px 7px;
}
.guji-book-author { font-size: 0.7rem; color: var(--gold); margin-top: 4px; }
.guji-book-desc { font-size: 0.78rem; color: var(--gray); margin-top: 7px; line-height: 1.6; }
.guji-book-meta { font-size: 0.7rem; color: var(--gray); margin-top: 9px; opacity: 0.85; }
.guji-book-progress { color: var(--gold); margin-left: 6px; }

/* 阅读器 */
.reader-top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,253,248,0.97); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line, rgba(0,0,0,0.06));
  padding: 10px 12px;
}
.reader-btn {
  flex-shrink: 0; min-width: 32px; height: 32px;
  border: 1px solid rgba(0,0,0,0.1); background: #fff; color: var(--ink);
  border-radius: 8px; font-size: 0.9rem; cursor: pointer;
}
.reader-top-title { flex: 1; min-width: 0; text-align: center; }
.reader-book { font-size: 0.82rem; font-weight: 700; color: var(--ink); letter-spacing: 1px; }
.reader-chapter { font-size: 0.68rem; color: var(--gray); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reader-body { padding: 16px; line-height: 1.9; color: #3a322b; }
.reader-title { font-size: 1.2em; font-weight: 700; color: var(--ink); letter-spacing: 2px; margin-bottom: 16px; text-align: center; }
.reader-body p { margin: 0 0 14px; text-align: justify; }
.reader-diver { height: 1px; background: rgba(0,0,0,0.06); margin: 18px 0; }
.reader-foot {
  position: sticky; bottom: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(255,253,248,0.97); backdrop-filter: blur(8px);
  border-top: 1px solid var(--line, rgba(0,0,0,0.06));
  padding: 10px 16px;
}
.reader-page-btn {
  border: 1px solid rgba(0,0,0,0.12); background: #fff; color: var(--ink);
  border-radius: 16px; padding: 6px 16px; font-size: 0.78rem; cursor: pointer;
}
.reader-page-btn:disabled { opacity: 0.35; cursor: default; }
.reader-page-info { font-size: 0.72rem; color: var(--gray); }

/* 目录抽屉 */
.toc-mask { position: fixed; inset: 0; z-index: 1500; background: rgba(20,16,12,0.45); }
.toc-panel {
  position: absolute; right: 0; top: 0; bottom: 0; width: 78%; max-width: 340px;
  background: #fffdf8; display: flex; flex-direction: column;
  animation: tocIn .2s ease;
}
@keyframes tocIn { from { transform: translateX(100%); } to { transform: none; } }
.toc-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid rgba(0,0,0,0.06);
  font-size: 0.9rem; font-weight: 700; color: var(--ink);
}
.toc-head button { border: none; background: none; font-size: 1.4rem; color: var(--gray); cursor: pointer; }
.toc-list { flex: 1; overflow-y: auto; padding: 8px 0; }
.toc-item {
  padding: 11px 18px; font-size: 0.85rem; color: var(--ink); cursor: pointer;
  border-left: 3px solid transparent;
}
.toc-item.active { background: rgba(201,169,97,0.12); color: var(--gold); font-weight: 700; border-left-color: var(--gold); }
.toc-item:active { background: #faf6ee; }

/* 字号面板 */
.font-mask { position: fixed; inset: 0; z-index: 1500; background: rgba(20,16,12,0.45); display: flex; align-items: center; justify-content: center; }
.font-panel {
  display: flex; align-items: center; gap: 14px;
  background: #fffdf8; border-radius: 12px; padding: 16px 22px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.2);
}
.font-label { font-size: 0.8rem; color: var(--gray); }
.font-btn {
  min-width: 44px; height: 36px; border: 1px solid rgba(0,0,0,0.12);
  background: #fff; color: var(--ink); border-radius: 8px; font-size: 0.85rem; cursor: pointer;
}
.font-val { font-size: 0.95rem; font-weight: 700; color: var(--ink); min-width: 30px; text-align: center; }

/* ===== 阅读设置面板 ===== */
.set-mask { position: fixed; inset: 0; z-index: 1500; background: rgba(20,16,12,0.45); display: flex; align-items: flex-end; justify-content: center; }
.set-panel {
  width: 100%; max-width: 480px;
  background: #fffdf8; border-radius: 16px 16px 0 0;
  padding: 16px 18px 22px; box-shadow: 0 -8px 30px rgba(0,0,0,0.18);
  animation: setIn .2s ease;
}
@keyframes setIn { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.set-head { display: flex; align-items: center; justify-content: space-between; font-size: 0.95rem; font-weight: 700; color: var(--ink); margin-bottom: 14px; }
.set-head button { border: none; background: none; font-size: 1.4rem; color: var(--gray); cursor: pointer; }
.set-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.set-label { font-size: 0.8rem; color: var(--gray); flex-shrink: 0; }
.set-fontrow { display: flex; align-items: center; gap: 12px; }
.seg-group { display: flex; gap: 6px; }
.seg-btn {
  border: 1px solid rgba(0,0,0,0.1); background: #fff; color: var(--ink);
  border-radius: 8px; padding: 6px 13px; font-size: 0.78rem; cursor: pointer;
}
.seg-btn.active { background: var(--gold); color: #fff; border-color: var(--gold); }
.reader-wordinfo { font-size: 0.72rem; color: var(--gray); text-align: center; margin-bottom: 16px; opacity: 0.8; }

/* ===== 门类横向 tab + 仿古封面书架（对标热卜） ===== */
.guji-tabs {
  display: flex; gap: 4px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  padding: 2px 2px 0; margin-bottom: 12px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.guji-tabs::-webkit-scrollbar { display: none; }
.guji-tab {
  flex-shrink: 0; border: none; background: transparent;
  color: var(--gray); font-size: 0.88rem; letter-spacing: 1px;
  padding: 8px 14px 10px; cursor: pointer; position: relative;
}
.guji-tab.active { color: var(--red); font-weight: 700; }
.guji-tab.active::after {
  content: ''; position: absolute; left: 50%; bottom: 0;
  transform: translateX(-50%); width: 22px; height: 3px;
  background: var(--red); border-radius: 2px;
}

.guji-book {
  display: flex; gap: 12px; align-items: flex-start;
  background: #fff; border: 1px solid rgba(0,0,0,0.07);
  border-radius: 12px; padding: 12px; margin-bottom: 10px;
  cursor: pointer; transition: transform .15s;
}
.guji-book:active { transform: scale(.985); }

/* 仿古线装书封面 */
.guji-cover {
  width: 66px; height: 90px; flex-shrink: 0;
  border-radius: 2px 6px 6px 2px;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  box-shadow: 2px 3px 9px rgba(0,0,0,0.28);
}
.guji-cover::before {
  content: ''; position: absolute; left: 5px; top: 4px; bottom: 4px;
  width: 1px; background: rgba(240,230,210,0.4);
}
.guji-cover::after {
  content: ''; position: absolute; left: 2.5px; top: 8px; bottom: 8px;
  width: 5px; background:
    radial-gradient(circle at 2.5px 4px, rgba(240,230,210,0.55) 1.2px, transparent 1.4px) 0 0/100% 14px repeat-y;
}
.guji-cover-title {
  writing-mode: vertical-rl;
  color: #f0e6d2; font-size: 0.8rem; font-weight: 700;
  letter-spacing: 4px; line-height: 1;
  font-family: 'Kaiti SC','STKaiti','KaiTi',serif;
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
  max-height: 78px; overflow: hidden;
}
.guji-book-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.guji-book-info .guji-book-title { font-size: 0.98rem; letter-spacing: 1px; }
.guji-book-info .guji-book-author { margin-top: 3px; }
.guji-book-info .guji-book-desc {
  margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; line-height: 1.5;
}
.guji-book-info .guji-book-meta { margin-top: auto; padding-top: 6px; }

/* ===== 排盘详细化：爻位标签 / 变卦全爻 / 伏神 ===== */
.yao-pos {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: var(--gray);
  letter-spacing: 1px;
  border-right: 1px solid var(--line);
  background: rgba(201,169,97,0.04);
}
.yao-ganzhi.bian .liuqin { color: var(--gray); }
.yao-ganzhi.bian { opacity: 0.82; }
.yao-fu {
  grid-column: 2 / -1;
  font-size: 0.68rem;
  color: #8a6a2f;
  background: rgba(201,169,97,0.09);
  border-radius: 6px;
  padding: 3px 8px;
  margin: 0 8px 6px 0;
  justify-self: start;
}

/* ===== 八字命局速览 ===== */
.bz-qv-row {
  display: flex; gap: 10px; padding: 7px 0;
  border-bottom: 1px dashed rgba(0,0,0,0.06);
  font-size: 0.82rem; line-height: 1.5;
}
.bz-qv-row:last-of-type { border-bottom: none; }
.bz-qv-k {
  flex-shrink: 0; width: 40px; color: var(--gold);
  font-weight: 700; letter-spacing: 1px;
}
.bz-qv-v { color: var(--ink); }
.bz-qv-btn {
  width: 100%; margin-top: 12px; padding: 10px 0;
  background: rgba(201,169,97,0.12); color: #8a6a2f;
  border: 1px solid rgba(201,169,97,0.35); border-radius: 10px;
  font-size: 0.82rem; cursor: pointer; letter-spacing: 1px;
}

/* ===== 八字人生轨迹 ===== */
.bz-life-list { display: flex; flex-direction: column; gap: 8px; }
.bz-life-item {
  border: 1px solid rgba(0,0,0,0.06); border-radius: 10px;
  padding: 10px 12px; background: #fff;
}
.bz-life-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bz-life-gz { font-size: 1.05rem; letter-spacing: 1px; }
.bz-life-shen { font-size: 0.78rem; color: var(--ink); background: rgba(201,169,97,0.14); border-radius: 6px; padding: 1px 7px; }
.bz-life-tone { font-size: 0.7rem; border-radius: 6px; padding: 1px 6px; font-weight: 700; }
.bz-life-xi { color: #1a7a3c; background: rgba(26,122,60,0.1); }
.bz-life-ji { color: #b5342b; background: rgba(181,52,43,0.1); }
.bz-life-ping { color: #888; background: rgba(0,0,0,0.05); }
.bz-life-age { font-size: 0.72rem; color: var(--gray); margin-left: auto; }
.bz-life-desc { font-size: 0.82rem; color: var(--ink); margin-top: 6px; line-height: 1.6; }
.bz-life-events { margin: 6px 0 0; padding-left: 18px; }
.bz-life-events li { font-size: 0.8rem; color: #5a5146; line-height: 1.7; }

/* ===== 分析模式：外格 / 合冲刑会 / 宫位 / 折叠块 ===== */
.bz-wg-item { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 4px; }
.bz-hc-block { padding: 10px 12px; }
.bz-hc-item {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  padding: 6px 0; border-bottom: 1px dashed rgba(0,0,0,0.07); line-height: 1.6;
}
.bz-hc-item:last-child { border-bottom: 0; }
.bz-hc-type {
  flex: none; font-size: 0.68rem; font-weight: 700; border-radius: 5px;
  padding: 1px 6px; background: rgba(201,169,97,0.16); color: #6a5a35;
}
.bz-hc-item.is-bad .bz-hc-type { background: rgba(181,52,43,0.12); color: #b5342b; }
.bz-hc-item.is-he .bz-hc-type { background: rgba(26,122,60,0.12); color: #1a7a3c; }
.bz-hc-name { flex: none; font-size: 0.9rem; letter-spacing: 1px; }
.bz-hc-desc { font-size: 0.78rem; color: #5a5146; }
.bz-gw-sub { display: block; font-size: 0.68rem; color: var(--gray); font-style: normal; }

.bz-fold {
  border: 1px solid rgba(0,0,0,0.07); border-radius: 8px;
  background: #fff; margin-bottom: 8px; overflow: hidden;
}
.bz-fold-h {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 9px 12px; cursor: pointer; list-style: none;
  font-size: 0.88rem; user-select: none;
}
.bz-fold-h::-webkit-details-marker { display: none; }
.bz-fold-h::before {
  content: '▸'; color: var(--gold); font-size: 0.8rem; flex: none; transition: transform .15s;
}
.bz-fold[open] .bz-fold-h::before { content: '▾'; }
.bz-fold-h b { color: var(--ink); }
.bz-fold-v {
  font-size: 0.75rem; color: var(--gray); font-weight: 400;
  margin-left: auto; text-align: right; flex: 1 1 auto;
}
.bz-fold-b { padding: 0 12px 10px; border-top: 1px dashed rgba(0,0,0,0.07); }

/* ===== 历史列表类型徽章 ===== */
.hist-tag {
  display: inline-block; font-size: 0.62rem; color: #6a5a35;
  background: rgba(201,169,97,0.16); border-radius: 5px;
  padding: 1px 5px; margin-right: 6px; vertical-align: 1px;
}
.hist-tag-bazi { color: #7a3b8f; background: rgba(122,59,143,0.12); }


/* ===== 排版修正（2026-09-23）：书架卡片高度统一 + 简介定高截断 =====
   原问题：标题/简介行数不同导致卡片高度出现 116 / 121 / 139 三种，视觉不齐。
   方案：对标题与简介设定位行数（-webkit-line-clamp），使每张卡片等高。 */
.guji-book-list .guji-book { align-items: stretch; }
.guji-book-list .guji-book-info { justify-content: flex-start; }
.guji-book-list .guji-book-info .guji-book-title {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: 2.6em; line-height: 1.3;
}
.guji-book-list .guji-book-desc {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; height: 3.2em;
}
.guji-book-list .guji-book-author,
.guji-book-list .guji-book-meta {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* 卡片等高补充：作者/简介为空的条目也要占位，否则整卡少一行（140 vs 158 不齐） */
.guji-book-list .guji-book-author:empty::before,
.guji-book-list .guji-book-desc:empty::before { content: "B"; display: inline-block; }
.guji-book-list .guji-book-author { min-height: 1.25em; }
.guji-book-list .guji-book-meta { min-height: 1.2em; }
