/* 玄机 · 地图定方位（MAP-ORIENT-001）
 * 前缀一律 mo-，不覆盖 app.css 既有类名。
 * 全离线自绘：只画经纬网格 + 省市县点云 + 方位扇区，不引第三方地图库。
 * 配色全部吃主题变量 —— 深色暖金、浅色品牌紫都跟着走，不写死颜色。 */

.mobile-sheet.map-orient-sheet {
  width: min(760px, calc(100% - 12px));
  height: min(88vh, 720px);
  max-height: calc(100vh - 24px);
  padding: 8px 12px 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.mobile-sheet.map-orient-sheet > #sheet-content {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
}

/* ---------- 面板骨架 ---------- */
.mo-panel {
  display: flex;
  flex-direction: column;
  gap: 9px;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
}

.mo-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

/* A/B 分段胶囊：当前正在落的点高亮，避免“到底在设哪一个”搞混 */
.mo-seg {
  display: inline-flex;
  padding: 2px;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}

.mo-seg-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 11px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--muted);
  font-size: .74rem;
  font-weight: 650;
  white-space: nowrap;
}

.mo-seg-btn > b {
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 1px solid currentColor;
  font-size: .6rem;
  font-weight: 700;
}

.mo-seg-btn.is-active {
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
  color: var(--accent);
}

.mo-mini {
  margin-left: auto;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  color: var(--accent);
  font-size: .7rem;
  font-weight: 650;
}

.mo-mini + .mo-mini { margin-left: 0; }

/* ---------- 地图区 ---------- */
.mo-map {
  position: relative;
  flex: 1 1 auto;
  min-height: 180px;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface-2);
  touch-action: none;
  cursor: crosshair;
}

.mo-map canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.mo-zoom {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: grid;
  gap: 5px;
}

.mo-zoom button {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  color: var(--text);
  font-size: 15px;
  line-height: 1;
  backdrop-filter: blur(6px);
}

.mo-tip {
  position: absolute;
  left: 8px;
  bottom: 8px;
  right: 56px;
  margin: 0;
  padding: 5px 9px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  color: var(--muted);
  font-size: .66rem;
  line-height: 1.35;
  pointer-events: none;
  backdrop-filter: blur(6px);
}

/* ---------- 读数区 ---------- */
.mo-readout {
  flex: 0 0 auto;
  display: grid;
  gap: 6px;
}

.mo-empty {
  margin: 0;
  color: var(--muted);
  font-size: .72rem;
}

.mo-points {
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-width: 0;
  font-size: .74rem;
}

.mo-points > b {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: .01em;
}

.mo-points > small {
  color: var(--muted);
  font-size: .66rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mo-dot {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  font-size: .58rem;
  font-weight: 700;
  transform: translateY(2px);
}

.mo-dot.is-a {
  background: color-mix(in srgb, var(--accent) 18%, var(--surface));
  color: var(--accent);
}

.mo-dot.is-b {
  background: var(--surface-3);
  color: var(--text);
}

/* 结论行：方位角 · 宫位 · 主操作，一行读完 */
.mo-verdict {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 2px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}

.mo-bearing {
  display: grid;
  gap: 1px;
  text-align: center;
  line-height: 1.1;
}

.mo-bearing > b {
  font-size: 1.02rem;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

.mo-bearing > span {
  color: var(--muted);
  font-size: .6rem;
}

.mo-arrow {
  color: var(--muted);
  font-size: .9rem;
}

.mo-palace {
  display: grid;
  gap: 1px;
  min-width: 0;
  line-height: 1.25;
}

.mo-palace > b {
  font-size: .86rem;
}

.mo-palace > span {
  color: var(--muted);
  font-size: .63rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mo-verdict .primary {
  margin-left: auto;
  flex: 0 0 auto;
  padding: 8px 13px;
  font-size: .74rem;
}

/* 窄屏：结论行允许换行，主按钮独占一行 */
@media (max-width: 420px) {
  .mo-verdict { flex-wrap: wrap; }
  .mo-verdict .primary { margin-left: 0; width: 100%; }
  .mo-seg-btn { padding: 7px 9px; font-size: .7rem; }
}
