/* 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; }

/* 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.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; margin: 0 0 12px; padding: 8px 14px; border: 1px dashed var(--line); border-radius: 8px; font-size: 12.5px; color: var(--dim); background: rgba(226, 197, 106, .04); }
  .zw-sample-tag b { color: var(--gold); margin-right: 6px; }

  /* 流月 / 流日 / 流时默认折叠 */
  .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; }
}

/* css/books.css */
/* 书库页：左目录 · 中阅读 · 右「与我的命盘相关」。手机端三块上下堆叠 */
#p-books.on { display: block; }
.bk-side, .bk-main, .bk-rel { min-width: 0; }
.bk-side { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 12px; }
.bk-search { width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: rgba(0, 0, 0, .25); color: var(--ink); font: 14px var(--font-ui); outline: none; }
.bk-search:focus { border-color: var(--gold); }
.bk-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.bk-tags button, .bk-tg button { padding: 3px 10px; border: 1px solid var(--line-sub); border-radius: 12px; background: none; color: var(--dim); font: 12px var(--font-ui); cursor: pointer; }
.bk-tags button small { margin-left: 4px; color: var(--dim-sub); }
.bk-tags button:hover, .bk-tg button:hover { color: var(--gold2); border-color: var(--line); }
.bk-tags button.on { color: #1a1405; background: var(--gold); border-color: var(--gold); }
.bk-tags button.on small { color: #4a3d12; }

.bk-bt { padding: 8px 0 6px; font: 600 14px var(--font-serif); color: var(--gold2); letter-spacing: 2px; }
.bk-bt small { display: block; margin-top: 2px; font: 400 11px var(--font-ui); color: var(--dim); letter-spacing: 0; }
.bk-toc a { display: flex; justify-content: space-between; padding: 8px 10px; border-radius: 6px; font-size: 14px; color: var(--ink); cursor: pointer; }
.bk-toc a small { color: var(--dim-sub); }
.bk-toc a:hover { background: rgba(226, 197, 106, .06); }
.bk-toc a.on { background: var(--card2); color: var(--gold); box-shadow: inset 2px 0 0 var(--gold); }

.bk-main { margin-bottom: 12px; }
.bk-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line-sub); }
.bk-head h2 { font: 700 20px var(--font-serif); color: var(--gold); letter-spacing: 2px; }
.bk-head span { font-size: 12.5px; color: var(--dim); }
.bk-head button { margin-left: auto; padding: 3px 12px; border: 1px solid var(--line); border-radius: 12px; background: none; color: var(--gold); font: 12px var(--font-ui); cursor: pointer; }
.bk-item { margin-bottom: 12px; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.bk-src { margin-bottom: 6px; font-size: 12px; }
.bk-src a { color: var(--dim); cursor: pointer; letter-spacing: 1px; }
.bk-src a:hover { color: var(--gold); }
.bk-o { font: 600 17px/1.9 var(--font-serif); color: var(--ink); letter-spacing: 1px; }
.bk-t { margin-top: 6px; font-size: 14px; line-height: 1.85; color: var(--dim); }
.bk-tg { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.bk-lock { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px; border: 1px dashed rgba(226, 197, 106, .45); border-radius: 10px; background: linear-gradient(135deg, rgba(226, 197, 106, .1), transparent 70%); }
.bk-lock b { display: block; color: var(--gold2); font: 600 15px var(--font-serif); }
.bk-lock span { display: block; margin-top: 4px; font-size: 12.5px; color: var(--dim); }
.bk-lock .insp-btn { margin-top: 0; flex: none; }
.bk-empty { padding: 40px 0; text-align: center; font-size: 14px; color: var(--dim); }
.bk-why { margin: 10px 0 6px; font-size: 12px; color: var(--gold); letter-spacing: 1px; }
.bk-why:first-of-type { margin-top: 0; }

@media (max-width: 959.98px) {
  .bk-toc { display: flex; flex-wrap: wrap; gap: 6px; }
  .bk-book { width: 100%; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
  .bk-bt { width: 100%; }
  .bk-toc a { border: 1px solid var(--line-sub); }
  .bk-toc a small { margin-left: 8px; }
  .bk-lock { flex-direction: column; align-items: flex-start; }
}

@media (min-width: 960px) {
  #p-books.on { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 20px; align-items: start; }
  .bk-side { position: sticky; top: 76px; max-height: calc(100vh - 92px); overflow-y: auto; margin: 0; }
  .bk-main { margin: 0; max-width: 760px; }
  .bk-rel { grid-column: 2; grid-row: 2; max-width: 760px; }
}
@media (min-width: 1280px) {
  #p-books.on { grid-template-columns: 260px minmax(0, 1fr) 340px; }
  .bk-main { max-width: none; }
  .bk-rel { grid-column: 3; grid-row: 1; max-width: none; position: sticky; top: 76px; }
}

/* css/unlock.css */
/* 公众号口令解锁弹窗 */
.ul-mask { position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, .6); opacity: 0; pointer-events: none; transition: opacity .2s; }
.ul-mask.open { opacity: 1; pointer-events: auto; }
.ul-box { position: fixed; z-index: 91; left: 50%; top: 50%; width: min(420px, calc(100vw - 32px)); padding: 24px 22px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); box-shadow: 0 20px 60px rgba(0, 0, 0, .6); transform: translate(-50%, -46%); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.ul-box.open { opacity: 1; transform: translate(-50%, -50%); pointer-events: auto; }
.ul-box h3 { margin-bottom: 14px; font: 700 18px var(--font-serif); color: var(--gold); letter-spacing: 2px; }
.ul-x { position: absolute; top: 12px; right: 14px; border: none; background: none; color: var(--dim); font-size: 16px; cursor: pointer; }
.ul-x:hover { color: #fff; }
.ul-steps { padding-left: 20px; font-size: 14px; line-height: 2; color: var(--ink); }
.ul-steps b { color: var(--gold2); }
.ul-copy { margin-left: 6px; padding: 1px 10px; border: 1px solid var(--line); border-radius: 10px; background: none; color: var(--gold); font: 12px var(--font-ui); cursor: pointer; }
.ul-in { display: flex; gap: 8px; margin-top: 14px; }
.ul-in input { flex: 1; min-width: 0; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: rgba(0, 0, 0, .25); color: var(--ink); font: 14px var(--font-ui); outline: none; }
.ul-in input:focus { border-color: var(--gold); }
.ul-in button { padding: 0 20px; border: none; border-radius: 8px; background: var(--gold); color: #1a1405; font: 600 14px var(--font-ui); cursor: pointer; }
.ul-msg { min-height: 20px; margin-top: 10px; font-size: 12.5px; line-height: 1.6; color: var(--dim); }

/* 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; margin: 0; border: none; border-radius: 0; overflow: visible; gap: 2px; }
  .tab { flex: none; height: 56px; padding: 0 18px; border-radius: 0; font-size: 15px; letter-spacing: 3px; border-bottom: 2px solid transparent; text-shadow: none !important; transition: color .15s, background .15s; }
  .tab + .tab { border-left: none; }
  .tab:hover { color: var(--ink); background: rgba(226, 197, 106, .05); }
  .tab.on { background: transparent; color: var(--gold); border-bottom-color: var(--gold); }
  .tab-books { position: relative; margin-left: 16px; }
  .tab-books::before { content: ""; position: absolute; left: -9px; top: 19px; 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-books.on { grid-column: 1 / -1; grid-row: 2; margin: 20px 24px 48px; }
  .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) .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; }
}
