/* 立极尺罗盘排盘 - 仅本目录使用 */

.mode-selector {
  display: flex;
  background: #f5f5f5;
  border-bottom: 2px solid #e0e0e0;
}

.mode-selector .mode-btn {
  flex: 1 1 0;
  min-width: 0;
  padding: 14px 6px;
  border: none;
  background: transparent;
  font-size: 15px;
  color: #666;
  cursor: pointer;
  transition: color 0.3s;
  position: relative;
}

.mode-selector .mode-btn.active,
.mode-selector .mode-btn.is-active {
  color: #14532d;
  font-weight: 600;
}

.mode-selector .mode-btn.active::after,
.mode-selector .mode-btn.is-active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: #16a34a;
}

.mode-content {
  display: none;
}

.mode-content.active,
.mode-content.is-active {
  display: block;
}

.luopan-panlu-panel.liuyao-gua-rec-embedded {
  padding: 4px 2px 16px;
  border: none;
  background: transparent;
  min-height: 0;
}

.luopan-panlu-panel .liuyao-gua-rec-share-groups-wrap,
.luopan-panlu-panel .liuyao-gua-rec-classic-cats {
  margin-top: 10px;
}

.luopan-panlu-panel .liuyao-gua-rec-share-cats:empty,
.luopan-panlu-panel .liuyao-gua-rec-share-groups-scroll:empty,
.luopan-panlu-panel .liuyao-gua-rec-classic-cat-options:empty {
  min-height: 0;
}

.luopan-panlu-hint {
  margin: 10px 2px 0;
  font-size: 12px;
  line-height: 1.5;
  color: #64748b;
}

.lijichi-records-list {
  flex: 1;
  overflow: visible;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
}

.luopan-panlu-panel .lijichi-records-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 8px;
  background: #f8f9fa;
  border-radius: 12px;
  border: 1px solid #d8e2dc;
  box-shadow: 0 1px 0 rgba(255,255,255,0.7) inset, 0 -1px 0 rgba(15,23,42,0.06) inset, 0 2px 8px rgba(15,23,42,0.06);
}

.luopan-panlu-panel .lijichi-records-card-time {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 2px;
}

.luopan-panlu-panel .lijichi-records-card-line3-time {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: #64748b;
  margin-bottom: 2px;
}

.luopan-panlu-panel .lijichi-records-card-time-left {
  min-width: 0;
}

.luopan-panlu-panel .lijichi-records-card-share-meta-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
  margin-left: auto;
}

.luopan-panlu-panel .liuyao-gua-rec-time-right,
.luopan-panlu-panel .lijichi-records-card-time-right {
  flex: 1 1 auto;
  min-width: 0;
  text-align: right;
  color: #475569;
}

.luopan-panlu-panel .liuyao-gua-rec-line3-share-only {
  justify-content: flex-end;
}

.luopan-panlu-panel .liuyao-gua-rec-share-owner,
.luopan-panlu-panel .liuyao-gua-rec-share-time {
  display: block;
  text-align: right;
  white-space: nowrap;
}

.luopan-panlu-panel .lijichi-records-card.liuyao-gua-rec-item--request-comment > .liuyao-gua-rec-request-comment-badge {
  position: absolute;
  top: 4px;
  right: 10px;
  z-index: 2;
  pointer-events: none;
}

.luopan-panlu-panel .lijichi-records-card.liuyao-gua-rec-item--request-comment .liuyao-gua-rec-badges {
  margin-top: 0px;
}

.luopan-panlu-panel .liuyao-gua-rec-request-comment-badge {
  flex: 0 0 auto;
  width: max-content;
  max-width: calc(100% - 20px);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.35;
  white-space: nowrap;
  color: #fff;
  text-shadow: 0 1px 2px rgba(120, 40, 0, 0.35);
  background: linear-gradient(135deg, #fbbf24 0%, #f97316 42%, #ea580c 72%, #dc2626 100%);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow:
    0 2px 10px rgba(234, 88, 12, 0.42),
    0 0 0 1px rgba(251, 191, 36, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.luopan-panlu-panel .lijichi-records-card-owner,
.luopan-panlu-panel .lijichi-records-card-share-time {
  display: block;
}

.luopan-panlu-panel .lijichi-records-name-load.liuyao-gua-rec-loadzone {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  margin: 0;
  padding: 8px 10px;
  width: 100%;
  box-sizing: border-box;
  border-radius: 6px;
  border: 1px solid #e6ebf1;
  background: #fcfdff;
  color: #1a1a1a;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.luopan-panlu-panel .liuyao-gua-rec-line1 {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
  line-height: 1.35;
}

.luopan-panlu-panel .liuyao-gua-rec-line1-text {
  flex: 1 1 auto;
  min-width: 0;
  white-space: normal;
  word-break: break-word;
}

.luopan-panlu-panel .liuyao-gua-rec-badges {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 1px;
}

.luopan-panlu-panel .liuyao-gua-rec-my-no-badge,
.luopan-panlu-panel .liuyao-gua-rec-share-no-badge,
.luopan-panlu-panel .liuyao-gua-rec-group-share-no-badge,
.luopan-panlu-panel .liuyao-gua-rec-classic-no-badge {
  padding: 1px 7px;
  border-radius: 5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, 'Cascadia Code', 'SF Mono', Consolas, monospace;
  letter-spacing: 0.03em;
  line-height: 1.35;
  white-space: nowrap;
  user-select: text;
}

.luopan-panlu-panel .liuyao-gua-rec-my-no-badge {
  color: #b45309;
  background: rgba(255, 251, 235, 0.98);
  border: 1px solid rgba(217, 119, 6, 0.35);
}

.luopan-panlu-panel .liuyao-gua-rec-share-no-badge {
  color: #0f766e;
  background: rgba(240, 253, 250, 0.98);
  border: 1px solid rgba(13, 148, 136, 0.32);
}

.luopan-panlu-panel .liuyao-gua-rec-group-share-no-badge {
  color: #1d4ed8;
  background: rgba(239, 246, 255, 0.98);
  border: 1px solid rgba(37, 99, 235, 0.3);
}

.luopan-panlu-panel .liuyao-gua-rec-classic-no-badge {
  color: #5b21b6;
  background: rgba(245, 243, 255, 0.98);
  border: 1px solid rgba(124, 58, 237, 0.32);
}

.luopan-panlu-panel .liuyao-gua-rec-actions-stack {
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 3px;
  margin: 0 3px 6px;
  align-self: stretch;
  overflow: visible;
}

.luopan-panlu-panel .liuyao-gua-rec-actions-stack .liuyao-gua-rec-action-btn {
  border: 1px solid #d7dbe3;
  background: #ffffff;
  color: #1f2937;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  min-width: 56px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
}

.luopan-panlu-panel .liuyao-gua-rec-actions-stack .liuyao-gua-rec-action-btn:hover {
  border-color: #b9c2d0;
  background: #e9ecef;
}

.luopan-panlu-panel .liuyao-gua-rec-actions-stack .luopan-record-del-btn {
  color: #b71c1c;
  border-color: #ffcdd2;
}

.luopan-panlu-panel .liuyao-gua-rec-action-btn.gua-info-share-target-badge-host {
  position: relative;
  padding-top: 9px;
}

.luopan-panlu-panel .gua-info-share-target-badges {
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 3px;
  pointer-events: none;
  white-space: nowrap;
}

.luopan-panlu-panel .gua-info-share-target-badge {
  min-width: 14px;
  height: 14px;
  padding: 0 2px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  border: 1px solid #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  pointer-events: none;
  color: #334155;
  background: #e2e8f0;
  box-shadow: 0 1px 3px rgba(100, 116, 139, 0.4);
}

.luopan-panlu-panel .gua-info-share-target-badge--plaza {
  color: #064e3b;
  background: linear-gradient(165deg, #ecfdf5 0%, #d1fae5 42%, #a7f3d0 100%);
  box-shadow: 0 1px 3px rgba(52, 211, 153, 0.45);
}

:root {
  --bg: #faf6ef;
  --panel: #fffdf9;
  --border: #e0d2c4;
  --text: #3a322b;
  --muted: #7d6f62;
  --accent: #a67c52;
  --danger: #b84a4a;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
}

body.luopan-page.caiyun-page.ximu-page {
  background: var(--bg);
}

a {
  color: var(--accent);
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}

.app-header-back {
  flex-shrink: 0;
  cursor: pointer;
  border: 1px solid var(--border);
  background: #f1e8de;
  color: var(--text);
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  text-decoration: none;
  line-height: 1.2;
}

.app-header-back:hover {
  border-color: var(--accent);
  color: var(--text);
}

.app-header-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  flex: 1;
  text-align: center;
  min-width: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.user-pill {
  font-size: 0.85rem;
  color: var(--muted);
}

.btn {
  cursor: pointer;
  border: 1px solid var(--border);
  background: #f1e8de;
  color: var(--text);
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
}

.btn:hover {
  border-color: var(--accent);
}

.btn:disabled,
.btn:disabled:hover {
  opacity: 0.45;
  cursor: not-allowed;
  border-color: var(--border);
}

.btn-primary {
  background: linear-gradient(180deg, #c9a06e, #9d7449);
  border-color: #b8916a;
  color: #fffdf9;
}

.btn-danger {
  border-color: #d4a0a0;
  background: #f8eaea;
  color: #8f3535;
}

.layout {
  display: block;
  min-height: calc(100vh - 56px);
}

.layout-single .main {
  max-width: none;
}

.sidebar {
  border-right: 1px solid var(--border);
  background: #f3ece4;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: calc(100vh - 52px);
  overflow: auto;
}

.sidebar h2 {
  margin: 0 0 4px;
  font-size: 0.95rem;
}

.record-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.record-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  background: #faf8f4;
}

.record-item:hover,
.record-item.active {
  border-color: var(--accent);
}

.record-title {
  font-weight: 600;
  font-size: 0.9rem;
  word-break: break-all;
}

.record-meta {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 4px;
}

.main {
  padding: 0;
  display: flex;
  flex-direction: column;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
}

.toolbar-mode {
  align-items: center;
}

/* 山网分层按钮：挂在 #stage 内左上，一字横排（不随 pivot 旋转） */
.ers-layer-toolbar {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 25;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 4px 8px;
  max-width: calc(100% - 100px);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid rgba(58, 50, 43, 0.22);
  border-radius: 8px;
  background: rgba(255, 253, 249, 0.93);
  box-shadow: 0 2px 12px rgba(74, 58, 42, 0.1);
  pointer-events: auto;
  touch-action: manipulation;
}

.ers-layer-toolbar[hidden] {
  display: none !important;
}

.ers-layer-btns {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: center;
  flex: 0 1 auto;
  min-width: 0;
}

.ers-layer-toolbar .btn-ers-layer {
  font-size: 0.78rem;
  padding: 4px 9px;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-ers-layer.is-active {
  border-color: #b8916a;
  background: linear-gradient(180deg, #c9a06e, #9d7449);
  color: #fffdf9;
}

#btn-ers-diagonals.is-active {
  border-color: #b8916a;
  background: linear-gradient(180deg, #c9a06e, #9d7449);
  color: #fffdf9;
}

.btn-mode.is-active {
  border-color: #b8916a;
  background: linear-gradient(180deg, #c9a06e, #9d7449);
  color: #fffdf9;
}

.btn-mode.is-active:hover {
  border-color: var(--accent);
}

.rot-target-row,
.rot-actions-row,
.zoom-target-row {
  align-items: center;
}

/* 九宫 / 二十四山：旋转区只保留「定山 + 锁定」；双 ID 提高优先级，压过 .toggle-row{display:flex} 与 [hidden] 被覆盖的情况 */
#toolbar-rot-bar.is-rot-compact #rot-target-row {
  display: none;
}

#toolbar-rot-bar.is-rot-compact {
  flex-wrap: nowrap;
  align-items: center;
}

body.lijichi-grid-mode #toolbar-zoom-target {
  display: none !important;
}

/* 九宫 / 立极尺：#toolbar-controls 无可见按钮，勿留空栏（[hidden] 偶被 .toolbar{display:flex} 顶掉） */
body[data-grid-mode="jiugong"] #toolbar-controls,
body[data-grid-mode="lijichi"] #toolbar-controls,
#toolbar-controls[hidden],
#toolbar-controls.is-toolbar-suppressed {
  display: none !important;
}

.btn-zoom-target.is-active {
  border-color: #b8916a;
  background: linear-gradient(180deg, #c9a06e, #9d7449);
  color: #fffdf9;
}

.btn-zoom-target.is-active:hover {
  border-color: var(--accent);
}

.zoom-shape-kind-sep {
  color: var(--muted);
  font-size: 0.88rem;
  user-select: none;
}

.btn-grid-shape-kind.is-active {
  border-color: #b8916a;
  background: linear-gradient(180deg, #c9a06e, #9d7449);
  color: #fffdf9;
}

.btn-grid-shape-kind.is-active:hover {
  border-color: var(--accent);
}

.grid-shape-gizmo.is-quad-mode .grid-shape-inner {
  display: none !important;
}

.btn-rot-target.is-active {
  border-color: #b8916a;
  background: linear-gradient(180deg, #c9a06e, #9d7449);
  color: #fffdf9;
}

.btn-rot-target.is-active:hover {
  border-color: var(--accent);
}

/* 立极尺图：挂在 #stage 上，不随 pivot 平移；尺寸由 JS 写入 */
.lijichi-stage-fixed {
  position: absolute;
  left: 50%;
  top: calc(50% + var(--pivot-shift-y, 0px));
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transform-origin: center center;
}

.lijichi-stage-fixed[hidden] {
  display: none !important;
}

.lijichi-overlay-img {
  position: relative;
  left: auto;
  top: auto;
  display: none;
  max-width: none;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-drag: none;
  z-index: 1;
  /* 白色描边：沿不透明轮廓，叠两层略加强 */
  filter: drop-shadow(0 0 1px #fff) drop-shadow(0 0 2px #fff) drop-shadow(0 0 3px rgba(255, 255, 255, 0.95));
}

/* 立极尺锁定：尺图不挡户型单指拖移 */
body.lijichi-ruler-pass-pointer #lijichi-stage-fixed .lijichi-overlay-img {
  pointer-events: none !important;
}

#lijichi-stage-fixed:not([hidden]) .lijichi-overlay-img:not([hidden]) {
  display: block;
}

/* 与 index 一致：网层为 id="grid-layer" */
#grid-layer.is-mode-lijichi .grid-svg {
  display: none;
}

.toolbar label {
  font-size: 0.88rem;
  color: var(--muted);
}

.toolbar input[type="range"] {
  width: 160px;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.hint {
  font-size: 0.82rem;
  color: var(--muted);
}

.stage-wrap {
  position: relative;
  flex: 1;
  min-height: 420px;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin:10px 0;
  background: repeating-linear-gradient(
      45deg,
      #f5efe6,
      #f5efe6 10px,
      #efe8dd 10px,
      #efe8dd 20px
    );
  /* 裁切放在 #stage，避免 wrap 层叠/圆角与绝对定位子元素导致整页点击异常 */
  overflow: visible;
}

.stage-zoom-toolbar {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 8;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  pointer-events: auto;
}

.btn-stage-zoom {
  padding: 5px 10px;
  font-size: 0.82rem;
  touch-action: manipulation;
}

.stage-wrap.grid-oversize {
  overflow: visible;
}

.stage {
  position: absolute;
  inset: 0;
  touch-action: pan-y;
  overflow: hidden;
  border-radius: 12px;
}

.pivot {
  position: absolute;
  left: 50%;
  top: calc(50% + var(--pivot-shift-y, 0px));
  width: 0;
  height: 0;
}

.layer {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
  transform-origin: center center;
  pointer-events: none;
}

#grid-layer {
  pointer-events: none;
}

/* 网层栈：SVG 挂载区可缩为内接矩形；四角手柄仅在「缩放对象=网层」时显示 */
#grid-layer-stack {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#grid-svg-mount {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

#grid-layer:not(.is-mode-lijichi) #grid-svg-mount {
  overflow: visible;
}

#grid-svg-mount .grid-svg {
  display: block;
  pointer-events: auto;
  touch-action: none;
}

.grid-shape-gizmo {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

.grid-shape-gizmo[hidden] {
  display: none !important;
}

.grid-shape-inner {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  box-sizing: border-box;
  pointer-events: none;
  border: 1px dashed rgba(61, 158, 255, 0.55);
}

.grid-shape-handle {
  position: absolute;
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  background: rgba(61, 158, 255, 0.95);
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.35);
  cursor: nwse-resize;
  pointer-events: auto;
  touch-action: none;
  transform: translate(-50%, -50%);
  appearance: none;
  -webkit-appearance: none;
}

/* 圆点由 JS 按格层像素定位；勿再用相对 inner 的 0%/100% */

.floor-inner {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(58, 50, 43, 0.14);
  box-shadow: 0 8px 28px rgba(74, 58, 42, 0.12);
  pointer-events: auto;
}

.floor-inner img {
  display: block;
  position: absolute;
  left: 0;
  top: 0;
  max-width: none;
  user-select: none;
  -webkit-user-drag: none;
  z-index: 0;
  pointer-events: auto;
  touch-action: none;
}

/* 已保存的局部定位框（只读描边） */
.ers-local-markers {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: visible;
}

#ers-local-markers-layer {
  z-index: 7;
  pointer-events: none;
  overflow: visible;
}

#ers-local-markers-layer .ers-local-markers {
  position: absolute;
  left: 0;
  top: 0;
  overflow: visible;
}

#stage.stage-crop-bleed {
  overflow: visible;
}

.ers-local-marker-wrap {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  overflow: visible;
}

.ers-local-marker-svg {
  position: absolute;
  left: 0;
  top: 0;
  overflow: visible;
}

.ers-local-marker-room {
  position: absolute;
  box-sizing: border-box;
  border: 2px dashed rgba(200, 52, 52, 0.88);
  border-radius: 2px;
  background: rgba(220, 48, 48, 0.04);
  pointer-events: none;
}

/* 二十四山 · 局部定位草稿框（四角红点，随户型图层旋转） */
.ers-room-zoom-gizmo {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.ers-room-zoom-gizmo[hidden] {
  display: none !important;
}

.ers-room-zoom-frame {
  position: absolute;
  left: 0;
  top: 0;
  width: 40%;
  height: 40%;
  box-sizing: border-box;
  border: 2px solid rgba(220, 48, 48, 0.92);
  border-radius: 2px;
  background: rgba(220, 48, 48, 0.1);
  pointer-events: auto;
  cursor: move;
  touch-action: none;
}

.ers-room-zoom-handle {
  position: absolute;
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #e02020;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.35);
  cursor: nwse-resize;
  pointer-events: auto;
  touch-action: none;
  transform: translate(-50%, -50%);
  appearance: none;
  -webkit-appearance: none;
}

.ers-room-zoom-tl {
  left: 0;
  top: 0;
}

.ers-room-zoom-tr {
  left: 100%;
  top: 0;
  cursor: nesw-resize;
}

.ers-room-zoom-bl {
  left: 0;
  top: 100%;
  cursor: nesw-resize;
}

.ers-room-zoom-br {
  left: 100%;
  top: 100%;
  cursor: nwse-resize;
}

.ers-room-zoom-actions {
  position: absolute;
  right: 6px;
  bottom: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  z-index: 6;
  pointer-events: auto;
}

.ers-room-zoom-actions .btn {
  padding: 6px 12px;
  font-size: 0.85rem;
}

.stage-wrap.is-ers-room-zoom #drag-layer {
  pointer-events: none;
  cursor: default;
}

/* 局部定位：控件在 #floor-layer，须压住其上的 #grid-layer（网层 SVG 默认可接指针会挡红框与按钮） */
.stage-wrap.is-ers-room-zoom #floor-layer {
  z-index: 11;
  pointer-events: none;
}

.stage-wrap.is-ers-room-zoom #grid-layer {
  z-index: 1;
  pointer-events: none;
}

.stage-wrap.is-ers-room-zoom #grid-layer .grid-svg,
.stage-wrap.is-ers-room-zoom #grid-svg-mount .grid-svg {
  pointer-events: none !important;
}

.stage-wrap.is-ers-room-zoom .grid-shape-gizmo {
  display: none !important;
}

.stage-wrap.is-ers-room-zoom .floor-inner {
  pointer-events: auto;
}

.stage-wrap.is-ers-room-zoom .ers-room-zoom-gizmo {
  z-index: 20;
  pointer-events: none;
}

body.lijichi-ers-room-zoom #toolbar-controls,
body.lijichi-ers-room-zoom #toolbar-rot-bar,
body.lijichi-ers-room-zoom #toolbar-zoom-target {
  opacity: 0.42;
  pointer-events: none;
}

.grid-svg {
  display: block;
  overflow: visible;
  pointer-events: none;
}

.grid-svg line,
.grid-svg rect {
  vector-effect: non-scaling-stroke;
}

.drag-layer {
  position: absolute;
  inset: 0;
  cursor: default;
  z-index: 5;
  pointer-events: none;
}

.drag-layer:active {
  cursor: grabbing;
}

.stage-wrap.is-crop-adjust #stage {
  touch-action: none;
}

/* 裁切模式：控件在 #floor-layer，须压住 #grid-layer（与局部定位同理） */
.stage-wrap.is-crop-adjust #floor-layer {
  z-index: 11;
  pointer-events: none;
}

.stage-wrap.is-crop-adjust #grid-layer {
  z-index: 1;
  pointer-events: none;
  touch-action: none;
}

.stage-wrap.is-crop-adjust #grid-layer .grid-svg,
.stage-wrap.is-crop-adjust #grid-svg-mount .grid-svg {
  pointer-events: none !important;
}

.stage-wrap.is-crop-adjust .grid-shape-gizmo {
  display: none !important;
}

.crop-gizmo {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  pointer-events: none;
}

.crop-frame-inner {
  position: absolute;
  box-sizing: border-box;
  border: 2px solid rgba(46, 168, 72, 0.95);
  overflow: visible;
  pointer-events: none;
}

.crop-gizmo[hidden] {
  display: none !important;
}

.crop-corner {
  position: absolute;
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  background: rgba(46, 168, 72, 0.95);
  box-shadow: 0 1px 4px rgba(74, 58, 42, 0.25);
  cursor: nwse-resize;
  pointer-events: auto;
  touch-action: none;
  transform: translate(-50%, -50%);
  appearance: none;
  -webkit-appearance: none;
}

.crop-corner-tl {
  left: 0;
  top: 0;
  cursor: nwse-resize;
}

.crop-corner-tr {
  left: 100%;
  top: 0;
  cursor: nesw-resize;
  transform: translate(-50%, -50%);
}

.crop-corner-bl {
  left: 0;
  top: 100%;
  cursor: nesw-resize;
  transform: translate(-50%, -50%);
}

.crop-corner-br {
  left: 100%;
  top: 100%;
  cursor: nwse-resize;
  transform: translate(-50%, -50%);
}

.crop-confirm {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 5;
  pointer-events: auto;
  touch-action: manipulation;
  padding: 8px 16px;
  font-size: 0.9rem;
}

.stage-wrap.is-crop-adjust .drag-layer {
  pointer-events: none;
  cursor: default;
}

.stage-wrap.is-crop-adjust .floor-inner {
  outline: none;
  overflow: visible;
  pointer-events: auto;
}

.stage-wrap.is-crop-adjust .floor-inner img {
  pointer-events: none;
}

#btn-crop.is-active {
  border-color: #2ea848;
  background: linear-gradient(180deg, #4cc96a, #2a9e44);
  color: #fff;
}

body.lijichi-crop-adjust #toolbar-controls,
body.lijichi-crop-adjust #toolbar-rot-bar,
body.lijichi-crop-adjust #toolbar-zoom-target {
  opacity: 0.42;
  pointer-events: none;
}

body.lijichi-rotate-locked #stage #drag-layer {
  pointer-events: none;
  cursor: default;
}

#btn-rotate-lock.is-active {
  border-color: #b8916a;
  background: linear-gradient(180deg, #c9a06e, #9d7449);
  color: #fffdf9;
}

.empty-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.95rem;
  pointer-events: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(48, 40, 34, 0.42);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}

.modal-backdrop.show {
  display: flex;
}

.modal {
  width: 100%;
  max-width: 380px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
}

.angle-row {
  align-items: center;
}

.angle-slider-block {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.angle-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* 二十四山 · 定山名表（参考六爻居中浮层卡片） */
.lijichi-dingshan-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10080;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.lijichi-dingshan-overlay.show {
  display: flex;
  z-index: 10150;
}

.lijichi-dingshan-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(48, 40, 34, 0.45);
}

.lijichi-dingshan-box {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: min(90vh, 640px);
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px 20px;
  box-shadow: 0 10px 36px rgba(58, 50, 43, 0.22);
  z-index: 10081;
}

.lijichi-dingshan-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.lijichi-dingshan-title {
  margin: 0;
  flex: 1;
  font-size: 1.05rem;
  font-weight: 600;
  text-align: center;
  color: var(--text);
}

.lijichi-dingshan-close {
  cursor: pointer;
  border: 1px solid var(--border);
  background: #f1e8de;
  color: var(--text);
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 8px;
  font-size: 1.25rem;
  line-height: 1;
}

.lijichi-dingshan-close:hover {
  border-color: var(--accent);
}

.lijichi-dingshan-hint {
  margin: 0 0 12px;
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
}

.lijichi-dingshan-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px 6px;
}

.lijichi-dingshan-grid.dingshan-grid-bagua {
  grid-template-columns: repeat(4, 1fr);
}

.lijichi-dingshan-cell {
  margin: 0;
  padding: 8px 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #faf8f4;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  text-align: center;
  color: var(--text);
  line-height: 1.25;
  cursor: pointer;
  width: 100%;
  box-sizing: border-box;
}

.lijichi-dingshan-cell:hover {
  border-color: var(--accent);
  background: #fff9f0;
}

/* 排盘记录全屏浮层（参照 ximu 彩运记录/设置浮层结构） */
.lijichi-records-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10100;
}

.lijichi-records-overlay.show {
  display: flex;
  align-items: stretch;
  justify-content: stretch;
}

.lijichi-records-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(48, 40, 34, 0.42);
}

.lijichi-records-panel {
  position: relative;
  flex: 1;
  width: 100%;
  max-width: none;
  min-height: 100%;
  max-height: 100vh;
  background: var(--panel);
  z-index: 10101;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.lijichi-records-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.lijichi-records-head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  flex: 1;
}

.lijichi-records-back {
  cursor: pointer;
  border: 1px solid var(--border);
  background: #f1e8de;
  color: var(--text);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
}

.lijichi-records-back:hover {
  border-color: var(--accent);
}

.lijichi-records-scope {
  flex-shrink: 0;
  margin: 0;
  padding: 10px 16px;
  font-size: 0.82rem;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  background: #f0eae2;
}

.lijichi-records-list {
  flex: 1;
  overflow: visible;
  padding: 12px 16px 24px;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
}

.lijichi-records-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.lijichi-records-card {
  background: linear-gradient(180deg, #fffefb 0%, #fffdfa 100%);
  border: 1px solid #dbe7e0;
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: 0 6px 18px rgba(31, 41, 55, 0.04);
}

.lijichi-records-card.is-active {
  border-color: #2f6b52;
  box-shadow: 0 0 0 1px rgba(47, 107, 82, 0.16), 0 10px 22px rgba(30, 77, 63, 0.08);
}

.lijichi-records-card-time {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 10px;
}

.lijichi-records-overlay .lijichi-records-name-load {
  display: block;
  width: 100%;
  margin: 0 0 12px;
  padding: 11px 14px;
  border-radius: 14px;
  border: 1px solid #eadfce;
  background: linear-gradient(180deg, #fffaf3 0%, #fff7ee 100%);
  color: #3a322b;
  font-size: 15px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.lijichi-records-overlay .lijichi-records-name-load:hover {
  border-color: var(--accent);
}

.lijichi-records-overlay .lijichi-records-name-load[hidden] {
  display: none !important;
}

.lijichi-records-card-title {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff9f2;
  color: var(--text);
  font-size: 0.95rem;
  margin-bottom: 10px;
}

.lijichi-records-card-title[hidden] {
  display: none !important;
}

.lijichi-records-overlay .lijichi-records-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 8px;
}

.lijichi-records-overlay .lijichi-records-card-actions .liuyao-gua-rec-action-btn,
.lijichi-records-overlay .lijichi-records-card-actions .btn {
  border: 1px solid #d7dbe3;
  background: #ffffff;
  color: #1f2937;
  border-radius: 12px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  min-width: 72px;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.lijichi-records-overlay .lijichi-records-card-actions .liuyao-gua-rec-action-btn:hover,
.lijichi-records-overlay .lijichi-records-card-actions .btn:hover {
  border-color: #2f6b52;
  color: #1a5c40;
}

.luopan-record-nc-shell {
  margin-top: 16px;
  border: 1px solid #e6dccf;
  border-radius: 18px;
  background: linear-gradient(180deg, #fffefb 0%, #fffaf4 100%);
  box-shadow: 0 8px 24px rgba(31, 41, 55, 0.06);
  overflow: hidden;
}

.luopan-record-nc-tabs {
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 0 14px;
  border-bottom: 1px solid #eee3d6;
  background: linear-gradient(180deg, #fbf5ee 0%, #f7efe6 100%);
}

.luopan-record-nc-tab {
  flex: 1 1 0;
  min-width: 0;
  padding: 14px 12px 13px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.luopan-record-nc-tab.is-active {
  color: var(--text);
  background: rgba(255, 253, 249, 0.72);
  border-bottom-color: #d9b36c;
}

.luopan-record-nc-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 999px;
  background: #e8f4ee;
  color: #1a5c40;
  font-size: 11px;
  line-height: 1;
}

.luopan-record-nc-badge.is-zero {
  background: #eef2f7;
  color: #64748b;
}

.luopan-record-nc-panel {
  padding: 16px 16px 18px;
}

.luopan-record-nc-body {
  display: flex;
  flex-direction: column;
}

.luopan-pan-toolbar {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 12px 12px;
  border-top: 1px solid #e9ecef;
}

.luopan-pan-toolbar .luopan-result-meta-toolbar.liuyao-result-meta-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 10px 0 0;
  padding: 0;
  width: 100%;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.luopan-result-meta-toolbar.liuyao-result-meta-toolbar .gua-result-meta-actions-wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.luopan-result-meta-toolbar.liuyao-result-meta-toolbar .gua-result-meta-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

#luopan-result-meta-actions {
  display: contents;
}

.luopan-record-extra-actions.liuyao-result-meta-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 14px 16px 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.luopan-record-extra-actions.liuyao-result-meta-toolbar .gua-result-meta-actions-wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.luopan-record-extra-actions.liuyao-result-meta-toolbar .gua-result-meta-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.luopan-record-extra-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 16px 0;
  padding: 14px 16px;
  border: 1px solid #eadfce;
  border-radius: 16px;
  background: linear-gradient(180deg, #fffefb 0%, #fff8f0 100%);
  box-shadow: 0 6px 18px rgba(31, 41, 55, 0.04);
}

.luopan-record-extra-actions .btn {
  min-width: 88px;
  border-radius: 12px;
  font-weight: 700;
}

.luopan-record-classic-editor {
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid #eadfce;
  border-radius: 14px;
  background: #fffaf3;
}

.luopan-record-comment-toolbar {
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid #eee3d6;
}

.luopan-record-nc-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.modal .field {
  margin-bottom: 10px;
}

.modal input[type="text"],
.modal input[type="password"] {
  width: 100%;
  padding: 9px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff9f4;
  color: var(--text);
}

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #fff9f2;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 10px;
  z-index: 200;
  display: none;
  max-width: 90vw;
}

.toast.show {
  display: block;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* 情境笔记：编辑浮层高于笔记列表浮层 */
#ximu-ctx-notes-editor.notes-edit-overlay,
#ximu-ctx-notes-picker {
  z-index: 10200 !important;
}

/* 笔记全屏浮层（结构同排盘记录浮层） */
.lijichi-notes-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10100;
}

.lijichi-notes-overlay.show {
  display: flex;
  align-items: stretch;
  justify-content: stretch;
}

.lijichi-notes-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(48, 40, 34, 0.42);
}

.lijichi-notes-panel {
  position: relative;
  flex: 1;
  width: 100%;
  max-width: none;
  min-height: 100%;
  max-height: 100vh;
  background: var(--panel);
  z-index: 10101;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.lijichi-notes-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.lijichi-notes-head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  flex: 1;
  text-align: center;
  min-width: 0;
}

#lijichi-notes-add {
  flex-shrink: 0;
}

.lijichi-notes-back {
  cursor: pointer;
  border: 1px solid var(--border);
  background: #f1e8de;
  color: var(--text);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
}

.lijichi-notes-back:hover {
  border-color: var(--accent);
}

.lijichi-notes-scope {
  flex-shrink: 0;
  margin: 0;
  padding: 10px 16px;
  font-size: 0.82rem;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  background: #f0eae2;
}

.lijichi-notes-body {
  flex: 1;
  overflow: auto;
  padding: 12px 16px 24px;
}

.pp-notes-section[hidden] {
  display: none !important;
}

.pp-notes-hint {
  margin: 0 0 14px;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--muted);
  text-align: center;
}

.pp-notes-add-btn {
  display: block;
  margin-left: auto;
  margin-right: 0;
}

.pp-notes-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}

.pp-notes-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pp-notes-card {
  padding: 12px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff9f4;
}

.pp-notes-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.pp-notes-card-title {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pp-notes-edit-btn {
  flex-shrink: 0;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f1e8de;
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
}

.pp-notes-edit-btn:hover {
  border-color: var(--accent);
}

.pp-notes-card-meta {
  margin: 0 0 10px;
  font-size: 0.78rem;
  color: var(--muted);
}

body[data-home-tab="panlu"] #paipan-mode > #luopan-paipan-shell #toolbar-mode,
body[data-home-tab="panlu"] #paipan-mode > #luopan-paipan-shell #toolbar-rot-bar,
body[data-home-tab="panlu"] #paipan-mode > #luopan-paipan-shell #toolbar-zoom-target,
body[data-home-tab="panlu"] #paipan-mode > #luopan-paipan-shell #toolbar-controls,
body[data-home-tab="panlu"] #paipan-mode > #luopan-paipan-shell #stage-wrap,
body[data-home-tab="panlu"] #paipan-mode > #luopan-paipan-shell #stage-zoom-toolbar,
body[data-home-tab="panlu"] #paipan-mode > #luopan-paipan-shell #luopan-record-nc-shell {
  display: none !important;
}

.luopan-record-view-overlay {
  position: fixed;
  inset: 0;
  z-index: 10110;
  display: none;
  background: var(--bg);
}

.luopan-record-view-overlay.is-open {
  display: block;
}

.luopan-record-view-top-actions {
  display: none;
}

@media (min-width: 768px) {
  .luopan-record-view-top-actions {
    position: absolute;
    top: max(12px, env(safe-area-inset-top, 0px));
    right: max(12px, env(safe-area-inset-right, 0px));
    z-index: 2;
    display: block;
    pointer-events: none;
  }

  .luopan-record-view-close {
    pointer-events: auto;
  }
}

.luopan-record-view-body #stage-zoom-toolbar {
  display: flex !important;
}

/* 结果浮层打开时，定山/盘录对话框需叠在浮层之上 */
body.luopan-record-view-open .lijichi-dingshan-overlay.show,
body.luopan-record-view-open .liuyao-gua-rec-remark-dialog.show,
body.luopan-record-view-open .lijichi-notes-overlay.show {
  z-index: 10150;
}

body.bazi-paipan-overlay-open {
  overflow: hidden;
}

#ximu-bazi-gua-record-host .bazi-paipan-overlay,
.bazi-paipan-overlay {
  position: fixed;
  inset: 0;
  z-index: 10120;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  background: #ecfdf5;
}

#ximu-bazi-gua-record-host .bazi-paipan-overlay[hidden],
.bazi-paipan-overlay[hidden] {
  display: none !important;
}

#ximu-bazi-gua-record-host .bazi-paipan-overlay__loader,
.bazi-paipan-overlay__loader {
  display: none;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 12px 18px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  color: #166534;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
  box-shadow: 0 4px 16px rgba(22, 101, 52, 0.12);
  pointer-events: none;
}

#ximu-bazi-gua-record-host .bazi-paipan-overlay.is-loading .bazi-paipan-overlay__loader,
.bazi-paipan-overlay.is-loading .bazi-paipan-overlay__loader {
  display: block;
}

#ximu-bazi-gua-record-host .bazi-paipan-overlay.is-loading .bazi-paipan-overlay__frame,
.bazi-paipan-overlay.is-loading .bazi-paipan-overlay__frame {
  visibility: hidden;
}

#ximu-bazi-gua-record-host .bazi-paipan-overlay__frame,
.bazi-paipan-overlay__frame {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 100%;
  border: 0;
  background: #fff;
  overflow: hidden;
}

.meihua-gua-record-view-body .meihua-result-matter-row,
.meihua-gua-record-view-body #meihua-result-matter-row {
  display: flex;
}


.luopan-record-view-close {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.94);
  color: var(--text);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.luopan-record-view-body {
  width: 100%;
  height: 100%;
  overflow: auto;
  padding: 0;
}

.luopan-record-view-overlay .toolbar#toolbar {
  display: none !important;
}

.luopan-record-view-body #luopan-paipan-shell {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.luopan-record-view-body #stage-wrap {
  flex: 1 1 auto;
  width: 100%;
  min-height: min(68vh, 640px);
}

@media (max-width: 720px) {
  .mode-selector .mode-btn {
    padding: 12px 6px;
    font-size: 14px;
  }

  .luopan-panlu-panel {
    min-height: 360px;
  }
}

.pp-notes-readonly {
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text);
  word-break: break-word;
}

/* 盘录分享页 · 分类添加（与六爻 gua-records.css 对齐，避免缓存未命中） */
#lijichiGuaRecordsPanel .liuyao-gua-rec-classic-cat-btn.liuyao-gua-rec-classic-cat-add {
  border-style: dashed;
  color: #2f6b52;
  background: #f8fcf9;
}

#lijichiGuaRecordsPanel .liuyao-gua-rec-cat-add-form {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 2px;
  vertical-align: middle;
}

#lijichiGuaRecordsPanel .liuyao-gua-rec-cat-add-form[hidden] {
  display: none !important;
}

#lijichiGuaRecordsPanel .liuyao-gua-rec-cat-add-form .liuyao-gua-rec-cat-add-input {
  width: 5.5em;
  min-width: 5.5em;
  max-width: 5.5em;
  box-sizing: border-box;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-size: 12px;
  line-height: 1.2;
  padding: 6px 8px;
}

#lijichiGuaRecordsPanel .liuyao-gua-rec-cat-add-input:focus {
  outline: none;
  border-color: #2f6b52;
  box-shadow: 0 0 0 2px rgba(47, 107, 82, 0.15);
}

#lijichiGuaRecordsPanel .liuyao-gua-rec-cat-add-submit,
#lijichiGuaRecordsPanel .liuyao-gua-rec-cat-add-cancel {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  line-height: 1.2;
  padding: 6px 10px;
  cursor: pointer;
  white-space: nowrap;
}

#lijichiGuaRecordsPanel .liuyao-gua-rec-cat-add-submit {
  border-color: #2f6b52;
  background: #eef6f2;
  color: #1a5c40;
  font-weight: 600;
}

#lijichiGuaRecordsPanel .liuyao-gua-rec-cat-add-cancel:hover,
#lijichiGuaRecordsPanel .liuyao-gua-rec-cat-add-submit:hover {
  filter: brightness(0.97);
}

#lijichiGuaRecordsPanel .liuyao-gua-rec-share-cats,
#lijichiGuaRecordsPanel .liuyao-gua-rec-classic-cats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 10px 0 0 10px;
}

/* 盘录列表 · 笔记/评论计数角标（六爻 gua-records.css 未含完整样式，在此补齐） */
.liuyao-gua-comment-count-host {
  position: relative;
}

.liuyao-gua-comment-count-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  z-index: 2;
  min-width: 14px;
  height: 14px;
  padding: 0 2px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  border: 1px solid #fff;
  background: #ea580c;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  box-shadow: 0 1px 3px rgba(234, 88, 12, 0.45);
}

.liuyao-gua-comment-count-badge[hidden] {
  display: none !important;
}

.liuyao-gua-note-count-host {
  position: relative;
}

.liuyao-gua-note-count-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  z-index: 2;
  min-width: 14px;
  height: 14px;
  padding: 0 2px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  border: 1px solid #fff;
  background: #2563eb;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.45);
}

.liuyao-gua-note-count-badge[hidden] {
  display: none !important;
}

.liuyao-gua-rec-action-btn.liuyao-gua-comment-count-host .liuyao-gua-comment-count-badge,
.liuyao-gua-rec-action-btn.liuyao-gua-note-count-host .liuyao-gua-note-count-badge {
  top: -5px;
  right: -4px;
}

/* 情境笔记删除确认：高于盘录结果浮层(10110)与笔记编辑(10200) */
#luopanCtxNotesDeleteDialog.logout-confirm-dialog {
  z-index: 10250 !important;
}
