/* ============================================================
   玄境 · 新生兒命名／改名
   ------------------------------------------------------------
   版面沿用姓名學頁（xm-*）的卡片與金線，這裡只補「表單」與
   「候選名」兩種新元件：
     · 表單在手機上必須是單欄、每個欄位都有可見標籤、觸控高度 ≥44px
     · 候選名用「名字本體 → 兩個分數 → 一行理由」的順序，
       讓使用者先看到名字，再看到數字，而不是先被分數淹沒
   ============================================================ */

.nm-wrap { max-width: 900px; }

/* ── 開場：主打文案 ── */
.nm-lead {
  max-width: 45em;
  margin: 14px 0 0;
  padding-left: 14px;
  border-left: 1px solid rgba(224, 196, 130, .3);
  font-size: 15.5px;
  line-height: 2.05;
  color: #d8cbb2;
}
.nm-lead-facts {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid rgba(224, 196, 130, .12);
  padding-top: 16px;
}
.nm-lead-facts li {
  font-size: 13.5px;
  line-height: 1.85;
  color: #a99c86;
}
.nm-lead-facts b {
  display: inline-block;
  min-width: 5.2em;
  color: #e0c482;
  font-weight: 500;
  letter-spacing: .06em;
}
@media (min-width: 768px) {
  .nm-lead-facts {
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
  }
  .nm-lead-facts b { display: block; min-width: 0; margin-bottom: 3px; }
}

/* ── 流程列 ── */
.nm-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
  counter-reset: nmstep;
}
.nm-flow li {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border: 1px solid rgba(224, 196, 130, .16);
  border-radius: 999px;
  font-size: 12.5px;
  color: #a99c86;
  counter-increment: nmstep;
}
.nm-flow li::before {
  content: counter(nmstep);
  display: inline-grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: rgba(224, 196, 130, .12);
  color: #c9a05e;
  font-size: 10.5px;
}

/* ── 表單 ── */
.nm-form { margin: 0; }
.nm-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
}
.nm-field { min-width: 0; }
.nm-field--full { grid-column: 1 / -1; }

.nm-field > label,
.nm-legend {
  display: block;
  margin: 0 0 7px;
  font-size: 12.5px;
  letter-spacing: .08em;
  color: #a99c86;
}
.nm-req { color: #c9a05e; }

.nm-input,
.nm-select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid rgba(224, 196, 130, .22);
  border-radius: 10px;
  background: rgba(10, 8, 14, .66);
  color: #efe6d5;
  font-size: 15.5px;
  font-family: inherit;
}
.nm-input:focus,
.nm-select:focus {
  outline: none;
  border-color: rgba(224, 196, 130, .6);
  box-shadow: 0 0 0 3px rgba(224, 196, 130, .1);
}
.nm-select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #c9a05e 50%), linear-gradient(135deg, #c9a05e 50%, transparent 50%);
  background-position: calc(100% - 17px) 19px, calc(100% - 12px) 19px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 32px;
}

.nm-date { display: grid; grid-template-columns: 1.25fr .9fr .9fr; gap: 8px; }

/* 選項膠囊（性別、單雙名、五行） */
.nm-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.nm-chips label { position: relative; cursor: pointer; }
.nm-chips input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.nm-chips span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(224, 196, 130, .22);
  border-radius: 999px;
  color: #b9ac93;
  font-size: 14px;
  transition: border-color .16s, background .16s, color .16s;
}
.nm-chips input:checked + span {
  border-color: rgba(224, 196, 130, .65);
  background: rgba(224, 196, 130, .13);
  color: #f4dfa4;
}
.nm-chips input:focus-visible + span {
  box-shadow: 0 0 0 3px rgba(224, 196, 130, .25);
}

.nm-hint {
  margin: 7px 0 0;
  font-size: 12.5px;
  line-height: 1.8;
  color: #8f8677;
}
.nm-prefill {
  margin-top: 12px;
  padding: 8px 12px;
  border-left: 2px solid rgba(224, 196, 130, .5);
  background: rgba(224, 196, 130, .05);
  border-radius: 0 8px 8px 0;
  color: #b3a68d;
}

.nm-submit {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  margin-top: 20px;
  border: 1px solid rgba(224, 196, 130, .6);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(224, 196, 130, .22), rgba(224, 196, 130, .08));
  color: #f4dfa4;
  font-size: 16px;
  font-family: var(--serif);
  letter-spacing: .26em;
  cursor: pointer;
}
.nm-submit:hover { background: linear-gradient(180deg, rgba(224, 196, 130, .32), rgba(224, 196, 130, .13)); }

.nm-flash {
  margin: 14px 0 0;
  padding: 11px 14px;
  border: 1px solid rgba(255, 140, 140, .32);
  border-radius: 10px;
  background: rgba(255, 90, 90, .06);
  color: #ffb0b0;
  font-size: 13.5px;
  line-height: 1.85;
}

/* ── 生辰摘要 ── */
.nm-pillars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 0 0 16px;
}
.nm-pillar {
  padding: 10px 6px;
  border: 1px solid rgba(224, 196, 130, .16);
  border-radius: 10px;
  text-align: center;
  background: rgba(12, 9, 18, .45);
}
.nm-pillar small {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  letter-spacing: .16em;
  color: #8f8677;
}
.nm-pillar b {
  display: block;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: .12em;
  color: #eadfc7;
}
.nm-pillar.is-unknown b { color: #6d6458; }

.nm-bars { margin: 0; }
.nm-bar {
  display: grid;
  grid-template-columns: 30px 1fr 28px;
  align-items: center;
  gap: 10px;
  margin: 0 0 7px;
  font-size: 12.5px;
  color: #a99c86;
}
.nm-bar i {
  display: block;
  height: 6px;
  border-radius: 999px;
  background: rgba(224, 196, 130, .12);
  overflow: hidden;
}
.nm-bar i span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(224, 196, 130, .85), rgba(224, 196, 130, .35));
}
.nm-bar.is-favor i span { background: linear-gradient(90deg, #8fd9ac, rgba(143, 217, 172, .3)); }
.nm-bar b { text-align: right; font-weight: 500; color: #d8c8a6; font-variant-numeric: tabular-nums; }

.nm-verdict {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-left: 2px solid rgba(224, 196, 130, .55);
  background: rgba(224, 196, 130, .05);
  font-size: 14px;
  line-height: 1.95;
  color: #ded2ba;
}
.nm-verdict b { color: #f0d79c; font-weight: 500; }

.nm-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }
.nm-links a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(224, 196, 130, .22);
  border-radius: 999px;
  color: #b9ac93;
  font-size: 13px;
  text-decoration: none;
}
.nm-links a:hover { border-color: rgba(224, 196, 130, .48); color: #e0c482; }

/* ── 舊名 ── */
.nm-old {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: center;
}
.nm-old .xm-ring { flex: 0 0 auto; }
.nm-old-notes { margin: 0; padding: 0; list-style: none; }
.nm-old-notes li {
  position: relative;
  margin: 0 0 6px;
  padding-left: 14px;
  font-size: 14px;
  line-height: 1.85;
  color: #ded2ba;
}
.nm-old-notes li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .72em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(224, 196, 130, .55);
}

/* ── 候選名 ── */
.nm-list { display: grid; gap: 12px; margin: 16px 0 0; }

.nm-name {
  position: relative;
  padding: 16px 16px 14px;
  border: 1px solid rgba(224, 196, 130, .18);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(30, 21, 42, .62), rgba(15, 10, 22, .5));
}
.nm-name:first-child {
  border-color: rgba(224, 196, 130, .42);
  box-shadow: 0 12px 34px rgba(0, 0, 0, .26);
}
.nm-name-top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 14px;
}
.nm-name-text {
  margin: 0;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: .16em;
  color: #f4e6c8;
}
.nm-name-scores {
  display: flex;
  gap: 8px;
  margin-left: auto;
  font-size: 12px;
  color: #a99c86;
}
.nm-score-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 3px 10px;
  border: 1px solid rgba(224, 196, 130, .26);
  border-radius: 999px;
}
.nm-score-chip b {
  font-size: 15px;
  font-weight: 600;
  color: #f0d79c;
  font-variant-numeric: tabular-nums;
}
.nm-score-chip.is-match b { color: #8fd9ac; }
.nm-score-chip.is-pop {
  padding: 3px 9px;
  border-color: rgba(224, 196, 130, .14);
  color: #8d8271;
  font-size: 11.5px;
  letter-spacing: .08em;
}

.nm-name-meta {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.9;
  color: #b9ac93;
}
.nm-name-meta em { font-style: normal; color: #c9a05e; }

.nm-name-chars {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 10px 0 0;
  padding: 10px 0 0;
  border-top: 1px solid rgba(224, 196, 130, .1);
  font-size: 12.5px;
  color: #8f8677;
}
.nm-name-chars span b { color: #c9b184; font-weight: 500; }

.nm-name-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 12px 0 0;
}
.nm-name-foot a {
  font-size: 12.5px;
  color: #a8946a;
  text-decoration: none;
  border-bottom: 1px solid rgba(224, 196, 130, .25);
}
.nm-name-foot a:hover { color: #e0c482; }

.nm-wuge-mini {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin: 8px 0 0;
  font-size: 11.5px;
  color: #8f8677;
}
.nm-wuge-mini b { color: #c9b184; font-weight: 500; }
.nm-wuge-mini .bad b { color: #e8a0a0; }

/* ── 說明 ── */
.nm-prose {
  margin: 0 0 12px;
  font-size: 14.5px;
  line-height: 1.95;
  color: #b9ac93;
}
.nm-prose:last-child { margin-bottom: 0; }
.nm-prose b { color: #d8c8a6; font-weight: 500; }

.nm-faq { margin: 0; }
.nm-faq dt {
  margin: 16px 0 5px;
  font-size: 14.5px;
  color: #ded2ba;
}
.nm-faq dt:first-child { margin-top: 0; }
.nm-faq dd {
  margin: 0;
  font-size: 14px;
  line-height: 1.9;
  color: #a99c86;
}

/* ── 手機 ── */
@media (max-width: 768px) {
  .nm-grid { grid-template-columns: 1fr; }
  .nm-pillars { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .nm-pillar b { font-size: 17px; letter-spacing: .06em; }
  .nm-name-text { font-size: 25px; }
  .nm-name-scores { margin-left: 0; }
  .nm-old { grid-template-columns: 1fr; }
  .nm-old .xm-ring { margin: 0 auto; }
  .nm-date { grid-template-columns: 1fr 1fr 1fr; }
  /* 開場的三條說明是連續閱讀的文字，不能跟註記同級 */
  .nm-lead { font-size: 15px; line-height: 2; }
  .nm-lead-facts li { font-size: 14px; }
  .nm-hint { font-size: 13px; line-height: 1.85; }
  .nm-score-chip.is-pop { font-size: 11.5px; }
}
@media (max-width: 380px) {
  .nm-pillar { padding: 8px 4px; }
  .nm-pillar b { font-size: 15.5px; }
  .nm-name { padding: 14px 13px 12px; }
  .nm-name-text { font-size: 23px; }
}
