   文墨天机专业版 · 乾坤堂紫微斗数专业排盘系统 核心样式 (style.css)
   100% 还原文墨天机专业版真迹，兼顾乾坤堂黑曜金尊典仪暗色
   严格契合 universal_responsive_auditor 与 universal_static_auditor 军规
============================================================================== */

:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  /* 文墨天机经典原版亮色 (默认) */
  --wm-bg: #eceef2;
  --wm-card: #ffffff;
  --wm-border: #ccd0d8;
  --wm-border-light: #e5e8ed;
  --wm-text-main: #1f2328;
  --wm-text-sub: #57606a;
  --wm-text-dim: #8c959f;

  /* 文墨天机星曜体系色彩 */
  --star-red: #c62828;       /* 十四主星标准红 */
  --star-blue: #1565c0;      /* 六吉曜标准蓝 */
  --star-dark: #212121;      /* 煞星与中性星黑 */
  --star-gray: #424242;      /* 杂曜与小星深灰 */
  
  /* 生年与流年四化标准角标 */
  --sihua-lu: #2e7d32;       /* 化禄 (绿) */
  --sihua-quan: #ad1457;     /* 化权 (深红) */
  --sihua-ke: #c2185b;       /* 化科 (红紫) */
  --sihua-ji: #b71c1c;       /* 化忌 (砖红) */

  /* 交互指示 */
  --active-target: #e65100;
  --active-opposite: #f57c00;
  --active-trine: #0288d1;
}

/* 乾坤堂黑曜金尊典仪暗色 */
body.theme-dark {
  --wm-bg: #090c10;
  --wm-card: #161b22;
  --wm-border: #30363d;
  --wm-border-light: #21262d;
  --wm-text-main: #f0f6fc;
  --wm-text-sub: #8b949e;
  --wm-text-dim: #6e7681;
  --star-red: #ff7b72;
  --star-blue: #79c0ff;
  --star-dark: #d2a8ff;
  --star-gray: #c9d1d9;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background: var(--wm-bg);
  color: var(--wm-text-main);
  overflow-x: hidden;
  padding-top: var(--safe-top);
  padding-bottom: calc(var(--safe-bottom) + 50px);
  min-height: 100vh;
}

/* 军规 1 & SEC-13: 案台安全箱 (max-width: 1080px) */
.wrap, main, .container, .qkt-safe-box {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  overflow-x: hidden;
  box-sizing: border-box;
  position: relative;
}

/* ==================== 1. 顶部经典文墨天机导航栏 ==================== */
.wenmo-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 44px;
  padding: 0 10px;
  background: var(--wm-card);
  border-bottom: 1px solid var(--wm-border);
  user-select: none;
}

.top-nav-left, .top-nav-right {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.nav-arrow {
  color: #0969da;
  font-size: 1.1rem;
  font-weight: 700;
}

.nav-title {
  color: #0969da;
  font-size: 0.95rem;
  font-weight: 500;
}

.top-brand-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--wm-text-main);
  letter-spacing: 0.5px;
}

.nav-settings-btn {
  color: #0969da;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
}

.top-theme-toggle {
  background: transparent;
  border: 1px solid var(--wm-border);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--wm-text-main);
}

.capsule-pill {
  border: 1px solid var(--wm-border);
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 0.72rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.03);
  cursor: pointer;
}

.pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2ea043;
}

/* ==================== 2. 4x4 天圆地方命盘主体 ==================== */
.wenmo-board-container {
  position: relative;
  width: 100%;
  padding: 22px 26px;
  margin: 0 auto;
}

/* 二十四山罗盘外围标签 */
.compass-label {
  position: absolute;
  font-size: 0.65rem;
  color: var(--wm-text-sub);
  user-select: none;
  font-family: serif;
}

.comp-top-left  { top: 5px; left: 32%; transform: translateX(-50%); }
.comp-top-right { top: 5px; left: 68%; transform: translateX(-50%); }

.comp-right-top  { right: 5px; top: 12%; }
.comp-right-mid1 { right: 5px; top: 37%; }
.comp-right-mid2 { right: 5px; top: 62%; }
.comp-right-bot  { right: 5px; top: 87%; }

.comp-bot-left  { bottom: 5px; left: 32%; transform: translateX(-50%); }
.comp-bot-right { bottom: 5px; left: 68%; transform: translateX(-50%); }

.comp-left-top  { left: 5px; top: 12%; }
.comp-left-mid1 { left: 5px; top: 37%; }
.comp-left-mid2 { left: 5px; top: 62%; }
.comp-left-bot  { left: 5px; top: 87%; }

/* 4x4 网格面板 */
.wenmo-grid-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, minmax(130px, 1fr));
  border: 1.5px solid var(--wm-border);
  background: var(--wm-border);
  gap: 1px;
  position: relative;
  width: 100%;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

/* SVG 三方四正飞线与指示层 */
.sanfang-svg-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

/* 顺时针网格布局定位 */
.cell-si   { grid-column: 1; grid-row: 1; }
.cell-wu   { grid-column: 2; grid-row: 1; }
.cell-wei  { grid-column: 3; grid-row: 1; }
.cell-shen { grid-column: 4; grid-row: 1; }

.cell-you  { grid-column: 4; grid-row: 2; }
.cell-xu   { grid-column: 4; grid-row: 3; }

.cell-hai  { grid-column: 4; grid-row: 4; }
.cell-zi   { grid-column: 3; grid-row: 4; }
.cell-chou { grid-column: 2; grid-row: 4; }
.cell-yin  { grid-column: 1; grid-row: 4; }

.cell-mao  { grid-column: 1; grid-row: 3; }
.cell-chen { grid-column: 1; grid-row: 2; }

/* 宫位单元格设计 (1:1 还原文墨天机专业版内部排布) */
.wenmo-cell {
  background: var(--wm-card);
  padding: 3px 4px 2px 4px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  position: relative;
  overflow: hidden;
  transition: background 0.15s ease;
}

.wenmo-cell.active-target {
  background: #fff8e1 !important;
  box-shadow: inset 0 0 0 2px #ff9800;
}

body.theme-dark .wenmo-cell.active-target {
  background: rgba(255, 152, 0, 0.12) !important;
}

.wenmo-cell.active-opposite {
  background: #fff3e0 !important;
  box-shadow: inset 0 0 0 1.5px #ff5722;
}

body.theme-dark .wenmo-cell.active-opposite {
  background: rgba(255, 87, 34, 0.12) !important;
}

.wenmo-cell.active-trine {
  background: #e3f2fd !important;
  box-shadow: inset 0 0 0 1.5px #0288d1;
}

body.theme-dark .wenmo-cell.active-trine {
  background: rgba(2, 136, 209, 0.12) !important;
}

/* 宫位内部上区：纵向多列星曜排布 (文墨天机核心特征) */
/* ==================== 文墨天机极致一目了然星曜排版 ==================== */
.cell-stars-wrapper {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 1.5px;
  width: 100%;
  min-height: 52px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 1px;
}
.cell-stars-wrapper::-webkit-scrollbar {
  display: none;
}

.star-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 12.5px;
  line-height: 1.05;
  text-align: center;
}

.star-char {
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.02;
  display: block;
}

.star-bright {
  font-size: 0.58rem;
  font-weight: 500;
  color: #4b5563;
  margin-top: 1px;
  min-height: 10px;
  line-height: 1;
  display: block;
}

/* 十四正曜: 纯正大红粗体 */
.star-col.star-col-major .star-char, .star-col.major .star-char {
  color: #c62828 !important;
  font-weight: 800;
}

/* 六吉星(文昌、文曲、左辅、右弼、天魁、天钺、禄存、天马): 文墨典雅深紫 */
.star-col.star-col-lucky .star-char, .star-col.lucky .star-char {
  color: #7e22ce !important;
  font-weight: 700;
}

/* 六煞星(羊陀火铃空劫): 沉稳暗黑粗体 */
.star-col.star-col-sha .star-char, .star-col.sha .star-char {
  color: #1e293b !important;
  font-weight: 700;
}

/* 杂吉小星(三台八座恩光天贵天官等): 清亮湛蓝 */
.star-col.star-col-adj-lucky .star-char {
  color: #0284c7 !important;
  font-size: 0.68rem;
  font-weight: 600;
}

/* 杂煞小星与空星(天刑天姚破碎寡宿截空等): 钢灰冷蓝 */
.star-col.star-col-adj-sha .star-char, .star-col.minor .star-char {
  color: #475569 !important;
  font-size: 0.68rem;
  font-weight: 600;
}

/* 文墨天机实底方块四化标徽 */
.star-mutagen-tag {
  display: inline-block;
  width: 12px;
  height: 12px;
  font-size: 9px;
  line-height: 12px;
  text-align: center;
  border-radius: 2px;
  color: #ffffff !important;
  font-weight: 700;
  margin-top: 1px;
}
.star-mutagen-tag.mutagen-lu, .star-mutagen-tag.lu { background: #16a34a !important; }
.star-mutagen-tag.mutagen-quan, .star-mutagen-tag.quan { background: #991b1b !important; }
.star-mutagen-tag.mutagen-ke, .star-mutagen-tag.ke { background: #ea580c !important; }
.star-mutagen-tag.mutagen-ji, .star-mutagen-tag.ji { background: #dc2626 !important; }

/* 宫位内部中区：流年与小限年龄标签 */
.cell-middle-info {
  display: flex;
  flex-direction: column;
  font-size: 0.54rem;
  color: #6b7280;
  line-height: 1.15;
  margin: 1px 0;
}
.cell-middle-info span {
  white-space: nowrap;
}

/* 宫位底栏 */
.cell-bottom-info {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-top: 1px solid #e2e8f0;
  padding-top: 1px;
  width: 100%;
  margin-top: auto;
}

.cell-boshi-trio {
  display: flex;
  flex-direction: column;
  font-size: 0.52rem;
  color: #059669; /* 翡翠绿神煞 */
  line-height: 1.12;
  text-align: left;
}

.cell-center-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}

.cell-daxian-range {
  font-size: 0.72rem;
  font-weight: 700;
  color: #991b1b; /* 红褐色大限 */
  line-height: 1.1;
}

.cell-palace-title-row {
  display: flex;
  align-items: center;
  gap: 2px;
}

.cell-palace-name {
  font-size: 0.78rem;
  font-weight: 800;
  color: #111827;
}

.cell-palace-name.is-ming {
  color: #c62828 !important; /* 命宫专属鲜红 */
}

.cell-stembranch {
  font-size: 0.74rem;
  font-weight: 700;
  color: #111827;
}

.cell-shen-tag {
  border: 1px solid #ef4444;
  color: #ef4444;
  border-radius: 2px;
  font-size: 0.50rem;
  line-height: 1;
  padding: 1px 2px;
  font-weight: 700;
}

.cell-right-info {
  display: flex;
  align-items: flex-end;
}

.cell-changsheng {
  font-size: 0.56rem;
  color: #4b5563;
  writing-mode: vertical-rl;
  line-height: 1;
}

/* 抽屉式详断案台 (Bottom Sheet Drawer) */
.reading-deck-section {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 600px;
  margin: 0 auto;
  background: #ffffff;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  box-shadow: 0 -6px 28px rgba(0, 0, 0, 0.22);
  z-index: 1050;
  transform: translateY(105%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  pointer-events: none;
}

.reading-deck-section.active {
  transform: translateY(0);
  pointer-events: auto;
}

.deck-drag-handle-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.deck-close-btn {
  background: transparent;
  border: none;
  font-size: 1.1rem;
  color: #64748b;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}
.deck-close-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* 中宫紫白操作按键对齐文墨天机 */
.step-btn-group {
  display: flex;
  gap: 4px;
  justify-content: center;
}

.step-btn {
  background: #ffffff;
  border: 1px solid #d1d5db;
  color: #1f2937;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.step-btn:active {
  background: #e5e7eb;
}

.step-btn.btn-purple {
  background: #7e22ce !important;
  color: #ffffff !important;
  border: 1px solid #7e22ce !important;
}

.step-btn.btn-purple:active {
  background: #6b21a8 !important;
}


/* ==================== 3. 中央中宫 (Center 2x2 控制中枢) ==================== */
.wenmo-center-palace {
  grid-column: 2 / span 2;
  grid-row: 2 / span 2;
  background: var(--wm-card);
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--wm-border);
  overflow: hidden;
}

.center-meta-header {
  display: flex;
  flex-direction: column;
  gap: 1.5px;
  border-bottom: 1px dashed var(--wm-border-light);
  padding-bottom: 4px;
}

.center-brand-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.wm-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--wm-text-main);
  letter-spacing: 0.5px;
}

.wm-ver {
  font-size: 0.72rem;
  color: var(--wm-text-dim);
}

.wm-code {
  font-size: 0.72rem;
  font-weight: 700;
  color: #0969da;
}

.center-person-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 600;
}

.person-gender-badge {
  color: var(--star-red);
}

.center-time-row {
  font-size: 0.68rem;
  color: var(--wm-text-sub);
}

.center-masters-row {
  font-size: 0.7rem;
  color: var(--wm-text-main);
  font-weight: 600;
}

/* 中宫四柱八字案台 (四柱坚固4列防折断 repeat(4, 1fr)) */
.center-bazi-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.bazi-title-row {
  display: flex;
  gap: 10px;
  font-size: 0.62rem;
  color: var(--wm-text-dim);
}

.four-pillars-row.pillars-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 2px;
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid var(--wm-border-light);
  border-radius: 3px;
  padding: 3px 2px;
  text-align: center;
}

.pillar-col {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.p-gan {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--star-red);
}

.p-zhi {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--star-dark);
}

.p-nayin {
  font-size: 0.6rem;
  color: var(--wm-text-sub);
  margin-top: 1px;
}

.qiyun-desc {
  font-size: 0.62rem;
  color: var(--wm-text-dim);
}

.dayun-scroll-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  font-size: 0.65rem;
  padding: 2px 0;
  white-space: nowrap;
}

.dayun-pill {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  color: var(--wm-text-sub);
}

.dayun-pill .dy-gz { font-weight: 700; color: #0969da; }
.dayun-pill .dy-age { font-size: 0.58rem; }

/* 行盘快调与四化图示控制条 */
.center-controls-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px dashed var(--wm-border-light);
  padding-top: 3px;
}

.step-btn-group {
  display: flex;
  gap: 2px;
}

.step-btn {
  background: var(--wm-card);
  border: 1px solid var(--wm-border);
  border-radius: 3px;
  padding: 1px 4px;
  font-size: 0.65rem;
  cursor: pointer;
  color: var(--wm-text-main);
}

.step-btn:active { background: #e1e4e8; }

.sihua-legend-row {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 0.62rem;
}

.leg-title { color: var(--wm-text-dim); }
.leg-item.leg-lu   { color: var(--sihua-lu); font-weight: 700; }
.leg-item.leg-quan { color: var(--sihua-quan); font-weight: 700; }
.leg-item.leg-ke   { color: var(--sihua-ke); font-weight: 700; }
.leg-item.leg-ji   { color: var(--sihua-ji); font-weight: 700; }

/* ==================== 4. 多阶限流滑动控制面板 ==================== */
.wenmo-horoscope-panel {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--wm-card);
  border-top: 1px solid var(--wm-border);
  border-bottom: 1px solid var(--wm-border);
  padding: 4px 6px;
  margin-top: 6px;
}

.horo-row {
  display: flex;
  align-items: center;
  height: 28px;
}

.horo-row-header {
  width: 42px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--wm-text-sub);
  line-height: 1.1;
  text-align: center;
  flex-shrink: 0;
  border-right: 1px solid var(--wm-border-light);
  padding-right: 4px;
}

.horo-pills-scroll {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding-left: 6px;
  scrollbar-width: none;
}

.horo-pills-scroll::-webkit-scrollbar { display: none; }

.horo-pill-btn {
  flex-shrink: 0;
  background: #f6f8fa;
  border: 1px solid var(--wm-border-light);
  border-radius: 3px;
  padding: 3px 6px;
  font-size: 0.68rem;
  color: var(--wm-text-main);
  cursor: pointer;
  white-space: nowrap;
}

body.theme-dark .horo-pill-btn {
  background: #21262d;
  border-color: #30363d;
}

.horo-pill-btn.active {
  background: #0969da;
  border-color: #0969da;
  color: #fff;
  font-weight: 700;
}

/* ==================== 5. 文墨天机操作底栏 ==================== */
.wenmo-action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 12px;
  background: var(--wm-card);
  border-bottom: 1px solid var(--wm-border);
}

.wm-btn {
  background: #f6f8fa;
  border: 1px solid var(--wm-border);
  border-radius: 4px;
  padding: 5px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--wm-text-main);
  cursor: pointer;
}

.wm-btn.primary {
  background: #0969da;
  border-color: #0969da;
  color: #fff;
}

.style-toggle-pill {
  display: flex;
  background: #eef0f3;
  border: 1px solid var(--wm-border);
  border-radius: 4px;
  overflow: hidden;
}

body.theme-dark .style-toggle-pill { background: #21262d; }

.style-btn {
  background: transparent;
  border: none;
  padding: 4px 10px;
  font-size: 0.75rem;
  color: var(--wm-text-sub);
  cursor: pointer;
}

.style-btn.active {
  background: var(--wm-card);
  color: #0969da;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* ==================== 6. 底部固定主标签栏 ==================== */
.wenmo-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50px;
  background: var(--wm-card);
  border-top: 1px solid var(--wm-border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 99;
  padding-bottom: var(--safe-bottom);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.65rem;
  color: var(--wm-text-dim);
  cursor: pointer;
}

.nav-item.active {
  color: #0969da;
  font-weight: 700;
}

.nav-ico { font-size: 1.15rem; }

/* ==================== 7. 设置页面抽屉 (文墨天机真迹) ==================== */
.settings-drawer {
  background: #f6f8fa;
  z-index: 1000;
  display: flex;
  flex-direction: column;
}

body.theme-dark .settings-drawer { background: #0d1117; }

.settings-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 44px;
  padding: 0 12px;
  background: var(--wm-card);
  border-bottom: 1px solid var(--wm-border);
}

.settings-back-btn, .settings-save-btn {
  color: #0969da;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.settings-title {
  font-size: 1rem;
  font-weight: 700;
}

.settings-top-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--wm-card);
  border-bottom: 1px solid var(--wm-border);
}

.set-action-btn {
  background: #f6f8fa;
  border: 1px solid var(--wm-border);
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 0.78rem;
  cursor: pointer;
  color: var(--wm-text-main);
}

.set-code-badge {
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 1px;
}

.settings-scroll-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.settings-group {
  background: var(--wm-card);
  border: 1px solid var(--wm-border);
  border-radius: 6px;
  overflow: hidden;
}

.group-title {
  padding: 8px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--wm-text-sub);
  background: rgba(0, 0, 0, 0.02);
  border-bottom: 1px solid var(--wm-border-light);
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--wm-border-light);
  font-size: 0.82rem;
  color: var(--wm-text-main);
}

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

/* 开关组件 */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input { opacity: 0; width: 0; height: 0; }

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #ccc;
  transition: .3s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider { background-color: #2ea043; }
input:checked + .slider:before { transform: translateX(20px); }

/* ==================== 8. 模态框与抽屉全局组件 ==================== */
.drawer-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
  z-index: 500;
  display: none;
}

.drawer-overlay.active { display: block; }

.qkt-drawer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  max-height: 85vh;
  background: var(--wm-card);
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.2);
  z-index: 600;
  transform: translateY(100%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.qkt-drawer.active { transform: translateY(0); }

.drawer-drag-bar {
  width: 100%;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.drag-handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--wm-border);
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  border-bottom: 1px solid var(--wm-border-light);
}

.drawer-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.drawer-badge {
  background: #0969da;
  color: #fff;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.72rem;
  font-weight: 700;
}

.drawer-title { font-size: 0.95rem; font-weight: 700; }
.drawer-close-btn {
  background: transparent;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--wm-text-sub);
}

.drawer-body {
  padding: 12px 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.drawer-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.section-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--wm-text-main);
}

.classic-quote-box, .sanfang-analysis-box {
  background: var(--wm-bg);
  border: 1px solid var(--wm-border);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 0.8rem;
  line-height: 1.5;
}

/* 模态框 */
.qkt-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  z-index: 700;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.qkt-modal.active { display: flex; }

.modal-card {
  width: 100%;
  max-width: 480px;
  background: var(--wm-card);
  border: 1px solid var(--wm-border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--wm-border-light);
}

.modal-title { font-size: 0.95rem; font-weight: 700; }
.modal-close-btn { background: transparent; border: none; font-size: 1.1rem; cursor: pointer; color: var(--wm-text-sub); }

.modal-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 70vh;
  overflow-y: auto;
}

.input-form-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-item label { font-size: 0.78rem; font-weight: 600; color: var(--wm-text-sub); }
.form-item input, .form-item select {
  min-height: 38px;
  padding: 6px 10px;
  border: 1px solid var(--wm-border);
  border-radius: 4px;
  font-size: 0.85rem;
  background: var(--wm-card);
  color: var(--wm-text-main);
  outline: none;
}

.time-picker-flex { display: flex; gap: 6px; }
.time-picker-flex select { flex: 2; }
.time-picker-flex input { flex: 1; }

.gender-btn-group { display: flex; gap: 6px; }
.g-btn {
  flex: 1;
  min-height: 38px;
  background: #f6f8fa;
  border: 1px solid var(--wm-border);
  border-radius: 4px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--wm-text-sub);
}

.g-btn.active {
  background: #0969da;
  border-color: #0969da;
  color: #fff;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--wm-border-light);
  background: rgba(0, 0, 0, 0.02);
}

.btn-cancel, .btn-submit {
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-cancel {
  background: transparent;
  border: 1px solid var(--wm-border);
  color: var(--wm-text-main);
}

.btn-submit {
  background: #0969da;
  border: 1px solid #0969da;
  color: #fff;
}

.license-info-note {
  font-size: 0.72rem;
  line-height: 1.5;
  color: #57606a;
  background: #f6f8fa;
  padding: 8px;
  border-radius: 4px;
}

/* ==============================================================================
   军规响应式断言适配 (涵盖 1024px 平板, 640px 手机, 375px 超小屏)
   严格遵守 universal_responsive_auditor SEC-13 / SEC-18 军规要求
============================================================================== */

@media (max-width: 1024px) {
  .wenmo-board-container { padding: 18px 20px; }
  .wenmo-grid-board { grid-template-rows: repeat(4, minmax(115px, 1fr)); }
}

@media (max-width: 640px) {
  .wenmo-board-container { padding: 14px 14px; }
  .wenmo-grid-board { grid-template-rows: repeat(4, minmax(100px, 1fr)); }
  .wm-title { font-size: 1.05rem; }
  
  /* SEC-13: 四柱八字主盘 4 列坚决不折行 */
  .pillars-container {
    grid-template-columns: repeat(4, 1fr) !important;
  }
}

@media (max-width: 375px) {
  .wenmo-board-container { padding: 10px 8px; }
  .wenmo-grid-board { grid-template-rows: repeat(4, minmax(90px, 1fr)); }
  .compass-label { display: none; }
  
  .pillars-container {
    grid-template-columns: repeat(4, 1fr) !important;
  }
}

/* ==============================================================================
   南山樵客 · 中宫四柱乾坤柱与大运常驻案台 (极简素净 · 高对比清晰度)
============================================================================== */
.center-bazi-showcase {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 3px 0;
  width: 100%;
}

.four-pillars-row.pillars-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 4px;
  background: #f8fafc;
  border: 1px solid #d0d7de;
  border-radius: 4px;
  padding: 4px 6px;
  text-align: center;
}

body.theme-dark .four-pillars-row.pillars-container {
  background: #161b22;
  border-color: #30363d;
}

.pillar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.15;
}

.p-title {
  font-size: 0.60rem;
  color: var(--wm-text-sub);
  margin-bottom: 1px;
}

.p-gan {
  font-size: 0.95rem;
  font-weight: 700;
  color: #c62828; /* 醒目正红 */
}

.p-zhi {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1f2328; /* 清晰深黑 */
}

body.theme-dark .p-zhi {
  color: #f0f6fc;
}

.p-nayin {
  font-size: 0.58rem;
  color: var(--wm-text-sub);
  margin-top: 1px;
}

/* 大运流逝条 (常驻横向卷轴 · 点击即选大限) */
.dayun-strip-wrapper {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #f8fafc;
  border: 1px solid #d0d7de;
  border-radius: 4px;
  padding: 2px 6px;
  overflow: hidden;
}

body.theme-dark .dayun-strip-wrapper {
  background: #161b22;
  border-color: #30363d;
}

.dayun-strip-title {
  font-size: 0.62rem;
  font-weight: 700;
  color: #0969da;
  white-space: nowrap;
  flex-shrink: 0;
  border-right: 1px solid #d0d7de;
  padding-right: 5px;
}

.dayun-scroll-row {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  font-size: 0.62rem;
  padding: 1px 0;
  white-space: nowrap;
  scrollbar-width: none;
}
.dayun-scroll-row::-webkit-scrollbar { display: none; }

.dayun-pill {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 3px;
  background: #ffffff;
  border: 1px solid #d0d7de;
  border-radius: 3px;
  padding: 1px 5px;
  color: #57606a;
  cursor: pointer;
  transition: all 0.15s;
}

body.theme-dark .dayun-pill {
  background: #21262d;
  border-color: #30363d;
  color: #8b949e;
}

.dayun-pill .dy-gz { font-weight: 700; color: #1f2328; }
body.theme-dark .dayun-pill .dy-gz { color: #f0f6fc; }
.dayun-pill .dy-age { font-size: 0.55rem; color: #57606a; }

.dayun-pill:hover {
  border-color: #0969da;
  color: #0969da;
}

.dayun-pill.active {
  background: #0969da !important;
  border-color: #0969da !important;
}
.dayun-pill.active .dy-gz,
.dayun-pill.active .dy-age {
  color: #ffffff !important;
  font-weight: 700;
}

/* ==============================================================================
   多阶限流滑动控制栏 (素净高清晰度)
============================================================================== */
.horo-pill-btn {
  flex-shrink: 0;
  background: #ffffff;
  border: 1px solid #d0d7de;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 0.66rem;
  font-weight: 500;
  color: #1f2328;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}
body.theme-dark .horo-pill-btn {
  background: #21262d;
  border-color: #30363d;
  color: #f0f6fc;
}
.horo-pill-btn:hover {
  border-color: #0969da;
  color: #0969da;
}
.horo-pill-btn.active {
  background: #0969da !important;
  border-color: #0969da !important;
  color: #ffffff !important;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(9, 105, 218, 0.3);
}

/* 宫位岁运流年呼吸徽标 */
.cell-horo-active-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: #0969da;
  color: #ffffff;
  font-size: 0.55rem;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  z-index: 15;
  pointer-events: none;
}

/* ==============================================================================
   万年历打字式时间输入案台 (素净清爽风格 · 白底黑字高对比)
============================================================================== */
.bazi-input-card {
  background: #ffffff;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
}

body.theme-dark .bazi-input-card {
  background: #161b22;
  border-color: #30363d;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.bic-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px dashed #d0d7de;
}

.bic-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bic-seal {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  background: #c62828;
  color: #fff;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.bic-title {
  font-size: 14px;
  font-weight: 700;
  color: #1f2328;
}

body.theme-dark .bic-title {
  color: #f0f6fc;
}

.bic-sub {
  font-size: 11px;
  color: #57606a;
  margin-top: 1px;
}

.bic-fold-btn {
  background: #f6f8fa;
  border: 1px solid #d0d7de;
  color: #0969da;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 3px;
  min-height: 28px;
}
.bic-fold-btn:hover {
  background: #eef2f8;
}

/* 折叠摘要胶囊 */
.bic-summary-pill {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 5px 10px;
  background: #f6f8fa;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  color: #1f2328;
}
body.theme-dark .bic-summary-pill {
  background: #21262d;
  border-color: #30363d;
  color: #f0f6fc;
}

.bsp-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
}
.bsp-badge.dry {
  background: rgba(9, 105, 218, 0.1);
  color: #0969da;
  border: 1px solid rgba(9, 105, 218, 0.25);
}
.bsp-badge.name {
  background: rgba(198, 40, 40, 0.1);
  color: #c62828;
  border: 1px solid rgba(198, 40, 40, 0.25);
}
.bsp-loc {
  color: #57606a;
}
.bsp-expand {
  margin-left: auto;
  color: #0969da;
  font-weight: 600;
}

.bic-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.bic-input, .bic-select {
  background: #ffffff;
  border: 1px solid #d0d7de;
  border-radius: 4px;
  color: #1f2328;
  padding: 5px 8px;
  font-size: 13px;
  min-height: 32px;
  outline: none;
}
body.theme-dark .bic-input, body.theme-dark .bic-select {
  background: #21262d;
  border-color: #30363d;
  color: #f0f6fc;
}
.bic-input:focus, .bic-select:focus {
  border-color: #0969da;
}

.bic-btn {
  background: #f6f8fa;
  border: 1px solid #d0d7de;
  color: #1f2328;
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
body.theme-dark .bic-btn {
  background: #21262d;
  border-color: #30363d;
  color: #f0f6fc;
}
.bic-btn:hover {
  background: #eef2f8;
  border-color: #0969da;
}
.bic-btn.active {
  background: #0969da !important;
  border-color: #0969da !important;
  color: #ffffff !important;
  font-weight: 700;
}

.bic-btn-primary {
  background: #0969da;
  border-color: #0969da;
  color: #ffffff;
  font-weight: 700;
}
.bic-btn-primary:hover {
  background: #085fc4;
}

.bic-radar-box {
  background: #fff8f0;
  border: 1px solid #ffd8a8;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 11.5px;
  color: #d4380d;
  line-height: 1.4;
  margin-top: 6px;
}

/* 卫星地图抽屉高度适应 */
.satellite-map-container, #amapContainer {
  height: 240px;
  width: 100%;
  border-radius: 6px;
  border: 1px solid #d0d7de;
}

@media (max-width: 640px) {
  .satellite-map-container, #amapContainer {
    height: 230px !important;
  }
}


/* 中宫默认总览视图 (强制垂直列布局 · 绝不横向挤扁) */

.center-default-view {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  justify-content: space-between;
  overflow: hidden;
  box-sizing: border-box;
}
.center-default-view.hidden, .center-tactical-view.hidden {
  display: none !important;
}


.center-meta-header {
  display: flex;
  flex-direction: column;
  gap: 1.5px;
  border-bottom: 1px dashed var(--wm-border-light);
  padding-bottom: 3px;
  width: 100%;
}

.center-bazi-showcase {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 2px 0;
  width: 100% !important;
  box-sizing: border-box;
}

.four-pillars-row.pillars-container {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 2px;
  background: #f8fafc;
  border: 1px solid #d0d7de;
  border-radius: 4px;
  padding: 3px 2px;
  text-align: center;
  width: 100% !important;
  box-sizing: border-box;
}

body.theme-dark .four-pillars-row.pillars-container {
  background: #161b22;
  border-color: #30363d;
}

.pillar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.1;
  padding: 0 1px;
}

.p-title {
  font-size: 0.58rem;
  color: var(--wm-text-sub);
  margin-bottom: 1px;
}

.p-gan {
  font-size: 0.88rem;
  font-weight: 800;
  color: #c62828;
}

.p-zhi {
  font-size: 0.88rem;
  font-weight: 800;
  color: #1f2328;
}

body.theme-dark .p-zhi {
  color: #f0f6fc;
}

.p-nayin {
  font-size: 0.52rem;
  color: var(--wm-text-sub);
  margin-top: 1px;
  white-space: nowrap;
}

/* 战术态垂直整齐布局 (防止断字错行) */
.center-tactical-view {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100% !important;
  height: 100% !important;
  justify-content: space-between;
  overflow: hidden;
  box-sizing: border-box;
}
.tactical-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px dashed var(--wm-border-light);
  padding-bottom: 2px;
}
.tactical-badge {
  font-size: 0.85rem;
  font-weight: 800;
  color: #0969da;
}
.tactical-switch-back {
  font-size: 0.65rem;
  color: #c62828;
  cursor: pointer;
  font-weight: 600;
}
.energy-bar-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.energy-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.62rem;
}
.energy-track {
  display: flex;
  height: 5px;
  border-radius: 3px;
  overflow: hidden;
  background: #eee;
}
.energy-fill-auspicious { background: #2e7d32; }
.energy-fill-sha { background: #b71c1c; }
.tactical-stamp-row {
  display: flex;
  gap: 4px;
  align-items: center;
}
.vermilion-stamp {
  font-size: 0.68rem;
  font-weight: 700;
  color: #c62828;
  background: rgba(198, 40, 40, 0.08);
  border: 1px solid rgba(198, 40, 40, 0.2);
  padding: 1px 4px;
  border-radius: 3px;
}
.tac-pattern-pill {
  font-size: 0.62rem;
  color: #0969da;
}
.tactical-verdict-box {
  font-size: 0.62rem;
  line-height: 1.35;
  color: var(--wm-text-sub);
  background: rgba(0, 0, 0, 0.02);
  padding: 3px 5px;
  border-radius: 3px;
}


/* ==============================================================================
   万年历时空穿梭抽屉样式 (严格浮层隔离 · 默认完全隐藏 · 点击呼出)
============================================================================== */
.qkt-cal-drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 99999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.26s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.qkt-cal-drawer-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.qkt-cal-drawer-card {
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  background: var(--bg-card, #191c23);
  color: var(--text-main, #e8e6e3);
  border: 1px solid var(--card-border, rgba(212,175,55,0.3));
  border-bottom: none;
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(100%);
  transition: transform 0.30s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}
.qkt-cal-drawer-overlay.active .qkt-cal-drawer-card {
  transform: translateY(0);
}

@media (min-width: 768px) {
  .qkt-cal-drawer-overlay {
    align-items: center;
    padding: 20px;
  }
  .qkt-cal-drawer-card {
    max-height: 88vh;
    border-bottom: 1px solid var(--card-border, rgba(212,175,55,0.3));
    border-radius: 16px;
    transform: translateY(24px) scale(0.97);
  }
  .qkt-cal-drawer-overlay.active .qkt-cal-drawer-card {
    transform: translateY(0) scale(1);
  }
}

.qkt-cal-header {
  padding: 10px 14px 8px;
  background: var(--card-inner-bg, rgba(255, 255, 255, 0.04));
  border-bottom: 1px solid var(--border-color, rgba(212,175,55,0.22));
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.qkt-cal-drag-bar {
  width: 38px;
  height: 4px;
  background: rgba(255,255,255,0.22);
  border-radius: 2px;
  margin: 0 auto -2px;
}
.qkt-cal-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.qkt-cal-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--gold, #d4af37);
  display: flex;
  align-items: center;
  gap: 6px;
}
.qkt-cal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted, #9c9c9c);
  font-size: 24px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.qkt-cal-stepper-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
}
.qkt-cal-step-group {
  display: flex;
  align-items: center;
  gap: 3px;
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid var(--border-color, rgba(212,175,55,0.22));
}
.qkt-cal-btn-step {
  background: transparent;
  border: none;
  color: var(--gold, #d4af37);
  font-weight: bold;
  font-size: 13px;
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 4px;
  min-height: 28px;
}
.qkt-cal-btn-step:hover {
  background: rgba(212,175,55,0.18);
}

.qkt-cal-input-num::-webkit-outer-spin-button,
.qkt-cal-input-num::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.qkt-cal-input-num {
  -moz-appearance: textfield;
  appearance: textfield;
}

.qkt-cal-input-num {
  width: 54px;
  text-align: center;
  background: transparent;
  border: none;
  color: var(--text-main, #e8e6e3);
  font-weight: bold;
  font-size: 14px;
}
.qkt-cal-today-btn {
  background: rgba(212,175,55,0.16);
  border: 1px solid var(--gold, #d4af37);
  color: var(--gold, #d4af37);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  min-height: 30px;
}

.qkt-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  text-align: center;
  padding: 6px 12px 2px;
  background: var(--bg-card, #191c23);
  font-size: 12px;
  font-weight: bold;
  color: var(--text-muted, #9c9c9c);
}
.qkt-cal-weekdays .weekend {
  color: #ff7875;
}

.qkt-cal-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 12px 14px;
}

.qkt-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  margin-bottom: 10px;
}

.qkt-cal-cell {
  background: var(--bg-card, #20242d);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  border-radius: 6px;
  min-height: 52px;
  padding: 3px 2px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}
.qkt-cal-cell.other-month {
  opacity: 0.28;
}
.qkt-cal-cell:hover {
  border-color: var(--gold, #d4af37);
}
.qkt-cal-cell.today {
  border: 1.5px solid #ff7875 !important;
}
.qkt-cal-cell.selected {
  border: 1.5px solid var(--gold, #d4af37) !important;
  background: rgba(212, 175, 55, 0.18) !important;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.35);
}

.qkt

/* 明亮素净风格适配 */
.qkt-cal-drawer-card {
  background: #ffffff !important;
  color: #1f2328 !important;
  border: 1px solid #d0d7de !important;
}
.qkt-cal-header {
  background: #f6f8fa !important;
  border-bottom: 1px solid #d0d7de !important;
}
.qkt-cal-title {
  color: #0969da !important;
}
.qkt-cal-close-btn {
  color: #57606a !important;
}
.qkt-cal-step-group {
  background: #ffffff !important;
  border: 1px solid #d0d7de !important;
}
.qkt-cal-btn-step {
  color: #0969da !important;
}
.qkt-cal-input-num {
  color: #1f2328 !important;
}
.qkt-cal-today-btn {
  background: #f6f8fa !important;
  border: 1px solid #0969da !important;
  color: #0969da !important;
}
.qkt-cal-weekdays {
  background: #ffffff !important;
  color: #57606a !important;
  border-bottom: 1px solid #d0d7de !important;
}
.qkt-cal-cell {
  background: #f8fafc !important;
  border: 1px solid #e1e4e8 !important;
  color: #1f2328 !important;
}
.qkt-cal-cell:hover {
  border-color: #0969da !important;
  background: #eef2f8 !important;
}
.qkt-cal-cell.selected {
  border: 1.5px solid #0969da !important;
  background: rgba(9, 105, 218, 0.12) !important;
}
.qkt-cal-mode-tabs {
  display: flex;
  gap: 6px;
  background: #e1e4e8;
  padding: 3px;
  border-radius: 6px;
}
.qkt-cal-mode-btn {
  flex: 1;
  padding: 4px 8px;
  border: none;
  background: transparent;
  color: #57606a;
  font-size: 12px;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
}
.qkt-cal-mode-btn.active {
  background: #ffffff !important;
  color: #0969da !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

body.theme-dark .qkt-cal-drawer-card {
  background: #161b22 !important;
  color: #f0f6fc !important;
  border-color: #30363d !important;
}
body.theme-dark .qkt-cal-header {
  background: #0d1117 !important;
  border-color: #30363d !important;
}
body.theme-dark .qkt-cal-cell {
  background: #21262d !important;
  border-color: #30363d !important;
  color: #f0f6fc !important;
}


/* ==================== 遥感地图与位置微调抽屉 (Fixed Bottom Sheet) ==================== */
.bazi-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.bazi-drawer-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.bazi-drawer-card {
  background: #ffffff;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  padding: 14px 16px;
  color: #1e293b;
}

.bazi-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 8px;
  margin-bottom: 12px;
}

.bazi-drawer-title {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
}

.bazi-drawer-close {
  background: transparent;
  border: none;
  font-size: 1.4rem;
  color: #64748b;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}
.bazi-drawer-close:hover {
  color: #0f172a;
}


/* ==============================================================================
   三端响应式极美排版 (移动端优先 · 平板对称平衡 · 电脑端居中典仪安全箱)
   100% 遵照《堂主最高指挥令》标准实现
============================================================================== */

/* 1. 根容器与安全内边距 */
body {
  margin: 0;
  padding: 0;
  background-color: var(--wm-bg, #f4f6f9);
  color: var(--wm-text-main, #1e293b);
  overflow-x: hidden;
}

.qkt-safe-box {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  box-sizing: border-box;
  padding-bottom: 75px !important; /* 关键：彻底杜绝底部固定导航栏遮挡流日/流时内容 */
  position: relative;
}

/* 2. 居中典仪案台与 4x4 网格自适应 */
.wenmo-board-container {
  position: relative;
  width: 100%;
  max-width: 680px; /* 电脑端与平板端黄金收敛尺寸，拒绝无限拉伸为“带鱼长条” */
  margin: 0 auto;
  padding: 16px 18px;
  box-sizing: border-box;
}

.wenmo-grid-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, minmax(96px, 1fr));
  width: 100%;
  border: 1.5px solid var(--wm-border, #d1d5db);
  background: var(--wm-border, #d1d5db);
  gap: 1px;
  position: relative;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.07);
  box-sizing: border-box;
  border-radius: 4px;
}

/* 3. 宫位内部垂直对齐底线规范 (所有十二宫底部信息坚守同一水平基线) */
.wenmo-cell {
  background: var(--wm-card, #ffffff);
  padding: 4px 4px 3px 4px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  transition: background 0.15s ease;
  min-height: 96px;
}

.wenmo-cell .cell-stars-wrapper {
  flex-shrink: 0;
}

.wenmo-cell .cell-middle-info {
  margin-top: auto;
  margin-bottom: 2px;
}

.wenmo-cell .cell-bottom-info {
  margin-top: auto;
}

/* 4. 中宫中枢信息紧凑居中 */
.center-default-view {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  justify-content: space-between;
  padding: 4px 6px;
  box-sizing: border-box;
  overflow: hidden;
  text-align: center;
}

.center-meta-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5px;
}

.center-brand-row {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 2px;
}

.center-brand-row .wm-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #111827;
  letter-spacing: 0.5px;
}

.center-person-row,
.center-time-row,
.center-masters-row {
  font-size: 0.62rem;
  color: #4b5563;
  line-height: 1.25;
}

/* 5. 电脑端与平板端专属案台安全箱 (Desktop & Tablet Container) */
@media (min-width: 1025px) {
  .wenmo-board-container {
    max-width: 680px;
    padding: 16px 20px;
  }
  .wenmo-grid-board {
    grid-template-rows: repeat(4, 140px); /* 电脑端大屏稳定比例 */
  }
  .horo-flow-section,
  .wenmo-action-bar {
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
  }
  .wenmo-bottom-nav {
    max-width: 680px;
    margin: 0 auto;
    left: 0;
    right: 0;
    border-left: 1px solid var(--wm-border, #d1d5db);
    border-right: 1px solid var(--wm-border, #d1d5db);
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .wenmo-board-container {
    max-width: 620px;
    padding: 14px 16px;
  }
  .wenmo-grid-board {
    grid-template-rows: repeat(4, 125px); /* 平板端饱满比例 */
  }
  .horo-flow-section,
  .wenmo-action-bar {
    max-width: 620px;
    margin-left: auto;
    margin-right: auto;
  }
  .wenmo-bottom-nav {
    max-width: 620px;
    margin: 0 auto;
    left: 0;
    right: 0;
  }
}

/* 6. 手机端专属紧凑排版 (< 640px) */
@media (max-width: 640px) {
  .wenmo-board-container {
    padding: 12px 6px;
  }
  .wenmo-grid-board {
    grid-template-rows: repeat(4, minmax(95px, 1fr));
  }
  /* 隐藏易导致移动端横向挤压溢出的外侧罗盘标签，优先保障 12 宫格最大阅读空间 */
  .comp-left-top, .comp-left-mid1, .comp-left-mid2, .comp-left-bot,
  .comp-right-top, .comp-right-mid1, .comp-right-mid2, .comp-right-bot {
    display: none !important;
  }
  .comp-top-left, .comp-top-right, .comp-bot-left, .comp-bot-right {
    font-size: 0.55rem;
    opacity: 0.7;
  }
  .comp-top-left  { top: 1px; }
  .comp-top-right { top: 1px; }
  .comp-bot-left  { bottom: 1px; }
  .comp-bot-right { bottom: 1px; }
}

@media (max-width: 375px) {
  .wenmo-board-container {
    padding: 8px 3px;
  }
  .compass-label {
    display: none !important;
  }
  .wenmo-grid-board {
    grid-template-rows: repeat(4, minmax(90px, 1fr));
  }
  .star-char {
    font-size: 0.68rem;
  }
  .cell-palace-name {
    font-size: 0.74rem;
  }
}


/* ==============================================================================
   南山樵客 · 黄金三端自适应 (手机一屏尽览 · 平板对称平衡 · 电脑端案台安全箱)
   遵照《堂主最高指挥令》7 大铁律执行
============================================================================== */

/* 1. 基础容器与底部避让 */
body {
  margin: 0;
  padding: 0;
  background-color: var(--wm-bg, #f4f6f9);
  color: var(--wm-text-main, #1e293b);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.qkt-safe-box {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  box-sizing: border-box;
  padding-bottom: 72px !important; /* 彻底杜绝底部固定导航栏遮挡流日与流时 */
  position: relative;
}

/* 2. 居中案台收敛尺寸 (拒绝拉伸为带鱼长条) */
.wenmo-board-container {
  position: relative;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 12px 14px;
  box-sizing: border-box;
}

.wenmo-grid-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 112px);
  width: 100%;
  border: 1.5px solid var(--wm-border, #d1d5db);
  background: var(--wm-border, #d1d5db);
  gap: 1px;
  position: relative;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  box-sizing: border-box;
  border-radius: 4px;
}

/* 3. 十二宫位高低对齐一致基线 */
.wenmo-cell {
  background: var(--wm-card, #ffffff);
  padding: 3px 3px 2px 3px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  transition: background 0.15s ease;
  min-height: 100%;
}

.wenmo-cell .cell-stars-wrapper {
  flex-shrink: 0;
  min-height: 48px;
}

.wenmo-cell .cell-middle-info {
  margin-top: auto;
  margin-bottom: 2px;
}

.wenmo-cell .cell-bottom-info {
  margin-top: auto;
}

/* 4. 流限与底栏案台居中收拢 */
.horo-flow-section,
.wenmo-action-bar {
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

.horo-pills-scroll {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 2px 0;
  -webkit-overflow-scrolling: touch;
}
.horo-pills-scroll::-webkit-scrollbar {
  display: none;
}

.horo-pill {
  white-space: nowrap;
  flex-shrink: 0;
}

/* 5. 电脑端典仪安全箱规范 (> 1024px) */
@media (min-width: 1025px) {
  .wenmo-board-container {
    max-width: 660px;
    padding: 14px 18px;
  }
  .wenmo-grid-board {
    grid-template-rows: repeat(4, 115px);
  }
  .wenmo-bottom-nav {
    max-width: 660px;
    margin: 0 auto;
    left: 0;
    right: 0;
    border-left: 1px solid var(--wm-border, #d1d5db);
    border-right: 1px solid var(--wm-border, #d1d5db);
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
  }
}

/* 6. 平板端平衡对称规范 (641px ~ 1024px) */
@media (min-width: 641px) and (max-width: 1024px) {
  .wenmo-board-container {
    max-width: 620px;
    padding: 12px 14px;
  }
  .wenmo-grid-board {
    grid-template-rows: repeat(4, 110px);
  }
  .wenmo-bottom-nav {
    max-width: 620px;
    margin: 0 auto;
    left: 0;
    right: 0;
  }
}

/* 7. 手机端极美自适应规范 (< 640px) */
@media (max-width: 640px) {
  .wenmo-board-container {
    padding: 8px 4px;
  }
  .wenmo-grid-board {
    grid-template-rows: repeat(4, minmax(88px, 1fr));
  }
  /* 隐藏外围多余罗盘标签，保障手机端 4 列格子 100% 居中无溢出 */
  .comp-left-top, .comp-left-mid1, .comp-left-mid2, .comp-left-bot,
  .comp-right-top, .comp-right-mid1, .comp-right-mid2, .comp-right-bot {
    display: none !important;
  }
  .comp-top-left, .comp-top-right, .comp-bot-left, .comp-bot-right {
    font-size: 0.52rem;
    opacity: 0.7;
  }
  .comp-top-left  { top: 0px; }
  .comp-top-right { top: 0px; }
  .comp-bot-left  { bottom: 0px; }
  .comp-bot-right { bottom: 0px; }

  .wenmo-cell {
    padding: 2px 2px 1px 2px;
  }
  .star-col {
    width: 11.5px;
  }
  .star-char {
    font-size: 0.68rem;
  }
  .star-bright {
    font-size: 0.52rem;
  }
  .cell-daxian-range {
    font-size: 0.66rem;
  }
  .cell-palace-name {
    font-size: 0.72rem;
  }
  .cell-stembranch {
    font-size: 0.68rem;
  }
  .cell-boshi-trio {
    font-size: 0.50rem;
  }
  .cell-changsheng {
    font-size: 0.50rem;
  }
}

@media (max-width: 375px) {
  .wenmo-board-container {
    padding: 6px 2px;
  }
  .compass-label {
    display: none !important;
  }
  .wenmo-grid-board {
    grid-template-rows: repeat(4, minmax(82px, 1fr));
  }
  .star-char {
    font-size: 0.64rem;
  }
  .cell-palace-name {
    font-size: 0.68rem;
  }
}


/* ==============================================================================
   南山樵客 · 黄金三端极美排版规范 (Tri-Screen Golden Ratio Master Rules)
   严格遵守堂主最高指挥令：手机端一屏尽览无溢出，平板端对称平衡，电脑端居中典仪安全箱
============================================================================== */

html, body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden !important;
  margin: 0;
  padding: 0;
  background-color: var(--wm-bg, #f4f6f9);
  color: var(--wm-text-main, #1e293b);
  box-sizing: border-box;
}

*, *::before, *::after {
  box-sizing: inherit;
}

.qkt-safe-box {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  box-sizing: border-box;
  overflow-x: hidden !important;
  position: relative;
  padding-bottom: 68px !important; /* 彻底杜绝底部固定导航栏遮挡流日流时 */
}

/* 电脑端案台安全箱规范 (> 1024px) */
@media (min-width: 1025px) {
  .wenmo-board-container {
    max-width: 660px;
    margin: 0 auto;
    padding: 14px 20px;
    box-sizing: border-box;
  }
  .wenmo-grid-board {
    grid-template-rows: repeat(4, 114px) !important;
    width: 100%;
  }
  .horo-flow-section,
  .wenmo-action-bar {
    max-width: 660px;
    margin-left: auto;
    margin-right: auto;
  }
  .wenmo-bottom-nav {
    max-width: 660px;
    margin: 0 auto;
    left: 0;
    right: 0;
    border-left: 1px solid var(--wm-border, #d1d5db);
    border-right: 1px solid var(--wm-border, #d1d5db);
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
  }
  .compass-label {
    display: block;
  }
}

/* 平板端对称平衡规范 (641px ~ 1024px) */
@media (min-width: 641px) and (max-width: 1024px) {
  .wenmo-board-container {
    max-width: 620px;
    margin: 0 auto;
    padding: 12px 16px;
    box-sizing: border-box;
  }
  .wenmo-grid-board {
    grid-template-rows: repeat(4, 108px) !important;
    width: 100%;
  }
  .horo-flow-section,
  .wenmo-action-bar {
    max-width: 620px;
    margin-left: auto;
    margin-right: auto;
  }
  .wenmo-bottom-nav {
    max-width: 620px;
    margin: 0 auto;
    left: 0;
    right: 0;
  }
  .compass-label {
    display: block;
  }
}

/* 手机端黄金一屏尽览规范 (< 640px) */
@media (max-width: 640px) {
  .qkt-safe-box {
    padding-bottom: 62px !important;
  }
  .wenmo-top-bar {
    height: 38px;
    padding: 0 8px;
  }
  .top-brand-title {
    font-size: 0.88rem;
  }
  .bazi-input-card {
    margin: 2px 4px !important;
  }
  .bic-summary-pill {
    height: 26px !important;
    line-height: 26px !important;
    font-size: 0.68rem !important;
    padding: 0 6px !important;
  }
  .wenmo-board-container {
    padding: 6px 3px 4px 3px !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }
  /* 手机端隐藏外围多余罗盘标签，保障 4 列格子 100% 居中无右侧溢出裁剪 */
  .compass-label {
    display: none !important;
  }
  .wenmo-grid-board {
    width: 100% !important;
    margin: 0 auto !important;
    grid-template-columns: repeat(4, 1fr) !important;
    grid-template-rows: repeat(4, minmax(84px, 1fr)) !important;
    gap: 1px !important;
  }
  .wenmo-cell {
    padding: 2px 2px 1px 2px !important;
    min-height: 84px !important;
  }
  .star-col {
    width: 11px !important;
    line-height: 1.02 !important;
  }
  .star-char {
    font-size: 0.66rem !important;
    line-height: 1.0 !important;
  }
  .star-bright {
    font-size: 0.50rem !important;
    min-height: 8px !important;
  }
  .star-mutagen-tag {
    width: 11px !important;
    height: 11px !important;
    font-size: 8px !important;
    line-height: 11px !important;
  }
  .cell-middle-info {
    font-size: 0.48rem !important;
    line-height: 1.05 !important;
    margin: 1px 0 !important;
  }
  .cell-daxian-range {
    font-size: 0.64rem !important;
    line-height: 1.0 !important;
  }
  .cell-palace-name {
    font-size: 0.70rem !important;
  }
  .cell-stembranch {
    font-size: 0.66rem !important;
  }
  .cell-boshi-trio {
    font-size: 0.48rem !important;
    line-height: 1.05 !important;
  }
  .cell-changsheng {
    font-size: 0.48rem !important;
  }

  /* 中宫微调 */
  .center-default-view {
    padding: 2px 3px !important;
  }
  .center-brand-row .wm-title {
    font-size: 0.92rem !important;
  }
  .center-person-row,
  .center-time-row,
  .center-masters-row {
    font-size: 0.56rem !important;
    line-height: 1.15 !important;
  }
  .four-pillars-row.pillars-container {
    gap: 2px !important;
    padding: 1px 2px !important;
    margin: 1px 0 !important;
  }
  .pillar-col .p-title {
    font-size: 0.50rem !important;
  }
  .pillar-col .p-gan, .pillar-col .p-zhi {
    font-size: 0.80rem !important;
    line-height: 1.05 !important;
  }
  .pillar-col .p-nayin {
    font-size: 0.46rem !important;
  }
  .qiyun-strip {
    font-size: 0.50rem !important;
    margin: 1px 0 !important;
  }
  .dayun-scroll-row {
    padding: 0 !important;
  }
  .step-btn-group {
    gap: 3px !important;
    margin-top: 2px !important;
  }
  .step-btn {
    padding: 2px 5px !important;
    font-size: 0.60rem !important;
  }
  .sihua-legend-row {
    font-size: 0.50rem !important;
    margin-top: 1px !important;
  }

  /* 流限控制条高度紧凑 */
  .horo-flow-section {
    padding: 2px 4px !important;
    margin: 2px auto !important;
  }
  .horo-row {
    margin-bottom: 2px !important;
    min-height: 24px !important;
  }
  .horo-row-header {
    font-size: 0.62rem !important;
    min-width: 32px !important;
    padding: 2px 4px !important;
  }
  .horo-pill {
    padding: 2px 5px !important;
    font-size: 0.58rem !important;
  }
  .wenmo-action-bar {
    padding: 4px 8px !important;
  }
  .wm-btn {
    padding: 3px 8px !important;
    font-size: 0.64rem !important;
  }
  .style-btn {
    padding: 2px 6px !important;
    font-size: 0.60rem !important;
  }
  .wenmo-bottom-nav {
    height: 48px !important;
  }
}

@media (max-width: 375px) {
  .wenmo-board-container {
    padding: 4px 1px !important;
  }
  .wenmo-grid-board {
    grid-template-rows: repeat(4, minmax(80px, 1fr)) !important;
  }
  .star-char {
    font-size: 0.62rem !important;
  }
  .cell-palace-name {
    font-size: 0.66rem !important;
  }
}
