/* ============================================================
   易缘通宝·电子罗盘 - 样式表
   设计风格：玄学典雅 · 深色古铜 · 朱红点缀
   ============================================================ */

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

/* 横向裁剪只放在 html：若 body 也设 overflow，body 会成为裁剪容器，
   导致其内部 position:sticky（固定标题栏）失效 */
html {
  overflow-x: hidden;
}

html, body {
  width: 100%;
  min-height: 100vh;
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: #ffffff;
  color: #333333;
  touch-action: manipulation;
}

.app {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

/* ============= 顶部标题 ============= */
.app-header {
  /* 固定在顶部：拉动页面时标题栏与导航栏（用户信息栏）保持可见 */
  position: sticky;
  top: 0;
  z-index: 100;
  background: #ffffff;
  text-align: center;
  padding: 12px 0 8px;
  border-bottom: 1px solid rgba(138, 101, 32, 0.35);
  width: 100%;
}

.app-title {
  font-family: "STKaiti", "KaiTi", "楷体", serif;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 4px;
  color: #8a6520;
}

.app-subtitle {
  font-size: 12px;
  letter-spacing: 6px;
  color: #8b6f3f;
  margin-top: 4px;
}

/* ============= 罗盘舞台 ============= */
.luopan-stage {
  width: 100%;
  max-width: 560px;
  aspect-ratio: 1 / 1;
  background: radial-gradient(circle at 45% 40%, #3a2f1f 0%, #1a1410 50%, #0d0a08 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 0 40px rgba(212, 175, 110, 0.15),
    0 0 80px rgba(0, 0, 0, 0.5),
    inset 0 0 40px rgba(0, 0, 0, 0.4);
  padding: 0;
  position: relative;
  overflow: hidden;
}
.luopan-stage::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid rgba(180, 140, 60, 0.25);
  pointer-events: none;
  z-index: 2;
}

/* 盘面旋转容器：盘面图 + 天心十道十字线一同旋转 */
.luopan-dial {
  position: relative;
  width: 100%;
  height: 100%;
  transform: translateZ(0) scale(1) rotate(0deg);
  transform-origin: 50% 50%;
  transition: transform 0.18s ease-out;
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.luopan-dial picture,
.luopan-dial picture img {
  display: block;
  width: 100%;
  height: 100%;
}

/* ===== 天心十道（固定十字线：竖为子午、横为卯酉，不随盘面转动） ===== */
.luopan-cross {
  position: absolute;
  /* 与盘面对齐（.luopan-stage 有 12px 内边距）；不用 inset 简写以兼容老内核 */
  top: 12px;
  right: 12px;
  bottom: 12px;
  left: 12px;
  pointer-events: none;
  z-index: 2;
  border-radius: 50%;
  /* 中心天池处留空，不遮挡指南针磁针（天池盘 14%，遮罩略大于其半径） */
  -webkit-mask: radial-gradient(circle at 50% 50%, transparent 0 7.4%, #000 7.8%);
  mask: radial-gradient(circle at 50% 50%, transparent 0 7.4%, #000 7.8%);
}

.luopan-cross::before,
.luopan-cross::after {
  content: '';
  position: absolute;
  background: #e02020;
  box-shadow: 0 0 4px rgba(224, 32, 32, 0.85);
}

/* 竖线：子（北）— 午（南） */
.luopan-cross::before {
  left: 50%;
  top: 0;
  width: 2px;
  height: 100%;
  transform: translateX(-50%);
}

/* 横线：卯（东）— 酉（西） */
.luopan-cross::after {
  top: 50%;
  left: 0;
  width: 100%;
  height: 2px;
  transform: translateY(-50%);
}

/* ===== 指南针磁针（独立于盘面，始终指向实际南北） ===== */
.luopan-needle {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14%;
  /* 用 padding 撑出正方形（aspect-ratio 在部分老内核不生效，会导致磁针层塌陷） */
  height: 0;
  padding-bottom: 14%;
  transform: translate(-50%, -50%) rotate(0deg) scale(1);
  transform-origin: 50% 50%;
  transition: transform 0.18s ease-out;
  z-index: 3;
  pointer-events: none;
  border-radius: 50%;
  /* 天池底：覆盖盘面图上随盘转动的旧磁针（新版三盘天池均为白色，图内旧针直径约 13.5%） */
  background: var(--pool-bg, #ffffff);
  box-shadow:
    inset 0 0 0 1px rgba(120, 90, 40, 0.55),
    inset 0 0 8px rgba(90, 60, 20, 0.35),
    0 0 8px rgba(0, 0, 0, 0.45);
}

/* 北针（红，尖端朝上 = 指向实际正北） */
.luopan-needle .needle-n {
  position: absolute;
  left: 47%;
  width: 6%;
  top: 7%;
  height: 43%;
  background: linear-gradient(180deg, #ff5a4d 0%, #d81e1e 100%);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.5));
}

/* 南针（白，尖端朝下） */
.luopan-needle .needle-s {
  position: absolute;
  left: 47%;
  width: 6%;
  bottom: 7%;
  height: 43%;
  background: linear-gradient(180deg, #ffffff 0%, #cfd4d8 100%);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.5));
}

/* 中心铜帽 */
.luopan-needle .needle-cap {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18%;
  height: 18%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle at 34% 32%, #f7e3ae 0%, #c79a3c 55%, #8a6520 100%);
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.55);
}

/* ===== 天池水平水珠（不随盘面/磁针转动，随手机倾斜向高处滚动） ===== */
/* 层级说明：位于磁针层(z-index:3)之上，模拟浮于天池液面的气泡 */
.level-bubble {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14%;
  /* 与磁针层同款技巧撑出正方形（老内核 aspect-ratio 不可靠） */
  height: 0;
  padding-bottom: 14%;
  transform: translate(-50%, -50%);
  z-index: 4;
  pointer-events: none;
  border-radius: 50%;
  overflow: hidden; /* 气泡始终限制在天池圆内 */
}

.level-bubble .bubble {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 34%;
  height: 26%;
  transform: translate(-50%, -50%);
  /* 横向椭圆气泡：内层高光 + 蓝灰水体，双层 radial-gradient */
  background:
    radial-gradient(circle at 36% 30%, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.5) 30%, rgba(255, 255, 255, 0) 58%),
    radial-gradient(ellipse at 50% 50%, rgba(96, 150, 196, 0.5) 0%, rgba(60, 110, 158, 0.68) 68%, rgba(30, 66, 108, 0.85) 100%);
  border-radius: 50%;
  /* 弯月面：上缘受光、下缘沉影，营造液体张力感 */
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.85),
    inset 0 -2px 4px rgba(12, 42, 78, 0.55),
    0 1px 3px rgba(0, 0, 0, 0.35);
  transition: left 0.12s linear, top 0.12s linear;
}

#luopan-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  border-radius: 50%;
  transform-origin: 50% 50%;
  /* 渲染优化：保持子像素抗锯齿 */
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

#luopan-img:active {
  cursor: grabbing;
}

/* 拖动期间临时禁用 transition（JS 端会切到 transition:none） */
#luopan-img.dragging {
  transition: none !important;
}

/* 顶部读数指针 */
.top-marker {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 30px solid #c41a1a;
  z-index: 4;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.5));
}
.top-marker::after {
  content: '';
  position: absolute;
  top: -34px;
  left: -5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #c41a1a;
}

/* ============= 盘面四角信息角标 ============= */
/* 角标挂在舞台外侧的定位容器四角，单行"标签+数值"，无背景框 */
.stage-wrap {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
}

.dial-badge {
  position: absolute;
  z-index: 6;
  display: flex;
  align-items: baseline;
  gap: 5px;
  pointer-events: none;
  line-height: 1.3;
  white-space: nowrap;
}

.dial-badge .badge-label {
  font-size: 14px;
  font-weight: 700;
  color: #8a6520;
  letter-spacing: 1px;
}

.dial-badge .badge-value {
  font-size: 15px;
  font-weight: 800;
  color: #c41a1a;
  font-family: "STKaiti", "KaiTi", "楷体", serif;
}

.badge-tl { top: 2px; left: 0; }
.badge-tr { top: 2px; right: 0; }
.badge-bl { bottom: 2px; left: 0; }
.badge-br { bottom: 2px; right: 0; }

@media (max-width: 480px) {
  .dial-badge .badge-label { font-size: 12px; }
  .dial-badge .badge-value { font-size: 13px; }
}

/* ============= 信息面板 ============= */
.info-panel {
  width: 100%;
  background: #ffffff;
  border: 1px solid rgba(138, 101, 32, 0.28);
  border-radius: 12px;
  padding: 4px 16px;
}

/* 表格标题 */
.info-title {
  margin: 0;
  padding: 12px 2px 10px;
  border-bottom: 1px solid rgba(138, 101, 32, 0.28);
  font-family: "STKaiti", "KaiTi", "楷体", serif;
  font-size: 16px;
  font-weight: 700;
  color: #8a6520;
  letter-spacing: 4px;
  text-align: center;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0 20px;
}

/* 简洁列表风：无卡片底色，仅细分隔线；标题居左、参数居右同行显示 */
.info-cell {
  padding: 11px 2px;
  border-bottom: 1px solid rgba(138, 101, 32, 0.13);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.info-label {
  font-size: 11px;
  color: #9a7b40;
  letter-spacing: 2px;
  flex-shrink: 0; /* 长参数换行时标签不被压缩 */
}

.info-value {
  font-family: "STKaiti", "KaiTi", "楷体", serif;
  font-size: 15px; /* 缩小字号，避免手机端过长换行 */
  font-weight: 700;
  color: #3a2f1f;
  text-align: left; /* 改为靠左对齐 */
  flex-shrink: 1; /* 允许在 flex 行中收缩，避免撑破布局 */
  min-width: 0;
}

/* 整行宽项（类象等长文本）：标题在上、内容在下 */
.info-cell.wide {
  grid-column: 1 / -1;
  display: block;
}
.info-cell.wide .info-label {
  display: block;
  margin-bottom: 6px;
}
.info-cell.wide .info-value {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.8;
  white-space: normal; /* 长类象内容允许换行，覆盖手机端 nowrap 规则 */
  overflow: visible;
  text-overflow: clip;
}

/* ============= 控制按钮 ============= */
.controls {
  width: 100%;
  display: grid;
  /* 启用指南针 / 校准归零 / 满屏模式 三按钮同行 */
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.ctrl-btn {
  background: linear-gradient(135deg, #3a2f1f, #2a1f10);
  color: #fdf6e3;
  border: 1px solid #8b6f3f;
  border-radius: 8px;
  /* 变窄后收紧内边距/字号，避免文字溢出 */
  padding: 12px 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  /* 防止 emoji/文字被换行撑高 */
  white-space: nowrap;
}

.ctrl-btn:hover {
  background: linear-gradient(135deg, #4a3f2f, #3a2f1f);
  transform: translateY(-1px);
}

.ctrl-btn:active {
  transform: translateY(0);
}

.ctrl-btn.primary.active {
  background: linear-gradient(135deg, #8b1a1a, #c41a1a);
  border-color: #ff7a7a;
}

/* ============= 移动端传感器横幅 ============= */
.sensor-banner {
  display: none; /* 默认隐藏，移动端由 JS 设为 flex 显示 */
  width: 100%;
  background: linear-gradient(135deg, rgba(139, 26, 26, 0.92), rgba(196, 26, 26, 0.88));
  border: 1px solid #ff7a7a;
  border-radius: 10px;
  padding: 12px 14px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  box-shadow: 0 4px 14px rgba(196, 26, 26, 0.3);
}

.sensor-banner-text {
  font-size: 13px;
  color: #fff;
  letter-spacing: 1px;
  flex: 1;
  line-height: 1.4;
}

.sensor-banner-btn {
  flex: none;
  background: #fdf6e3;
  color: #8b1a1a;
  border: none;
  border-radius: 8px;
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 2px;
  cursor: pointer;
  font-family: inherit;
}

.sensor-banner-btn:active {
  transform: translateY(1px);
}

/* ============= 盘面切换 ============= */
.preset-bar {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.preset-label {
  font-size: 13px;
  color: #8a6520;
  letter-spacing: 1px;
  font-weight: 700;
  flex: none;
}

.preset-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
}

.preset-tab {
  background: linear-gradient(135deg, #3a2f1f, #2a1f10);
  color: #fdf6e3;
  border: 1px solid #8b6f3f;
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  white-space: nowrap;
}

.preset-tab:hover {
  background: linear-gradient(135deg, #4a3f2f, #3a2f1f);
}

.preset-tab.active {
  background: linear-gradient(135deg, #8b1a1a, #c41a1a);
  border-color: #ff7a7a;
  color: #fff;
  box-shadow: 0 0 10px rgba(196, 26, 26, 0.4);
}

/* 三个排盘按钮在窄屏仍保持同一行（八宅 / 玄空 / 阴宅） */
@media (max-width: 400px) {
  #paipan-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
  #paipan-tabs .preset-tab { padding: 8px 2px; font-size: 12px; letter-spacing: 0; text-align: center; }
}

/* 子午基准校正按钮 */
.calibrate-tab {
  flex: none;
  font-size: 12px;
  padding: 8px 12px;
  background: linear-gradient(135deg, #26331f, #1a2416);
  border-color: #6f8b5f;
}

.calibrate-tab.active {
  background: linear-gradient(135deg, #1c6b3a, #2f9c5c);
  border-color: #7fe0a8;
  box-shadow: 0 0 10px rgba(47, 156, 92, 0.4);
}

/* ============= 磁针校准 ============= */
.calib-bar {
  justify-content: flex-start;
  gap: 6px;
}

.calib-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.calib-btn,
.calib-reset {
  min-width: 38px;
  padding: 7px 9px;
  font-size: 13px;
  line-height: 1;
  color: #f3e3bd;
  background: linear-gradient(135deg, #2c2a20, #1e1c16);
  border: 1px solid #6b5a33;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.calib-btn:hover,
.calib-reset:hover {
  border-color: #d4af6a;
  color: #fff3d4;
}

.calib-btn:active,
.calib-reset:active {
  transform: scale(0.94);
}

.calib-value {
  min-width: 52px;
  text-align: center;
  padding: 6px 4px;
  font-size: 13px;
  color: #ffd88a;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid #5b4c2b;
  border-radius: 8px;
  font-variant-numeric: tabular-nums;
}

.calib-reset {
  color: #cfe6d4;
  border-color: #4f6b52;
}

/* 子位校准（点击盘面「子」字自动对准） */
.calib-pick {
  min-width: 38px;
  padding: 7px 10px;
  font-size: 13px;
  line-height: 1;
  color: #ffe6b8;
  background: linear-gradient(135deg, #3a2a12, #241a0c);
  border: 1px solid #8a6a2e;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.calib-pick.active {
  color: #fff;
  background: linear-gradient(135deg, #b8860b, #e0a92e);
  border-color: #ffd88a;
  box-shadow: 0 0 10px rgba(224, 169, 46, 0.5);
}

.pick-hint {
  font-size: 12px;
  color: #a0680a;
  line-height: 1.5;
}

.pick-hint:empty {
  display: none;
}

/* 拾取子位时：盘面显示十字光标，放大提示可点 */
.luopan-stage.pick-mode {
  cursor: crosshair;
}

.luopan-stage.pick-mode::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  border: 2px dashed rgba(255, 216, 138, 0.7);
  border-radius: 50%;
  pointer-events: none;
  z-index: 5;
}

/* ============= 盘面大小调节 ============= */
.size-bar {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
}

.size-label {
  font-size: 13px;
  color: #d4af6e;
  letter-spacing: 1px;
  font-weight: 700;
  flex: none;
}

.size-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, #3a2f1f, #8b6f3f);
  outline: none;
  cursor: pointer;
  /* 让滑块手势更跟手 */
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
}

.size-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d4af6e, #8b6f3f);
  border: 2px solid #fdf6e3;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  cursor: pointer;
  /* 滑块自身的 transition：避免按下后有视觉滞后 */
  transition: transform 0.1s ease-out;
}
.size-slider:active::-webkit-slider-thumb,
.size-slider:focus::-webkit-slider-thumb {
  transform: scale(1.15);
}

.size-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d4af6e, #8b6f3f);
  border: 2px solid #fdf6e3;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  cursor: pointer;
  transition: transform 0.1s ease-out;
}
.size-slider:active::-moz-range-thumb,
.size-slider:focus::-moz-range-thumb {
  transform: scale(1.15);
}

.size-value {
  font-size: 13px;
  color: #fdf6e3;
  font-weight: 700;
  min-width: 40px;
  text-align: right;
}

/* ============= 状态文字 ============= */
.sensor-status {
  font-size: 12px;
  color: #8b6f3f;
  letter-spacing: 1px;
  text-align: center;
}

/* ============= 使用说明 ============= */
.usage {
  width: 100%;
  background: #faf6ee;
  border: 1px solid rgba(138, 101, 32, 0.25);
  border-radius: 8px;
  padding: 0;
  overflow: hidden;
}

.usage summary {
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 700;
  color: #8a6520;
  cursor: pointer;
  letter-spacing: 2px;
  list-style: none;
  user-select: none;
}

.usage summary::-webkit-details-marker {
  display: none;
}

.usage summary::before {
  content: "▶ ";
  font-size: 10px;
  transition: transform 0.2s;
  display: inline-block;
}

.usage[open] summary::before {
  transform: rotate(90deg);
}

.usage ol {
  padding: 0 16px 16px 36px;
  font-size: 13px;
  line-height: 1.8;
  color: #555555;
}

.usage ol li {
  margin-bottom: 6px;
}

.usage strong {
  color: #c41a1a;
}

/* ============= 底部 ============= */
.app-footer {
  width: 100%;
  text-align: center;
  padding: 16px 0;
  border-top: 1px solid rgba(138, 101, 32, 0.25);
  margin-top: 8px;
}

.app-footer p {
  font-size: 11px;
  color: #5c4a2a;
  letter-spacing: 2px;
}

.app-footer .version {
  font-size: 10px;
  color: #3a2f1f;
  margin-top: 4px;
}

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 480px) {
  .app {
    padding: 10px;
    gap: 12px;
  }
  .app-title {
    font-size: 20px;
    letter-spacing: 2px;
  }
  .app-subtitle {
    font-size: 10px;
    letter-spacing: 3px;
  }
  .info-grid {
    gap: 8px;
  }
  .info-cell {
    padding: 8px 10px;
  }
  .info-value {
    font-size: 13px; /* 手机端进一步缩小 */
    white-space: nowrap; /* 强制单行，避免溢出到第二行 */
    overflow: hidden;
    text-overflow: ellipsis; /* 极端长值以省略号收尾，不撑破屏幕 */
  }
  .ctrl-btn {
    padding: 12px 8px;
    font-size: 13px;
  }
}

@media (max-width: 360px) {
  .app-title {
    font-size: 18px;
  }
}

/* 横屏适配 */
@media (orientation: landscape) and (max-height: 500px) {
  .app {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: center;
  }
  .app-header {
    width: 100%;
  }
  .luopan-stage {
    max-width: 320px;
  }
  .info-panel, .controls, .sensor-status, .usage, .app-footer {
    width: auto;
    flex: 1;
    min-width: 280px;
  }
}

/* ============= 排盘弹窗（八宅 / 玄空）============= */
.pp-lock { overflow: hidden; }

.pp-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(26, 20, 10, 0.72);
  backdrop-filter: blur(2px);
}

.pp-modal.open { display: flex; }

.pp-dialog {
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  background: #fdf6e3;
  border: 1px solid #8b6f3f;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.pp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  background: linear-gradient(135deg, #3a2f1f, #2a1f10);
  border-bottom: 1px solid #8b6f3f;
  flex: none;
}

.pp-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #fdf6e3;
}

.pp-close {
  flex: none;
  width: 28px;
  height: 28px;
  border: 1px solid #8b6f3f;
  border-radius: 6px;
  background: rgba(253, 246, 227, 0.1);
  color: #fdf6e3;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s;
}

.pp-close:hover { background: rgba(196, 26, 26, 0.85); border-color: #ff7a7a; }

.pp-sub {
  flex: none;
  padding: 9px 14px;
  font-size: 12px;
  line-height: 1.6;
  color: #8a6520;
  background: rgba(139, 101, 32, 0.07);
  border-bottom: 1px solid rgba(138, 101, 32, 0.13);
}

.pp-tools {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(138, 101, 32, 0.13);
}

.pp-tools:empty { display: none; }

.pp-tool-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.pp-tool-label {
  flex: none;
  font-size: 12px;
  font-weight: 700;
  color: #8a6520;
  letter-spacing: 1px;
}

.pp-tool-btn {
  border: 1px solid #8b6f3f;
  border-radius: 14px;
  background: linear-gradient(135deg, #3a2f1f, #2a1f10);
  color: #fdf6e3;
  padding: 4px 11px;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}

.pp-tool-num { min-width: 30px; padding: 4px 0; text-align: center; }

.pp-tool-btn:hover { background: linear-gradient(135deg, #4a3f2f, #3a2f1f); }

.pp-tool-btn.active {
  background: linear-gradient(135deg, #8b1a1a, #c41a1a);
  border-color: #ff7a7a;
  color: #fff;
}

.pp-body {
  flex: 1 1 auto;
  overflow: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.pp-foot {
  flex: none;
  padding: 9px 14px;
  font-size: 11px;
  text-align: center;
  color: #9a7b40;
  background: rgba(138, 101, 32, 0.06);
  border-top: 1px solid rgba(138, 101, 32, 0.13);
}

.pp-empty {
  padding: 30px 10px;
  font-size: 13px;
  color: #8a6520;
  text-align: center;
}

/* ============= 择日详表按钮 ============= */
.zeri-tab {
  background: linear-gradient(135deg, #8B6914, #B8860B) !important;
  color: #fffbf0 !important;
  border-color: #8B6914 !important;
  font-weight: 700;
}
.zeri-tab:active {
  background: linear-gradient(135deg, #6B4F0D, #8B6914) !important;
}

/* ============= 择日详表弹窗 ============= */
.zeri-dialog {
  max-width: 580px;
  background: linear-gradient(180deg, #fffbf0 0%, #fff8e6 100%);
  border-color: #B8860B;
}

.zeri-head {
  background: linear-gradient(135deg, #6B4F0D, #8B6914);
  border-bottom-color: #B8860B;
}

.zeri-modal-body {
  padding: 12px 14px;
  gap: 12px;
}

/* 择日选山（二十四山 + 二十四兼山） */
.zeri-choose {
  margin: 0 14px 2px;
  padding: 10px 12px;
  border: 1px solid rgba(184, 134, 11, 0.25);
  background: rgba(255, 252, 240, 0.9);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.zc-label {
  flex: 0 0 auto;
  font-size: 12px;
  color: #8b6914;
  font-weight: 700;
  letter-spacing: 1px;
  white-space: nowrap;
}

.zc-sel {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  padding: 6px 8px;
  font-size: 14px;
  font-family: "STKaiti", "KaiTi", "楷体", "Microsoft YaHei", serif;
  color: #3a2f1f;
  border: 1px solid rgba(139, 105, 20, 0.45);
  border-radius: 6px;
  background: #fffdf6;
  box-sizing: border-box;
  letter-spacing: 1px;
}

/* 兼山参考区 */
.zeri-jian-ref {
  border-color: rgba(184, 134, 11, 0.45);
  background: rgba(255, 248, 230, 0.55);
}

/* 兼山参考区头部：金色底纹分隔，突出"附加参考层" */
.zeri-jian-ref > .zeri-detail-header {
  background: linear-gradient(90deg, transparent, rgba(184, 134, 11, 0.14), transparent);
  border-radius: 4px;
  margin-bottom: 8px;
}

/* 兼山对冲 / 兼山五行 —— 中性信息卡（金棕，不下吉/凶结论） */
.zeri-col-neu {
  background: rgba(184, 134, 11, 0.07);
  border: 1px solid rgba(184, 134, 11, 0.25);
}
.zcd-title.zcd-neu {
  color: #8B6914;
  border-bottom-color: rgba(139, 105, 20, 0.28);
}
.zcd-tag-neu {
  background: rgba(184, 134, 11, 0.15);
  color: #6d5410;
  border: 1px solid rgba(184, 134, 11, 0.4);
}

.zeri-jian-note {
  margin-top: 8px;
  padding: 8px 10px;
  border-top: 1px dashed rgba(184, 134, 11, 0.3);
  background: rgba(184, 134, 11, 0.07);
  border-radius: 6px;
  font-size: 12px;
  color: #a16207;
  line-height: 1.7;
  letter-spacing: 0.5px;
}

@media (max-width: 480px) {
  .zeri-choose { margin: 0 10px 2px; padding: 9px 10px; }
  .zc-row { flex-wrap: wrap; gap: 6px; }
  .zc-label { width: 100%; }
}

/* 详表分区 */
.zeri-detail-section {
  width: 100%;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(184, 134, 11, 0.2);
  border-radius: 8px;
  padding: 10px 12px;
}

.zeri-detail-header {
  font-family: "STKaiti", "KaiTi", "楷体", serif;
  font-size: 14px;
  font-weight: 700;
  color: #8B6914;
  letter-spacing: 2px;
  text-align: center;
  padding-bottom: 8px;
  margin-bottom: 10px;
  border-bottom: 1px dashed rgba(184, 134, 11, 0.3);
}

/* 坐山基本信息网格 */
.zeri-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px 12px;
}

.zeri-detail-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
}

.zdi-label {
  font-size: 11px;
  color: #9a7b40;
  letter-spacing: 1px;
}

.zdi-value {
  font-family: "STKaiti", "KaiTi", "楷体", serif;
  font-size: 15px;
  font-weight: 700;
  color: #3a2f1f;
}

.zdi-accent {
  color: #B8860B;
  font-size: 17px;
}

/* 吉/凶双列布局 */
.zeri-detail-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.zeri-detail-col {
  padding: 8px;
  border-radius: 6px;
  height: 100%;
}

.zeri-col-ji {
  background: rgba(185, 28, 28, 0.05);
  border: 1px solid rgba(185, 28, 28, 0.15);
}

.zeri-col-xiong {
  background: rgba(55, 65, 81, 0.05);
  border: 1px solid rgba(55, 65, 81, 0.15);
}

.zcd-title {
  text-align: center;
  font-family: "STKaiti", "KaiTi", "楷体", serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 4px;
  padding-bottom: 6px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.zcd-ji {
  color: #b91c1c;
  border-bottom-color: rgba(185, 28, 28, 0.2);
}

.zcd-xiong {
  color: #374151;
  border-bottom-color: rgba(55, 65, 81, 0.2);
}

.zcd-group {
  margin-bottom: 6px;
}

.zcd-group:last-child {
  margin-bottom: 0;
}

.zcd-label {
  font-size: 11px;
  color: #6b5a3a;
  margin-bottom: 4px;
  letter-spacing: 1px;
}

.zcd-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.zcd-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  font-family: "STKaiti", "KaiTi", "楷体", serif;
  letter-spacing: 1px;
}

.zcd-tag-ji {
  background: rgba(185, 28, 28, 0.12);
  color: #991b1b;
  border: 1px solid rgba(185, 28, 28, 0.2);
}

.zcd-tag-ji2 {
  background: rgba(185, 28, 28, 0.06);
  color: #b91c1c;
  border: 1px dashed rgba(185, 28, 28, 0.2);
}

.zcd-tag-xiong {
  background: rgba(55, 65, 81, 0.12);
  color: #1f2937;
  border: 1px solid rgba(55, 65, 81, 0.2);
}

.zcd-tag-xiong2 {
  background: rgba(185, 28, 28, 0.08);
  color: #991b1b;
  border: 1px solid rgba(185, 28, 28, 0.18);
}

.zcd-tag-xiong3 {
  background: rgba(55, 65, 81, 0.06);
  color: #4b5563;
  border: 1px dashed rgba(55, 65, 81, 0.2);
  font-size: 11px;
}

.zcd-tag-warn {
  background: rgba(217, 119, 6, 0.1);
  color: #a16207;
  border: 1px solid rgba(217, 119, 6, 0.2);
  font-size: 11px;
}

.zcd-tag-empty {
  background: rgba(120, 120, 120, 0.08);
  color: #9ca3af;
  border: 1px dashed rgba(120, 120, 120, 0.35);
  font-size: 11px;
  letter-spacing: 0;
}

/* 择日要旨 */
.zeri-yaozhi-content {
  font-size: 13px;
  line-height: 1.9;
  color: #4a3f2f;
  text-align: justify;
  font-family: "STKaiti", "KaiTi", "楷体", serif;
  font-weight: 600;
}

/* 洪潮和口诀 */
.zeri-koujie {
  background: linear-gradient(135deg, rgba(184, 134, 11, 0.08), rgba(139, 105, 20, 0.05));
  border-color: rgba(184, 134, 11, 0.25);
}

.zeri-koujie-content {
  font-size: 13px;
  line-height: 2;
  color: #6B4F0D;
  text-align: center;
  font-family: "STKaiti", "KaiTi", "楷体", serif;
  font-weight: 600;
  letter-spacing: 1px;
}

/* 移动端适配 */
@media (max-width: 480px) {
  .zeri-detail-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .zeri-detail-row {
    grid-template-columns: 1fr;
  }
  .zdi-value {
    font-size: 14px;
  }
  .zdi-accent {
    font-size: 16px;
  }
}

/* ----- 八宅九宫图（复刻 bzfs.html）----- */
.bz-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px;
  background: #fff;
  border: 2px solid #D2691E;
  border-radius: 5px;
}

.bz-tag {
  font-size: 13px;
  font-weight: 700;
  color: #c41a1a;
}

.bz-grid {
  display: grid;
  grid-template-columns: repeat(3, 108px);
  grid-template-rows: repeat(3, 108px);
  gap: 5px;
}

.bz-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2px;
  border: 2px solid #9E9E9E;
  border-radius: 8px;
  background-color: #f5f5f5;
  font-size: 14px;
}

.bz-position { font-size: 12px; color: #666; margin-bottom: 4px; }
.bz-name     { font-size: 18px; font-weight: bold; margin-bottom: 4px; color: #8B4513; }
.bz-star     { font-size: 12px; color: #666; margin-bottom: 4px; }
.bz-luck     { font-size: 12px; font-weight: bold; padding: 3px 9px; border-radius: 10px; }

.bz-good    .bz-luck { background: rgba(76, 175, 80, 0.14); color: #2e7d32; }
.bz-neutral .bz-luck { background: rgba(255, 193, 7, 0.18); color: #b8860b; }
.bz-bad     .bz-luck { background: rgba(244, 67, 54, 0.14); color: #c62828; }

.bz-house { color: #FF0000; font-size: 1.5rem; font-weight: bold; }

/* ----- 玄空九宫飞星图（复刻 xkfs.html）----- */
.xk-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px;
  background: #fff;
  border: 2px solid #D2691E;
  border-radius: 8px;
}

.xk-dir-label {
  font-size: 15px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 6px;
  display: inline-block;
}

.xk-chao {
  background-color: rgba(244, 162, 97, 0.15);
  color: #f4a261;
  border: 2px solid #f4a261;
}

.xk-zuo {
  background-color: rgba(42, 157, 143, 0.15);
  color: #2a9d8f;
  border: 2px solid #2a9d8f;
}

.xk-grid {
  display: grid;
  grid-template-columns: repeat(3, 112px);
  grid-template-rows: repeat(3, 112px);
  gap: 0;
  width: 336px;
  position: relative;
}

.xk-cell {
  border: 2px solid #264653;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  position: relative;
  padding: 2px;
  background-color: #f8f9fa;
}

.xk-center {
  background-color: rgba(233, 196, 106, 0.2);
  border: 3px solid #e76f51;
}

.xk-stars {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 2px 0;
}

.xk-star-row { display: flex; gap: 8px; margin-bottom: 2px; }

.xk-num {
  font-size: 1.4rem;
  font-weight: bold;
  min-width: 25px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.xk-shan  { color: #2a9d8f; }
.xk-yun   { color: #e63946; }
.xk-xiang { color: #f4a261; }

.xk-ele-row {
  display: flex;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.xk-ele {
  min-width: 25px;
  padding: 1px 3px;
  border-radius: 6px;
  background-color: rgba(0, 0, 0, 0.05);
  text-align: center;
}

.xk-ele-shan  { color: #2a9d8f; }
.xk-ele-yun   { color: #e63946; }
.xk-ele-xiang { color: #f4a261; }

.xk-labels { display: flex; gap: 8px; font-size: 0.65rem; color: #666; margin-top: 1px; }

.xk-palace {
  font-size: 0.8rem;
  font-weight: bold;
  color: #264653;
  margin-top: 2px;
  background-color: rgba(38, 70, 83, 0.1);
  padding: 1px 4px;
  border-radius: 4px;
}

/* ----- 阴宅排盘（仙命合山 + 二十四山水法）----- */
.yz-wrap {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.yz-head {
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: #8B4513;
  background: linear-gradient(135deg, #FFF8DC, #F5E6C8);
  border: 1px solid #D2691E;
  border-radius: 8px;
  padding: 8px 10px;
  letter-spacing: 1px;
}
.yz-head b { color: #c41a1a; font-size: 17px; margin: 0 2px; }

.yz-sec {
  background: #fff;
  border: 1px solid rgba(138, 101, 32, 0.28);
  border-radius: 8px;
  overflow: hidden;
}
.yz-sec-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 700;
  color: #FFF8DC;
  background: linear-gradient(135deg, #8B4513, #5D4037);
}
.yz-sec-hd .yz-mini {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid rgba(245, 197, 66, 0.8);
  color: #F5C542;
  background: rgba(0, 0, 0, 0.18);
  cursor: pointer;
  white-space: nowrap;
}
.yz-sec-hd .yz-mini.active { background: #F5C542; color: #5D4037; }
.yz-sec-bd { padding: 9px 10px; display: flex; flex-direction: column; gap: 9px; }

.yz-block-hd {
  font-size: 12.5px;
  font-weight: 700;
  color: #5D4037;
  padding: 3px 0;
  border-bottom: 1px dashed rgba(93, 64, 55, 0.3);
  margin-bottom: 6px;
}
.yz-block-hd .yz-cnt { color: #c41a1a; }
.yz-block-hd.warn { color: #b3261e; }

.yz-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.yz-chip {
  font-size: 12px;
  line-height: 1.25;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid #D2691E;
  background: #FFF8DC;
  color: #7a4a12;
  white-space: nowrap;
}
.yz-chip i { font-style: normal; font-size: 10px; color: #a0761f; margin-left: 3px; }
.yz-chip.dajin { border-color: #c41a1a; background: #fdecec; color: #a01010; }
.yz-chip.dali  { border-color: #e07b39; background: #fff3e6; color: #b3531a; }
.yz-chip.jili  { border-color: #2e7d32; background: #eaf6ec; color: #2e7d32; }
.yz-chip.chong { border-color: #b3261e; background: #f7e4e4; color: #8c1d18; }
.yz-chip.sha   { border-color: #6d4c41; background: #efebe9; color: #4e342e; }
.yz-none { font-size: 12px; color: #9a7b40; padding: 2px 0; }

.yz-water { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.yz-item {
  border: 1px solid rgba(138, 101, 32, 0.3);
  border-left-width: 4px;
  border-radius: 6px;
  padding: 7px 9px;
  background: #FFFDF7;
}
.yz-item.ji { border-left-color: #2e7d32; background: #f4fbf5; }
.yz-item.xiong { border-left-color: #c62828; background: #fdf5f5; }
.yz-item-hd { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; flex-wrap: wrap; }
.yz-no {
  flex: none;
  min-width: 20px; height: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: #5D4037;
  color: #F5C542;
  font-size: 11px; font-weight: 700;
}
.yz-fang { font-size: 13px; font-weight: 700; color: #8B4513; }
.yz-luck {
  font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 10px;
}
.yz-item.ji .yz-luck { background: rgba(46, 125, 50, 0.14); color: #2e7d32; }
.yz-item.xiong .yz-luck { background: rgba(198, 40, 40, 0.13); color: #c62828; }
.yz-txt { margin: 0; font-size: 12px; line-height: 1.75; color: #4a3f2f; }

.yz-tip {
  font-size: 11.5px;
  line-height: 1.8;
  color: #6b5a33;
  background: rgba(138, 101, 32, 0.07);
  border-radius: 6px;
  padding: 7px 9px;
}
.yz-tip b { color: #8B4513; }

/* ----- 排盘弹窗窄屏适配 ----- */
@media (max-width: 420px) {
  .pp-modal { padding: 8px; }
  .bz-grid {
    grid-template-columns: repeat(3, 92px);
    grid-template-rows: repeat(3, 92px);
  }
  .bz-name { font-size: 16px; }
  .bz-house { font-size: 1.2rem; }
  .xk-grid {
    grid-template-columns: repeat(3, 92px);
    grid-template-rows: repeat(3, 92px);
    width: 276px;
  }
  .xk-num { font-size: 1.15rem; min-width: 21px; height: 22px; }
  .xk-star-row, .xk-ele-row, .xk-labels { gap: 6px; }
  .xk-ele { min-width: 21px; font-size: 0.72rem; }
}

@media (max-width: 340px) {
  .bz-grid {
    grid-template-columns: repeat(3, 80px);
    grid-template-rows: repeat(3, 80px);
  }
  .xk-grid {
    grid-template-columns: repeat(3, 80px);
    grid-template-rows: repeat(3, 80px);
    width: 240px;
  }
  .xk-num { font-size: 1rem; min-width: 18px; height: 19px; }
}
/* ============= 满屏模式（罗盘居中最大化）============= */
/* 满屏时锁定页面滚动 */
html.lp-fs-lock, body.lp-fs { overflow: hidden; }

.controls .fs-btn {
  /* 不再独占一行，与另两个按钮同列 */
  background: linear-gradient(135deg, #8B4513 0%, #5D4037 100%);
  border-color: #D2691E;
  color: #F5C542;
}
.controls .fs-btn.active {
  background: linear-gradient(135deg, #5D4037 0%, #3a2f1f 100%);
  border-color: #8b6f3f;
  color: #fdf6e3;
}

/* 满屏遮罩层：直接把盘面容器提升为全屏固定层 */
body.lp-fs .stage-wrap {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  /* 满屏底色：中国红渐变（中心亮、四周暗），与金色角标/描边相配 */
  background: radial-gradient(circle at 50% 45%, #D32F2F 0%, #9B1B11 58%, #5A0B07 100%);
  /* 满屏时不触发页面滚动/下拉刷新，保证转盘手势跟手 */
  touch-action: none;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
}

/* 盘面铺满：取屏幕短边为正方形边长，保证整盘完整且最大化、居中 */
body.lp-fs .luopan-stage {
  max-width: none;
  width: 100vmin;
  height: 100vmin;
  border-radius: 50%;
  box-shadow:
    0 0 60px rgba(212, 175, 110, 0.22),
    0 0 120px rgba(0, 0, 0, 0.6),
    inset 0 0 40px rgba(0, 0, 0, 0.4);
}
@supports (height: 100dvh) {
  /* 现代移动浏览器：排除动态地址栏高度，避免被裁切 */
  body.lp-fs .luopan-stage {
    width: 100dvmin;
    height: 100dvmin;
  }
}

/* 满屏时角标改为浅色（深色底上才看得清），并避让刘海/手势条 */
body.lp-fs .dial-badge .badge-label { color: #d4af6e; }
body.lp-fs .dial-badge .badge-value { color: #F5C542; }
body.lp-fs .badge-tl { top: calc(10px + env(safe-area-inset-top)); left: 12px; }
body.lp-fs .badge-tr { top: calc(10px + env(safe-area-inset-top)); right: 12px; }
body.lp-fs .badge-bl { bottom: calc(10px + env(safe-area-inset-bottom)); left: 12px; }
body.lp-fs .badge-br { bottom: calc(10px + env(safe-area-inset-bottom)); right: 12px; }

/* 满屏退出按钮：默认隐藏，满屏时悬浮在底部居中 */
.lp-fs-exit { display: none; }
body.lp-fs .lp-fs-exit {
  display: block;
  position: absolute;
  z-index: 10000;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  padding: 10px 24px;
  border-radius: 22px;
  background: rgba(74, 11, 7, 0.78);
  border: 1px solid rgba(245, 197, 66, 0.85);
  color: #F5C542;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
body.lp-fs .lp-fs-exit:active {
  background: rgba(155, 27, 17, 0.95);
  color: #fff;
}

/* 超窄屏（<360px）：3 个按钮文字会被挤压，回退为 2 列 */
@media (max-width: 360px) {
  .controls { grid-template-columns: 1fr 1fr; }
  .controls .ctrl-btn { font-size: 12px; padding: 10px 4px; letter-spacing: 0; }
}
