/* ─── 演禽三世 · 二十八宿命理（浅色玻璃主题，参考梅花易数页） ─── */
* { 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;
  --gold: #b8862c;
  --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;
  inset: 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 {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 10px;
  z-index: 20;
}
.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;
  text-align: center;
  font-size: 21px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 2px;
  text-shadow: 0 2px 10px rgba(47, 124, 232, .3);
}
.intro-btn {
  appearance: none;
  border: 1.5px solid rgba(120, 150, 200, .45);
  background: rgba(255, 255, 255, .7);
  color: var(--bright-deep);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
}
.intro-btn:hover { border-color: var(--bright); background: #fff; }

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

.seal-note {
  text-align: center;
  font-size: 13.5px;
  color: rgba(44, 62, 93, .75);
  margin: 6px 0 16px;
  letter-spacing: 1.5px;
  font-weight: 500;
}

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

.field { display: block; flex: 1; min-width: 0; }
.field-label {
  display: block;
  font-size: 14.5px;
  font-weight: 600;
  color: #2c3e5d;
  margin-bottom: 7px;
}
.field-row { display: flex; gap: 12px; align-items: flex-end; }
.field-row + .field-row { margin-top: 12px; }
.field select,
.field input {
  width: 100%;
  border: 1.5px solid rgba(120, 150, 200, .42);
  border-radius: 14px;
  padding: 11px 13px;
  font-size: 15px;
  background: var(--panel-deep);
  color: var(--ink);
  font-family: inherit;
}
.field select:focus {
  outline: none;
  border-color: var(--bright);
  box-shadow: 0 0 0 3px rgba(47, 124, 232, .16);
}
.birth-pick-btn {
  width: 100%;
  text-align: left;
  border: 1.5px solid rgba(120, 150, 200, .42);
  border-radius: 14px;
  padding: 11px 13px;
  font-size: 15px;
  background: var(--panel-deep);
  color: var(--ink);
  font-family: inherit;
  cursor: pointer;
}
.birth-pick-btn.placeholder { color: rgba(80, 105, 150, .45); }

/* 阳历/阴历切换胶囊（参考 bazi 页 radio-label） */
.calendar-toggle-row { display: flex; gap: 8px; margin-bottom: 9px; flex-wrap: wrap; }
.radio-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 13px 5px 9px;
  border: 1.5px solid rgba(120, 150, 200, .42);
  border-radius: 999px;
  background: var(--panel-deep);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: border-color .15s, background .15s, color .15s;
}
.radio-label input { width: 15px; height: 15px; margin: 0; accent-color: var(--bright); }
.radio-label:has(input:checked) {
  border-color: var(--bright);
  background: rgba(47, 124, 232, .1);
  color: var(--bright-deep);
  font-weight: 700;
}
.radio-label input:checked + span { color: var(--bright-deep); font-weight: 700; }

.actions { margin-top: 18px; }
.btn {
  appearance: none;
  border: none;
  border-radius: 16px;
  font-family: inherit;
  cursor: pointer;
  transition: opacity .15s;
}
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary {
  width: 100%;
  padding: 14px 0;
  font-size: 18px;
  font-weight: 700;
  background: linear-gradient(90deg, #3fb9f9 0%, #5c8cf8 55%, #8d7cf9 100%);
  color: #fff;
  letter-spacing: 8px;
  text-indent: 8px;
  box-shadow: 0 6px 20px rgba(92, 140, 248, .38), inset 0 1px 0 rgba(255, 255, 255, .55);
}
.btn-primary:active { opacity: .88; }

.panel-note {
  margin-top: 12px;
  font-size: 12px;
  color: var(--ink-mute);
  text-align: center;
}

.hidden { display: none !important; }

/* ── 加载态（动态省略号） ── */
.loading-panel {
  background: var(--panel);
  border: 1.5px solid var(--panel-line);
  border-radius: 22px;
  padding: 26px 16px;
  text-align: center;
  margin-bottom: 18px;
  box-shadow: 0 8px 28px rgba(96, 125, 170, .22);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.loading-panel p { font-size: 15px; color: var(--ink-soft); font-weight: 600; }
.dots i {
  font-style: normal;
  animation: dotJump 1.2s infinite;
}
.dots i:nth-child(2) { animation-delay: .2s; }
.dots i:nth-child(3) { animation-delay: .4s; }
@keyframes dotJump {
  0%, 60%, 100% { opacity: .25; }
  30% { opacity: 1; }
}

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

.sub-card {
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 13px 13px 14px;
  margin-bottom: 12px;
  background: var(--panel-deep);
}
.sub-card:last-child { margin-bottom: 0; }
.sub-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.sub-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 9px;
  border-radius: 999px;
  background: rgba(47, 124, 232, .1);
  color: var(--bright);
  vertical-align: 1px;
}
.sub-badge.gold { background: rgba(184, 134, 44, .14); color: var(--gold); }
.sub-badge.ok { background: rgba(47, 168, 100, .12); color: var(--ok); }
.sub-badge.bad { background: rgba(226, 87, 74, .12); color: var(--warn); }

.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 16px; }
.info-grid p { font-size: 13.5px; color: var(--ink-soft); line-height: 1.6; min-width: 0; }
.info-grid p b { color: var(--ink); font-weight: 700; }
.info-grid p span {
  display: inline-block;
  font-size: 11.5px;
  color: var(--ink-mute);
  background: rgba(47, 124, 232, .08);
  border-radius: 6px;
  padding: 0 6px;
  margin-right: 6px;
  vertical-align: 1px;
}

/* 命断正文 */
.ming-text { font-size: 15px; color: var(--ink); line-height: 1.9; font-weight: 500; }
.ming-lu {
  margin-top: 10px;
  padding: 9px 11px;
  border: 1px solid rgba(184, 134, 44, .25);
  border-radius: 10px;
  background: rgba(184, 134, 44, .07);
  font-size: 13.5px;
  line-height: 1.8;
  color: #7a5a1e;
}
.hua-text { font-size: 14.5px; color: var(--ink-soft); line-height: 1.85; }

/* 安命盘 */
.palace-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}
.palace-cell {
  border: 1px solid rgba(47, 124, 232, .2);
  border-radius: 12px;
  padding: 8px 6px;
  text-align: center;
  background: linear-gradient(170deg, rgba(255, 255, 255, .85), rgba(235, 244, 255, .8));
}
.palace-cell .p-name { font-size: 11.5px; color: var(--ink-mute); }
.palace-cell .p-gz { font-size: 16.5px; font-weight: 700; color: var(--bright-deep); margin-top: 2px; }
.star-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.star-table th, .star-table td {
  border: 1px solid var(--line-soft);
  padding: 7px 8px;
  text-align: center;
  line-height: 1.5;
}
.star-table th { background: rgba(47, 124, 232, .07); font-weight: 600; color: var(--ink); white-space: nowrap; }
.star-table td b { color: var(--bright-deep); }
.dedi-note {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--ink-mute);
  line-height: 1.7;
}
.qiju-note {
  margin-top: 8px;
  font-size: 12px;
  color: var(--ink-mute);
  line-height: 1.7;
}

/* 流年运势 */
.sui-now {
  border: 1px solid rgba(47, 124, 232, .25);
  border-radius: 12px;
  padding: 11px 12px;
  background: linear-gradient(170deg, rgba(255, 255, 255, .9), rgba(235, 244, 255, .82));
  margin-bottom: 12px;
}
.sui-now .sui-head { font-size: 14px; font-weight: 700; color: var(--ink); margin-bottom: 7px; }
.sui-text { font-size: 14.5px; line-height: 1.85; color: var(--ink); font-weight: 500; }
.yuxia-box {
  margin-top: 9px;
  padding: 9px 11px;
  border: 1px dashed rgba(184, 134, 44, .4);
  border-radius: 10px;
  background: rgba(184, 134, 44, .06);
  font-size: 12.5px;
  line-height: 1.75;
  color: #7a5a1e;
}
.yuxia-box .poem { font-size: 13.5px; font-weight: 700; color: var(--gold); }

.sui-list { width: 100%; border-collapse: collapse; font-size: 13px; }
.sui-list th, .sui-list td {
  border: 1px solid var(--line-soft);
  padding: 6px 8px;
  text-align: center;
}
.sui-list th { background: rgba(47, 124, 232, .07); font-weight: 600; color: var(--ink); white-space: nowrap; }
.sui-list tr.sui-row { cursor: pointer; }
.sui-list tr.sui-row:hover { background: rgba(47, 124, 232, .06); }
.sui-list tr.cur { background: rgba(47, 124, 232, .1); font-weight: 700; }
.sui-list tr.cur td:first-child { color: var(--bright-deep); }
.sui-list td b { color: var(--bright-deep); }

/* 流年查询 */
.sui-query {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}
.sui-query-label { font-size: 14px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.sui-query-sel {
  flex: 1;
  min-width: 0;
  border: 1.5px solid rgba(120, 150, 200, .42);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 14px;
  background: var(--panel-deep, rgba(255, 255, 255, .62));
  color: var(--ink);
  font-family: inherit;
}
.sui-query-sel:focus { outline: none; border-color: var(--bright); box-shadow: 0 0 0 3px rgba(47, 124, 232, .16); }
.sui-query-btn {
  appearance: none;
  border: none;
  border-radius: 10px;
  padding: 9px 20px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(90deg, #3fb9f9 0%, #5c8cf8 55%, #8d7cf9 100%);
  box-shadow: 0 4px 12px rgba(92, 140, 248, .3);
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.sui-detail {
  margin-top: 12px;
  border: 1px solid rgba(47, 124, 232, .22);
  border-radius: 12px;
  background: rgba(47, 124, 232, .04);
  padding: 12px;
}
.sui-detail .sui-now { margin-top: 10px; }
.sui-detail .sui-now:first-of-type { margin-top: 0; }

/* 表单行内提示（替代弹窗） */
.form-tip {
  margin-top: 12px;
  border: 1px solid rgba(226, 138, 22, .4);
  border-radius: 10px;
  background: rgba(253, 238, 216, .9);
  color: #a4530a;
  font-size: 13.5px;
  padding: 9px 12px;
  text-align: center;
}
.form-tip.hidden { display: none; }

/* 关煞 */
.sha-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line-soft);
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--ink-soft);
}
.sha-item:last-child { border-bottom: none; padding-bottom: 0; }
.sha-item .tag {
  flex: 0 0 auto;
  font-size: 11.5px;
  font-weight: 700;
  padding: 1px 9px;
  border-radius: 999px;
  margin-top: 1px;
}
.sha-item.bad .tag { color: #fff; background: var(--warn); }
.sha-item.ok .tag { color: #fff; background: var(--ok); }
.sha-item b { color: var(--ink); }

/* 三世 / 北斗 */
.sanshi-text, .bd-text { font-size: 14.5px; line-height: 1.9; color: var(--ink); }
.bd-row { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 8px; }
.bd-row p { font-size: 14px; color: var(--ink-soft); }
.bd-row p b { color: var(--bright-deep); font-size: 15.5px; }

/* 手机端错误上屏 */
.fatal-tip {
  max-width: 720px;
  margin: 0 auto 18px;
  text-align: center;
  font-size: 12.5px;
  color: var(--warn);
  word-break: break-all;
}

/* ── 页脚 ── */
.site-footer {
  text-align: center;
  font-size: 13px;
  color: rgba(44, 62, 93, .6);
  padding: 18px 0 26px;
}

/* ── 弹窗（功能介绍） ── */
.interpret-modal { position: fixed; z-index: 140; inset: 0; display: grid; place-items: center; padding: 1rem; }
.interpret-modal.hidden { display: none; }
.interpret-backdrop { position: absolute; inset: 0; background: rgba(26, 35, 50, .32); backdrop-filter: blur(3px); }
.interpret-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(680px, 100%);
  max-height: min(88vh, 760px);
  overflow: hidden;
  border: 1px solid rgba(44, 62, 93, .16);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 22px 58px rgba(26, 35, 50, .18);
}
.interpret-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .85rem 1rem;
  border-bottom: 1px solid rgba(44, 62, 93, .1);
  background: #f2f7fd;
}
.interpret-header-text { min-width: 0; display: flex; flex-direction: column; gap: .12rem; }
.interpret-header h2 { margin: 0; color: var(--ink); font-size: 1.15rem; line-height: 1.25; }
.interpret-disclaimer { margin: 0; color: var(--ink-mute); font-size: .68rem; line-height: 1.35; }
.interpret-close {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 1px solid rgba(44, 62, 93, .14);
  border-radius: 50%;
  color: var(--bright-deep);
  background: #fff;
  font-size: 1.3rem;
  cursor: pointer;
}
.intro-body {
  overflow-y: auto;
  padding: 1.05rem 1.15rem 1.3rem;
  display: grid;
  gap: .7rem;
  background: linear-gradient(180deg, #fdfeff, #f3f8fd);
}
.intro-body p { font-size: .9rem; line-height: 1.8; color: var(--ink-soft); }
.intro-body p b { color: var(--ink); }
.intro-body .intro-note { color: var(--warn); font-size: .8rem; }

@media (max-width: 520px) {
  .palace-grid { grid-template-columns: 1fr 1fr; }
  .info-grid { grid-template-columns: 1fr; }
  .field-row { flex-wrap: wrap; }
  .field-row .field { flex: 1 1 100%; }
  .logo-title { font-size: 17px; }
  .sub-card { padding: 11px 10px; }
  .result-panel { padding: 13px 12px 15px; }
  .sui-list { font-size: 12px; }
  .sui-list th, .sui-list td { padding: 5px 5px; }
}
