/* 宝宝起名专属深色表单；所有规则限定在 .bb-form，避免影响站内其他工具页。 */
.bb-form {
  padding: 22px 12px;
  border: 1px solid #522e2e;
  border-radius: 8px;
  background: #3a1e1e;
  box-shadow: 0 10px 30px rgba(60,20,20,.25);
}
.bb-form .block-title { margin-bottom: 16px; color: #f5e6d8; }
.bb-form #nameForm {
  overflow: hidden;
  border: 1px solid #3e3b42;
  border-radius: 5px;
  background: #342123;
  color: #f5e6d8;
}

/* 姓氏、出生状态、性别、日期使用与下方一致的暗棕色，并以细框围合。 */
.bb-form .tool-row {
  display: grid;
  grid-template-columns: minmax(110px,.8fr) minmax(145px,1fr) minmax(220px,1.35fr) minmax(230px,1.35fr);
  gap: 0;
  align-items: stretch;
  padding: 7px 6px;
  border: 0;
  border-bottom: 1px solid #3e3b42;
  border-radius: 0;
  background: #342123;
  box-shadow: none;
}
.bb-form .tool-row .field {
  position: relative;
  min-width: 0;
  margin: 0;
  padding: 5px 14px;
}
.bb-form .tool-row .field + .field::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  border-left: 1px solid #444;
}
.bb-form .field label,
.bb-form .tool-row .field label {
  margin-bottom: 4px;
  color: rgba(255,255,255,.55);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .03em;
}
.bb-form .req-star { margin-left: 2px; color: #ff665a; font-size: 13px; font-weight: 800; }
.bb-form .tool-row .field input {
  width: 100%;
  min-width: 0;
  height: 26px;
  padding: 2px 0;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  box-shadow: none;
  color: #fff;
  font-family: inherit;
  font-size: 14.5px;
}
.bb-form .tool-row .field input::placeholder { color: rgba(255,255,255,.35); }
.bb-form .tool-row .field input:focus { border: 0; background: transparent; box-shadow: none; }
.bb-form .tool-row .field input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 50px #342123 inset;
  -webkit-text-fill-color: #fff;
}
.bb-form .tool-row input[type="datetime-local"] { color-scheme: dark; }

/* 所有单选、多选仍使用原 .active 与 data-* 逻辑，仅替换外观。 */
.bb-form .seg,
.bb-form .segm { gap: 6px; }
.bb-form .seg-item,
.bb-form .tool-row .seg-item,
.bb-form .adv-line .seg-item {
  flex: 0 0 auto;
  padding: 5px 13px;
  border: 1px solid #555;
  border-radius: 4px;
  background: transparent;
  box-shadow: none;
  color: rgba(255,255,255,.65);
  font-size: 12.5px;
  line-height: 18px;
}
.bb-form .seg-item:not(.active):hover { border-color: #9b7670; color: #fff; }
.bb-form .seg-item.active {
  border-color: var(--vermilion);
  background: var(--vermilion);
  box-shadow: none;
  color: #fff;
}

/* 起名偏好区保留全部项目，改为深色分组。 */
.bb-form .tool-adv {
  margin-top: 0;
  padding: 15px 12px 3px;
  border-top: 0;
  border-radius: 0;
  background: #342123;
}
.bb-form .tool-adv .block-sub {
  margin-bottom: 13px;
  color: rgba(245,230,216,.66);
  font-size: 12.5px;
}
.bb-form .adv-line { margin-bottom: 12px; gap: 14px; }
.bb-form .adv-line > label {
  flex-basis: 64px;
  color: rgba(255,255,255,.55);
  font-size: 12px;
  line-height: 30px;
}
.bb-form .tool-submit { gap: 16px; margin-top: 8px; }
.bb-form .tool-submit .field-row { grid-template-columns: minmax(180px,1fr) minmax(210px,1.15fr); }
.bb-form .tool-adv .field input {
  padding: 9px 11px;
  border: 1px solid #514b54;
  border-radius: 5px;
  background: #342123;
  color: #fff;
  font-size: 13.5px;
}
.bb-form .tool-adv .field input::placeholder { color: rgba(255,255,255,.32); }
.bb-form .tool-adv .field input:focus {
  border-color: #a84a40;
  background: #35272a;
  box-shadow: 0 0 0 2px rgba(192,57,43,.16);
}
.bb-form .tool-submit .btn {
  min-height: 42px;
  padding: 10px 34px;
  border: 0;
  border-radius: 5px;
  background: linear-gradient(135deg,var(--vermilion),var(--vermilion-dark));
  box-shadow: 0 8px 20px rgba(192,57,43,.22);
  color: #fff;
}

.bb-form .bb-date-pick { cursor: pointer; }
.bb-form .bb-date-val {
  display: block;
  height: 26px;
  overflow: hidden;
  color: rgba(255,255,255,.35);
  font-size: 14.5px;
  line-height: 26px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bb-form .bb-date-pick.filled .bb-date-val { color: #fff; }

/* 表单填写说明：提交后由结果状态逻辑隐藏。 */
.bb-form-guide { margin: -10px 0 28px; padding: 18px 20px 20px; border: 1px solid #d4a85d; border-radius: 8px;
  background: linear-gradient(180deg,#fffaf1,#fffdf9); box-shadow: inset 0 0 0 4px rgba(255,244,222,.72),0 8px 24px rgba(70,45,25,.08); }
.bbg-head { display: flex; align-items: baseline; gap: 14px; padding: 0 4px 12px; border-bottom: 1px dashed #d7b87f; }
.bbg-head h2 { flex: none; margin: 0; color: var(--vermilion); font-family: var(--serif); font-size: 19px; font-weight: 700; }
.bbg-head p { margin: 0; color: #665456; font-size: 12.5px; line-height: 1.7; }
.bbg-head p span { color: var(--vermilion); font-weight: 800; }
.bbg-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 11px 16px; margin-top: 14px; }
.bbg-grid article { padding: 12px 13px; border: 1px solid #e2c18b; border-radius: 7px;
  background: linear-gradient(135deg,#fff,#fff3e5); box-shadow: 0 4px 12px rgba(120,72,35,.07); }
.bbg-grid h3 { display: inline-block; margin: 0 0 7px; padding: 3px 8px; border-radius: 4px;
  background: rgba(192,57,43,.09); color: #a93228; font-size: 14px; font-weight: 800; }
.bbg-grid p { margin: 0; color: #493d40; font-size: 13.5px; line-height: 1.75; }

/* 智能起名结果总标题。 */
.bb-result-title { margin: 0; padding: 0 2px 12px; border-bottom: 1px solid var(--line); color: var(--vermilion); }

/* AI 结果首选推荐：只使用本次返回的名字与评分数据。 */
.bb-primary { position: relative; margin-top: 18px; padding: 20px 22px; overflow: hidden;
  border: 1px solid #b8873a; border-radius: 8px; background: #fffdf9;
  box-shadow: inset 0 0 0 5px rgba(255,248,235,.9); }
.bbp-head { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.bbp-head h3 { margin: 0; color: var(--ink); font-family: var(--serif); font-size: 20px; font-weight: 600; }
.bbp-head h3 b { color: var(--vermilion); }
.bbp-head h3 small { display: inline-block; margin-left: 10px; padding: 3px 9px; border: 1px solid rgba(192,57,43,.22);
  border-radius: 5px; background: #fff2ee; color: var(--vermilion); font-family: inherit; font-size: 12px; vertical-align: middle; }
.bbp-head > span { flex: none; padding: 5px 16px; border-radius: 999px; background: var(--gold-soft); color: #8a641d; font-size: 13px; font-weight: 700; }
.bbp-chars { display: flex; gap: 14px; margin-bottom: 18px; overflow-x: auto; padding-bottom: 2px; }
.bbp-char { display: flex; flex: 1 1 0; align-items: center; gap: 12px; min-width: 180px; }
.bbp-zi { display: grid; flex: 0 0 90px; width: 90px; height: 90px; place-items: center; border: 1px solid rgba(192,57,43,.25);
  border-radius: 8px; background-color: #fff; color: var(--vermilion); font-family: var(--serif); font-size: 48px; font-weight: 700;
  background-image: linear-gradient(45deg,transparent 49.5%,rgba(192,57,43,.1) 50%,transparent 50.5%),linear-gradient(-45deg,transparent 49.5%,rgba(192,57,43,.1) 50%,transparent 50.5%),linear-gradient(90deg,transparent 49.5%,rgba(192,57,43,.1) 50%,transparent 50.5%),linear-gradient(0deg,transparent 49.5%,rgba(192,57,43,.1) 50%,transparent 50.5%); }
.bbp-meta { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.bbp-meta > div { width: 100%; box-sizing: border-box; padding: 4px 7px; overflow: hidden; border: 1px solid rgba(214,170,69,.28); border-radius: 5px;
  background: linear-gradient(135deg,#fff,#fffaf3); text-overflow: ellipsis; white-space: nowrap; }
.bbp-meta b { color: var(--ink-soft); font-weight: 600; }
.bbp-score-row { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; align-items: center; }
.bbp-score { width: 100%; max-width: 320px; margin: 0 auto; text-align: center; }
.bbp-score > label { display: block; margin-bottom: 5px; color: var(--muted); font-size: 13px; }
.bbp-score strong { color: var(--vermilion); font-family: var(--serif); font-size: 60px; line-height: 1; }
.bbp-score em { margin-left: 4px; color: var(--ink); font-size: 18px; font-style: normal; }
.bbp-score p { margin: 10px 0 0; padding: 8px 10px; border: 1px solid rgba(214,170,69,.25); border-radius: 6px;
  background: linear-gradient(135deg,#fff,#fff7f2); color: var(--ink-soft); font-size: 13px; line-height: 1.7; text-align: left; }
.bbp-score p strong { color: var(--vermilion); font-family: inherit; font-size: inherit; line-height: inherit; }
.bbp-radar { display: flex; justify-content: center; min-width: 0; }
.bbp-radar svg { display: block; width: 100%; max-width: 320px; }
.bbp-radar text { fill: var(--muted); font-size: 12px; }
.bbp-dims { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px 16px; margin-top: 14px; }
.bbp-dim { display: grid; grid-template-columns: 52px minmax(0,1fr) 36px; gap: 8px; align-items: center;
  padding: 7px 9px; border: 1px solid rgba(214,170,69,.28); border-radius: 7px; background: linear-gradient(135deg,#fff,#fff8f3); }
.bbp-dim > span { color: var(--ink); font-size: 12.5px; font-weight: 700; }
.bbp-dim > div { height: 9px; overflow: hidden; border-radius: 99px; background: #f1e6d5; }
.bbp-dim i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#c49a4a,#c0392b); }
.bbp-dim em { color: var(--vermilion); font-size: 12px; font-style: normal; font-weight: 700; text-align: center; }

.bb-analysis { margin-top: 24px; padding: 0 18px 20px; border: 1px solid #d8c4a2; border-radius: 8px;
  background: #fffdf9; box-shadow: inset 0 0 0 4px rgba(255,248,235,.72); }
.bb-analysis .ai-sec:first-child { margin-top: 18px; }

/* 与姓名打分页共用同款公历/农历出生时刻选择器。 */
.qm-mask { position: fixed; inset: 0; z-index: 998; background: rgba(32,29,43,.34); }
.qm-panel { position: fixed; z-index: 999; overflow: hidden; border: 1px solid var(--line); border-radius: 6px;
  background: var(--paper); box-shadow: 0 18px 48px rgba(60,40,20,.22); }
.qm-pick { width: 470px; max-width: calc(100vw - 24px); }
.qm-head { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; padding: 11px 14px;
  border-bottom: 1px solid var(--line); background: linear-gradient(180deg,var(--cream),var(--paper)); }
.qm-cur { flex: 1 1 100%; color: var(--ink); font-size: 13px; font-weight: 700; }
.qm-opt { display: flex; gap: 14px; }
.qm-radio { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12.5px; cursor: pointer; user-select: none; }
.qm-mark { width: 13px; height: 13px; border: 1px solid #cfc7bb; border-radius: 50%; }
.qm-check .qm-mark { border-radius: 3px; }
.qm-radio.on { color: var(--vermilion); font-weight: 700; }
.qm-radio.on .qm-mark { border-color: var(--vermilion); background: var(--vermilion); box-shadow: inset 0 0 0 2px #fff; }
.qm-radio.off { opacity: .32; cursor: not-allowed; }
.qm-ok { margin-left: auto; padding: 6px 18px; border: 0; border-radius: 5px; color: #fff;
  background: var(--vermilion); font-family: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.qm-cols { display: grid; grid-template-columns: repeat(5,1fr); }
.qm-col { min-width: 0; }
.qm-col + .qm-col { border-left: 1px solid var(--line); }
.qm-col-t { padding: 6px 0; background: #faf7f2; color: var(--muted); font-size: 11.5px; text-align: center; }
.qm-col-list { height: 212px; overflow-y: auto; }
.qm-col-i { padding: 6px 2px; color: var(--ink-soft); font-size: 13px; text-align: center; cursor: pointer; }
.qm-col-i:hover { background: var(--cream); }
.qm-col-i.on { background: var(--vermilion); color: #fff; font-weight: 700; }

@media (max-width: 900px) {
  .bb-form .tool-row { grid-template-columns: 1fr 1fr; }
  .bb-form .tool-row .field:nth-child(3)::before { display: none; }
  .bb-form .tool-row .field:nth-child(n+3) { border-top: 1px solid #444; }
  .bb-form .tool-submit { flex-direction: column; align-items: stretch; }
  .bb-form .tool-submit .field-row { width: 100%; }
  .bb-form .tool-submit .btn { width: 100%; }
}

@media (max-width: 640px) {
  .bb-form { padding: 14px 10px; }
  .bb-form .block-title { margin-bottom: 12px; }
  .bb-form .tool-row { grid-template-columns: 1fr 1fr; padding: 5px; }
  .bb-form .tool-row .field { padding: 8px 9px; }
  .bb-form .tool-row .field:nth-child(n+3) { grid-column: 1 / -1; }
  .bb-form .tool-row .field:nth-child(2)::before { height: auto; top: 8px; bottom: 8px; }
  .bb-form .tool-row .field:nth-child(3)::before,
  .bb-form .tool-row .field:nth-child(4)::before { display: none; }
  .bb-form .tool-row .field:nth-child(n+3) { border-top: 1px solid #444; }
  .bb-form .tool-row .field input { height: 30px; font-size: 16px !important; }
  .bb-form .bb-date-val { height: 30px; font-size: 16px; line-height: 30px; }
  .bb-form .tool-row .seg { flex-wrap: wrap; }
  .bb-form .tool-row .seg-item { flex: 1; padding: 5px 4px; }
  .bb-form .tool-adv { margin-top: 0; padding: 13px 9px 2px; }
  .bb-form .adv-line { gap: 4px; margin-bottom: 9px; }
  .bb-form .adv-line > label { flex: 0 0 auto; line-height: 1.35; }
  .bb-form .tool-submit .field-row { grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 7px; }
  .bb-form .tool-submit .field label { overflow: hidden; font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
  .bb-form .tool-submit .field input { height: 30px; min-height: 30px; padding: 3px 6px; font-size: 13px !important; line-height: 20px; }
  .bb-form-guide { margin-top: -4px; padding: 15px 13px; }
  .bbg-head { display: block; }
  .bbg-head h2 { margin-bottom: 6px; font-size: 16px; }
  .bbg-grid { grid-template-columns: 1fr; gap: 8px; margin-top: 12px; }
  .bbg-grid article { padding: 10px; }
  .bb-primary { padding: 15px 13px; }
  .bbp-head { align-items: flex-start; flex-direction: column; gap: 8px; }
  .bbp-head h3 { font-size: 17px; }
  .bbp-head h3 small { margin-left: 5px; }
  .bbp-char { flex: 0 0 100px; width: 100px; min-width: 100px; flex-direction: column; gap: 8px; }
  .bbp-zi { flex-basis: 72px; width: 72px; height: 72px; font-size: 39px; }
  .bbp-meta { width: 100%; font-size: 12px; }
  .bbp-score-row { grid-template-columns: 1fr; gap: 8px; }
  .bbp-score strong { font-size: 50px; }
  .bbp-radar svg { max-width: 280px; }
  .bbp-dims { grid-template-columns: 1fr; gap: 7px; }
  .bb-analysis { padding: 0 12px 15px; }
  .bb-analysis .ai-sec:first-child { margin-top: 15px; }
  .qm-panel { left: 0 !important; right: 0; top: auto !important; bottom: 0; border-radius: 6px 6px 0 0; }
  .qm-pick { width: auto; max-width: none; }
  .qm-col-i { padding: 8px 1px; font-size: 12.5px; }
}
