/* ─── 玉辇经 · 安门楼安后土（浅色玻璃主题，参考姓名页） ─── */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ink: #2c3e5d;
  --ink-soft: rgba(44, 62, 93, .72);
  --ink-mute: rgba(44, 62, 93, .5);
  --panel: rgba(255, 255, 255, .72);
  --panel-deep: rgba(255, 255, 255, .62);
  --panel-line: rgba(255, 255, 255, .9);
  --line-soft: rgba(44, 62, 93, .12);
  --bright: #2f7ce8;
  --bright-deep: #1f5fd6;
  --ok: #2fa864;
  --warn: #e2574a;
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, sans-serif;
  color: var(--ink);
  min-height: 100vh;
  background: #eaf1f9;
  position: relative;
}
body::before {
  content: "";
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: -2;
  background:
    radial-gradient(1100px 560px at 50% -8%, rgba(255, 255, 255, .95), transparent 62%),
    radial-gradient(900px 480px at 12% 88%, rgba(147, 197, 253, .22), transparent 58%),
    radial-gradient(900px 480px at 88% 92%, rgba(160, 150, 250, .16), transparent 58%),
    linear-gradient(180deg, #f2f7fd 0%, #e7eff9 46%, #dbe8f6 100%);
}

/* ── 顶栏 ── */
.top-bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 10px;
}
.top-intro {
  flex-shrink: 0;
}
.link-back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: rgba(44, 62, 93, .8);
  text-decoration: none;
  font-size: 15px;
  white-space: nowrap;
}
.link-back:hover { color: var(--bright-deep); }
.logo-title {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  color: #1e3a6e;
  letter-spacing: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.top-bar-space { width: 72px; }

@media (max-width: 600px) {
  .top-bar { gap: 6px; padding-left: 10px; padding-right: 10px; }
  .top-bar-space { width: 62px; }
  .link-back { font-size: 13.5px; padding: 0 4px; }
  .logo-title { font-size: 14.5px; letter-spacing: 0; }
}

/* ── 主区 ── */
.page { max-width: 720px; margin: 0 auto; padding: 14px 14px 32px; }

.intro-row { text-align: center; margin-bottom: 14px; }
.intro-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  border: 1.5px solid rgba(96, 150, 240, .45);
  border-radius: 999px;
  background: rgba(255, 255, 255, .7);
  color: var(--bright-deep);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(92, 140, 248, .18);
  transition: box-shadow .15s, border-color .15s;
}
.intro-btn:hover {
  border-color: rgba(96, 150, 240, .8);
  box-shadow: 0 5px 16px rgba(92, 140, 248, .28);
}
.intro-btn-icon { font-size: 15px; }

/* ── 卡片 ── */
.card {
  background: var(--panel);
  border: 1.5px solid var(--panel-line);
  border-radius: 26px;
  box-shadow: 0 8px 28px rgba(96, 125, 170, .22);
  padding: 16px 16px 20px;
  margin-bottom: 18px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.field-label {
  font-size: 14.5px;
  font-weight: 600;
  color: #2c3e5d;
  margin-bottom: 8px;
}
.field-gap { margin-top: 16px; }

/* ── 下拉框（选中值字体颜色与朝向一致） ── */
.field-select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  padding: 9px 38px 9px 14px;
  border: 1.5px solid rgba(120, 150, 200, .38);
  border-radius: 12px;
  background: rgba(255, 255, 255, .7) url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%232f7ce8' d='M1.4.6 6 5.2 10.6.6 12 2 6 8 0 2z'/%3E%3C/svg%3E") no-repeat right 14px center;
  font-family: inherit;
  font-size: 19px;
  font-weight: 700;
  color: var(--bright-deep);
  letter-spacing: 2px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.field-select option {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0;
}
.field-select:focus {
  outline: none;
  border-color: rgba(96, 150, 240, .8);
  box-shadow: 0 0 0 3px rgba(92, 140, 248, .18);
}
.field-select.is-placeholder {
  color: var(--ink-mute);
  font-weight: 600;
  font-size: 15.5px;
  letter-spacing: 0;
}

.xiang-wrap { margin-top: 14px; }
.xiang-box {
  padding: 9px 14px;
  display: flex;
  align-items: center;
  border: 1.5px dashed rgba(96, 150, 240, .45);
  border-radius: 12px;
  background: rgba(240, 247, 255, .7);
}
.xiang-value {
  font-size: 19px;
  font-weight: 700;
  color: var(--bright-deep);
  letter-spacing: 2px;
}

/* ── 主按钮 ── */
.btn-main {
  display: block;
  width: 100%;
  margin-top: 20px;
  padding: 13px 0;
  border: none;
  border-radius: 16px;
  background: linear-gradient(90deg, #3fb9f9 0%, #5c8cf8 50%, #8d7cf9 100%);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 6px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(92, 140, 248, .35);
  transition: box-shadow .15s, transform .15s, opacity .15s;
}
.btn-main:hover { box-shadow: 0 10px 24px rgba(92, 140, 248, .45); }
.btn-main:active { transform: scale(.985); }
.btn-main:disabled {
  opacity: .5;
  cursor: not-allowed;
  box-shadow: none;
}

/* ── 门楼方位图 ── */
.diagram-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 1px;
  text-align: center;
}
.diagram-sub {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--ink-mute);
  text-align: center;
}
.diagram-box { margin-top: 10px; }
.diagram-box svg {
  display: block;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  height: auto;
}

/* ── 结果卡 ── */
.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.result-title {
  font-size: 21px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 1px;
}
.ji-badge {
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 800;
  padding: 5px 16px;
  border-radius: 999px;
  letter-spacing: 3px;
}
.ji-badge.is-ji {
  color: #1d7a4a;
  background: linear-gradient(135deg, #e9f9f0, #d4f3e3);
  border: 1px solid rgba(47, 168, 100, .45);
}
.ji-badge.is-xiong {
  color: #b83226;
  background: linear-gradient(135deg, #fdeeea, #fbdbd5);
  border: 1px solid rgba(226, 87, 74, .45);
}

.result-meta {
  margin-top: 10px;
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.7;
}

/* 天地丁警示块 */
.td-warn {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1.5px solid rgba(226, 87, 74, .5);
  border-radius: 14px;
  background: linear-gradient(135deg, #fdf0ee, #fbe3df);
  color: #b83226;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.75;
}

.verse-box {
  margin-top: 14px;
  padding: 16px 14px;
  border: 1.5px solid rgba(96, 150, 240, .3);
  border-radius: 16px;
  background: linear-gradient(160deg, #ffffff 0%, #f0f6ff 100%);
  font-size: 16.5px;
  line-height: 2.05;
  color: var(--ink);
  letter-spacing: 1.5px;
  text-align: center;
}

/* ── 二十四位列表 ── */
.all-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 1px;
  text-align: center;
}
.all-sub {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--ink-mute);
  text-align: center;
}
.all-list { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.all-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1.5px solid rgba(120, 150, 200, .22);
  border-radius: 14px;
  background: rgba(255, 255, 255, .6);
}
.all-item.is-current {
  border-color: rgba(96, 150, 240, .8);
  background: linear-gradient(160deg, #ffffff 0%, #e8f2ff 100%);
  box-shadow: 0 4px 14px rgba(92, 140, 248, .22);
}
.all-item.is-xiong:not(.is-current) { background: rgba(255, 249, 248, .65); }
.all-item.is-ji:not(.is-current) { background: rgba(248, 255, 251, .65); }
.all-pos {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(145deg, #8ba3c7, #5f7ba6);
}
.all-item.is-ji .all-pos { background: linear-gradient(145deg, #57c58c, #2fa864); }
.all-item.is-xiong .all-pos { background: linear-gradient(145deg, #ef8a7d, #d95345); }
.all-main { flex: 1; min-width: 0; }
.all-name {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
}
.all-name .all-tag {
  font-size: 11px;
  font-weight: 800;
  padding: 1px 8px;
  border-radius: 999px;
  margin-left: 6px;
  letter-spacing: 1px;
}
.all-item.is-ji .all-tag { color: #1d7a4a; background: rgba(47, 168, 100, .14); }
.all-item.is-xiong .all-tag { color: #b83226; background: rgba(226, 87, 74, .14); }
.all-verse {
  margin-top: 4px;
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--ink-soft);
  letter-spacing: .5px;
}

.foot-tip {
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-mute);
  letter-spacing: 1px;
  margin-top: 4px;
}

/* ── 弹窗 ── */
.tip-modal { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 50; }
.tip-modal.hidden { display: none; }
.tip-backdrop {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background: rgba(30, 45, 70, .45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.tip-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 620px;
  max-width: calc(100vw - 24px);
  max-height: min(86vh, 760px);
  display: flex;
  flex-direction: column;
  background: #fffdf9;
  border: 1.5px solid var(--panel-line);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(30, 45, 70, .3);
  animation: tip-pop .2s ease-out;
}
@keyframes tip-pop {
  from { opacity: 0; transform: translate(-50%, -50%) scale(.94); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.tip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-soft);
  flex: 0 0 auto;
}
.tip-head h2 {
  font-size: 17px;
  font-weight: 700;
  color: #1e3a6e;
  letter-spacing: 1px;
}
.tip-close {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: rgba(44, 62, 93, .08);
  color: var(--ink-soft);
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
}
.tip-close:hover { background: rgba(226, 87, 74, .15); color: var(--warn); }
.tip-body {
  padding: 14px 18px 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.intro-block { margin-bottom: 18px; }
.intro-block:last-child { margin-bottom: 0; }
.intro-block h3 {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--bright-deep);
  margin-bottom: 8px;
  padding-left: 9px;
  border-left: 3px solid rgba(96, 150, 240, .7);
}
.intro-block h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  margin: 10px 0 6px;
}
.intro-block p {
  font-size: 13.5px;
  line-height: 1.9;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.intro-block p b { color: var(--ink); }
.intro-verse {
  padding: 10px 12px;
  border: 1.5px solid rgba(96, 150, 240, .25);
  border-radius: 12px;
  background: rgba(240, 247, 255, .7);
  color: var(--ink) !important;
  letter-spacing: 1px;
  line-height: 2 !important;
}

@media (max-width: 480px) {
  .logo-title { font-size: 13px; letter-spacing: 0; }
  .top-intro { padding: 5px 10px; font-size: 12px; }
  .field-select { padding: 8px 36px 8px 12px; }
  .field-select.is-placeholder { font-size: 15px; }
  .btn-main { letter-spacing: 4px; }
  .result-title { font-size: 18.5px; }
  .verse-box { font-size: 15px; }
}

/* ── 子午斜流图（连体九宫格） ── */
.bagua-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 2px solid rgba(96, 150, 240, .55);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, .5);
}
.palace {
  min-height: 104px;
  padding: 10px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-right: 1.5px solid rgba(96, 150, 240, .35);
  border-bottom: 1.5px solid rgba(96, 150, 240, .35);
  background: transparent;
}
.palace:nth-child(3n) { border-right: none; }
.palace:nth-child(n+7) { border-bottom: none; }
.palace-center {
  background: linear-gradient(160deg, #ffffff 0%, #e8f2ff 100%);
}
.palace-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-soft);
  letter-spacing: 1px;
}
.palace-mts {
  display: flex;
  gap: 14px;
  justify-content: center;
  align-items: flex-end;
}
.mt-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.mt-shans {
  display: flex;
  gap: 8px;
}
.mt-shan {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-soft);
  line-height: 1;
}
.mt-line {
  width: calc(100% + 2px);
  height: 1.5px;
  border-radius: 2px;
  background: rgba(44, 62, 93, .38);
}
.mt-line.is-ghost { visibility: hidden; }
.bchar {
  font-size: 21px;
  font-weight: 800;
  line-height: 1;
}
.bchar.ji { color: #2fa864; }
.bchar.xiong { color: #d95345; }
.bchar.ping { color: #6b7280; }
.palace-roles {
  display: flex;
  gap: 4px;
  justify-content: center;
  flex-wrap: wrap;
  min-height: 18px;
}
.role-chip {
  font-size: 11px;
  font-weight: 800;
  color: #ffffff;
  background: linear-gradient(135deg, #5c8cf8, #8d7cf9);
  border-radius: 999px;
  padding: 2px 9px;
  letter-spacing: 1px;
}
.center-xiang {
  font-size: 15px;
  font-weight: 700;
  color: #1f5fd6;
  letter-spacing: 2px;
}
.center-zuo {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  letter-spacing: 1px;
}

/* ── 所选方位结果行 ── */
.zx-list { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.zx-row {
  border: 1.5px solid rgba(120, 150, 200, .25);
  border-radius: 14px;
  background: rgba(255, 255, 255, .6);
  padding: 12px 14px;
}
.zx-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.zx-role {
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
}
.zx-pos {
  font-size: 13.5px;
  color: var(--ink-soft);
}
.zx-badge {
  font-size: 12.5px;
  font-weight: 800;
  padding: 3px 12px;
  border-radius: 999px;
  letter-spacing: 2px;
  flex-shrink: 0;
}
.zx-badge.ji { color: #1d7a4a; background: linear-gradient(135deg, #e9f9f0, #d4f3e3); border: 1px solid rgba(47, 168, 100, .45); }
.zx-badge.xiong { color: #b83226; background: linear-gradient(135deg, #fdeeea, #fbdbd5); border: 1px solid rgba(226, 87, 74, .45); }
.zx-badge.ping { color: #4b5563; background: linear-gradient(135deg, #f3f4f6, #e5e7eb); border: 1px solid rgba(107, 114, 128, .4); }
.zx-info {
  margin-top: 6px;
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.7;
}
.zx-warn {
  margin-top: 8px;
  padding: 8px 12px;
  border: 1.5px solid rgba(226, 87, 74, .5);
  border-radius: 10px;
  background: linear-gradient(135deg, #fdf0ee, #fbe3df);
  color: #b83226;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.7;
}
.zx-verse {
  margin-top: 8px;
  padding: 10px 12px;
  border: 1.5px solid rgba(96, 150, 240, .3);
  border-radius: 12px;
  background: linear-gradient(160deg, #ffffff 0%, #f0f6ff 100%);
  font-size: 14.5px;
  line-height: 1.95;
  color: var(--ink);
  letter-spacing: 1px;
  text-align: center;
}

/* 平级配色（十二支列表与圆形字） */
.all-item.is-ping:not(.is-current) { background: rgba(249, 250, 251, .65); }
.all-item.is-ping .all-pos { background: linear-gradient(145deg, #9ca3af, #6b7280); }
.all-item.is-ping .all-tag { color: #4b5563; background: rgba(107, 114, 128, .14); }

/* ── 方位多选（下拉选择即添加，标签胶囊可删，同罗盘理气） ── */
.label-hint {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-soft);
}
.label-hint.is-warm {
  color: #d9691f;
  font-weight: 600;
}
.msel-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.msel-tags:empty { margin-top: 0; }
.msel-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 5px 3px 12px;
  border: 1px solid rgba(96, 150, 240, .5);
  border-radius: 999px;
  background: rgba(96, 150, 240, .1);
  color: #1f5fd6;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}
.msel-tag-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #1f5fd6;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  opacity: 0.72;
}
.msel-tag-x:hover,
.msel-tag-x:focus {
  opacity: 1;
  background: rgba(96, 150, 240, .22);
  outline: none;
}

@media (max-width: 480px) {
  .palace { min-height: 88px; }
  .mt-shan { font-size: 10.5px; }
  .bchar { font-size: 18px; }
}
