/* css/base.css */
/* 变量 · 重置 · 页面骨架 · 卡片 */
:root {
  /* 东方玄青深邃墨玉底板 */
  --bg: #090e15;
  --bg2: #0e1622;
  --card: #131f2d;
  --card2: #182738;
  --card-hover: #1c2e42;

  /* 金石正色与高对比明度（彻底消灭发虚模糊感） */
  --gold: #e2c56a;
  --gold2: #f3dc8e;
  --gold-glow: rgba(226, 197, 106, 0.35);
  --ink: #eef3f7;   /* 高对比度铅白正文，清晰锐利 */
  --dim: #9cb1bf;   /* 明亮清晰辅助色 */
  --dim-sub: #697e8f;
  --line: rgba(226, 197, 106, 0.2);
  --line-sub: rgba(255, 255, 255, 0.08);

  /* 四化正统矿物色系统 */
  --lu: #32a874;   /* 松柏绿 */
  --quan: #854b98; /* 紫檀紫 */
  --ke: #2b7fc3;   /* 霁青蓝 */
  --ji: #c84136;   /* 朱砂红 */

  /* 字体分层规范：宋体题骨，黑体行文 */
  --font-serif: "Noto Serif SC", "Songti SC", "Source Han Serif SC", "STSong", "SimSun", serif;
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--font-ui); /* 全局黑体行文：表单、控件、数字清晰锐利，彻底消灭楷体模糊 */
  min-height: 100vh;
  background-image: radial-gradient(1200px 500px at 50% -10%, #152434 0%, var(--bg) 65%);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.wrap {
  width: 100%;
  max-width: 760px; /* 严格坚守原本舒适经典的 760px，绝不改大撑屏！ */
  margin: 0 auto;
  padding: 0 12px 60px;
}
header { text-align: center; padding: 34px 0 20px; }
.brand { font-size: 36px; letter-spacing: 12px; color: var(--gold); text-shadow: 0 0 24px var(--gold-glow); font-family: var(--font-serif); font-weight: 700; padding-left: 12px; }
.brand-sub { margin-top: 8px; font-size: 12px; letter-spacing: 6px; color: var(--dim); font-family: var(--font-serif); padding-left: 6px; }
.tabs { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-top: 8px; }
.tab {
  flex: 1; text-align: center; padding: 11px 0; font-size: 15px; letter-spacing: 2px;
  color: var(--dim); cursor: pointer; background: transparent; border: none; font-family: var(--font-serif); font-weight: 500; transition: color .2s;
}
.tab.on { color: var(--gold); background: var(--card); text-shadow: 0 0 10px rgba(212,175,55,.4); }
.tab + .tab { border-left: 1px solid var(--line); }
.panel { display: none; margin-top: 14px; }
.panel.on { display: block; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 16px 14px; margin-bottom: 12px;
}
.card h3 { font-size: 13px; color: var(--gold2); letter-spacing: 3px; margin-bottom: 12px; font-weight: normal; }
.row { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.f { flex: 1; min-width: 90px; }
.f label { display: block; font-size: 11px; color: var(--dim); margin-bottom: 5px; letter-spacing: 1px; }

/* css/form.css */
/* 排盘表单控件（玄青烫金 seg / input / 按钮 / 结果头） */
/* 玄青烫金专属表单控件体系 */
select {
  width: 100%;
  padding: 9px 28px 9px 10px;
  background-color: var(--bg2);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1.5 2L6 6.5L10.5 2' fill='none' stroke='%23d4af37' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' opacity='0.85'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 11px 7px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13.5px;
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  letter-spacing: 0.5px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.35) inset;
  transition: border-color .2s, box-shadow .2s, background-image .2s;
}
select:hover {
  border-color: rgba(212, 175, 55, 0.45);
  box-shadow: 0 0 6px rgba(212, 175, 55, 0.15), 0 1px 3px rgba(0,0,0,0.35) inset;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1.5 2L6 6.5L10.5 2' fill='none' stroke='%23e8c96a' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.3), 0 1px 3px rgba(0,0,0,0.35) inset;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1.5 2L6 6.5L10.5 2' fill='none' stroke='%23e8c96a' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
select option {
  background-color: #14222e; /* 深玄青底色 */
  color: #d8e2e8;
  padding: 8px 10px;
  font-family: "Kaiti SC", "STKaiti", "楷体", "KaiTi", "SimKai", "Noto Serif SC", "Songti SC", serif;
}
select option:checked,
select option:hover {
  background-color: #1c3040;
  color: #e8c96a; /* 金色高亮 */
}

input[type=date], input[type=datetime-local], input[type=number] {
  width: 100%;
  padding: 9px 10px;
  background: var(--bg2);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13.5px;
  font-family: inherit;
  letter-spacing: 0.5px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.35) inset;
  transition: border-color .2s, box-shadow .2s;
}
input[type=date]:focus, input[type=datetime-local]:focus, input[type=number]:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.3), 0 1px 3px rgba(0,0,0,0.35) inset;
}
input[type=date]::-webkit-calendar-picker-indicator {
  filter: invert(0.7) sepia(1) saturate(3) hue-rotate(5deg);
  opacity: 0.7;
  cursor: pointer;
  transition: opacity .2s;
}
input[type=date]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}
.seg { display: flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.seg button {
  flex: 1; padding: 9px 0; background: transparent; color: var(--dim); border: none;
  font-size: 13px; font-family: inherit; cursor: pointer; letter-spacing: 1px;
}
.seg button.on { background: rgba(212,175,55,.15); color: var(--gold); }
.go {
  width: 100%; padding: 13px 0; margin-top: 4px; font-size: 16px; letter-spacing: 8px;
  background: linear-gradient(135deg, #b8952e, var(--gold), #b8952e);
  color: #0c151d; border: none; border-radius: 8px; font-family: inherit; font-weight: 700;
  cursor: pointer; box-shadow: 0 4px 18px rgba(212,175,55,.3);
}
.go:active { transform: scale(.98); }
.go:disabled { opacity: .5; cursor: wait; }
.hint { font-size: 11px; color: var(--dim); margin-top: 9px; line-height: 1.7; }
.adv-toggle { font-size: 12px; color: var(--gold2); background: none; border: none; cursor: pointer; font-family: inherit; padding: 0; letter-spacing: 1px; }
.adv { display: none; margin-top: 10px; }
.adv.on { display: block; }
label.ck { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink); cursor: pointer; }
label.ck input { width: auto; }

#result { margin-top: 18px; }
.r-head { text-align: center; margin-bottom: 12px; }
.r-head .t { font-size: 19px; color: var(--gold); letter-spacing: 4px; }
.r-head .s { font-size: 12px; color: var(--dim); margin-top: 5px; letter-spacing: 1px; }

/* css/checkbox.css */
/* 自定义复选框 */
/* ===== 自定义复选框（玄青金印风格） ===== */
label.ck {
  display: inline-flex; align-items: center; gap: 7px; font-size: 13px;
  color: var(--ink); cursor: pointer; user-select: none;
}
label.ck input[type=checkbox] {
  appearance: none; -webkit-appearance: none;
  width: 17px; height: 17px; margin: 0;
  border: 1px solid var(--line); border-radius: 4px;
  background: var(--bg2); cursor: pointer;
  position: relative; outline: none; vertical-align: middle;
  box-shadow: 0 1px 3px rgba(0,0,0,0.4) inset;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
label.ck:hover input[type=checkbox] {
  border-color: rgba(212,175,55,.5);
  box-shadow: 0 0 6px rgba(212,175,55,.2), 0 1px 3px rgba(0,0,0,0.4) inset;
}
label.ck input[type=checkbox]:checked {
  border-color: var(--gold);
  background: linear-gradient(135deg, rgba(212,175,55,0.25), rgba(212,175,55,0.08)), var(--bg2);
  box-shadow: 0 0 8px rgba(212,175,55,.35);
}
label.ck input[type=checkbox]:checked::after {
  content: ''; position: absolute;
  left: 5px; top: 2px; width: 4px; height: 8px;
  border: solid var(--gold2); border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* css/select.css */
/* 自定义下拉组件 */
/* ===== 自定义下拉组件（PC玄青烫金浮层） ===== */
select.c-native-hidden {
  display: none !important;
}
.c-select {
  position: relative; width: 100%; min-width: 0; user-select: none;
  font-family: inherit;
}
.c-select-trigger {
  width: 100%; padding: 9px 28px 9px 10px;
  background-color: var(--bg2); color: var(--ink);
  border: 1px solid var(--line); border-radius: 6px;
  font-size: 13.5px; cursor: pointer; letter-spacing: 0.5px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0,0,0,0.35) inset;
  transition: border-color .2s, box-shadow .2s;
  white-space: nowrap; overflow: hidden;
}
.c-select-text {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1;
}
.c-select-arrow {
  position: absolute; right: 10px; top: 50%; width: 10px; height: 6px;
  margin-top: -3px; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1.5 2L6 6.5L10.5 2' fill='none' stroke='%23d4af37' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' opacity='0.85'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-size: contain;
  transition: transform .2s ease;
}
.c-select:hover .c-select-trigger {
  border-color: rgba(212,175,55,0.45);
  box-shadow: 0 0 6px rgba(212,175,55,0.15), 0 1px 3px rgba(0,0,0,0.35) inset;
}
.c-select.open .c-select-trigger {
  border-color: var(--gold);
  box-shadow: 0 0 10px rgba(212,175,55,0.25), 0 1px 3px rgba(0,0,0,0.35) inset;
}
.c-select.open .c-select-arrow {
  transform: rotate(180deg);
}
.c-select-dropdown {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px);
  background: #111e28; border: 1px solid rgba(212,175,55,0.45);
  border-radius: 6px; z-index: 1000;
  max-height: 230px; overflow-y: auto; overflow-x: hidden;
  box-shadow: 0 12px 32px rgba(0,0,0,0.75), 0 0 16px rgba(212,175,55,0.15);
  padding: 4px 0; display: none;
  scrollbar-width: thin; scrollbar-color: rgba(212,175,55,0.3) transparent;
}
.c-select.open .c-select-dropdown {
  display: block; animation: cSelectFade .15s ease-out;
}
@keyframes cSelectFade {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.c-select-dropdown::-webkit-scrollbar { width: 5px; }
.c-select-dropdown::-webkit-scrollbar-thumb {
  background: rgba(212,175,55,0.3); border-radius: 4px;
}
.c-select-option {
  padding: 8px 12px; font-size: 13px; color: #c4d3dc;
  cursor: pointer; display: flex; align-items: center; justify-content: space-between;
  transition: background .15s, color .15s;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.c-select-option:hover {
  background: rgba(212,175,55,0.12); color: #e8c96a;
}
.c-select-option.selected {
  background: rgba(212,175,55,0.18); color: var(--gold2); font-weight: bold;
}
.c-select-option.selected::after {
  content: '✓'; color: var(--gold); font-size: 12px; margin-left: 8px; font-weight: bold;
}

/* 高级设置抽屉里的专属微调 */
.adv-item .c-select-trigger {
  padding: 7px 22px 7px 8px; font-size: 12px;
}
.adv-item .c-select-arrow { right: 7px; width: 9px; height: 5px; }
.adv-item .c-select-option { padding: 6px 8px; font-size: 11.5px; }

/* css/datepicker.css */
/* 自定义日期选择器 */
/* ===== 自定义日期选择器（玄青烫金古风日历） ===== */
input[type=date].c-native-hidden {
  display: none !important;
}
.c-datepicker {
  position: relative; width: 100%; min-width: 0; user-select: none;
  font-family: inherit;
}
.c-dp-trigger {
  width: 100%; padding: 9px 30px 9px 10px;
  background-color: var(--bg2); color: var(--ink);
  border: 1px solid var(--line); border-radius: 6px;
  font-size: 13.5px; cursor: pointer; letter-spacing: 0.5px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0,0,0,0.35) inset;
  transition: border-color .2s, box-shadow .2s;
  white-space: nowrap; overflow: hidden;
}
.c-dp-text {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1;
}
.c-dp-icon {
  position: absolute; right: 10px; top: 50%; width: 14px; height: 14px;
  margin-top: -7px; pointer-events: none; opacity: 0.8;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23d4af37' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E");
  background-repeat: no-repeat; background-size: contain;
  transition: opacity .2s;
}
.c-datepicker:hover .c-dp-trigger {
  border-color: rgba(212,175,55,0.45);
  box-shadow: 0 0 6px rgba(212,175,55,0.15), 0 1px 3px rgba(0,0,0,0.35) inset;
}
.c-datepicker:hover .c-dp-icon { opacity: 1; }
.c-datepicker.open .c-dp-trigger {
  border-color: var(--gold);
  box-shadow: 0 0 10px rgba(212,175,55,0.25), 0 1px 3px rgba(0,0,0,0.35) inset;
}
.c-dp-popup {
  position: absolute; left: 0; top: calc(100% + 5px);
  width: 290px;
  background: #111e28; border: 1px solid rgba(212,175,55,0.45);
  border-radius: 8px; z-index: 1000;
  box-shadow: 0 14px 36px rgba(0,0,0,0.8), 0 0 18px rgba(212,175,55,0.15);
  padding: 10px 12px; display: none;
  backdrop-filter: blur(12px);
}
.c-datepicker.open .c-dp-popup {
  display: block; animation: cSelectFade .15s ease-out;
}

/* 顶部导航 */
.c-dp-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px; padding-bottom: 6px;
  border-bottom: 1px dashed rgba(212,175,55,0.25);
}
.c-dp-nav-group { display: flex; gap: 2px; }
.c-dp-btn {
  background: transparent; border: none; color: var(--gold);
  font-size: 14px; width: 24px; height: 24px; line-height: 24px;
  border-radius: 4px; cursor: pointer; display: inline-flex;
  align-items: center; justify-content: center; font-family: inherit;
  transition: background .15s, color .15s;
}
.c-dp-btn:hover {
  background: rgba(212,175,55,0.15); color: #fff;
}
.c-dp-title {
  display: flex; gap: 6px; align-items: center;
}
.c-dp-title-btn {
  background: transparent; border: none; color: var(--gold2);
  font-size: 13.5px; font-weight: bold; cursor: pointer;
  padding: 2px 6px; border-radius: 4px; font-family: inherit;
  letter-spacing: 0.5px; transition: background .15s;
}
.c-dp-title-btn:hover {
  background: rgba(212,175,55,0.15); color: #fff;
}

/* 星期栏 */
.c-dp-weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr);
  text-align: center; font-size: 11px; color: var(--dim);
  margin-bottom: 6px; font-weight: normal;
}

/* 日期网格 */
.c-dp-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 3px; row-gap: 4px; text-align: center;
}
.c-dp-day {
  height: 28px; line-height: 28px; font-size: 12px; color: #c4d3dc;
  border-radius: 50%; cursor: pointer; position: relative;
  transition: background .15s, color .15s;
  display: flex; align-items: center; justify-content: center;
}
.c-dp-day:hover {
  background: rgba(212,175,55,0.15); color: #e8c96a;
}
.c-dp-day.other-month {
  color: #3b5060;
}
.c-dp-day.today {
  box-shadow: 0 0 0 1px rgba(212,175,55,0.6) inset;
  color: var(--gold2);
}
.c-dp-day.selected {
  background: linear-gradient(135deg, #b8952e, #d4af37);
  color: #0c151d; font-weight: bold;
  box-shadow: 0 0 8px rgba(212,175,55,0.4);
}

/* 年份/月份快速选择面板 */
.c-dp-selector-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
  padding: 6px 0;
}
.c-dp-selector-item {
  padding: 8px 0; text-align: center; font-size: 12.5px; color: #c4d3dc;
  border-radius: 4px; cursor: pointer; background: rgba(255,255,255,0.02);
  transition: background .15s, color .15s;
}
.c-dp-selector-item:hover {
  background: rgba(212,175,55,0.15); color: #e8c96a;
}
.c-dp-selector-item.selected {
  background: linear-gradient(135deg, #b8952e, #d4af37);
  color: #0c151d; font-weight: bold;
}

/* 底部操作条 */
.c-dp-footer {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 8px; padding-top: 6px;
  border-top: 1px dashed rgba(212,175,55,0.25);
}
.c-dp-fbtn {
  background: transparent; border: none; font-size: 11.5px;
  color: var(--dim); cursor: pointer; padding: 2px 6px;
  border-radius: 4px; font-family: inherit;
  transition: color .15s;
}
.c-dp-fbtn:hover { color: var(--gold2); }
.c-dp-fbtn.btn-today { color: var(--gold); font-weight: bold; }

/* css/bazi.css */
/* 八字：四柱 · 大运 · 立体柱与流光交互 */
/* ===== 八字 ===== */
.pillars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pillar { background: var(--card2); border: 1px solid var(--line); border-radius: 8px; text-align: center; padding: 11px 4px; }
.pillar .ss { font-size: 11px; color: var(--dim); margin-bottom: 7px; min-height: 14px; }
.pillar .gz { font-size: 26px; color: var(--gold); line-height: 1.3; font-family: var(--font-serif); font-weight: 700; text-shadow: 0 0 10px rgba(226,197,106,0.25); }
.pillar .cg { font-size: 10px; color: var(--dim); margin-top: 7px; line-height: 1.5; }
.pillar .ny { font-size: 10px; color: var(--dim); margin-top: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { font-size: 11px; color: var(--gold2); border: 1px solid rgba(212,175,55,.35); border-radius: 4px; padding: 3px 8px; }
.chip.rel { color: #7ec8e3; border-color: rgba(126,200,227,.4); }
.wxbar { display: flex; gap: 6px; margin-top: 6px; }
.wxc { flex: 1; text-align: center; }
.wxc .bar { height: 8px; border-radius: 4px; background: var(--bg2); overflow: hidden; }
.wxc .fill { height: 100%; border-radius: 4px; }
.wxc .lb { font-size: 10px; color: var(--dim); margin-top: 3px; }
.dayun-strip { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 8px; }
.dy { min-width: 52px; text-align: center; background: var(--card2); border: 1px solid var(--line); border-radius: 6px; padding: 8px 4px; flex-shrink: 0; }
.dy .gz { font-size: 17px; color: var(--gold); }
.dy .age { font-size: 10px; color: var(--dim); margin-top: 4px; }
.kv { font-size: 13px; line-height: 2; }
.kv b { color: var(--gold2); font-weight: normal; }

/* ===== 八字四柱立体柱与大运流光交互 ===== */
.pillar {
  position: relative;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.pillar:hover {
  border-color: rgba(226, 197, 106, 0.45);
  transform: translateY(-2px);
}
.pillar.is-ri {
  border-color: var(--gold);
  box-shadow: 0 0 12px rgba(226, 197, 106, 0.25), inset 0 0 8px rgba(226, 197, 106, 0.1);
}
.pillar.is-ri::after {
  content: "日元";
  position: absolute;
  top: -8px;
  right: 6px;
  background: linear-gradient(135deg, #c79e32, var(--gold));
  color: #090e15;
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: 0.5px;
  font-family: var(--font-serif);
}

/* 大运流光交互轴 */
.dy {
  cursor: pointer;
  transition: all 0.2s ease;
}
.dy:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
  background: rgba(226, 197, 106, 0.08);
}
.dy.on {
  border-color: var(--gold);
  background: linear-gradient(180deg, rgba(226, 197, 106, 0.2) 0%, rgba(20, 35, 48, 0.9) 100%);
  box-shadow: 0 0 10px rgba(226, 197, 106, 0.35);
}
.dy.on .gz {
  color: #f7df8d;
  font-weight: 700;
}
.dayun-detail-card {
  margin-top: 10px;
  padding: 8px 12px;
  background: rgba(226, 197, 106, 0.06);
  border: 1px dashed var(--line);
  border-radius: 6px;
  font-size: 12px;
  color: var(--gold2);
  letter-spacing: 0.5px;
  animation: fadeIn .25s ease;
}

/* css/liuyao.css */
/* 六爻：卦行 · 明代永乐通宝摇卦 3D 动效 */
/* ===== 六爻 ===== */
.ly-headrow { display: grid; grid-template-columns: 40px 44px 1fr 1fr 56px; gap: 4px; font-size: 10px; color: var(--dim); padding: 0 8px 4px; }
.ly-row {
  display: grid; grid-template-columns: 40px 44px 1fr 1fr 56px; gap: 4px; align-items: center;
  background: var(--card2); border: 1px solid var(--line); border-radius: 6px;
  padding: 8px 8px; margin-bottom: 5px; font-size: 13px;
}
.ly-row .god { color: var(--dim); font-size: 12px; }
.ly-row .qin { color: var(--gold2); }
.ly-row .najia { color: var(--ink); }
.ly-row .chg { color: #7ec8e3; }
.ly-row .chg-none { color: #3a4c58; }
.ly-row .pos { color: var(--dim); font-size: 11px; text-align: center; }
.ly-row .mark { font-size: 11px; text-align: center; }
.ly-row .mark.move { color: var(--gold2); }
.ly-row .mark.shi { color: var(--gold); }

/* ===== 六爻铜钱摇卦（古风纯矢量 3D 明代永乐通宝） ===== */
.coins-stage {
  margin: 16px 0 20px;
  background: radial-gradient(circle at 50% 50%, rgba(32, 42, 54, 0.65) 0%, rgba(13, 18, 24, 0.9) 100%);
  border: 1px solid rgba(212, 175, 55, 0.28);
  border-radius: 14px;
  padding: 24px 16px 20px;
  box-shadow: inset 0 2px 14px rgba(0, 0, 0, 0.6), 0 4px 18px rgba(0, 0, 0, 0.4);
  text-align: center;
}
.coins-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 28px;
  min-height: 105px;
}
.coin-box {
  width: 92px;
  height: 92px;
  perspective: 900px;
  position: relative;
  user-select: none;
}
.coin-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.65s cubic-bezier(0.2, 0.85, 0.35, 1.2);
}
.coin-face {
  position: absolute;
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5));
}
.coin-face.front {
  transform: rotateY(0deg);
}
.coin-face.back {
  transform: rotateY(180deg);
}
.coin-svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* 翻转到背面 */
.coin-box.is-back .coin-inner {
  transform: rotateY(180deg);
}

/* 摇卦剧烈抛掷旋转动画 */
.coin-box.spin .coin-inner {
  animation: coinTossAnim 0.7s cubic-bezier(0.3, 0.1, 0.3, 1) infinite;
}
.coin-box:nth-child(2).spin .coin-inner {
  animation-delay: 0.05s;
}
.coin-box:nth-child(3).spin .coin-inner {
  animation-delay: 0.1s;
}

@keyframes coinTossAnim {
  0% { transform: translateY(0) rotateY(0deg) scale(1); }
  50% { transform: translateY(-38px) rotateY(720deg) scale(1.15) rotateZ(12deg); }
  100% { transform: translateY(0) rotateY(1440deg) scale(1) rotateZ(0deg); }
}

.coins-sub-hint {
  font-size: 12.5px;
  color: var(--dim);
  margin-top: 14px;
  letter-spacing: 1.5px;
}
.coins-sub-hint b {
  color: var(--gold2);
  font-weight: normal;
}

/* css/qimen.css */
/* 奇门：九宫 */
/* ===== 奇门 ===== */
.qm-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.qm-cell { background: var(--card2); border: 1px solid var(--line); border-radius: 6px; padding: 8px 6px; min-height: 96px; font-size: 12px; position: relative; }
.qm-cell.mid { background: transparent; border-style: dashed; }
.qm-cell .pal { position: absolute; top: 5px; right: 7px; font-size: 10px; color: var(--dim); }
.qm-cell .badge { position: absolute; top: 5px; left: 7px; font-size: 10px; color: #e07b6a; }
.qm-cell .god { color: var(--gold2); font-size: 11px; }
.qm-cell .star { color: var(--ink); margin-top: 3px; }
.qm-cell .door { color: var(--gold); margin-top: 3px; }
.qm-cell .gans { margin-top: 4px; font-size: 13px; letter-spacing: 2px; }
.qm-cell .gans small { color: var(--dim); font-size: 10px; }

/* css/reading.css */
/* 解读卡片与沉浸式宣纸阅读器 */
/* ===== 解读卡片（八字/结果页用） ===== */
.read {
  margin-top: 14px; position: relative; overflow: hidden;
  border: 1px solid rgba(212,175,55,.4); border-radius: 10px; background: var(--card2);
  min-height: 240px; display: flex; align-items: center; justify-content: center; padding: 18px;
}
.read .body { position: absolute; inset: 0; padding: 18px; filter: blur(7px); user-select: none; pointer-events: none; opacity: .75; overflow: hidden; }
.read .body p { font-size: 13px; line-height: 2; color: var(--ink); margin-bottom: 8px; }
.read .lock { position: relative; z-index: 1; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.read .lock .t { font-size: 15px; color: var(--gold); letter-spacing: 3px; }
.read .lock .d { font-size: 12px; color: var(--dim); line-height: 1.8; }
.read .lock .btn { padding: 9px 26px; border-radius: 6px; font-size: 14px; letter-spacing: 2px; background: linear-gradient(135deg, #b8952e, var(--gold), #b8952e); color: #0c151d; font-family: inherit; border: none; font-weight: 700; cursor: pointer; }
.err { color: #e07b6a; font-size: 13px; text-align: center; padding: 20px; }
footer { text-align: center; padding: 36px 20px 26px; }
footer .f1 { font-size: 12px; color: var(--dim); line-height: 2; }
footer .f2 { font-size: 11px; color: #5a6c77; margin-top: 12px; line-height: 1.8; }

/* =====================================================================
   沉浸式宣纸古籍阅读器
   ===================================================================== */
#p-reader {
  display: none;
  width: 100%;
}
#p-reader.on {
  display: block;
}

@media (min-width: 960px) {
  #p-reader.on {
    grid-column: 1 / -1;
    grid-row: 2;
    margin: 0;
    width: 100%;
  }
}

.reader-view {
  background: #10171c;
  min-height: 100vh;
  color: var(--white);
}

.reader-nav {
  height: 62px;
  background: #0b1217;
  display: flex;
  align-items: center;
  padding: 0 30px;
  gap: 20px;
  border-bottom: 1px solid #283139;
  position: sticky;
  top: 0;
  z-index: 25;
}
.reader-nav button {
  border: 0;
  background: none;
  color: var(--dim);
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  border-radius: 4px;
}
.reader-nav button:hover {
  color: var(--gold);
}
.reader-nav .book-title {
  font: 500 15px var(--font-serif);
  color: #d5dcde;
  letter-spacing: 1px;
}
.reader-nav .reader-actions {
  margin-left: auto;
  display: flex;
  gap: 12px;
}

.reader-layout {
  display: grid;
  grid-template-columns: 230px minmax(600px, 800px) 260px;
  justify-content: center;
  gap: 32px;
  padding: 32px 30px 70px;
}

.toc {
  padding-top: 20px;
  color: #9eaaaf;
  position: sticky;
  top: 94px;
  align-self: start;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}
.toc h3 {
  font: 500 15px var(--font-serif);
  color: #d4dcde;
  margin: 0 0 24px;
  letter-spacing: 2px;
}
.toc .volume {
  font-size: 11px;
  color: #677a84;
  margin: 25px 0 10px;
  letter-spacing: 1px;
}
.toc button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  color: #94a4ab;
  padding: 9px 12px;
  font: 14px var(--font-serif);
  cursor: pointer;
  border-radius: 3px;
  transition: all .15s;
}
.toc button:hover {
  color: var(--gold2);
  background: rgba(200, 169, 104, .04);
}
.toc button.on {
  color: var(--gold);
  border-left: 2px solid var(--gold);
  background: rgba(200, 169, 104, .08);
}

/* 宣纸正文页 */
.paper {
  background: var(--paper, #ece3d2);
  color: var(--ink, #292a26);
  min-height: 1000px;
  padding: 72px 74px 55px;
  box-shadow: 0 15px 60px rgba(0, 0, 0, .4);
  position: relative;
  border-radius: 2px;
}
.paper:after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .13;
  background-image: radial-gradient(#5d513c .45px, transparent .6px);
  background-size: 7px 7px;
}
.paper-content {
  position: relative;
  z-index: 1;
}
.paper .chapter-label {
  text-align: center;
  font-size: 11px;
  color: #7d7464;
  letter-spacing: 3px;
}
.paper h1 {
  text-align: center;
  font: 500 38px var(--font-serif);
  letter-spacing: 10px;
  margin: 18px 0 12px;
  color: #1a1a17;
}
.paper .chapter-source {
  text-align: center;
  color: #857b69;
  font: 12px var(--font-serif);
  margin-bottom: 50px;
}
.paper p {
  font: 18px/2.15 var(--font-serif);
  margin: 0 0 24px;
  text-align: justify;
  letter-spacing: 1px;
}
.paper p.original {
  font-size: 21px;
  font-weight: 600;
  color: #111;
}
.paper p.annotation {
  font-size: 16px;
  color: #5b584f;
  line-height: 2.05;
}
.paper .translation {
  border-top: 1px solid #bdb29c;
  margin-top: 32px;
  padding-top: 27px;
  color: #686153;
  font: 15px/2 var(--font-ui);
  letter-spacing: 0;
}

.paper-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #c4b8a3;
  margin-top: 52px;
  padding-top: 25px;
  position: relative;
  z-index: 2;
}
.paper-nav button {
  border: 0;
  background: none;
  color: #625b4e;
  font: 13px var(--font-serif);
  cursor: pointer;
  padding: 6px 10px;
}
.paper-nav button:hover {
  color: #1a1a17;
}
.paper-nav span {
  font-size: 11px;
  color: #8a7e6a;
}

/* 右侧与我的命盘相关 */
.reader-rel {
  padding-top: 20px;
  color: #aab5b9;
  position: sticky;
  top: 94px;
  align-self: start;
}
.reader-rel h3 {
  font: 500 16px var(--font-serif);
  color: #d7dfe1;
  margin: 0 0 12px;
  letter-spacing: 1px;
}
.reader-rel p {
  font-size: 12px;
  line-height: 1.9;
  color: var(--dim);
}
.rel-quote {
  border-top: 1px solid #344149;
  padding: 18px 0;
  margin-top: 18px;
}
.rel-quote strong {
  font: 500 14px var(--font-serif);
  color: var(--gold-soft);
  display: block;
}
.rel-quote p {
  margin: 8px 0;
}
.rel-quote .text-link {
  border: 0;
  background: none;
  color: var(--gold);
  padding: 0;
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
}

/* 阅读设置浮层 */
.reader-settings {
  display: none;
  position: fixed;
  right: 28px;
  top: 72px;
  width: 290px;
  padding: 22px;
  background: #152129;
  border: 1px solid #40505a;
  z-index: 35;
  box-shadow: 0 15px 50px rgba(0, 0, 0, .5);
  border-radius: 4px;
}
.reader-settings.open {
  display: block;
}
.reader-settings h3 {
  margin: 0 0 20px;
  font: 500 17px var(--font-serif);
  color: var(--gold);
}
.setting-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 15px 0;
  color: #b6c1c6;
  font-size: 12px;
}
.setting-line button {
  background: #0d171e;
  color: #bbc6ca;
  border: 1px solid #3b4a53;
  padding: 6px 10px;
  border-radius: 3px;
  cursor: pointer;
}
.setting-line button:hover {
  border-color: var(--gold);
  color: var(--gold2);
}

.reader-view.serif-large .paper p { font-size: 22px; }
.reader-view.serif-large .paper p.original { font-size: 25px; }
.reader-view.hide-translation .translation { display: none; }
.reader-view.hide-translation .paper p.annotation { display: none; }

/* 响应式 */
@media (max-width: 1200px) {
  .reader-layout { grid-template-columns: 190px minmax(550px, 1fr); }
  .reader-rel { display: none; }
}

@media (max-width: 959px) {
  .reader-layout { display: block; padding: 15px; }
  .toc { display: none; }
  .paper { padding: 50px 30px; min-height: auto; }
  .paper h1 { font-size: 28px; }
  .paper p.original { font-size: 18px; }
  .paper p { font-size: 16px; }
}

/* css/drawer.css */
/* 设置抽屉（盘面流派 / 高级设置） */
/* ===== 文墨天机级设置抽屉系统 (Settings Drawer) ===== */
.drawer-mask {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9998;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.drawer-mask.open {
  display: block;
  opacity: 1;
}

.drawer-container {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 72vh;
  max-height: 72vh;
  background: #111c28;
  border-top: 1px solid var(--line-strong);
  border-radius: 16px 16px 0 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.28s;
  box-shadow: 0 -6px 30px rgba(0, 0, 0, 0.85);
  visibility: hidden;
  pointer-events: none;
}
.drawer-container.open {
  transform: translateY(0);
  visibility: visible;
  pointer-events: auto;
}
@media (min-width: 768px) {
  .drawer-container {
    left: auto;
    right: 0;
    top: 0;
    bottom: 0;
    width: 440px;
    max-height: 100vh;
    border-radius: 16px 0 0 16px;
    border-top: none;
    border-left: 1px solid var(--line-strong);
    transform: translateX(100%);
  }
  .drawer-container.open {
    transform: translateX(0);
  }
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--bg2);
}
.drawer-title {
  font-family: var(--font-serif);
  font-size: 16px;
  color: var(--gold);
  font-weight: 700;
  letter-spacing: 1.5px;
}
.drawer-close {
  background: transparent;
  border: none;
  color: var(--dim);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
}
.drawer-close:hover {
  color: #fff;
}
.drawer-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
}
.drawer-footer {
  flex-shrink: 0;
  display: flex;
  gap: 12px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  background: var(--bg2);
}
.drawer-btn-cancel {
  flex: 1;
  padding: 10px 0;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--dim);
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13.5px;
}
.drawer-btn-apply {
  flex: 2;
  padding: 10px 0;
  background: linear-gradient(135deg, #c79e32, var(--gold));
  color: #080d13;
  font-weight: 700;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  letter-spacing: 1px;
}

/* css/ziwei-board.css */
/* 紫微盘面：容器 · 宫格 · 星曜 · 四化方块 · 皮肤微调 */
/* ===== 紫微盘 · 文墨天机像素级精准复刻体系（高对比、大字号、饱满竖长方形宫格） ===== */
.zw-wrap { position: relative; padding: 0; }
@media (max-width: 600px) {
  .zw-wrap { padding: 0; border: none; background: transparent; }
}

/* 顶栏彻底去卡片化：纯净通透，完全对标文墨天机 */
.result-top-bar {
  display: none;
  width: 100%;
  height: 44px;
  align-items: center;
  justify-content: space-between;
  margin: 0 !important; /* 绝对零外边距，严禁悬浮边隙 */
  padding: 0 12px;
  background: var(--card2) !important; /* 质感卡片深色底板 */
  border: none !important;
  border-bottom: 1px solid var(--line) !important; /* 文墨天机级底边分割线 */
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5) !important;
  border-radius: 0 !important;
  box-sizing: border-box;
  flex-shrink: 0;
}
body.in-result-view .result-top-bar {
  display: flex !important;
}
.rtb-btn {
  background: transparent !important;
  border: none !important;
  color: #64b5f6 !important; /* 文墨天机同款清澈天蓝 */
  font-size: 15px;
  padding: 0 4px;
  height: 34px;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap !important;
  flex-shrink: 0;
  font-weight: 500;
  letter-spacing: 0.5px;
  transition: opacity 0.15s;
}
.rtb-btn:active { opacity: 0.7; }
.rtb-btn.rtb-sub {
  color: #ff8a80 !important;
  font-size: 12.5px;
  margin-left: 4px;
}
.rtb-title {
  font-family: var(--font-serif);
  font-size: 17px !important;
  color: #ffd54f !important; /* 纯正明金 */
  font-weight: 700 !important;
  letter-spacing: 2px !important;
  text-shadow: 0 0 12px rgba(255, 213, 79, 0.35);
  text-align: center;
  white-space: nowrap;
}

/* 盘面容器：横向 100% 满幅利用手机物理屏幕！最大宽度 520px */
.wm-board-container {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}
.wm-dir-bar {
  display: flex;
  justify-content: space-around;
  padding: 1px 0;
  font-size: 10.5px;
  color: #8da2b3;
  letter-spacing: 1px;
  line-height: 1.1;
}
.wm-dir-bar.top { margin-bottom: 1px; }
.wm-dir-bar.bottom { margin-top: 1px; }

/* 命盘：单格竖长方形高宽比 1:1.28，整盘纵横比 4 / 5.12！文墨天机真机完全一致 */
.zw-board {
  position: relative;
  container-type: inline-size;
  width: 100%;
  aspect-ratio: 4 / 5.12;
  border: 1px solid rgba(226, 197, 106, 0.28);
  background: rgba(226, 197, 106, 0.28); /* 1px 极细黄金分割线 */
  overflow: hidden;
  border-radius: 2px;
}
.zw-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 1px;
  width: 100%;
  height: 100%;
}
.zw-cell {
  background: #0f1924; /* 沉静玄铁墨底，衬托高对比度星曜 */
  border: none;
  border-radius: 0;
  padding: clamp(2px, 0.8cqw, 4px) clamp(1.5px, 0.6cqw, 3px);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
  min-width: 0;
  min-height: 0;
}
.zw-cell.sel { background: rgba(255, 213, 79, .12); box-shadow: inset 0 0 0 1.5px #ffd54f; }
.zw-cell.ln { box-shadow: inset 0 0 0 1.5px #ff5252; }

/* ① 星曜区：顶部并排，文字大幅放大，高对比度明亮色系 */
.cell-stars {
  display: flex; flex-wrap: nowrap; align-items: flex-start;
  gap: 0; flex: 0 0 auto; overflow: hidden; min-height: 0;
}
.star-v {
  display: inline-flex; flex-direction: column; align-items: center;
  flex-shrink: 0; line-height: 1; letter-spacing: 0;
}
.star-v .char {
  font-size: clamp(8px, var(--fs, 3.8cqw), 26px); /* 大幅提升字号！字字清晰饱满 */
  font-weight: 700;
  font-family: var(--font-serif);
  line-height: 1.05;
}
/* 文墨天机高对比明度体系（在黑底上犹如鲜明刻印，绝不发虚） */
.star-v.major .char { color: #ff5252; } /* 明艳朱砂红 */
.star-v.assist .char { color: #ce93d8; } /* 明亮紫晶 */
.star-v.sha .char { color: #90caf9; }   /* 明亮天蓝 */
.star-v.misc .char { color: #4dd0e1; }  /* 明晰天青 */
.star-v .bright {
  font-size: clamp(5.5px, 2.0cqw, 13px);
  color: #b0bec5; margin-top: 1.5px; line-height: 1;
  font-family: var(--font-ui); font-weight: 500;
}
.star-v .zh {
  font-size: clamp(4px, 1.3cqw, 10px); line-height: 1.1; margin-top: 1px;
  font-family: var(--font-ui); white-space: nowrap; font-weight: bold;
}
.star-v .zh.lu { color: #69f0ae; }
.star-v .zh.qa { color: #ea80fc; }
.star-v .zh.ke { color: #80d8ff; }
.star-v .zh.ji { color: #ff8a80; }
.star-v .hchip { display: block; margin-top: 1px; padding: 0 1px; border-radius: 1.5px; color: #fff; font-weight: 700; line-height: 1.2;
  font-size: max(6px, min(var(--t-sub, 8px), calc(var(--fs, 3.3cqw) * .95))); font-family: var(--font-ui); }
.star-v .hchip.lu { background: #00c853; } .star-v .hchip.qa { background: #aa00ff; }
.star-v .hchip.ke { background: #0091ea; } .star-v .hchip.ji { background: #d50000; }
.star-v .hchip.flow { background: transparent; box-shadow: inset 0 0 0 1.2px currentColor; }
.star-v .hchip.flow.lu { color: #69f0ae; } .star-v .hchip.flow.qa { color: #ea80fc; }
.star-v .hchip.flow.ke { color: #80d8ff; } .star-v .hchip.flow.ji { color: #ff8a80; }

/* ② 四化方块：紧随其下，纯正明亮色彩 */
.cell-hua {
  display: flex; gap: 1.5px; margin-top: 1.5px;
  flex-wrap: nowrap; overflow: hidden; flex: 0 0 auto;
}
.cell-hua .h {
  font-size: clamp(5px, 1.8cqw, 12px); line-height: 1.25;
  padding: 0 clamp(1px, 0.4cqw, 2.5px); border-radius: 1.5px;
  color: #fff; font-weight: 700; flex-shrink: 0;
}
.cell-hua .h.lu { background: #00c853; }
.cell-hua .h.qa { background: #aa00ff; }
.cell-hua .h.ke { background: #0091ea; }
.cell-hua .h.ji { background: #d50000; }
.cell-hua .h.flow { background: transparent; border: 1.2px solid currentColor; font-weight: bold; }
.cell-hua .h.flow.lu { color: #69f0ae; }
.cell-hua .h.flow.qa { color: #ea80fc; }
.cell-hua .h.flow.ke { color: #80d8ff; }
.cell-hua .h.flow.ji { color: #ff8a80; }

.cell-ghua {
  display: flex; flex-wrap: wrap; gap: 1px 2px; margin-top: 1px;
  flex: 0 0 auto; overflow: hidden;
}
.cell-ghua .g {
  font-size: clamp(4.5px, 1.5cqw, 11px); line-height: 1.3;
  font-family: var(--font-ui); color: #cfd8dc; white-space: nowrap;
}
.cell-ghua .g i { font-style: normal; opacity: .7; }
.cell-ghua .g.lu { color: #69f0ae; }
.cell-ghua .g.qa { color: #ea80fc; }
.cell-ghua .g.ke { color: #80d8ff; }
.cell-ghua .g.ji { color: #ff8a80; }

/* ③ 中段：流年/小限虚岁，文墨天机严密两行居中排布 */
.cell-ages {
  margin: auto 0 2px; text-align: center;
  font-size: clamp(4.5px, 1.7cqw, 11px); line-height: 1.25;
  color: #78909c; white-space: nowrap; flex: 0 0 auto;
  font-family: var(--font-ui);
}
.cell-ages .k { color: #90a4ae; font-weight: 500; }

/* ④ 大限岁数：文墨天机标志性清晰粗大字号 */
.cell-dx {
  text-align: center; font-family: var(--font-serif);
  font-size: clamp(8px, 3.2cqw, 19px); font-weight: 700;
  color: #eceff1; letter-spacing: .4px; line-height: 1.1;
  flex: 0 0 auto; margin-bottom: 2px;
}

/* ⑤ 底部：文墨天机精准四角定位 */
.cell-foot {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 2px; flex: 0 0 auto;
}
.foot-shen {
  display: flex; flex-direction: column;
  font-size: clamp(4.2px, 1.5cqw, 11px); line-height: 1.15;
  color: #4dd0e1; white-space: nowrap; overflow: hidden;
}
.foot-r { display: flex; align-items: flex-end; gap: clamp(1px, 0.4cqw, 3px); min-width: 0; overflow: hidden; flex-shrink: 0; }
.foot-r .pal-name {
  font-family: var(--font-serif);
  font-size: clamp(7.5px, 2.9cqw, 19px); font-weight: 700;
  color: #ff5252; /* 文墨天机同款纯正红色大字宫名！ */
  line-height: 1; white-space: nowrap;
}
.foot-r .pal-name.ming-pal { color: #ff1744; text-shadow: 0 0 6px rgba(255, 23, 68, .5); }
.foot-r .right-col { display: flex; flex-direction: column; align-items: center; line-height: 1.0; }
.foot-r .right-col i { font-style: normal; }
.foot-r .right-col .gz {
  font-family: var(--font-serif);
  font-size: clamp(6px, 2.2cqw, 15px); color: #eceff1; font-weight: 700;
}
.foot-r .right-col .cs { font-size: clamp(4.5px, 1.6cqw, 11px); color: #b0bec5; margin-bottom: 1px; }
.laiyin-stamp {
  border: 1px solid #4dd0e1; color: #4dd0e1; border-radius: 2px;
  font-size: clamp(4.5px, 1.5cqw, 11px); padding: 0 1px; line-height: 1.1;
  font-weight: 700; white-space: nowrap;
}
.zw-cell .sg-stamp, .zw-cell .layer-ming-stamp {
  border: 1px solid #ff1744; color: #ff1744; border-radius: 2px;
  font-size: clamp(4.5px, 1.5cqw, 11px); padding: 0 1px; line-height: 1.1;
  font-weight: 700; white-space: nowrap;
}

/* 皮肤差异微调 */
.zw-cell.skin-fx .cell-ages, .zw-cell.skin-fx .cell-dx, .zw-cell.skin-fx .star-v .bright { display: none; }
.zw-cell.skin-fx .cell-stars { justify-content: center; width: 100%; }
.zw-cell.skin-fx .cell-hua { justify-content: center; }
.zw-cell.skin-fx .cell-ghua { margin: auto 0; justify-content: center; gap: 2px 4px; }
.zw-cell.skin-fx .cell-ghua .g { font-size: clamp(5px, 1.8cqw, 13px); font-weight: 600; }
.zw-cell.skin-4h .cell-hua { display: none; }
.zw-cell.skin-4h .star-v .bright { display: none; }
.star-v .h-inline {
  font-size: clamp(5px, 1.7cqw, 12px); line-height: 1.25;
  color: #fff; font-weight: 700; padding: 0 clamp(1px, .4cqw, 2px);
  border-radius: 1.5px; margin-top: 1px;
}
.star-v .h-inline.lu { background: #00c853; }
.star-v .h-inline.qa { background: #aa00ff; }
.star-v .h-inline.ke { background: #0091ea; }
.star-v .h-inline.ji { background: #d50000; }

/* css/ziwei-center.css */
/* 紫微中宫（基础）：四柱 · 大运 · 自化图示 · 旧版选宫态 */
/* 中宫：文墨天机 1:1 像素级复刻体系（竖向充盈、左右对齐、消灭空旷） */
.zw-center {
  grid-column: 2 / 4; grid-row: 2 / 4;
  background: #09121a;
  display: flex; flex-direction: column;
  align-items: center; justify-content: space-between; /* 竖向完全顶格撑满，消除中间空洞！ */
  text-align: center;
  padding: clamp(5px, 1.8cqw, 12px) clamp(4px, 1.5cqw, 10px);
  overflow: hidden; cursor: default;
  box-sizing: border-box;
}
.ct-row {
  display: flex; justify-content: space-between; align-items: baseline;
  width: 100%;
}
.ct-brand {
  font-family: var(--font-serif);
  font-size: clamp(10px, 3.4cqw, 19px); font-weight: 700;
  color: #ffd54f; letter-spacing: 1.5px;
}
.ct-head-sub {
  font-family: var(--font-serif);
  font-size: clamp(8px, 2.7cqw, 15px); color: #eceff1;
  font-weight: 600; white-space: nowrap;
}
.ct-line-kv {
  display: flex; justify-content: space-between; align-items: baseline;
  width: 100%; font-size: clamp(6.5px, 2.2cqw, 13px); color: #b0bec5;
  line-height: 1.35; white-space: nowrap;
}
.ct-line-kv span { white-space: nowrap; }
.ct-line-kv b { color: #ffd54f; font-weight: 600; }
.ct-line-center {
  font-size: clamp(6.5px, 2.2cqw, 13px); color: #b0bec5;
  line-height: 1.35; white-space: nowrap;
}
.ct-line-center b { color: #ffd54f; font-weight: 600; }

/* 核心四柱大表：两列对称排布（节气四柱 + 非节气四柱，或大字居中） */
.ct-bazi-wrap {
  display: flex; flex-direction: column; align-items: center;
  margin: clamp(2px, 0.8cqw, 6px) 0; width: 100%;
}
.ct-bazi-label {
  font-size: clamp(5.5px, 1.8cqw, 10.5px); color: #78909c;
  margin-bottom: 2px; letter-spacing: 1px;
}
.ct-gz { display: flex; gap: clamp(8px, 3cqw, 24px); }
.ct-gz .it { display: flex; flex-direction: column; align-items: center; font-family: var(--font-serif); line-height: 1.0; }
.ct-gz .it .g { color: #ff5252; font-weight: 700; font-size: clamp(14px, 4.8cqw, 28px); }
.ct-gz .it .z { color: #ffd54f; font-weight: 700; font-size: clamp(14px, 4.8cqw, 28px); }

/* 起运信息条 */
.ct-qiyun-bar {
  font-size: clamp(6.5px, 2.1cqw, 12px); color: #90a4ae;
  line-height: 1.25; white-space: nowrap;
}

/* 文墨天机同款：8 列独立竖排大运表（干支、岁数、年份上下紧凑对齐） */
.ct-dayun-grid {
  display: flex; justify-content: space-between; align-items: flex-start;
  width: 100%; margin-top: 2px;
}
.ct-dayun-grid .dy-col {
  display: flex; flex-direction: column; align-items: center;
  line-height: 1.1; flex: 1; min-width: 0;
}
.ct-dayun-grid .dy-gz {
  display: flex; flex-direction: column; align-items: center;
  font-family: var(--font-serif); font-weight: 700;
  font-size: clamp(7.5px, 2.6cqw, 16px); line-height: 1.0;
}
.ct-dayun-grid .dy-gz .g { color: #eceff1; }
.ct-dayun-grid .dy-gz .z { color: #ffd54f; }
.ct-dayun-grid .dy-age {
  font-size: clamp(5.5px, 1.8cqw, 11px); color: #b0bec5;
  margin-top: 2px; white-space: nowrap;
}
.ct-dayun-grid .dy-yr {
  font-size: clamp(4.8px, 1.5cqw, 9.5px); color: #78909c;
  margin-top: 1px; white-space: nowrap;
}

/* 文墨天机同款：中宫底部四化图示（自化 / 生年图示） */
.ct-sihua-diagram {
  display: flex; justify-content: center; align-items: center;
  gap: clamp(3px, 1cqw, 8px);
  width: 100%; padding-top: 2px;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
  font-size: clamp(5.5px, 1.8cqw, 11px); color: #78909c;
}
.ct-sihua-diagram .it-h { display: flex; align-items: center; gap: 1px; }
.ct-sihua-diagram .it-h.lu { color: #69f0ae; }
.ct-sihua-diagram .it-h.qa { color: #ea80fc; }
.ct-sihua-diagram .it-h.ke { color: #80d8ff; }
.ct-sihua-diagram .it-h.ji { color: #ff8a80; }

/* 中宫选宫态 */
.zw-center .cinfo { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; }
.zw-center .c-header {
  font-size: clamp(8px, 2.7cqw, 20px); color: #ffd54f; font-weight: 700;
  letter-spacing: .3cqw; margin-bottom: clamp(1px, .3cqw, 4px);
  font-family: var(--font-serif);
}
.zw-center .c-line { font-size: clamp(5.5px, 1.9cqw, 14px); color: #eceff1; line-height: 1.35; white-space: nowrap; }
.zw-center .c-line.dim { color: #90a4ae; font-size: clamp(5px, 1.7cqw, 12.5px); }
.zw-center .c-line b { color: #ffd54f; font-weight: 600; }
.zw-center .sel-box { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; height: 100%; }

/* css/ziwei-flow.css */
/* 紫微限流区：流运滑轨 · 标签 · 条带 */
/* 命盘下方紧贴的流运滑轨（5 行紧凑排列） */
.wm-flow-controls {
  margin-top: 2px;
  background: #0f1924;
  border: 1px solid rgba(226, 197, 106, 0.28);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.wm-flow-row {
  display: flex;
  align-items: center;
  background: rgba(0,0,0,0.22);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1px 2px;
  height: 24px;
}
.wm-flow-row:last-child { border-bottom: none; }
.wm-flow-label {
  width: 38px;
  flex-shrink: 0;
  font-family: var(--font-serif);
  font-size: 11px;
  font-weight: 700;
  color: #ffd54f;
  text-align: center;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  padding-right: 2px;
  line-height: 1;
}
.wm-flow-strip {
  flex: 1;
  display: flex;
  gap: 3px;
  overflow-x: auto;
  padding: 1px 3px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.wm-flow-strip::-webkit-scrollbar { display: none; }
.wm-flow-strip .st-chip {
  flex-shrink: 0;
  min-width: 44px;
  padding: 1.5px 3px;
  text-align: center;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 3px;
  font-size: 11px;
  color: #b0bec5;
  cursor: pointer;
  line-height: 1.05;
  transition: all .15s;
}
.wm-flow-strip .st-chip.on {
  background: linear-gradient(135deg, rgba(255,213,79,0.3) 0%, rgba(20,35,48,0.95) 100%);
  border-color: #ffd54f;
  color: #fff;
  font-weight: bold;
}
.wm-flow-strip .st-chip small {
  display: block;
  font-size: 9px;
  color: #78909c;
}
.wm-flow-strip .st-chip.on small { color: #ffd54f; }

/* 连线层 */
.zw-svg { position: absolute; inset: 0; pointer-events: none; width: 100%; height: 100%; }
.zw-svg line { stroke: #b2bec3; opacity: .85; }
.zw-feiline { animation: feiDash .9s linear infinite; }
@keyframes feiDash { to { stroke-dashoffset: -14; } }

.board-title { display: none !important; }
.zw-cell .sec-name { font-size: clamp(5.5px, 1.7cqw, 13px); color: #ffe082; line-height: 1.2; white-space: nowrap; }
details.adv {
  display: block;   /* 部分 Chrome UA 对未展开 details 计算为 none，显式覆盖 */
  margin-top: 10px; border: 1px dashed var(--line); border-radius: 8px;
  padding: 8px 12px; background: rgba(255,255,255,.015);
}
details.adv summary {
  cursor: pointer; color: var(--dim); font-size: 12px; letter-spacing: 1px;
  user-select: none;
}
details.adv .row { margin-top: 8px; }
details.adv[open] summary { color: var(--gold2); margin-bottom: 4px; }
.adv-body { margin-top: 10px; }
.adv-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.adv-item { display: flex; flex-direction: column; gap: 3px; }
.adv-item .adv-lbl { font-size: 11px; color: var(--gold); font-weight: bold; }
.adv-item select {
  width: 100%;
  min-width: 0;
  font-size: 12px;
  padding: 7px 22px 7px 8px;
  background-size: 9px 6px;
  background-position: right 7px center;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 600px) {
  details.adv .row { flex-direction: column; gap: 8px; }
  details.adv .row .f { width: 100%; min-width: 100%; }
  .adv-grid { grid-template-columns: 1fr; gap: 6px; }
}
.flow-tabs { display: flex; gap: 6px; margin-bottom: 6px; }
.flow-tabs .ft {
  padding: clamp(2px, 0.75cqw, 6px) clamp(8px, 2.5cqw, 20px);
  border: 1px solid var(--line); border-radius: 999px;
  font-size: clamp(10px, 2.6cqw, 20px); color: var(--dim); cursor: pointer; user-select: none;
}
.flow-tabs .ft.on { border-color: var(--gold); color: var(--gold); background: rgba(212,175,55,.08); }
/* 控制滑条基础样式 */
.zw-strip {
  display: flex; gap: 5px; overflow-x: auto; padding: 6px 0;
  scrollbar-width: none; -ms-overflow-style: none;
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 16px), transparent);
          mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 16px), transparent);
}
.zw-strip::-webkit-scrollbar { display: none; width: 0; height: 0; }
.zw-strip .st-chip {
  min-width: 58px; text-align: center; background: var(--card2); border: 1px solid var(--line);
  border-radius: 6px; padding: 6px 4px; flex-shrink: 0; cursor: pointer; font-size: 11px; color: var(--ink);
  transition: border-color .15s, color .15s, background-color .15s;
  user-select: none;
}
.zw-strip .st-chip:hover { border-color: rgba(212,175,55,0.4); color: var(--gold2); }
.zw-strip .st-chip.on {
  border-color: var(--gold); color: var(--gold);
  background: rgba(212,175,55,0.1); font-weight: bold;
}
.zw-strip .st-chip small { display: block; color: var(--dim); font-size: 9px; margin-top: 2px; font-weight: normal; }

/* PC 桌面端 (≥640px)：彻底平铺，所有选项一览无余，彻底无需滚动！ */
@media (min-width: 640px) {
  /* 12等分平铺（大限条、年份条、流月条） */
  .zw-strip.grid-12 {
    display: grid !important;
    grid-template-columns: repeat(12, 1fr) !important;
    gap: 4px !important;
    overflow-x: visible !important;
    mask-image: none !important;
    -webkit-mask-image: none !important;
  }
  .zw-strip.grid-12 .st-chip {
    min-width: 0 !important;
    padding: 6px 2px !important;
    font-size: 11px !important;
  }
  .zw-strip.grid-12 .st-chip small {
    font-size: 8.5px !important;
  }

  /* 30天流日平铺：三旬排列（每旬10天，共3行，十天为一旬） */
  .zw-strip.grid-days {
    display: grid !important;
    grid-template-columns: repeat(10, 1fr) !important;
    gap: 4px !important;
    overflow-x: visible !important;
    mask-image: none !important;
    -webkit-mask-image: none !important;
  }
  .zw-strip.grid-days .st-chip {
    min-width: 0 !important;
    padding: 5px 2px !important;
    font-size: 11px !important;
    line-height: 1.15;
  }
  .zw-strip.grid-days .st-chip small {
    display: inline-block;
    font-size: 8.5px !important;
    margin-left: 1px;
    margin-top: 0;
  }
}

/* css/ziwei-track.css */
/* 三方四正星轨流光动效 */
/* ===== 三方四正星轨流光进场动效 ===== */
.zw-track-line {
  animation: starTrackFlow 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.zw-track-arrow {
  animation: starArrowPop 0.25s 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275) backwards;
  transform-origin: center;
}
@keyframes starTrackFlow {
  from {
    opacity: 0;
    stroke-dashoffset: 60;
  }
  to {
    opacity: 0.85;
    stroke-dashoffset: 0;
  }
}
@keyframes starArrowPop {
  from {
    opacity: 0;
    transform: scale(0.4);
  }
  to {
    opacity: 0.95;
    transform: scale(1);
  }
}

/* css/result-view.css */
/* 结果页：一屏锁定 · 顶栏 · 表单态隐藏结果 */
/* ===== 文墨天机级统一结果页与顶栏交互体系 ===== */
/* 手机：只有紫微盘做「一屏锁定」；八字 / 奇门 / 六爻内容比一屏长，必须能正常下拉 */
@media (max-width: 959.98px) {
  body.in-result-view.rv-ziwei {
    overflow: hidden; /* 紫微盘一屏零滚动 */
    height: 100vh;
    height: 100dvh;   /* 安卓 Chrome 的 100vh 含地址栏，实际可视高度更小，会把底部流时行裁掉 */
  }
  body.in-result-view.rv-ziwei .wrap {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    padding: 0; /* 彻底去除左右 padding，满幅贴满屏幕！ */
    display: flex;
    flex-direction: column;
    max-width: 520px;
  }
  body.in-result-view:not(.rv-ziwei) .wrap { max-width: 560px; padding-bottom: 28px; }
  body.in-result-view:not(.rv-ziwei) .result-top-bar { position: sticky; top: 0; z-index: 20; margin-top: 0; }
  body.in-result-view header,
  body.in-result-view .topnav,
  body.in-result-view .panel-form-card { display: none !important; }
  body.in-result-view.rv-ziwei footer { display: none !important; }
  /* 表单态隐藏上一次的排盘结果 */
  body:not(.in-result-view) #zw-result,
  body:not(.in-result-view) #bz-result,
  body:not(.in-result-view) #qm-result,
  body:not(.in-result-view) #ly-result { display: none !important; }
}

.result-top-bar {
  display: none;
  height: 46px;
  padding: 0 10px;
  align-items: center;
  justify-content: space-between;
  margin: 4px 0 8px;
  padding: 0 6px;
  background: var(--card2);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.4);
}
body.in-result-view .result-top-bar {
  display: flex !important;
}

.rtb-btn {
  background: rgba(226, 197, 106, 0.1);
  border: 1px solid var(--line);
  color: var(--gold);
  font-size: 13px;
  padding: 0 12px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap !important;
  flex-shrink: 0;
  line-height: 32px;
  transition: all .15s;
}
.rtb-btn:hover {
  background: rgba(226, 197, 106, 0.2);
  color: #fff;
}
.rtb-title {
  font-family: var(--font-serif);
  font-size: 13px;
  color: var(--ink);
  font-weight: 600;
  letter-spacing: 0.5px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  padding: 0 6px;
}
.rtb-title b {
  color: var(--gold2);
}

/* 出盘后彻底隐藏重复多余的居中大标题，让命盘/立柱紧贴顶栏！ */
body.in-result-view .r-head {
  display: none !important;
}

/* 文墨天机级顶栏标题 */
.rtb-title {
  font-family: var(--font-serif);
  font-size: 15px !important;
  color: var(--gold) !important;
  font-weight: 700 !important;
  letter-spacing: 2px !important;
  text-shadow: 0 0 10px rgba(226, 197, 106, 0.3);
}

/* 盘面紧贴顶栏，去除多余留白 */
body.in-result-view .board-title {
  display: none !important;
}
body.in-result-view .zw-wrap {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* css/ziwei-layout.css */
/* 紫微专业版紧凑架构（盘面 + 流运滑轨） */
/* ===== 文墨天机专业版 1:1 紧凑架构样式 ===== */
.wm-board-container {
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}
.wm-dir-bar {
  display: flex;
  justify-content: space-around;
  padding: 3px 0;
  font-size: 11px;
  color: var(--dim-sub);
  letter-spacing: 1px;
}
.wm-dir-bar.top {
  margin-bottom: 2px;
}
.wm-dir-bar.bottom {
  margin-top: 2px;
}

/* 命盘下方紧贴的流运滑轨体系 */
.wm-flow-controls {
  margin-top: 6px;
  background: var(--card2);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.wm-flow-row {
  display: flex;
  align-items: center;
  background: rgba(0,0,0,0.2);
  border-bottom: 1px solid var(--line-sub);
  padding: 3px 4px;
}
.wm-flow-row:last-child {
  border-bottom: none;
}
.wm-flow-label {
  width: 44px;
  flex-shrink: 0;
  font-family: var(--font-serif);
  font-size: 12px;
  font-weight: 700;
  color: var(--gold);
  text-align: center;
  border-right: 1px solid var(--line-sub);
  padding-right: 4px;
}
.wm-flow-strip {
  flex: 1;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 2px 4px;
  -webkit-overflow-scrolling: touch;
}
.wm-flow-strip .st-chip {
  flex-shrink: 0;
  min-width: 46px;
  padding: 3px 4px;
  text-align: center;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--line-sub);
  border-radius: 4px;
  font-size: 11px;
  color: var(--dim);
  cursor: pointer;
  line-height: 1.1;
  transition: all .15s;
}
.wm-flow-strip .st-chip.on {
  background: linear-gradient(135deg, rgba(226,197,106,0.3) 0%, rgba(20,35,48,0.9) 100%);
  border-color: var(--gold);
  color: #fff;
  font-weight: bold;
}
.wm-flow-strip .st-chip small {
  display: block;
  font-size: 9.5px;
  color: var(--dim-sub);
}
.wm-flow-strip .st-chip.on small {
  color: var(--gold2);
}

/* css/ziwei-switch.css */
/* 体 / 用 / 应 三盘切换器 · 叠宫状态条 */
/* ===== 紫微 体/用/应 三盘切换器 ===== */
.wm-pan-switch {
  display: flex;
  gap: 4px;
  margin: 0 0 4px;
  padding: 3px;
  background: var(--card2);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.wm-pan-btn {
  flex: 1;
  padding: 6px 0;
  font-size: 12.5px;
  font-family: var(--font-serif);
  color: var(--dim);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
}
.wm-pan-btn:hover { color: var(--gold2); background: rgba(226,197,106,.06); }
.wm-pan-btn.on {
  color: #080d13;
  background: linear-gradient(135deg, #f3dc8e, #e2c56a);
  border-color: var(--gold);
  font-weight: 700;
}
.wm-block-title {
  font-family: var(--font-serif);
  font-size: 12px;
  color: var(--gold);
  text-align: center;
  padding: 6px 0 2px;
  letter-spacing: 1.5px;
}
.wm-all .zw-board { max-width: 520px; margin: 0 auto; }
.wm-board-block { margin-bottom: 4px; }


/* 叠宫状态条（限流盘） */
.wm-stack-bar {
  display: flex; align-items: center; gap: 6px;
  margin: 0 0 4px; padding: 4px 8px;
  background: rgba(226, 197, 106, .06);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 11.5px; color: var(--dim);
}
.wm-stack-bar .sk {
  color: #0a1017; background: var(--gold);
  font-size: 10px; font-weight: 700;
  padding: 0 5px; border-radius: 3px; line-height: 16px;
}
.wm-stack-bar .sk-back {
  margin-left: auto;
  background: transparent; border: 1px solid var(--line);
  color: var(--gold); font-size: 11px; padding: 2px 8px;
  border-radius: 4px; cursor: pointer; font-family: inherit;
}
.wm-stack-bar .sk-back:hover { background: rgba(226, 197, 106, .15); color: #fff; }

/* css/ziwei-skin.css */
/* 三合 / 飞星 / 四化皮肤 · 天地人盘切换 */
/* ===== 三合 / 飞星 / 四化 皮肤 + 天盘/地盘/人盘 切换 ===== */
.wm-mode-bar {
  display: flex; gap: 6px; margin: 0 0 4px;
}
.wm-mode-bar .seg {
  display: flex; flex: 1; gap: 2px; padding: 2px;
  background: var(--card2); border: 1px solid var(--line); border-radius: 7px;
}
.wm-mode-bar .seg button {
  flex: 1; padding: 4px 0; font-size: 11.5px; font-family: var(--font-serif);
  color: var(--dim); background: transparent; border: 1px solid transparent;
  border-radius: 5px; cursor: pointer; white-space: nowrap; transition: all .15s;
}
.wm-mode-bar .seg button:hover { color: var(--gold2); }
.wm-mode-bar .seg button.on {
  color: #0a1017; background: linear-gradient(135deg, #f3dc8e, #e2c56a);
  border-color: var(--gold); font-weight: 700;
}

/* 自化箭头 */
.star-v .zh {
  font-size: clamp(3.4px, 1.1cqw, 9px); line-height: 1.1; margin-top: .5px;
  font-family: var(--font-ui); white-space: nowrap;
}
.star-v .zh.li { color: #4fd39a; }
.star-v .zh.quan { color: #c08ad6; }
.star-v .zh.ke { color: #6cb6ef; }
.star-v .zh.ji { color: #ef7d70; }

/* 宫干四化（飞星 / 四化皮肤） */
.cell-ghua {
  display: flex; flex-wrap: wrap; gap: 1px 2px; margin-top: 2px;
  flex: 0 0 auto; overflow: hidden;
}
.cell-ghua .g {
  font-size: clamp(4px, 1.25cqw, 9.5px); line-height: 1.3;
  font-family: var(--font-ui); color: var(--dim); white-space: nowrap;
}
.cell-ghua .g i { font-style: normal; opacity: .7; }
.cell-ghua .g.lu { color: #4fd39a; }
.cell-ghua .g.qa { color: #c08ad6; }
.cell-ghua .g.ke { color: #6cb6ef; }
.cell-ghua .g.ji { color: #ef7d70; }

/* 来因宫印 */
.laiyin-stamp {
  border: 1px solid #4ea8b6; color: #4ea8b6; border-radius: 2px;
  font-size: clamp(4px, 1.25cqw, 10px); padding: 0 1px; line-height: 1.2;
  font-weight: 700; white-space: nowrap;
}

/* 飞星皮肤：隐藏运限层，突出宫干飞化 */
.zw-cell.skin-fx .cell-ages,
.zw-cell.skin-fx .cell-dx,
.zw-cell.skin-fx .star-v .bright { display: none; }
.zw-cell.skin-fx .cell-stars { justify-content: center; width: 100%; }
.zw-cell.skin-fx .cell-hua { justify-content: center; }
.zw-cell.skin-fx .cell-ghua {
  margin: auto 0; justify-content: center; gap: 2px 4px;
}
.zw-cell.skin-4h .cell-stars { justify-content: center; width: 100%; }
.zw-cell.skin-4h .cell-ghua { justify-content: center; }
.zw-cell.skin-fx .cell-ghua .g {
  font-size: clamp(4.5px, 1.55cqw, 12px); font-weight: 600;
}

/* 四化皮肤：四化方块放大、庙旺隐藏 */
.zw-cell.skin-fx .star-v .char { font-weight: 700; }
.zw-cell.skin-fx .star-v .zh { font-size: clamp(4.5px, 1.5cqw, 11px); }
.zw-cell.skin-4h .star-v .bright { display: none; }
.zw-cell.skin-4h .cell-hua { display: none; }
.star-v .h-inline {
  font-size: clamp(4.2px, 1.4cqw, 10.5px); line-height: 1.25;
  color: #fff; font-weight: 700; padding: 0 clamp(1px, .3cqw, 2px);
  border-radius: 1.5px; margin-top: 1px;
}
.star-v .h-inline.lu { background: #2a8f5c; }
.star-v .h-inline.qa { background: #854b98; }
.star-v .h-inline.ke { background: #2974b0; }
.star-v .h-inline.ji { background: #b23a31; }
.zw-cell.skin-4h .star-v .char { font-weight: 700; }

/* css/ziwei-spec.css */
/* 文墨天机规范落地（字号令牌 · 宫格 · 限流区 · 手机一屏） */
/* =====================================================================
   文墨天机规范落地（docs/wmtj-ui-spec.md）—— 本段置于最末，覆盖前面的历史样式
   字号只有 6 档令牌；星曜字号由 JS 按列数分档（--fs），永不裁切；
   四边方位标；限流区 5 行 × (9 格 + ▷ 翻页)
   ===================================================================== */
.zw-board {
  aspect-ratio: 4 / 5.88;                       /* 单宫高宽比 1.47（比文墨 1.37 略高，容纳我们多出的星曜层） */
  --t-gz:   clamp(9px, 4.2cqw, 20px);          /* 干支 */
  --t-name: clamp(7.5px, 3.0cqw, 15px);        /* 宫名 */
  --t-age:  clamp(7.5px, 2.9cqw, 14px);          /* 大限岁数 */
  --t-sub:  clamp(7px, 2.35cqw, 12px);        /* 三神 / 长生 / 四化块 / 印章 */
  --t-flow: clamp(5.6px, 2.15cqw, 11px);          /* 流年 / 小限 两行 */
}
.wm-board-container { --side: 13px; max-width: 520px; }
body.in-result-view #p-ziwei { margin-top: 0 !important; }
body.in-result-view .wm-board-container { min-height: calc(100dvh - 46px); }
.wm-board-block { display: block; }
.wm-dir-h {
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 0 var(--side); height: 16px; align-items: center; text-align: center;
  font-size: 9px; line-height: 1; color: var(--dim-sub, #78909c);
}
.wm-dir-h span { white-space: nowrap; }
.wm-mid { display: grid; grid-template-columns: var(--side) minmax(0, 1fr) var(--side); }
.wm-dir-v { display: grid; grid-template-rows: repeat(4, 1fr); }
.wm-dir-v span {
  display: flex; align-items: center; justify-content: center;
  writing-mode: vertical-rl; text-orientation: upright;
  font-size: 9px; line-height: 1; letter-spacing: 0; color: var(--dim-sub, #78909c);
}

/* 宫格 */
.zw-cell { padding: 2px; }
.cell-stars { flex-wrap: wrap; overflow: visible; align-content: flex-start; width: 100%; }
.star-v { width: calc(var(--fs, 3.6cqw) * 1.02); }
.star-v .char { font-size: var(--fs, 3.6cqw); line-height: 1.04; }
.star-v .bright { font-size: max(6px, calc(var(--fs, 3.6cqw) * .74)); margin-top: 1px; }
.star-v .zh { font-size: max(6.5px, calc(var(--fs, 3.6cqw) * .5)); margin-top: 0; line-height: 1; }
.star-v .h-inline { font-size: max(7.5px, calc(var(--fs, 3.6cqw) * .6)); padding: 0 1px; }
.cell-hua, .cell-ghua { overflow: visible; flex-wrap: wrap; margin-top: 1px; }
.cell-hua .h { font-size: var(--t-sub); padding: 0 2px; }
.cell-ghua .g, .zw-cell.skin-fx .cell-ghua .g { font-size: var(--t-sub); }
.cell-ages { font-size: var(--t-flow); line-height: 1.15; margin: auto 0 1px; }
.cell-dx { position: relative; font-size: var(--t-age); margin-bottom: 1px; }
.cell-dx b { font-weight: 700; }
.cell-dx em { position: absolute; right: 0; bottom: 0; font-style: normal; font-weight: 500; font-size: var(--t-sub); color: #b0bec5; font-family: var(--font-ui); }
.foot-shen { font-size: var(--t-sub); line-height: 1.15; }
.foot-r { overflow: visible; }
.foot-r .pal-name { font-size: var(--t-name); }
.foot-r .right-col .gz { font-size: var(--t-gz); line-height: 1; }
.laiyin-stamp, .zw-cell .sg-stamp, .zw-cell .layer-ming-stamp { font-size: var(--t-sub); }
.zw-cell.skin-4h .cell-ages { display: none; }   /* 四化皮肤：让位给宫干四化三行，星曜才能保持大字号 */
.zw-cell.tight .cell-ages { line-height: 1.02; margin-bottom: 0; }
.zw-cell.tight .cell-dx { line-height: 1; margin-bottom: 0; }

/* 大限 / 限流中宫文字：放大并允许折行，不再被右侧裁切 */
.zw-center .c-line { font-size: clamp(9px, 2.6cqw, 14px); white-space: normal; text-align: center; }
.zw-center .c-line.dim { font-size: clamp(8.5px, 2.35cqw, 12.5px); }

/* 限流区：5 行 × (9 格 + ▷)，行高吃满剩余空间，无横向滚动 */
.wm-flow-controls {
  margin: 4px 0 0; padding: 0 0 calc(3px + env(safe-area-inset-bottom)); background: transparent; border: 0; border-radius: 0;
  flex: 1 1 auto; max-height: 232px; overflow: visible; gap: 2px;
}
.wm-flow-row {
  flex: 1 1 0; min-height: 30px; height: auto; padding: 0; gap: 2px;
  align-items: stretch; background: transparent; border: 0;
}
.wm-flow-label {
  width: 28px; padding: 0; border: 0; border-radius: 3px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(226, 197, 106, .12); color: var(--gold); font-size: 12px; line-height: 1.1;
}
.wm-flow-strip {
  flex: 1; min-width: 0; display: grid; grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 1px; padding: 0; overflow: visible;
}
.wm-flow-strip .st-chip {
  min-width: 0; padding: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: 3px; border: 1px solid transparent; background: rgba(255, 255, 255, .04);
  font-size: 12px; line-height: 1.15; color: var(--dim-sub, #8da2b3); white-space: nowrap;
}
.wm-flow-row.l2 .st-chip { font-size: 10px; letter-spacing: -.2px; color: #cfd8dc; background: rgba(255, 255, 255, .07); }
.wm-flow-row.l2 .st-chip small { font-size: min(8px, 1.8vw); color: var(--dim-sub, #8da2b3); margin-top: 1px; letter-spacing: -.2px; }
.wm-flow-row.l2 .st-chip { font-size: min(10px, 2.5vw); overflow: hidden; }
.wm-flow-strip .st-chip.on {
  background: linear-gradient(135deg, rgba(226, 197, 106, .34), rgba(20, 35, 48, .95));
  border-color: var(--gold); color: #fff; font-weight: 700;
}
.wm-flow-strip .st-chip.on small { color: var(--gold2, #ffd54f); }
.wm-flow-strip .st-chip.void { background: rgba(255, 255, 255, .02); pointer-events: none; }
.wm-flow-strip .st-chip.nxt { color: var(--gold); font-size: 14px; background: rgba(226, 197, 106, .08); }

/* 星曜过密的宫：行距逐级收紧（字号不再下调） */
.zw-cell.tighter .star-v .char { line-height: .94; }
.zw-cell.tighter .star-v .bright { margin-top: 0; line-height: 1; }
.zw-cell.tighter .cell-hua, .zw-cell.tighter .cell-ghua { margin-top: 0; }

/* ===== 叠宫：宫名小字竖排 / 顶栏状态 / 本命首格 ===== */
.foot-r .pal-stack { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.12; font-size: var(--t-flow); font-weight: 600; font-family: var(--font-serif); }
.foot-r .pal-stack i { font-style: normal; white-space: nowrap; }
.wm-flow-strip .st-chip.base { color: var(--gold); background: rgba(226, 197, 106, .1); font-size: 11px; letter-spacing: 0; }
.wm-flow-strip .st-chip.base.on { color: #fff; }
.rtb-title.zw2 { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; line-height: 1.1; letter-spacing: 0 !important; }
.rtb-title.zw2 .rtb-main { font-size: 15px; letter-spacing: 2px; max-width: 100%; }
.rtb-title.zw2 .rtb-sub { font-size: 10.5px; font-weight: 400; color: var(--dim, #90a4ae); text-shadow: none; letter-spacing: .2px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* =====================================================================
   手机：盘面宽度按「可视高度」反算，保证 顶栏 + 方位标 + 盘 + 限流 5 行 一屏放得下（流时不再被裁）
   盘高 = 内宽 × 1.47；预留 = 顶栏 52 + 方位标 32 + 限流区 168
   ===================================================================== */
body.in-result-view .result-top-bar { margin: 2px 0 4px; }
body.in-result-view .wm-board-col { width: min(100%, calc((100vh - 252px) / 1.47 + 26px)); margin: 0 auto; }
@supports (height: 100dvh) {
  body.in-result-view .wm-board-col { width: min(100%, calc((100dvh - 252px) / 1.47 + 26px)); }
}
body.in-result-view .wm-board-container.wm-all .wm-board-col { width: 100%; }

/* css/ziwei-center-detail.css */
/* 中宫常驻信息与选中宫详情 */
/* =====================================================================
   中宫（对标文墨）：标题 · 命主信息 · 节气 / 非节气四柱 · 八字大运 · 日时按钮 · 自化图示
   ===================================================================== */
.zw-center { justify-content: space-between; padding: 1.5cqw 1.4cqw 1.7cqw; }
.zw-center i { font-style: normal; }
.zw-center .ct-title { font-family: var(--font-serif); font-weight: 800; font-size: max(11px, 4.1cqw); line-height: 1.1; color: var(--gold2, #ffd54f); letter-spacing: .5cqw; }
.zw-center .ct-info { width: 100%; text-align: center; font-size: max(7px, 2.35cqw); line-height: 1.36; color: #cfd8dc; }
.zw-center .ct-kv { display: flex; justify-content: center; gap: 3.2cqw; font-weight: 700; color: #eceff1; font-size: max(7.5px, 2.6cqw); }
.zw-center .ct-ln { white-space: nowrap; }
.zw-center .ct-ln u { text-decoration: none; color: #78909c; margin-right: .3cqw; }
.zw-center .ct-ln u + u, .zw-center .ct-ln span + u { margin-left: 1cqw; }
.zw-center .ct-flow { white-space: normal; line-height: 1.25; color: #cfd8dc; font-size: max(6.5px, 2.15cqw); }
.zw-center .ct-flow b { color: #ffd54f; font-weight: 600; }
.zw-center .ct-flow .lu { color: #69f0ae; } .zw-center .ct-flow .qa { color: #ea80fc; }
.zw-center .ct-flow .ke { color: #80d8ff; } .zw-center .ct-flow .ji { color: #ff8a80; }
.zw-center .ct-bz { display: flex; justify-content: space-around; width: 100%; }
.zw-center .ct-bz .lb { font-size: max(5.5px, 1.75cqw); color: #78909c; line-height: 1.1; margin-bottom: .2cqw; }
.zw-center .ct-bz .ps { display: flex; gap: 1.1cqw; justify-content: center; }
.zw-center .ct-bz .it { display: flex; flex-direction: column; align-items: center; font-family: var(--font-serif); font-weight: 700; font-size: max(10px, 3.3cqw); line-height: 1.08; }
.zw-center .ct-qiyun { font-size: max(6px, 2cqw); color: #90a4ae; white-space: nowrap; }
.zw-center .ct-dayun { display: flex; width: 100%; }
.zw-center .dy-col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.zw-center .dy-gz { display: flex; flex-direction: column; font-family: var(--font-serif); font-weight: 700; font-size: max(8.5px, 2.8cqw); line-height: 1.05; margin-right: 1.4cqw; }
.zw-center .dy-gz .s { position: relative; display: block; text-align: center; }
.zw-center .dy-gz .s em { position: absolute; left: 100%; top: 0; margin-left: .1cqw; font-style: normal; font-weight: 400; writing-mode: vertical-rl; white-space: nowrap; line-height: 1; font-size: max(4.8px, 1.45cqw); color: #b79ad9; }
.zw-center .dy-age { font-size: max(5.5px, 1.7cqw); color: #b0bec5; white-space: nowrap; }
.zw-center .dy-yr { font-size: max(5px, 1.55cqw); color: #78909c; white-space: nowrap; }
.zw-center .ct-btns { display: flex; width: 97%; border: 1px solid rgba(226, 197, 106, .35); border-radius: 1cqw; overflow: hidden; }
.zw-center .ct-btns button { flex: 1; min-width: 0; padding: 1.1cqw 0; border: 0; border-right: 1px solid rgba(226, 197, 106, .25); background: rgba(255, 255, 255, .08); color: #eceff1; font: inherit; font-size: max(7px, 2.5cqw); line-height: 1.1; white-space: nowrap; cursor: pointer; }
.zw-center .ct-btns button.mid { flex: 1.6; }
.zw-center .ct-btns button:last-child { border-right: 0; }
.zw-center .ct-btns button:active { background: rgba(226, 197, 106, .25); }
.zw-center .ct-self { display: flex; justify-content: center; gap: .8cqw; font-size: max(6px, 2.05cqw); color: #78909c; white-space: nowrap; }
.zw-center .ct-self .lu { color: #69f0ae; } .zw-center .ct-self .qa { color: #ea80fc; }
.zw-center .ct-self .ke { color: #80d8ff; } .zw-center .ct-self .ji { color: #ff8a80; }

/* =====================================================================
   中宫「选中宫」详情：标题 · 层间宫名 · 本宫星曜 · 三方四正 · 宫干四化 · 神煞 / 岁数
   字号全部 ≥ 9px（手机）并随盘宽放大；放不下时 fitCenterSel() 按优先级收起低优先项
   ===================================================================== */
.zw-center .sel-box { justify-content: space-between; gap: .6cqw; text-align: center; font-size: max(9px, 2.7cqw); line-height: 1.25; color: #cfd8dc; cursor: pointer; }
.zw-center .sel-box b { font-weight: 700; color: #ffd54f; }
.zw-center .sx-head { width: 100%; }
.zw-center .sx-title { font-family: var(--font-serif); font-weight: 800; font-size: max(15px, 4.9cqw); line-height: 1.1; color: var(--gold2, #ffd54f); letter-spacing: .3cqw; white-space: nowrap; }
.zw-center .sx-title i { font-style: normal; opacity: .6; margin: 0 .6cqw; }
.zw-center .sx-sub { font-size: max(8.5px, 2.35cqw); color: #90a4ae; margin-top: .5cqw; }
.zw-center .sx-sub b { font-weight: 600; }
.zw-center .sx-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: .8cqw; }
.zw-center .sx-tags .tg { font-size: max(8.5px, 2.4cqw); color: #eceff1; background: rgba(255,255,255,.06); border: 1px solid rgba(226,197,106,.4); border-radius: 999px; padding: .1cqw 1.6cqw; white-space: nowrap; }
.zw-center .sx-tags .tg:has(b.hot) { background: #e2c56a; border-color: #e2c56a; }
.zw-center .sx-tags .tg b.hot { color: #1a1204; }
.zw-center .sx-stars { width: 100%; }
.zw-center .sx-main { display: flex; flex-wrap: wrap; justify-content: center; gap: .2cqw 2.2cqw; font-family: var(--font-serif); font-weight: 800; font-size: max(13px, 4cqw); line-height: 1.2; color: #ff5252; }
.zw-center .sx-main i { font-style: normal; font-weight: 400; font-size: max(9px, 2.6cqw); color: #78909c; }
.zw-center .sx-main .bor { opacity: .75; }
.zw-center .sx-main small { font-size: .55em; font-weight: 600; color: #e2c56a; margin-left: .1em; }
.zw-center .sx-aux { font-size: max(8.5px, 2.4cqw); line-height: 1.3; margin-top: .6cqw; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.zw-center .sx-aux b { font-weight: 500; margin: 0 .5cqw; white-space: nowrap; }
.zw-center .sx-aux b.assist { color: #ce93d8; } .zw-center .sx-aux b.sha { color: #90caf9; } .zw-center .sx-aux b.misc { color: #4dd0e1; }
.zw-center .hh { font-style: normal; font-family: var(--font-sans, inherit); font-weight: 700; font-size: .6em; line-height: 1; color: #fff; border-radius: 2px; padding: .12em .22em; margin-left: .15em; vertical-align: .25em; }
.zw-center .hh.lu { background: #00c853; } .zw-center .hh.qa { background: #aa00ff; } .zw-center .hh.ke { background: #0091ea; } .zw-center .hh.ji { background: #d50000; }
.zw-center .sx-sfwrap { width: 100%; display: flex; flex-direction: column; gap: .5cqw; padding: .8cqw 1cqw; border-top: 1px dashed rgba(226,197,106,.3); border-bottom: 1px dashed rgba(226,197,106,.3); }
.zw-center .sx-sf { display: flex; align-items: baseline; gap: 1.2cqw; font-size: max(9px, 2.6cqw); white-space: nowrap; min-width: 0; }
.zw-center .sx-sf .t { flex: none; color: #90a4ae; font-size: .88em; min-width: 5.4cqw; text-align: left; }
.zw-center .sx-sf .n { flex: none; color: #ffd54f; font-weight: 700; min-width: 8cqw; text-align: left; }
.zw-center .sx-sf .z { flex: none; color: #b0bec5; font-family: var(--font-serif); }
.zw-center .sx-sf .s { flex: 1; min-width: 0; text-align: right; overflow: hidden; text-overflow: ellipsis; color: #ff8a80; font-family: var(--font-serif); font-weight: 700; }
.zw-center .sx-sf .s small { font-size: .7em; font-weight: 500; color: #e2c56a; }
.zw-center .sx-sf .s i { font-style: normal; font-weight: 400; color: #78909c; }
.zw-center .sx-fh { width: 100%; }
.zw-center .sx-lab { font-size: max(8.5px, 2.35cqw); color: #90a4ae; margin-bottom: .6cqw; }
.zw-center .feihua-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .8cqw; width: 100%; }
.zw-center .feihua-item { display: flex; align-items: center; justify-content: center; gap: .6cqw; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); border-radius: 3px; padding: .5cqw .4cqw; font-size: max(9.5px, 2.8cqw); white-space: nowrap; min-width: 0; }
.zw-center .fh-stamp { flex: none; font-size: .86em; font-weight: 700; color: #fff; border-radius: 2px; padding: .05em .28em; line-height: 1.15; }
.zw-center .fh-stamp.lu { background: #00c853; } .zw-center .fh-stamp.qa { background: #aa00ff; } .zw-center .fh-stamp.ke { background: #0091ea; } .zw-center .fh-stamp.ji { background: #d50000; }
.zw-center .fh-star { color: #eceff1; font-weight: 600; }
.zw-center .fh-arrow { color: #78909c; }
.zw-center .fh-target { color: #ffd54f; font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.zw-center .fh-target em { font-style: normal; font-weight: 400; font-size: .72em; color: #ff8a80; margin-left: .2em; }
.zw-center .sx-shen, .zw-center .sx-ages { width: 100%; display: flex; flex-wrap: wrap; justify-content: center; gap: 0 2cqw; font-size: max(8.5px, 2.3cqw); color: #b0bec5; }
.zw-center .sx-shen u, .zw-center .sx-ages u { text-decoration: none; color: #78909c; margin-right: .5cqw; }
.zw-center .sx-ages { color: #90a4ae; }
.zw-center .nar .fh-arrow, .zw-center .nar .sx-sf .z { display: none; }
.zw-center .nar .feihua-item { gap: .3cqw; }
.zw-center .nar .sx-sf .s small { display: none; }
.zw-center .sx-hint { font-size: max(8px, 2.1cqw); color: #607d8b; }

/* css/ziwei-compare.css */
/* 三盘对照模式滚动 */
/* =====================================================================
   移动端「三盘对照」可滚动（结果页锁一屏，对照模式需自行滚动）
   ===================================================================== */
body.in-result-view .wm-board-container.wm-all { overflow-y: auto; max-height: calc(100dvh - 58px); min-height: 0; }

/* css/inspector.css */
/* 紫微右栏检查器：卡片 · 古籍引证 · 折叠条。仅 PC 显示，手机端靠 .zw-insp-only 整块隐藏 */
.zw-inspector { display: contents; }
.zw-insp-only, .zw-sample-tag { display: none; }

.insp-card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.insp-card.gold { background: linear-gradient(135deg, rgba(226, 197, 106, .12), var(--card) 70%); border-color: rgba(226, 197, 106, .4); }
.insp-card.blue { background: linear-gradient(135deg, rgba(43, 127, 195, .16), var(--card) 75%); border-color: rgba(43, 127, 195, .5); }
.insp-card.hero { background: radial-gradient(400px 160px at 0 0, rgba(226, 197, 106, .12), var(--card) 70%); }
.insp-card h4 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 10px; font: 600 15px var(--font-serif); color: var(--gold2); letter-spacing: 2px; }
.insp-card h4 small { font: 400 11px var(--font-ui); color: var(--dim); letter-spacing: 0; text-align: right; }
.insp-card h5 { margin: 12px 0 8px; padding-top: 10px; border-top: 1px solid var(--line-sub); font: 600 12px var(--font-serif); color: var(--dim); letter-spacing: 2px; }
.insp-card p { font-size: 13px; line-height: 1.75; color: var(--dim); }
.insp-card p b { color: var(--gold2); }

.insp-stars { display: flex; flex-wrap: wrap; gap: 6px; }
.insp-stars span { padding: 3px 9px; border-radius: 12px; font-size: 13px; color: var(--ink); background: rgba(255, 255, 255, .05); }
.insp-stars span.mj-1 { color: var(--gold2); border: 1px solid var(--line); background: rgba(226, 197, 106, .08); }
.insp-stars span i { margin-left: 3px; font-style: normal; font-size: 10px; color: var(--dim); }
.insp-stars span.more, .insp-stars span.none { color: var(--dim); background: none; }

.cite { display: block; padding: 10px 12px; margin-bottom: 8px; border-radius: 8px; background: rgba(0, 0, 0, .22); border-left: 2px solid var(--gold); cursor: pointer; }
.cite:hover { background: rgba(226, 197, 106, .08); }
.cite-s { font-size: 11px; color: var(--dim); margin-bottom: 4px; letter-spacing: 1px; }
.cite-o { font: 600 14px/1.7 var(--font-serif); color: var(--ink); }
.cite-t { margin-top: 4px; font-size: 12.5px; line-height: 1.7; color: var(--dim); }
.insp-none { font-size: 12.5px; line-height: 1.7; color: var(--dim-sub); padding: 4px 0 8px; }
.insp-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; font-size: 12.5px; }
.insp-foot a { color: var(--gold); cursor: pointer; }
.insp-foot a:hover { color: #fff; }

.insp-btn { margin-top: 10px; padding: 8px 18px; border: 1px solid var(--gold); border-radius: 18px; background: rgba(226, 197, 106, .14); color: var(--gold2); font: 600 13px var(--font-ui); letter-spacing: 1px; cursor: pointer; transition: background .15s; }
.insp-btn:hover { background: var(--gold); color: #1a1405; }

.insp-set { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.insp-set:last-child { margin-bottom: 0; }
.insp-set > label { flex: 0 0 38px; font-size: 12px; color: var(--dim); }
.insp-set .seg { flex: 1; }
.insp-set select { flex: 1; min-width: 0; }

@media (min-width: 960px) {
  .zw-inspector { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
  .zw-insp-only { display: block; }
  .zw-insp-head { display: flex !important; justify-content: space-between; align-items: baseline; padding: 0 2px; font: 600 15px var(--font-serif); color: var(--gold2); letter-spacing: 2px; }
  .zw-insp-head em { font: 400 12px var(--font-ui); color: var(--dim); letter-spacing: 0; font-style: normal; }
  .zw-insp-cards { display: flex !important; flex-direction: column; gap: 12px; }

  .zw-sample-tag { display: block; width: fit-content; max-width: 100%; margin: 12px auto 0; padding: 5px 16px; border: 1px solid rgba(43, 127, 195, .55); border-radius: 14px; font-size: 12px; color: #9cc8ec; background: rgba(43, 127, 195, .14); }
  .zw-sample-tag b { color: #cfe6fa; margin-right: 8px; }

  /* 首屏（示例盘）：右栏只放引流卡，不显示限流；表单卡金边强调 */
  body.zw-sample .zw-inspector .zw-insp-head, body.zw-sample .zw-inspector .wm-flow-controls { display: none !important; }
  body.zw-sample #p-ziwei .panel-form-card { border-color: rgba(226, 197, 106, .55); background: linear-gradient(180deg, rgba(226, 197, 106, .08), var(--card) 40%); }
  body .h-old { display: none; } body .h-first { display: block; }
  body.rv-ziwei:not(.zw-sample) .h-first, body.rv-ziwei:not(.zw-sample) .go-first { display: none; }
  body.rv-ziwei:not(.zw-sample) .h-again { display: block; }
  body.rv-ziwei:not(.zw-sample) .go-again { display: inline; }

  /* 流月 / 流日 / 流时默认折叠 */
  .wm-flow-fold { padding: 5px 0; text-align: center; font-size: 12px; color: var(--dim); background: rgba(0, 0, 0, .3); border-bottom: 1px solid rgba(255, 255, 255, .08); cursor: pointer; user-select: none; }
  .wm-flow-fold:hover { color: var(--gold2); }
  .wm-flow-fold i { font-style: normal; margin-left: 4px; }
  .wm-flow-controls.fold .wm-flow-fold { border-bottom: none; }
  .wm-flow-controls.fold .wm-flow-fold ~ .wm-flow-row { display: none; }
}

/* 选中宫：一行「标签 + 内容」 */
.insp-row { display: flex; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line-sub); font-size: 13px; line-height: 1.7; color: var(--ink); }
.insp-row:first-of-type { border-top: none; padding-top: 0; }
.insp-row > label { flex: 0 0 56px; color: var(--dim); font-size: 12px; letter-spacing: 1px; padding-top: 1px; }
.insp-row > span { flex: 1; min-width: 0; }
.insp-row small { margin-left: 4px; font-size: 11.5px; color: var(--dim); }
.insp-row .insp-stars span small { font-size: 10px; margin-left: 2px; }
.insp-row .insp-stars span em.hh { margin-left: 2px; }
.insp-row .sp { display: inline-block; width: 10px; }
.insp-row em.hh { margin-right: 3px; padding: 1px 4px; border-radius: 2px; font: 700 10px var(--font-ui); color: #fff; font-style: normal; vertical-align: 1px; }
.insp-row em.hh.lu { background: #00c853; } .insp-row em.hh.qa { background: #aa00ff; } .insp-row em.hh.ke { background: #0091ea; } .insp-row em.hh.ji { background: #d50000; }
.insp-stars span.bor { opacity: .6; border-style: dashed; }
.insp-stars span.ast { color: #7fd6c2; } .insp-stars span.sha { color: #ff8a80; }

/* 盘面选项：默认收成一行 */
.insp-fold { padding: 0; }
.insp-fold > summary { display: flex; justify-content: space-between; align-items: baseline; padding: 11px 16px; list-style: none; cursor: pointer; font: 600 14px var(--font-serif); color: var(--gold2); letter-spacing: 2px; }
.insp-fold > summary::-webkit-details-marker { display: none; }
.insp-fold > summary::after { content: "▸"; order: 3; margin-left: 8px; font-size: 12px; color: var(--dim); }
.insp-fold[open] > summary::after { content: "▾"; }
.insp-fold > summary small { margin-left: auto; font: 400 11px var(--font-ui); letter-spacing: 0; color: var(--dim); }
.insp-fold[open] > summary { border-bottom: 1px solid var(--line-sub); margin-bottom: 12px; }
.insp-fold > .insp-set { padding: 0 16px; }
.insp-fold > .insp-set:last-child { margin-bottom: 14px; }

/* 表单按钮 / 提示：手机保持原样，PC 按状态切换（首屏 / 排盘后） */
.go-again, .h-first, .h-again { display: none; }

/* css/home.css */
/* 官网首页视觉与布局 */
/* =====================================================================
   玄夜星图 · 二十八宿环 · 今日示例活盘 · 术数横幅 · 引证与书库预告
   ===================================================================== */
#p-home {
  display: none;
  width: 100%;
}
#p-home.on {
  display: block;
}

@media (min-width: 960px) {
  #p-home.on {
    grid-column: 1 / -1;
    grid-row: 2;
    margin: 0;
    width: 100%;
  }
}

.home-wrap {
  overflow: hidden;
  background: radial-gradient(ellipse at 70% 20%, #12232d 0, transparent 55%), var(--bg);
  min-height: calc(100vh - 72px);
  position: relative;
}

.home-hero {
  max-width: none;
  min-height: calc(100vh - 72px);
  padding: 0;
  display: grid;
  grid-template-columns: minmax(400px, 42%) minmax(0, 58%);
  align-items: center;
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.home-hero:before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 8% 18%, #c8a96888 0 1px, transparent 1.3px),
    radial-gradient(circle at 17% 66%, #c8a96877 0 1px, transparent 1.3px),
    radial-gradient(circle at 37% 14%, #c8a96888 0 1px, transparent 1.3px),
    radial-gradient(circle at 49% 82%, #c8a96866 0 1px, transparent 1.3px),
    radial-gradient(circle at 72% 9%, #c8a96888 0 1px, transparent 1.3px);
  pointer-events: none;
  z-index: -1;
}

.hero-seal {
  position: absolute;
  left: 5.5vw;
  top: 9%;
  border: 1px solid #a45b4c;
  color: #b8725e;
  padding: 7px 5px 5px;
  writing-mode: vertical-rl;
  font: 14px/1.2 var(--font-serif);
  letter-spacing: 4px;
  transform: rotate(-5deg);
  opacity: .8;
  z-index: 4;
}

.mansion-ring {
  position: absolute;
  width: min(80vw, 1120px);
  height: min(80vw, 1120px);
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
  opacity: .48;
  z-index: 0;
}
.mansion-ring text {
  font: 11px var(--font-serif);
  fill: #887a5d;
  letter-spacing: 5px;
}
.mansion-ring circle {
  fill: none;
  stroke: #9c885227;
  stroke-width: .6;
}

.hero-side-note {
  position: absolute;
  right: 2.2vw;
  top: 50%;
  transform: translateY(-50%);
  writing-mode: vertical-rl;
  font: 12px var(--font-serif);
  letter-spacing: 6px;
  color: #69766f;
  z-index: 3;
}

.home-hero-copy {
  padding: 0 0 5vh 7.2vw;
  align-self: center;
  position: relative;
  z-index: 5;
}

.home-hero h1 {
  font: 500 clamp(68px, 6.4vw, 104px)/1.22 var(--font-serif);
  letter-spacing: .11em;
  margin: 0 0 38px;
  color: var(--ink);
  text-shadow: 0 4px 40px #080d12;
}
.home-hero h1 span { display: block; }
.home-hero h1 span:last-child { margin-left: .55em; }

.home-hero-copy .lead {
  font: 400 16px/2 var(--font-serif);
  color: #c8d0d2;
  margin: 0;
  letter-spacing: 3px;
}
.home-hero-copy .lead small {
  display: block;
  font: 13px/1.8 var(--font-ui);
  color: #8b9ba3;
  letter-spacing: 1px;
  margin-top: 13px;
}

.home-hero-actions {
  display: flex;
  gap: 28px;
  align-items: center;
  margin-top: 44px;
}
.home-hero-actions .primary {
  background: var(--gold);
  color: #131611;
  border: 1px solid var(--gold);
  padding: 17px 30px;
  font-weight: 600;
  font-size: 15px;
  border-radius: 3px;
  box-shadow: 0 8px 28px rgba(200, 169, 104, .12);
  cursor: pointer;
  transition: all .2s;
}
.home-hero-actions .primary:hover {
  background: var(--gold2);
  transform: translateY(-1px);
}
.home-hero-actions .text-link {
  background: none;
  border: 0;
  color: var(--ink);
  padding: 12px 0;
  border-bottom: 1px solid #53636b;
  font-size: 15px;
  cursor: pointer;
}
.home-hero-actions .text-link:hover {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

.home-privacy {
  font-size: 11px;
  color: #677b85;
  margin-top: 22px;
  letter-spacing: 1px;
}

.home-hero-art {
  position: relative;
  min-height: calc(100vh - 72px);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  z-index: 1;
}

.orbit {
  position: absolute;
  width: min(76vw, 1060px);
  height: min(76vw, 1060px);
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) rotate(-12deg);
  border: 1px solid rgba(200, 169, 104, .11);
  border-radius: 50%;
  pointer-events: none;
}
.orbit:before, .orbit:after {
  content: "";
  position: absolute;
  border-radius: 50%;
}
.orbit:before {
  inset: 70px;
  border: 1px dashed rgba(200, 169, 104, .08);
}
.orbit:after {
  inset: 155px;
  border: 1px solid rgba(200, 169, 104, .07);
}

.starfield {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 18% 24%, #d7c393 0 1px, transparent 1.5px),
    radial-gradient(circle at 75% 16%, #d7c393 0 1px, transparent 1.5px),
    radial-gradient(circle at 88% 72%, #d7c393 0 1px, transparent 1.5px),
    radial-gradient(circle at 14% 78%, #d7c393 0 1px, transparent 1.5px),
    radial-gradient(circle at 64% 90%, #d7c393 0 1px, transparent 1.5px);
  opacity: .6;
  pointer-events: none;
}

.constellation {
  position: absolute;
  right: 1%;
  top: 9%;
  width: 150px;
  height: 100px;
  opacity: .45;
  pointer-events: none;
}

.hero-chart-wrap {
  position: relative;
  width: min(56vw, calc((100vh - 190px) / 1.04), 800px);
  margin-left: 2%;
  transform: none;
  z-index: 2;
}

.home-chart-kicker {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 4px 16px;
  font-size: 11px;
  color: #8b9aa1;
  letter-spacing: 2px;
}
.home-chart-kicker strong {
  font-weight: 400;
  color: #a89670;
  font-size: 11px;
}

.hero-chart-wrap .chart {
  background: rgba(9, 18, 25, .89);
  border-color: rgba(124, 117, 95, .5);
  box-shadow: 0 45px 110px #0009, 0 0 100px rgba(200, 169, 104, .05);
  backdrop-filter: blur(2px);
}
.hero-chart-wrap .chart .palace { background: rgba(8, 15, 21, .12); }
.hero-chart-wrap .chart .palace:hover { background: rgba(200, 169, 104, .045); }
.hero-chart-wrap .chart .star { font-size: clamp(16px, 1.45vw, 23px); }
.hero-chart-wrap .chart .minor { display: none; }
.hero-chart-wrap .chart .ages { font-size: clamp(9px, .75vw, 12px); line-height: 1.7; color: #8b9ba3; }
.hero-chart-wrap .chart .palace-foot .name { font-size: clamp(13px, 1.05vw, 17px); }
.hero-chart-wrap .chart .palace-foot .gz { font-size: clamp(22px, 1.8vw, 29px); }
.hero-chart-wrap .chart .bright { font-size: 10px; }
.hero-chart-wrap .chart .center .birth { font-size: 13px; line-height: 2; }
.hero-chart-wrap .chart .center .dayun { font-size: 11px; gap: 12px; }

.home-hero-note {
  text-align: center;
  margin: 18px 0 0;
  color: #6e828c;
  font-size: 11px;
  letter-spacing: 1px;
}
.home-hero-note button {
  border: 0;
  background: none;
  color: #a9946a;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  margin-left: 4px;
}

.home-hero-foot {
  position: absolute;
  bottom: 22px;
  left: 7.2vw;
  right: 4vw;
  display: flex;
  justify-content: space-between;
  color: #566a74;
  font-size: 11px;
  letter-spacing: 2px;
}

/* —— 首页后续板块 —— */
.home-section {
  max-width: none;
  padding: 110px 7.2vw;
  border-top: 1px solid var(--line);
}
.home-section .section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 46px;
}
.home-section .section-heading h2 {
  font: 500 38px var(--font-serif);
  letter-spacing: 4px;
  color: var(--gold);
  margin: 0;
}
.home-section .section-heading p {
  color: var(--dim);
  margin: 0;
  max-width: 410px;
  line-height: 1.8;
}

.home-tool-bands {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 0;
  gap: 0;
}
.home-tool-band {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  min-height: 260px;
  padding: 30px 28px;
  border: 1px solid #28343a;
  border-right: 0;
  position: relative;
  background: none;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: all .2s;
}
.home-tool-band:last-child {
  border-right: 1px solid #28343a;
}
.home-tool-band .symbol {
  font: 400 54px/1 var(--font-serif);
  margin-bottom: 38px;
  color: #a9905e;
  opacity: .85;
}
.home-tool-band h3 {
  font: 500 22px var(--font-serif);
  margin: 0 0 16px;
  letter-spacing: 3px;
  color: var(--ink);
}
.home-tool-band p {
  display: block;
  font-size: 12px;
  line-height: 1.9;
  color: var(--dim);
  max-width: 200px;
  margin: 0;
}
.home-tool-band .arrow {
  position: absolute;
  right: 25px;
  top: 30px;
  font-size: 18px;
  color: #6d7b80;
  transition: transform .2s, color .2s;
}
.home-tool-band:hover {
  background: #101b22;
  border-color: #786b4d;
}
.home-tool-band:hover .arrow {
  transform: translate(2px, -2px);
  color: var(--gold);
}

.home-proof-section {
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  gap: 10vw;
  align-items: center;
  background: #0b141a;
  padding-top: 120px;
  padding-bottom: 120px;
}
.home-proof-quote {
  font: 500 36px/1.8 var(--font-serif);
  letter-spacing: 4px;
  color: var(--ink);
}
.home-proof-quote small {
  display: block;
  font: 12px var(--font-ui);
  color: var(--dim);
  letter-spacing: 1px;
  margin-top: 24px;
}

.home-quote-excerpt {
  border-left: 1px solid #8d7950;
  padding: 6px 0 6px 40px;
}
.home-quote-excerpt h3 {
  font: 500 24px var(--font-serif);
  margin: 0 0 24px;
  color: var(--gold2);
  letter-spacing: 2px;
}
.home-quote-excerpt p {
  font: 16px/2 var(--font-serif);
  color: #c7d0d4;
  margin: 0;
}
.home-quote-excerpt p span {
  display: block;
  font: 14px/1.9 var(--font-ui);
  color: var(--dim);
  margin-top: 12px;
}

.home-books-grid {
  display: flex;
  gap: 26px;
}
.home-books-grid .cover {
  aspect-ratio: .76;
}
.home-books-grid .book:nth-child(2) { transform: translateY(24px); }
.home-books-grid .book:nth-child(4) { transform: translateY(-14px); }

.home-qr-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  background: #0b141a;
}
.qr-copy h3 {
  font: 500 24px var(--font-serif);
  margin: 0 0 12px;
  color: var(--gold);
  letter-spacing: 2px;
}
.qr-copy p {
  color: var(--dim);
  line-height: 1.8;
  margin: 0;
  font-size: 14px;
}
.qr-pair {
  display: flex;
  align-items: center;
  gap: 24px;
}
.fake-qr {
  width: 112px;
  height: 112px;
  padding: 8px;
  background: #eee;
  display: grid;
  grid-template-columns: repeat(13, 1fr);
  grid-template-rows: repeat(13, 1fr);
  gap: 1px;
  border-radius: 4px;
}
.fake-qr i { background: #172028; }
.fake-qr i.off { background: transparent; }

.home-footer {
  padding: 32px 7.2vw;
  color: #5e707a;
  font-size: 11px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
}

/* 响应式断点 */
@media (max-width: 1200px) {
  .home-hero-copy { padding-left: 5vw; }
  .home-hero h1 { font-size: 68px; }
  .hero-chart-wrap { width: 62vw; margin-left: -8%; }
  .hero-seal { left: 3vw; }
  .hero-side-note { display: none; }
  .home-tool-band { padding: 22px 18px; }
  .home-tool-band p { font-size: 11px; }
}

@media (max-width: 959px) {
  .home-hero { display: block; padding: 70px 25px 40px; }
  .home-hero-copy { padding: 0; }
  .home-hero h1 { font-size: 58px; }
  .home-hero h1 span:last-child { margin-left: 0; }
  .home-hero-art { min-height: 620px; margin-top: 40px; }
  .hero-chart-wrap { width: 100%; margin: 0; transform: none; }
  .hero-seal { left: auto; right: 25px; top: 30px; }
  .mansion-ring, .orbit { width: 650px; height: 650px; left: 50%; transform: translate(-50%, -50%); }
  .home-tool-bands { grid-template-columns: 1fr 1fr; }
  .home-tool-band { border-right: 1px solid #28343a; min-height: 220px; }
  .home-proof-section { grid-template-columns: 1fr; gap: 50px; }
  .home-section { padding: 70px 25px; }
  .home-books-grid { flex-wrap: wrap; }
  .home-books-grid .book { flex: 1 1 40% !important; }
}

/* css/books.css */
/* 书库与书架视觉样式 */
/* =====================================================================
   书库（书架）：案头在读专场 · 藏书分类陈列 · 书籍详情抽屉/页面
   ===================================================================== */
#p-books {
  display: none;
  width: 100%;
}
#p-books.on {
  display: block;
}

@media (min-width: 960px) {
  #p-books.on {
    grid-column: 1 / -1;
    grid-row: 2;
    margin: 0;
    width: 100%;
  }
}

.library-wrap {
  background: radial-gradient(ellipse at 18% 3%, #17252b 0, transparent 42%), var(--bg);
  min-height: calc(100vh - 72px);
  padding-bottom: 80px;
}

.library-head {
  max-width: 1500px;
  margin: auto;
  padding: 42px 5vw 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.library-head h1 {
  font: 500 32px var(--font-serif);
  letter-spacing: 7px;
  color: var(--gold);
  margin: 0;
}
.library-head p {
  font: 13px var(--font-serif);
  letter-spacing: 2px;
  margin-top: 10px;
  color: #7f9199;
}

.library-search-button {
  border: 0;
  background: none;
  color: #9cabb1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #39464b;
  font-size: 13px;
  min-width: 220px;
  text-align: left;
  cursor: pointer;
  transition: border-color .2s;
}
.library-search-button:hover {
  border-bottom-color: var(--gold);
}
.library-search-button span {
  margin-left: auto;
  color: #657780;
  font-size: 12px;
}

.shelf {
  max-width: 1500px;
  margin: auto;
  padding: 0 5vw 100px;
}

/* —— 案头在读专场 —— */
.library-feature {
  display: grid;
  grid-template-columns: 230px minmax(300px, 1fr) minmax(280px, .8fr);
  gap: 52px;
  align-items: center;
  min-height: 390px;
  padding: 18px 4.5% 42px;
  position: relative;
  border-bottom: 1px solid #28353a;
}
.feature-book {
  position: relative;
  width: 210px;
  filter: drop-shadow(18px 22px 25px rgba(0, 0, 0, .6));
  transform: rotate(-2deg);
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
  transition: transform .2s;
}
.feature-book:hover {
  transform: rotate(0deg) scale(1.02);
}
.feature-book .cover {
  aspect-ratio: .7;
  border-color: rgba(185, 167, 122, .2);
  box-shadow: inset 7px 0 0 rgba(0, 0, 0, .2), inset 8px 0 0 rgba(255, 255, 255, .05);
}
.feature-book .cover .vertical {
  font-size: 36px;
  letter-spacing: 9px;
}
.feature-book:after {
  content: "";
  position: absolute;
  left: -35px;
  right: -35px;
  bottom: -25px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(130, 116, 84, .4), transparent);
}

.feature-copy .feature-eyebrow {
  font-size: 11px;
  letter-spacing: 3px;
  color: #9b8a66;
  margin-bottom: 19px;
}
.feature-copy h2 {
  font: 500 36px var(--font-serif);
  letter-spacing: 5px;
  margin: 0 0 10px;
  color: var(--ink);
}
.feature-copy .feature-author {
  color: #7e919b;
  font: 13px var(--font-serif);
  margin-bottom: 26px;
}
.feature-copy .feature-progress {
  display: flex;
  align-items: center;
  gap: 13px;
  font-size: 11px;
  color: #8fa0a7;
  margin-bottom: 12px;
}
.feature-copy .feature-progress i {
  display: block;
  width: 120px;
  height: 1px;
  background: #334148;
  position: relative;
}
.feature-copy .feature-progress i:after {
  content: "";
  display: block;
  width: 62%;
  height: 1px;
  background: var(--gold);
}
.feature-copy .feature-chapter {
  font: 19px var(--font-serif);
  color: #c5ced0;
  margin-bottom: 28px;
  letter-spacing: 2px;
}
.feature-copy .feature-chapter span {
  color: #6f838c;
  font: 11px var(--font-ui);
  margin-left: 14px;
  letter-spacing: 0;
}
.feature-actions {
  display: flex;
  align-items: center;
  gap: 23px;
}
.feature-actions .primary {
  background: var(--gold);
  color: #131611;
  border: 1px solid var(--gold);
  padding: 12px 22px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 3px;
  cursor: pointer;
  transition: all .2s;
}
.feature-actions .primary:hover {
  background: var(--gold2);
}
.feature-actions button:last-child {
  border: 0;
  background: none;
  color: #82949d;
  font-size: 13px;
  padding: 10px 0;
  cursor: pointer;
}
.feature-actions button:last-child:hover {
  color: var(--gold);
}

.feature-quote {
  border-left: 1px solid #665b43;
  padding: 10px 0 10px 30px;
}
.feature-quote p {
  font: 20px/2 var(--font-serif);
  letter-spacing: 2px;
  color: #b9c2c3;
  margin: 0;
}
.feature-quote small {
  display: block;
  font-size: 11px;
  color: #758991;
  margin-top: 18px;
  letter-spacing: 1px;
}
.feature-quote button {
  border: 0;
  background: none;
  color: #ad986d;
  padding: 0;
  margin-top: 22px;
  font-size: 12px;
  cursor: pointer;
}
.feature-quote button:hover {
  color: var(--gold2);
}

/* —— 藏书分类与书目陈列 —— */
.library-catalogue-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 36px 0 25px;
}
.catalogue-filters {
  display: flex;
  gap: 28px;
}
.catalogue-filters button {
  border: 0;
  background: none;
  color: #778b95;
  padding: 7px 0;
  font-size: 14px;
  cursor: pointer;
  position: relative;
}
.catalogue-filters button.on {
  color: var(--gold);
  border-bottom: 1px solid var(--gold);
}
.library-count {
  font-size: 11px;
  color: #627983;
  letter-spacing: 1px;
}

.library-section-title {
  grid-column: 1 / -1;
  font: 500 20px var(--font-serif);
  letter-spacing: 4px;
  color: #c8d0d1;
  margin: 20px 0 -4px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.library-section-title:after {
  content: "";
  height: 1px;
  background: #253239;
  flex: 1;
}

.book-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 30px 26px;
}
@media (min-width: 1400px) {
  .book-row { grid-template-columns: repeat(6, 1fr); }
}

.book {
  background: none;
  border: 0;
  text-align: left;
  color: var(--ink);
  padding: 0;
  cursor: pointer;
  position: relative;
}
.cover {
  aspect-ratio: .76;
  padding: 20px 14px;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #293b42;
  border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 7px 9px 20px rgba(0, 0, 0, .25), inset 5px 0 0 rgba(0, 0, 0, .15);
  transition: transform .22s, box-shadow .22s;
  border-radius: 2px;
}
.book:hover .cover {
  transform: translateY(-7px);
  box-shadow: 10px 18px 30px rgba(0, 0, 0, .45), inset 5px 0 0 rgba(0, 0, 0, .15);
}
.cover:before {
  content: "";
  position: absolute;
  inset: 9px;
  border: 1px solid rgba(215, 196, 148, .2);
}
.cover .vertical {
  writing-mode: vertical-rl;
  font: 500 23px/1.35 var(--font-serif);
  letter-spacing: 5px;
  color: #e3d8bc;
  max-height: 85%;
}
.cover .seal-small {
  position: absolute;
  bottom: 19px;
  right: 19px;
  border: 1px solid #b66d5e;
  color: #d39684;
  font: 9px var(--font-serif);
  padding: 2px 4px;
  border-radius: 1px;
}
.cover.green { background: #2d4039; }
.cover.red { background: #4b3330; }
.cover.blue { background: #2b3a49; }
.cover.brown { background: #4a4032; }

.book-meta {
  padding-top: 13px;
}
.book-meta h3 {
  font: 500 15px var(--font-serif);
  letter-spacing: 1px;
  margin: 0 0 7px;
  color: var(--ink);
}
.book-meta p {
  font-size: 11px;
  color: #758892;
  line-height: 1.7;
  margin: 0;
}
.book .progress {
  height: 1px;
  margin-top: 10px;
  background: #243139;
}
.book .progress i {
  display: block;
  height: 100%;
  background: var(--gold);
}

.book-access {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 73px;
  background: rgba(11, 21, 28, .93);
  border: 1px solid rgba(123, 107, 73, .4);
  padding: 13px 14px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .18s, transform .18s;
  pointer-events: none;
  text-align: left;
  z-index: 2;
  border-radius: 3px;
}
.book:hover .book-access, .book:focus-visible .book-access {
  opacity: 1;
  transform: none;
}
.book-access p {
  font: 12px/1.8 var(--font-serif);
  color: #bec8c9;
  margin: 0 0 10px;
}
.book-access span {
  font-size: 11px;
  color: var(--gold);
}

.library-note {
  margin-top: 50px;
  padding-top: 25px;
  border-top: 1px solid #243139;
  display: flex;
  justify-content: space-between;
  color: #657b85;
  font-size: 11px;
  line-height: 1.8;
}
.library-note strong {
  font: 14px var(--font-serif);
  color: #a5b2b5;
  letter-spacing: 2px;
}

/* —— 书籍详情页 —— */
.book-detail {
  display: none;
  max-width: 1120px;
  margin: 0 auto;
  padding: 70px 40px 90px;
  grid-template-columns: 250px 1fr;
  gap: 70px;
}
.book-detail.open {
  display: grid;
}
.book-detail-cover .cover {
  aspect-ratio: .7;
}
.book-detail-cover .vertical {
  font-size: 38px;
  letter-spacing: 8px;
}
.book-detail-copy .back-shelf {
  border: 0;
  background: none;
  color: #80949e;
  padding: 0;
  margin-bottom: 35px;
  font-size: 13px;
  cursor: pointer;
}
.book-detail-copy .back-shelf:hover {
  color: var(--gold);
}
.book-detail-copy h1 {
  font: 500 38px var(--font-serif);
  letter-spacing: 5px;
  margin: 0 0 12px;
  color: var(--gold);
}
.book-detail-copy .detail-author {
  color: #80949e;
  font: 14px var(--font-serif);
}
.detail-description {
  font: 15px/2.1 var(--font-serif);
  color: #b5c1c4;
  margin: 28px 0;
  max-width: 600px;
}
.detail-meta {
  display: flex;
  gap: 28px;
  color: #738891;
  font-size: 11px;
  border-top: 1px solid #2a373d;
  border-bottom: 1px solid #2a373d;
  padding: 15px 0;
  margin-bottom: 28px;
}
.detail-toc {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 15px 0 28px;
}
.detail-toc span {
  font: 12px var(--font-serif);
  color: #9dabb0;
  border: 1px solid #2b3940;
  padding: 7px 12px;
  border-radius: 2px;
}

#p-books.detail-mode .library-head,
#p-books.detail-mode .shelf {
  display: none;
}

/* 响应式 */
@media (max-width: 1200px) {
  .library-feature { grid-template-columns: 190px 1fr .8fr; gap: 35px; padding-left: 2%; padding-right: 2%; }
  .feature-book { width: 175px; }
  .feature-copy h2 { font-size: 30px; }
  .feature-quote p { font-size: 17px; }
  .book-row { grid-template-columns: repeat(4, 1fr); gap: 32px 22px; }
}

@media (max-width: 959px) {
  .library-head { padding: 30px 20px 20px; }
  .shelf { padding: 0 20px 60px; }
  .library-feature { grid-template-columns: 130px 1fr; gap: 28px; padding: 20px 0 35px; }
  .feature-book { width: 125px; }
  .feature-book .cover .vertical { font-size: 23px; }
  .feature-quote { display: none; }
  .feature-copy h2 { font-size: 26px; }
  .feature-copy .feature-eyebrow { margin-bottom: 12px; }
  .feature-copy .feature-author { margin-bottom: 16px; }
  .feature-copy .feature-chapter { font-size: 16px; margin-bottom: 18px; }
  .book-row { grid-template-columns: repeat(3, 1fr); }
  .book-detail.open { grid-template-columns: 150px 1fr; gap: 30px; padding: 40px 20px; }
  .book-detail-copy h1 { font-size: 28px; }
  .book-detail-cover .vertical { font-size: 25px; }
}

/* css/unlock.css */
/* 公众号口令解锁弹窗（高保真版） */
/* =====================================================================
   扫码关注公众号 · 关键词口令 · 兑换成功状态
   ===================================================================== */
.modal-backdrop, .ul-mask {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 9, .85);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  z-index: 200;
  align-items: center;
  justify-content: center;
}
.modal-backdrop.open, .ul-mask.open {
  display: flex;
}

.unlock-modal, .ul-box {
  width: min(660px, 92vw);
  background: #111d25;
  border: 1px solid #48544f;
  padding: 36px;
  position: relative;
  box-shadow: 0 30px 100px rgba(0, 0, 0, .65);
  border-radius: 4px;
  color: var(--white, #e9eef0);
}

.modal-close, .ul-x {
  position: absolute;
  right: 18px;
  top: 15px;
  border: 0;
  background: none;
  color: var(--dim, #8799a3);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}
.modal-close:hover, .ul-x:hover {
  color: #fff;
}

.unlock-modal h2, .ul-box h2 {
  font: 500 26px var(--font-serif);
  letter-spacing: 3px;
  margin: 0 0 9px;
  color: var(--gold, #c8a968);
}
.unlock-intro {
  color: var(--dim, #8799a3);
  font-size: 13px;
  margin-bottom: 27px;
}

.unlock-grid {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 30px;
  align-items: center;
}
.unlock-grid .fake-qr {
  width: 160px;
  height: 160px;
  padding: 10px;
  background: #eee;
  display: grid;
  grid-template-columns: repeat(13, 1fr);
  grid-template-rows: repeat(13, 1fr);
  gap: 1px;
  border-radius: 4px;
}
.unlock-grid .fake-qr i { background: #172028; }
.unlock-grid .fake-qr i.off { background: transparent; }

.unlock-steps {
  color: #c2cdd1;
  font-size: 13px;
  line-height: 2.2;
  margin: 0 0 18px;
  padding-left: 20px;
}
.unlock-steps b { color: var(--gold2, #f3dc8e); }
.unlock-steps .ul-copy {
  margin-left: 6px;
  padding: 1px 8px;
  border: 1px solid var(--line, rgba(226, 197, 106, 0.2));
  border-radius: 10px;
  background: none;
  color: var(--gold);
  font: 11px var(--font-ui);
  cursor: pointer;
}

.code-line, .ul-in {
  display: flex;
  gap: 8px;
}
.code-line input, .ul-in input {
  min-width: 0;
  flex: 1;
  background: #0b141a;
  border: 1px solid #46545d;
  color: var(--white, #e9eef0);
  padding: 11px 14px;
  font-size: 14px;
  border-radius: 3px;
  outline: none;
}
.code-line input:focus, .ul-in input:focus {
  border-color: var(--gold);
}
.code-line .primary, .ul-in button {
  background: var(--gold);
  color: #131611;
  border: 1px solid var(--gold);
  padding: 10px 20px;
  font-weight: 600;
  font-size: 14px;
  border-radius: 3px;
  cursor: pointer;
  transition: all .2s;
}
.code-line .primary:hover, .ul-in button:hover {
  background: var(--gold2);
}

.validity {
  font-size: 11px;
  color: #7b8e96;
  line-height: 1.8;
  margin-top: 14px;
}

.unlock-success {
  display: none;
  text-align: center;
  padding: 20px 0;
}
.unlock-success .check {
  font-size: 42px;
  color: var(--gold);
  margin-bottom: 14px;
}
.unlock-success h3 {
  font: 500 24px var(--font-serif);
  color: var(--ink);
  margin: 0 0 10px;
  letter-spacing: 2px;
}
.unlock-success p {
  color: var(--dim);
  line-height: 1.8;
  font-size: 13px;
  margin: 0 0 20px;
}
.unlock-success .primary {
  background: var(--gold);
  color: #131611;
  border: 1px solid var(--gold);
  padding: 11px 26px;
  font-weight: 600;
  font-size: 14px;
  border-radius: 3px;
  cursor: pointer;
}

.unlock-modal.success .unlock-grid,
.unlock-modal.success .unlock-intro {
  display: none;
}
.unlock-modal.success .unlock-success {
  display: block;
}

@media (max-width: 600px) {
  .unlock-grid {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 20px;
  }
  .unlock-modal {
    padding: 28px 20px;
  }
}

/* css/pc.css */
/* PC 布局（≥960px）：顶部导航 + 左表单 + 中盘面 + 右检查器 */
/* =====================================================================
   ┌──────────────────────────────────────────────────────────┐
   │ 玄枢   紫微 八字 奇门 六爻 │ 书库              公众号·领口令 │  topnav（sticky）
   ├──────────┬──────────────────────────┬────────────────────┤
   │ 命例表单 │ 盘面（无盘时为示例盘）   │ 限流 / 选中宫 /    │
   │ （常驻） │                          │ 古籍引证 / 引流    │
   └──────────┴──────────────────────────┴────────────────────┘
   · 首屏即是排盘面板：PC 无盘时自动排一张固定命例的示例盘，用户排盘后替换
   · 不再区分「表单态 / 结果态」：表单常驻左栏，切板块不丢盘
   · <1280px 时右栏收到盘面下方；手机（<960px）规则全部在 result-view.css，互不影响
   ===================================================================== */
.pc-empty { display: none; }
.nav-cta { display: none; }
.topnav { display: contents; }

@media (min-width: 960px) {
  body { background-image: radial-gradient(1400px 600px at 70% -10%, #152434 0%, var(--bg) 65%); }
  .wrap {
    max-width: none; margin: 0; padding: 0; min-height: 100vh;
    display: grid; grid-template-columns: 340px minmax(0, 1fr);
    grid-template-rows: auto 1fr auto; align-items: start;
  }

  /* —— 顶部导航 —— */
  .topnav {
    grid-column: 1 / -1; grid-row: 1; position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; gap: 36px; height: 56px; padding: 0 24px;
    background: rgba(9, 14, 21, .92); border-bottom: 1px solid var(--line);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  }
  header { padding: 0; text-align: left; display: flex; align-items: baseline; gap: 14px; }
  header .brand { font-size: 22px; letter-spacing: 8px; padding-left: 0; text-shadow: none; }
  header .brand-sub { margin: 0; padding: 0; font-size: 11px; letter-spacing: 3px; }
  .tabs { flex: none; height: 56px; align-items: center; margin: 0; border: none; border-radius: 0; overflow: visible; gap: 4px; }
  .tab { flex: none; height: 32px; padding: 0 16px; border-radius: 8px; font-size: 15px; letter-spacing: 3px; border: 1px solid transparent; text-shadow: none !important; transition: color .15s, background .15s, border-color .15s; }
  .tab + .tab { border-left: 1px solid transparent; }
  .tab:hover { color: var(--ink); background: rgba(226, 197, 106, .05); }
  .tab.on, .tab.on + .tab { border-left-color: transparent; }
  .tab.on { background: rgba(226, 197, 106, .12); color: var(--gold); border-color: var(--gold); }
  .tab-books { position: relative; margin-left: 16px; }
  .tab-books::before { content: ""; position: absolute; left: -10px; top: 7px; height: 18px; border-left: 1px solid var(--line); }
  .nav-cta {
    display: block; margin-left: auto; height: 34px; padding: 0 16px; border: 1px solid var(--gold); border-radius: 17px;
    background: rgba(226, 197, 106, .12); color: var(--gold2); font: 600 13px var(--font-ui); letter-spacing: 1px; cursor: pointer; transition: background .15s, color .15s;
  }
  .nav-cta:hover { background: var(--gold); color: #1a1405; }

  /* 顶栏已让位给导航：结果顶栏在 PC 不显示，各板块自己的标题头重新显示 */
  body .result-top-bar, body.in-result-view .result-top-bar { display: none !important; }
  body.in-result-view:not(.rv-ziwei) .r-head { display: block !important; }

  /* —— 左：表单（常驻） —— */
  .panel.on { display: contents; margin-top: 0; }
  .panel.on > .panel-form-card {
    grid-column: 1; grid-row: 2; margin: 20px 12px 20px 20px; align-self: start;
    position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow-y: auto;
  }
  footer { grid-column: 1 / -1; grid-row: 3; text-align: center; padding: 8px 24px 20px; margin: 0; }

  /* —— 中：盘面 / 结果 —— */
  .panel.on > [id$="-result"] { grid-column: 2; grid-row: 2; min-width: 0; margin: 20px 24px 48px 12px; align-self: start; }
  #bz-result, #qm-result, #ly-result { max-width: 1040px; }
  #p-home.on, #p-books.on, #p-reader.on { grid-column: 1 / -1; grid-row: 2; margin: 0; }
  .pc-empty { grid-column: 2; grid-row: 2; align-self: center; justify-self: center; margin-top: -8vh; text-align: center; flex-direction: column; align-items: center; gap: 12px; color: var(--dim); }
  body:not(.in-result-view):not(.on-books):not(.on-home):not(.on-reader) .pc-empty { display: flex; }
  .pc-empty .pe-seal {
    width: 84px; height: 84px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--line); color: var(--gold); font: 700 34px var(--font-serif);
    background: radial-gradient(circle at 50% 35%, rgba(226, 197, 106, .12), transparent 70%);
    box-shadow: 0 0 40px rgba(226, 197, 106, .08), inset 0 0 0 6px rgba(226, 197, 106, .04);
  }
  .pc-empty .pe-t { font: 600 20px var(--font-serif); letter-spacing: 8px; color: var(--ink); padding-left: 8px; }
  .pc-empty .pe-s { font-size: 13px; letter-spacing: 1px; }

  /* —— 紫微：盘面宽度随视口高度放大（高宽比 1:1.47）；<1280 右栏在盘下 —— */
  body .wm-board-container {
    max-width: none; min-height: 0; margin: 0;
    display: flex; flex-direction: column; align-items: center; gap: 14px;
  }
  body .wm-board-col { width: min(100%, clamp(460px, calc((100vh - 140px) / 1.47 + 26px), 640px)); }
  body .zw-inspector { width: min(100%, 660px); }
  body .wm-flow-controls {
    width: 100%; max-width: none; max-height: none; flex: 0 0 auto; margin: 0; gap: 3px;
  }
  body .wm-flow-row { flex: 0 0 auto; min-height: 0; height: 46px; }
  body .wm-flow-label { width: 34px; font-size: 13px; }
  body .wm-flow-strip .st-chip { font-size: 13px; cursor: pointer; }
  body .wm-flow-strip .st-chip:hover { border-color: rgba(226, 197, 106, .5); }
  body .wm-flow-row.l2 .st-chip { font-size: 11.5px; }
  body .wm-flow-row.l2 .st-chip small { font-size: 9.5px; }

  /* 三盘对照：横排三盘，右栏在下 */
  body .wm-board-container.wm-all { overflow: visible; max-height: none; }
  body .wm-all .wm-board-col { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  body .wm-all .zw-board { max-width: none; }
  body .wm-all .zw-inspector { width: 100%; }
}

/* ≥1280px：右栏并到盘面右侧；表单列加宽；八字结果两栏 */
@media (min-width: 1280px) {
  .wrap { grid-template-columns: 360px minmax(0, 1fr); }
  body .wm-board-container:not(.wm-all) { flex-direction: row; align-items: flex-start; justify-content: center; gap: 24px; }
  body .wm-board-container:not(.wm-all) .wm-board-col { flex: 0 0 auto; }
  body .wm-board-container:not(.wm-all) .zw-inspector { flex: 1 1 360px; width: auto; max-width: 440px; position: sticky; top: 76px; }

  #bz-result { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  #bz-result > * { margin: 0 !important; }
  #bz-result > .pillars, #bz-result > .read { grid-column: 1 / -1; }
  #bz-result > .pillars { order: 0; }
  #bz-result > .card:has(.wxbar) { order: 1; }  /* 五行能量 */
  #bz-result > .card:not(:has(.wxbar)):not(:has(.dayun-strip)) { order: 2; }  /* 神煞 */
  #bz-result > .card:has(.dayun-strip) { order: 3; grid-column: 1 / -1; }  /* 起运 · 大运 */
  #bz-result > .read { order: 4; }
}

/* css/workbench.css */
/* PC 工作台（≥1280px）：命例条 + 近方形大盘 + 右侧三页签检查器 */
/* 设计基准 docs/PC-REDESIGN.md §4。≥1280 有三种状态，全部由现有 body 类名推导，不新增状态类：
     示例盘    body.zw-sample                  首屏：左表单 + 盘 + 引流卡（沿用 pc.css 栅格，盘面改近方形并放大）
     工作台    紫微结果态（in-result-view.rv-ziwei）且非示例盘
                                               表单收起：命例条 + 盘 + 三页签检查器，整体锁一屏
     修改命例  工作台 + body.zw-editing         表单列回到左侧，盘与检查器保持不动
   手机 <960 与 960–1279 的版式一律不动：这两档本文件只有 display:none 的规则。 */

/* ---------- 基线（全档位）：命例条、页签条默认不显示 ---------- */
.zw-casebar, .zw-insp-tabs { display: none; }

.zw-casebar .cb-case { font-size: 14px; color: var(--ink); letter-spacing: 1px; white-space: nowrap; }
.zw-casebar .cb-case b { font-weight: 600; letter-spacing: .5px; }
.zw-casebar .cb-case i { margin-left: 12px; font-style: normal; font-size: 12px; color: var(--dim); }
.zw-casebar .cb-btn {
  height: 28px; padding: 0 12px; border: 1px solid var(--line); border-radius: 4px;
  background: transparent; color: var(--ink); font: 500 12px var(--font-ui); cursor: pointer;
  transition: border-color .15s, color .15s;
}
.zw-casebar .cb-btn:hover { border-color: var(--gold); color: var(--gold2); }
.zw-casebar .cb-btn .t-done { display: none; }
body.zw-editing .zw-casebar .cb-btn { border-color: var(--gold); color: var(--gold2); }
body.zw-editing .zw-casebar .cb-btn .t-edit { display: none; }
body.zw-editing .zw-casebar .cb-btn .t-done { display: inline; }
.zw-casebar .cb-status { margin-left: auto; font-size: 12px; color: var(--dim); letter-spacing: .5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.zw-insp-tabs button { border: 0; background: none; color: var(--dim); font: 500 14px var(--font-serif); letter-spacing: 2px; cursor: pointer; position: relative; }
.zw-insp-tabs button:hover { color: var(--ink); }
.zw-insp-tabs button.on { color: var(--gold); }
.zw-insp-tabs button.on::after { content: ""; position: absolute; left: 26%; right: 26%; bottom: 0; height: 2px; background: var(--gold); }
.zw-casebar .cb-btn:focus-visible, .zw-insp-tabs button:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }

@media (min-width: 1280px) {
  /* 左侧表单列占用的宽度（修改命例时 360px），算盘宽上限用 */
  :root { --wb-left: 0px; }
  body.zw-editing { --wb-left: 360px; }

  /* ===== 盘面（三种状态共用）：近方形 + PC 字号令牌 ===== */
  body .zw-board {
    aspect-ratio: 4 / 4.4;
    --t-gz:   clamp(9px, 4.2cqw, 26px);     /* 干支 */
    --t-name: clamp(7.5px, 2.7cqw, 17px);   /* 宫名 */
    --t-age:  clamp(7.5px, 2.6cqw, 15px);   /* 大限岁数 */
    --t-sub:  clamp(7px, 2.2cqw, 13px);     /* 三神 / 长生 / 四化块 */
    --t-flow: clamp(5.6px, 2.0cqw, 12px);   /* 流年 / 小限 */
  }

  /* ===== 示例盘（首屏）：沿用 pc.css 三栏栅格；盘宽 = 可视高度与剩余宽度取小 ===== */
  body.zw-sample .wm-board-container:not(.wm-all) .wm-board-col { flex: 0 0 auto; width: auto; margin: 0; }
  body.zw-sample .wm-board-container:not(.wm-all) .zw-board {
    width: min(920px, calc((100dvh - 180px) / 1.1), calc(100vw - 790px));
  }

  /* ===== 工作台：表单列退位，右列 = 命例条 + 盘 + 检查器，整体锁一屏（内部各自滚动） ===== */
  body.in-result-view.rv-ziwei:not(.zw-sample) .wrap {
    grid-template-columns: minmax(0, 1fr);
    height: 100vh; height: 100dvh; overflow: hidden; max-width: none;
  }
  body.in-result-view.rv-ziwei:not(.zw-sample) footer { display: none !important; }
  body.in-result-view.rv-ziwei:not(.zw-sample) .panel.on > .panel-form-card { display: none; }
  /* 必须显式钉在第 1 条轨道：pc.css 把结果区放在第 2 列，不钉的话 grid 会补出一条隐式轨道 */
  body.in-result-view.rv-ziwei:not(.zw-sample) .panel.on > #zw-result {
    grid-column: 1; align-self: stretch; margin: 0; min-height: 0; width: auto; max-width: none;
    display: flex; flex-direction: column;
  }

  /* —— 修改命例：表单列回到左侧 —— */
  body.in-result-view.rv-ziwei.zw-editing:not(.zw-sample) .wrap { grid-template-columns: 360px minmax(0, 1fr); }
  body.in-result-view.rv-ziwei.zw-editing:not(.zw-sample) .panel.on > .panel-form-card { display: block; }
  body.in-result-view.rv-ziwei.zw-editing:not(.zw-sample) .panel.on > #zw-result { grid-column: 2; }

  /* —— 命例条 —— */
  body.in-result-view.rv-ziwei:not(.zw-sample) .zw-casebar {
    display: flex; align-items: center; gap: 14px; flex: 0 0 auto; padding: 12px 24px 10px;
  }

  /* —— 盘 + 检查器横排 —— */
  body.in-result-view.rv-ziwei:not(.zw-sample) .wm-board-container:not(.wm-all) {
    flex: 1 1 auto; min-height: 0; max-width: none; gap: 0;
    display: flex; flex-direction: row; align-items: stretch; justify-content: flex-start;
    padding: 0 0 12px 24px;
  }
  body.in-result-view.rv-ziwei:not(.zw-sample) .wm-board-container:not(.wm-all) .wm-board-col {
    flex: 1 1 auto; width: auto; max-width: none; min-width: 0; margin: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
  }
  /* 盘宽 =（可视高度 − 导航 56 − 命例条 50 − 底边距 12 − 方位标 32）÷ 1.1；另受剩余宽度与 920px 上限约束。
     .zw-board 自带 container-type: inline-size，星曜字号的 cqw 以它为基准，这里只能设显式宽度，不能用百分比 */
  body.in-result-view.rv-ziwei:not(.zw-sample) .wm-board-container:not(.wm-all) .zw-board {
    width: min(920px, calc((100dvh - 152px) / 1.1), calc(100vw - var(--wb-left) - 446px));
  }

  /* —— 三盘对照：三盘横排，检查器落到下面（页面内滚动），保证「回到单盘」的入口始终可达 —— */
  body.in-result-view.rv-ziwei:not(.zw-sample) .wm-board-container.wm-all {
    flex: 1 1 auto; min-height: 0; max-height: none; overflow-y: auto;
    display: flex; flex-direction: column; align-items: stretch; padding: 0 24px 12px;
  }
  body.in-result-view.rv-ziwei:not(.zw-sample) .wm-all .zw-inspector {
    flex: 0 0 auto; width: 100%; border-top: 1px solid var(--line);
  }

  /* ===== 右侧检查器：页签 + 内容 ===== */
  body.in-result-view.rv-ziwei:not(.zw-sample) .zw-inspector { display: flex; flex-direction: column; gap: 0; min-width: 0; background: var(--card); }
  body.in-result-view.rv-ziwei:not(.zw-sample) .wm-board-container:not(.wm-all) .zw-inspector {
    flex: 0 0 380px; width: auto; max-width: none; position: static; min-height: 0;
    overflow-y: auto; border-left: 1px solid var(--line);
  }
  body.in-result-view.rv-ziwei:not(.zw-sample) .zw-insp-head { display: none !important; }
  body.in-result-view.rv-ziwei:not(.zw-sample) .zw-insp-tabs {
    display: grid; grid-template-columns: repeat(3, 1fr); flex: 0 0 auto; height: 50px;
    position: sticky; top: 0; z-index: 2; background: var(--card); border-bottom: 1px solid var(--line);
  }
  body.in-result-view.rv-ziwei:not(.zw-sample) .zw-inspector .zw-insp-cards { padding: 16px; }

  /* 页签内容：aside 的 data-tab 决定显示什么（宫位 = 选中宫 + 解锁 + 盘面选项；限流 = 五层限流条；引证 = 古籍引证） */
  body.in-result-view.rv-ziwei:not(.zw-sample) .zw-inspector:not([data-tab="flow"]) .wm-flow-controls { display: none; }
  body.in-result-view.rv-ziwei:not(.zw-sample) .zw-inspector[data-tab="flow"] .zw-insp-cards { display: none !important; }
  body.in-result-view.rv-ziwei:not(.zw-sample) .zw-inspector[data-tab="citation"] .insp-card[data-card="palace"] { display: none; }
  body.in-result-view.rv-ziwei:not(.zw-sample) .zw-inspector:not([data-tab="citation"]) .insp-card[data-card="citation"] { display: none; }

  /* 限流页签：右栏较窄，改成「标签在上、5 列格子在下」；流月 / 流日 / 流时不再折叠 */
  body.in-result-view.rv-ziwei:not(.zw-sample) .zw-inspector .wm-flow-controls {
    flex: 0 0 auto; width: auto; max-width: none; max-height: none; margin: 16px 16px 20px;
    padding: 0; gap: 18px; overflow: visible;
  }
  body.in-result-view.rv-ziwei:not(.zw-sample) .zw-inspector .wm-flow-fold { display: none !important; }
  body.in-result-view.rv-ziwei:not(.zw-sample) .zw-inspector .wm-flow-controls.fold .wm-flow-fold ~ .wm-flow-row { display: block; }
  body.in-result-view.rv-ziwei:not(.zw-sample) .zw-inspector .wm-flow-row { display: block; flex: none; height: auto; min-height: 0; padding: 0; }
  body.in-result-view.rv-ziwei:not(.zw-sample) .zw-inspector .wm-flow-label {
    display: block; width: auto; padding: 0 0 8px; background: none; color: var(--gold);
    font-size: 13px; letter-spacing: 3px; text-align: left;
  }
  body.in-result-view.rv-ziwei:not(.zw-sample) .zw-inspector .wm-flow-strip { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
  body.in-result-view.rv-ziwei:not(.zw-sample) .zw-inspector .wm-flow-strip .st-chip { min-height: 38px; font-size: 13px; }
  body.in-result-view.rv-ziwei:not(.zw-sample) .zw-inspector .wm-flow-row.l2 .st-chip { min-height: 48px; font-size: 13px; letter-spacing: 0; }
  body.in-result-view.rv-ziwei:not(.zw-sample) .zw-inspector .wm-flow-row.l2 .st-chip small { font-size: 10.5px; }
  body.in-result-view.rv-ziwei:not(.zw-sample) .zw-inspector .wm-flow-strip .st-chip.void { background: none; border-color: transparent; }
}
