/* 阴盘奇门遁甲排盘 · 界面样式（深色金线主题，移动端适配） */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #14161f;
  --bg-panel: #1c1f2b;
  --bg-card: #232736;
  --bg-card-hi: #2a2f42;
  --line: #3a4056;
  --gold: #d9b26a;
  --gold-hi: #f0cf8e;
  --text: #e8e6df;
  --text-dim: #9aa0b0;
  --shen: #c3a6ea;
  --xing: #9ad0ec;
  --men: #9fd8a8;
  --tian: #f0cf8e;
  --di: #e8e6df;
  --angan: #7d8496;
  --danger: #e57373;
  --blue: #64b5f6;
  --orange: #ffb74d;
  --purple: #ba68c8;
  --pink: #f06292;
}

html { font-size: 16px; }
body {
  background: radial-gradient(1200px 600px at 70% -10%, #232842 0%, var(--bg) 55%);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  min-height: 100vh;
  padding-bottom: 40px;
}

.serif { font-family: "STSong", "SimSun", "Songti SC", serif; }

/* ===== 头部 ===== */
header {
  text-align: center;
  padding: 26px 16px 10px;
}
header h1 {
  font-size: 1.65rem;
  letter-spacing: 0.35em;
  text-indent: 0.35em;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold) 60%, #a8874b);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 700;
}
header .sub {
  margin-top: 6px;
  color: var(--text-dim);
  font-size: 0.82rem;
  letter-spacing: 0.5em;
  text-indent: 0.5em;
}

main { max-width: 980px; margin: 0 auto; padding: 0 14px; }

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  margin-top: 16px;
}

/* ===== 输入区 ===== */
.input-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 12px;
  align-items: center;
}
.input-grid label {
  color: var(--text-dim);
  font-size: 0.85rem;
  grid-column: 1 / -1;
  margin-bottom: -4px;
}
input[type="datetime-local"], select {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 1rem;
  width: 100%;
  color-scheme: dark;
}
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
button {
  border: 1px solid var(--line);
  background: var(--bg-card);
  color: var(--text);
  border-radius: 10px;
  padding: 11px 18px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform .06s ease, background .15s ease;
  white-space: nowrap;
}
button:hover { background: var(--bg-card-hi); }
button:active { transform: scale(0.97); }
button.primary {
  background: linear-gradient(180deg, #caa25c, #a8874b);
  border-color: #b3915a;
  color: #221c10;
  font-weight: 700;
}
button.primary:hover { filter: brightness(1.08); }

details.settings { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 10px; }
details.settings summary { cursor: pointer; color: var(--text-dim); font-size: 0.85rem; }
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.settings-grid .field label { display: block; font-size: 0.75rem; color: var(--text-dim); margin-bottom: 4px; }
.settings-grid select { padding: 8px 10px; font-size: 0.88rem; }

/* ===== 信息区 ===== */
.info-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 0.86rem;
  color: var(--text);
}
.chip b { color: var(--gold-hi); font-weight: 600; margin-left: 4px; }
.chip.ju { background: linear-gradient(180deg, #4a3d20, #382e18); border-color: #7a6234; }
.chip.ju b { color: var(--gold-hi); font-size: 1.02rem; }
.pillars { display: inline-flex; gap: 6px; margin-left: 6px; vertical-align: middle; }
.pillar {
  display: inline-flex; flex-direction: column; align-items: center;
  background: var(--bg-card); border: 1px solid var(--line); border-radius: 8px;
  padding: 3px 8px; line-height: 1.25;
}
.pillar .lbl { font-size: 0.62rem; color: var(--text-dim); }
.pillar .gz { font-size: 1.02rem; letter-spacing: 0.12em; }

/* ===== 九宫盘（天阳盘式：外圈隐干，格内三行无横线） ===== */
.board-wrap { margin-top: 18px; }
.board {
  display: grid;
  grid-template-columns: auto auto auto auto auto;
  justify-content: center;
  gap: 0;
}
.oc {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 10px 9px; min-width: 3.4em;
}
.oc-hidden { color: var(--gold); font-size: 1.05rem; letter-spacing: 0.08em; }
.oc-name { color: var(--text-dim); font-size: 0.62rem; margin-top: 3px; letter-spacing: 0.12em; }
.oc.corner { min-width: 2.4em; }
.ma-char { color: #ff5c5c; font-size: 1.15rem; }

.palace {
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  padding: 10px 12px;
  min-width: 7.6em;
  min-height: 6.6em;
  display: flex; flex-direction: column; justify-content: space-around;
  background: linear-gradient(180deg, var(--bg-card-hi), var(--bg-card));
}
.palace.pb { border-bottom: 1px solid var(--line); }
.palace.pr { border-right: 1px solid var(--line); }
.c-row { display: flex; align-items: baseline; gap: 0.6em; }
.c-row.first { align-items: center; justify-content: space-between; }
.c-row.spread { justify-content: space-between; }
.p-shen { color: var(--shen); font-size: 0.92rem; letter-spacing: 0.12em; }
.kong-circle { color: #7fb2ff; font-size: 1.5rem; line-height: 1; display: inline-flex; align-items: center; }
.p-tian {
  font-size: 1.55rem; color: var(--tian); letter-spacing: 0.1em;
  text-shadow: 0 0 14px rgba(217, 178, 106, 0.25);
}
.p-xing { color: var(--xing); font-size: 0.84rem; letter-spacing: 0.08em; }
.p-di { font-size: 1.38rem; color: var(--di); }
.p-men { color: var(--men); font-size: 0.84rem; letter-spacing: 0.08em; }

/* 四害：干字/门字染色（天阳配色） */
.hm-xing { color: #b28cf0; }        /* 击刑 紫 */
.hm-mu { color: #56d27a; }          /* 入墓 绿 */
.hm-both { color: #f072d8; }        /* 刑墓双犯 粉 */
.men-po { color: var(--danger); font-style: italic; }  /* 门迫 红斜 */

/* ===== 图例 ===== */
.legend {
  margin-top: 14px;
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  color: var(--text-dim); font-size: 0.78rem;
}
.legend .lg { font-size: 0.85rem; font-weight: 700; }

/* ===== 记录区 ===== */
.panel-title {
  color: var(--gold);
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  margin-bottom: 12px;
}
.panel-title .dim { color: var(--text-dim); font-size: 0.75rem; letter-spacing: 0.05em; }
.rec-item {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  margin-bottom: 8px;
}
.rec-label { font-size: 0.92rem; letter-spacing: 0.08em; }
.rec-time { color: var(--text-dim); font-size: 0.75rem; margin-left: auto; }
.rec-item button { padding: 5px 12px; font-size: 0.8rem; }
.rec-empty { color: var(--text-dim); font-size: 0.85rem; padding: 8px 2px; }
.nav-row button { padding: 9px 13px; font-size: 0.85rem; }

/* ===== 提示条 ===== */
.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%) translateY(20px);
  background: #32384e; color: var(--text); border: 1px solid var(--line);
  padding: 12px 20px; border-radius: 12px; font-size: 0.9rem;
  opacity: 0; pointer-events: none; transition: all .25s ease;
  max-width: 86vw; text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,.45);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

footer {
  max-width: 980px; margin: 22px auto 0; padding: 0 16px;
  color: var(--text-dim); font-size: 0.75rem; line-height: 1.9; text-align: center;
}

/* ===== 移动端 ===== */
@media (max-width: 620px) {
  header h1 { font-size: 1.3rem; letter-spacing: 0.22em; }
  .palace { min-width: 0; min-height: 5.2em; padding: 7px 6px; }
  .oc { padding: 7px 3px; min-width: 2.2em; }
  .oc-name { display: none; }
  .p-tian { font-size: 1.25rem; }
  .p-di { font-size: 1.1rem; }
  .p-shen, .p-xing, .p-men { font-size: 0.68rem; }
  .c-row { gap: 0.35em; }
  button { padding: 10px 14px; font-size: 0.88rem; }
}
