/* 宝宝起名专属表单；所有规则限定在 .bb-form，避免影响站内其他工具页。 */
.bb-form {
  padding: 22px 12px;
  border: 1px solid #d4a85d;
  border-radius: 8px;
  background: #f4e8d4;
  box-shadow: 0 10px 30px rgba(120,80,30,.12);
}
.bb-form .block-title { margin-bottom: 16px; color: var(--ink); }
.bb-form #nameForm {
  overflow: hidden;
  border: 1px solid #d9c4a6;
  border-radius: 5px;
  background: #e8d8c0;
  color: var(--ink);
}

/* 姓氏、出生状态、性别、日期使用与下方一致的米色，并以细框围合。 */
.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 #d9c4a6;
  border-radius: 0;
  background: #e8d8c0;
  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 rgba(195,155,82,.35);
}
.bb-form .field label,
.bb-form .tool-row .field label {
  margin-bottom: 4px;
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .03em;
}
.bb-form .req-star { margin-left: 2px; color: var(--vermilion); 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: var(--ink);
  font-family: inherit;
  font-size: 14.5px;
}
.bb-form .tool-row .field input::placeholder { color: rgba(32,29,43,.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 #e8d8c0 inset;
  -webkit-text-fill-color: var(--ink);
}
.bb-form .tool-row input[type="datetime-local"] { color-scheme: light; }

/* 所有单选、多选仍使用原 .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 #d9c9b2;
  border-radius: 4px;
  background: #f0e7d5;
  box-shadow: none;
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 18px;
}
.bb-form .seg-item:not(.active):hover { border-color: var(--gold); color: var(--ink); }
.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: #e8d8c0;
}
.bb-form .tool-adv .block-sub {
  margin-bottom: 13px;
  color: var(--ink-soft);
  font-size: 12.5px;
}
.bb-form .adv-line { margin-bottom: 12px; gap: 14px; }
.bb-form .adv-line > label {
  flex-basis: 64px;
  color: var(--ink-soft);
  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 #d9c4a6;
  border-radius: 5px;
  background: #ede0ca;
  color: var(--ink);
  font-size: 13.5px;
}
.bb-form .tool-adv .field input::placeholder { color: rgba(32,29,43,.32); }
.bb-form .tool-adv .field input:focus {
  border-color: var(--vermilion);
  background: #fff;
  box-shadow: 0 0 0 2px rgba(192,57,43,.12);
}
.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(32,29,43,.35);
  font-size: 14.5px;
  line-height: 26px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bb-form .bb-date-pick.filled .bb-date-val { color: var(--ink); }

/* 表单填写说明：提交后由结果状态逻辑隐藏。 */
.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 { position: relative; 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; }

/* 9.9 元智能起名收款层：电脑与手机共用同一结构和交互。 */
.bb-pay-mask[hidden] { display: none !important; }
.bb-pay-mask { position: fixed; inset: 0; z-index: 1100; display: block; padding: 16px;
  background: rgba(32,29,43,.55); backdrop-filter: blur(2px); }
.bb-pay-dialog { position: fixed; left: var(--bb-pay-center-x,50vw); top: var(--bb-pay-center-y,50vh); width: 360px; max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px); overflow-y: auto; transform: translate(-50%,-50%); box-sizing: border-box;
  padding: 20px; border: 1px solid #d4a85d; border-radius: 10px; background: #fffaf1;
  box-shadow: 0 22px 60px rgba(40,25,18,.3); text-align: center; }
.bb-pay-close { position: absolute; top: 8px; right: 9px; width: 34px; height: 34px; padding: 0; border: 0;
  border-radius: 50%; background: transparent; color: var(--muted); font-size: 25px; line-height: 34px; cursor: pointer; }
.bb-pay-close:hover { background: rgba(192,57,43,.08); color: var(--vermilion); }
.bb-pay-head > span { display: block; color: var(--ink); font-family: var(--serif); font-size: 19px; font-weight: 700; }
.bb-pay-head strong { display: block; margin: 6px 0 2px; color: var(--vermilion); font-size: 38px; line-height: 1.1; }
.bb-pay-head strong small { margin-right: 2px; font-size: 20px; }
.bb-pay-head p { margin: 5px 0 14px; color: var(--muted); font-size: 13px; }
.bb-pay-tabs { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 14px; overflow: hidden;
  border: 1px solid #d9c4a6; border-radius: 6px; }
.bb-pay-tabs button { padding: 9px 8px; border: 0; background: #f4e8d4; color: var(--ink-soft);
  font-family: inherit; font-size: 14px; cursor: pointer; }
.bb-pay-tabs button + button { border-left: 1px solid #d9c4a6; }
.bb-pay-tabs button.active { background: var(--vermilion); color: #fff; font-weight: 700; }
.bb-pay-qr { display: grid; width: 236px; height: 236px; margin: 0 auto; padding: 8px; place-items: center;
  border: 1px solid #dcc79f; border-radius: 8px; background: #fff; }
.bb-pay-qr img { display: block; width: 220px; height: 220px; object-fit: contain; }
.bb-pay-hint { margin: 11px 0 13px; color: #665456; font-size: 12.5px; line-height: 1.6; }
.bb-pay-download { display: none; width: 100%; min-height: 40px; margin-bottom: 9px; align-items: center; justify-content: center;
  box-sizing: border-box; border: 1px solid #c49a4a; border-radius: 6px; background: #fff8e9;
  color: #8a641d; font-size: 13px; font-weight: 700; line-height: 20px; text-decoration: none; }
.bb-pay-confirm { width: 100%; min-height: 43px; border: 0; border-radius: 6px;
  background: linear-gradient(135deg,var(--vermilion),var(--vermilion-dark)); box-shadow: 0 8px 20px rgba(192,57,43,.2);
  color: #fff; font-family: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.bb-pay-note { margin: 9px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
body.bb-pay-open { overflow: hidden; }

@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 rgba(195,155,82,.3); }
  .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 rgba(195,155,82,.3); }
  .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; }
  .bb-pay-mask { padding: 10px; }
  .bb-pay-dialog { left: 50vw !important; top: 50vh !important; width: min(300px,calc(100vw - 20px)); max-height: calc(100vh - 20px); padding: 13px 12px; }
  .bb-pay-close { top: 5px; right: 5px; width: 31px; height: 31px; font-size: 22px; line-height: 31px; }
  .bb-pay-head > span { font-size: 16px; line-height: 1.35; }
  .bb-pay-head strong { margin-top: 3px; font-size: 30px; }
  .bb-pay-head strong small { font-size: 17px; }
  .bb-pay-head p { margin: 3px 0 9px; font-size: 11.5px; line-height: 1.45; }
  .bb-pay-tabs { margin-bottom: 9px; }
  .bb-pay-tabs button { min-height: 37px; padding: 6px; line-height: 20px; }
  .bb-pay-qr { width: 174px; height: 174px; padding: 6px; }
  .bb-pay-qr img { width: 160px; height: 160px; }
  .bb-pay-hint { margin: 7px 0 8px; font-size: 11.5px; line-height: 1.45; }
  .bb-pay-download { display: inline-flex; width: auto; min-height: 28px; margin: 0 auto 7px; padding: 3px 11px;
    border: 1px solid rgba(192,57,43,.24); border-radius: 5px; background: rgba(192,57,43,.08);
    color: #a33a32; font-size: 11.5px; font-weight: 500; line-height: 20px; }
  .bb-pay-confirm { min-height: 40px; line-height: 20px; }
  .bb-pay-note { margin-top: 6px; font-size: 10px; }
}
