﻿/* ─── 姓名测算 · 智能起名（浅色玻璃主题） ─── */
* { 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%);
}
/* 保留伪元素占位（旧星点已移除） */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

/* ── 顶栏 ── */
.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;
  margin-right: 76px;
  text-shadow: 0 2px 10px rgba(47, 124, 232, .3);
}

/* ── 主区 ── */
.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;
}

/* ── 功能切换（连体卡片顶） ── */
.kind-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 12px 12px 2px;
  background: var(--panel);
  border: 1.5px solid var(--panel-line);
  border-bottom: none;
  border-radius: 26px 26px 0 0;
  box-shadow: 0 8px 28px rgba(96, 125, 170, .22);
}
.kind-tab {
  appearance: none;
  border: 1.5px solid rgba(120, 150, 200, .38);
  background: rgba(255, 255, 255, .6);
  border-radius: 18px;
  padding: 12px 8px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.kind-tab.is-active {
  border-color: rgba(96, 150, 240, .8);
  background: linear-gradient(160deg, #ffffff 0%, #eef5ff 100%);
  box-shadow: 0 5px 16px rgba(92, 140, 248, .28), inset 0 1px 0 rgba(255, 255, 255, .9);
}
.kind-tab-label { font-size: 16px; font-weight: 700; color: var(--ink); letter-spacing: 1px; }
.kind-tab-desc { font-size: 11.5px; color: rgba(44, 62, 93, .55); }
.kind-tab.is-active .kind-tab-label { color: var(--bright-deep); }
.kind-tab.is-active .kind-tab-desc { color: rgba(47, 124, 232, .8); }

/* tab 面板 = 卡片主体（连体） */
.tab-panel {
  padding: 14px 16px 20px;
  background: var(--panel);
  border: 1.5px solid var(--panel-line);
  border-top: none;
  border-radius: 0 0 26px 26px;
  margin-bottom: 18px;
}
.result-panel { margin-top: 16px; }

/* ── 表单 ── */
.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.two-col { margin-bottom: 12px; }
.field-row + .field-row { margin-top: 12px; }

.field-row input,
.field-row select,
.field input,
.field select {
  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, .birth-hour-native {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232c3e5d' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 15px;
  padding-right: 36px;
}
.field-row input::placeholder,
.field input::placeholder { color: rgba(80, 105, 150, .45); }
.field-row input:focus,
.field-row select:focus,
.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--bright);
  box-shadow: 0 0 0 3px rgba(47, 124, 232, .16);
}

/* 出生日期按钮（birth-picker 组件） */
.birth-date-block .birth-pick-btn {
  min-height: 46px;
  width: 100%;
  background: var(--panel-deep);
  border: 1.5px solid rgba(120, 150, 200, .42);
  border-radius: 14px;
  color: var(--ink);
  font-size: 15px;
}
.birth-date-block .birth-pick-btn.placeholder { color: rgba(80, 105, 150, .45); }

/* 日期选择弹层保持组件默认浅色主题：本页 --panel 与组件变量撞名，此处恢复 */
.birth-picker-modal {
  --panel: #fff;
  --panel-alt: #faf8f4;
}

.birth-hour-block { margin-top: 12px; }

/* ── 起名结果：八字排盘卡 ── */
.paipan-card {
  background: var(--panel);
  border: 1.5px solid rgba(120, 150, 200, .35);
  border-radius: 20px;
  padding: 14px 14px 16px;
  margin-bottom: 12px;
}
.paipan-card .sub-title { margin-top: 0; }
.paipan-meta {
  margin: 4px 0 10px;
  font-size: 12.5px;
  color: rgba(44, 62, 93, .6);
}
.sizhu-grid {
  border: 1px solid rgba(44, 62, 93, .18);
  border-radius: 12px;
  overflow: hidden;
  background: var(--panel-deep);
}
.sz-row {
  display: grid;
  grid-template-columns: 52px repeat(4, 1fr);
  border-top: 1px solid rgba(44, 62, 93, .1);
}
.sz-row:first-child { border-top: none; }
.sz-label {
  padding: 8px 2px;
  font-size: 12.5px;
  color: rgba(44, 62, 93, .6);
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid rgba(44, 62, 93, .1);
  background: rgba(240, 246, 252, .9);
}
.sz-col-head {
  padding: 8px 2px;
  text-align: center;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--bright-deep);
  border-right: 1px solid rgba(44, 62, 93, .1);
}
.sz-col-head:last-child, .sz-cell:last-child { border-right: none; }
.sz-cell {
  padding: 8px 4px;
  text-align: center;
  font-size: 13px;
  color: rgba(44, 62, 93, .88);
  border-right: 1px solid rgba(44, 62, 93, .1);
  word-break: break-all;
}
.sz-ss { font-size: 12.5px; }
.sz-gz { font-size: 19px; font-weight: 700; }
.sz-zhi { padding: 8px 4px; }
.sz-zhi-char { font-size: 19px; font-weight: 700; display: block; }
.sz-cang {
  display: block;
  margin-top: 3px;
  font-size: 12px;
}
.sz-cang i {
  font-style: normal;
  font-size: 10.5px;
  color: rgba(44, 62, 93, .5);
  margin-left: 2px;
}
.sz-sha { font-size: 11.5px; color: rgba(44, 62, 93, .72); line-height: 1.55; }

.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 {
  text-align: center;
  font-size: 12px;
  color: rgba(44, 62, 93, .5);
  margin-top: 16px;
  letter-spacing: .5px;
}

.hidden { display: none !important; }

/* ── 测名结果 ── */
.score-head {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 6px 2px 16px;
  border-bottom: 1px dashed var(--line-soft);
  margin-bottom: 14px;
}
.score-ring {
  position: relative;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  background: conic-gradient(var(--bright) var(--score, 0%), rgba(255, 255, 255, .14) 0);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.score-ring::before {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  background: #ffffff;
}
.score-num {
  position: relative;
  font-size: 32px;
  font-weight: 700;
  color: var(--bright-deep);
  line-height: 1;
  text-shadow: 0 0 12px rgba(47, 124, 232, .25);
}
.score-unit {
  position: relative;
  font-size: 12px;
  color: var(--ink-mute);
  margin: 14px 0 0 -2px;
}
.score-side { min-width: 0; }
.score-grade {
  font-size: 20px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 4px;
}
.score-name { font-size: 15px; font-weight: 600; }
.score-sub { font-size: 12px; color: var(--ink-mute); margin-top: 3px; line-height: 1.5; }

.sub-card {
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 12px;
  background: var(--panel-deep);
}
.sub-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 10px;
}
.sub-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  padding: 1px 8px;
  border-radius: 8px;
  background: rgba(47, 124, 232, .1);
  color: var(--bright);
  vertical-align: 1px;
}
.sub-badge.bad { background: rgba(255, 155, 138, .16); color: var(--warn); }

.wuge-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.wuge-table th {
  text-align: left;
  font-weight: 500;
  color: var(--ink-mute);
  padding: 4px 6px;
  border-bottom: 1px solid var(--line-soft);
  white-space: nowrap;
}
.wuge-table td {
  padding: 7px 6px;
  border-bottom: 1px solid rgba(44, 62, 93, .08);
  vertical-align: top;
}
.wuge-table tr:last-child td { border-bottom: none; }
.wuge-ge { font-weight: 600; white-space: nowrap; }
.wuge-num {
  display: inline-block;
  min-width: 30px;
  text-align: center;
  font-weight: 700;
  color: var(--bright);
}
.wuge-lucky { white-space: nowrap; }
.wuge-lucky.dj { color: var(--ok); font-weight: 600; }
.wuge-lucky.j { color: var(--ok); }
.wuge-lucky.bj { color: var(--gold); }
.wuge-lucky.x { color: var(--warn); }
.wuge-lucky.dx { color: var(--warn); font-weight: 600; }
.wuge-sex {
  display: inline-block;
  margin-left: 4px;
  font-size: 10px;
  padding: 0 4px;
  border-radius: 6px;
  background: rgba(184, 134, 44, .15);
  color: var(--gold);
  vertical-align: 1px;
}
.wuge-info { color: var(--ink-soft); font-size: 12px; line-height: 1.5; }
.wuge-info em { font-style: normal; color: var(--ink); }

.sancai-key { font-size: 15px; font-weight: 700; margin-bottom: 6px; letter-spacing: 2px; }
.sancai-key .sc-wx { margin-right: 6px; }
.sancai-text { font-size: 13px; color: var(--ink-soft); line-height: 1.7; }

.yunshi-item { margin-bottom: 10px; }
.yunshi-item:last-child { margin-bottom: 0; }
.yunshi-label {
  font-size: 12px;
  color: var(--ink-mute);
  margin-bottom: 3px;
}
.yunshi-text { font-size: 13px; color: var(--ink-soft); line-height: 1.6; }
.yunshi-text .y-level {
  font-weight: 600;
  margin-right: 6px;
}
.y-level.dj, .y-level.j { color: var(--ok); }
.y-level.bj { color: var(--gold); }
.y-level.x, .y-level.dx { color: var(--warn); }

.bazi-line { font-size: 14px; margin-bottom: 8px; line-height: 1.6; }
.bazi-line em {
  font-style: normal;
  font-weight: 700;
  color: #fff;
}
.bazi-char-match { font-size: 13px; color: var(--ink-soft); line-height: 1.8; }
.bazi-char-match .cm {
  display: inline-block;
  margin-right: 12px;
}
.bazi-char-match .cm b { font-size: 16px; color: var(--ink); margin-right: 3px; }
/* 五行配色（浅底深色）：木绿 火红 土棕 金褐 水蓝 */
.wx-mu { color: #1fa05a; font-weight: 700; }
.wx-huo { color: #e2543f; font-weight: 700; }
.wx-tu { color: #a9761f; font-weight: 700; }
.wx-jin { color: #b3831d; font-weight: 700; }
.wx-shui { color: #2f6fd8; font-weight: 700; }
.cm-m1 { color: var(--ok); }
.cm-m-1 { color: var(--warn); }
.cm-m0 { color: var(--ink-mute); }

/* ── 起名结果 ── */
.gen-head { margin-bottom: 14px; }
.gen-summary { font-size: 13px; color: var(--ink-soft); }
.gen-summary.err { color: var(--warn); font-weight: 600; text-align: center; }
.gen-xiyong {
  margin-top: 6px;
  font-size: 13px;
  color: var(--ink-soft);
}

.name-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.name-card {
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--panel-deep);
  padding: 12px 10px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.name-card:active { border-color: var(--bright); box-shadow: 0 2px 12px rgba(47, 124, 232, .22); }
@media (hover: hover) {
  .name-card:hover { border-color: var(--bright); box-shadow: 0 2px 14px rgba(47, 124, 232, .2); transform: translateY(-1px); }
}
.name-card-more {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 10px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  color: #fff;
  background: var(--bright);
  box-shadow: 0 1px 6px rgba(47, 124, 232, .28);
}
@media (hover: hover) {
  .name-card:hover .name-card-more { background: #4c8cf0; }
}
.name-card-name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--ink);
}
.name-card-name .surname { color: rgba(44, 62, 93, .72); }
/* 名字按五行着色（wx-*），入调候的字加金色下划线标识 */
.name-card-name .nc-th { text-decoration: underline; text-decoration-color: rgba(255, 210, 122, .95); text-decoration-thickness: 2px; text-underline-offset: 5px; }
.name-card-total {
  margin-top: 6px;
  font-size: 22px;
  font-weight: 700;
  color: var(--bright);
  text-shadow: 0 0 10px rgba(47, 124, 232, .2);
}
.name-card-total small { font-size: 11px; font-weight: 400; color: var(--ink-mute); margin-left: 2px; }
.name-card-grade {
  display: inline-block;
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 8px;
  background: rgba(47, 124, 232, .1);
  color: var(--bright);
  margin-top: 4px;
}
.name-card-meta {
  margin-top: 8px;
  font-size: 11px;
  color: var(--ink-mute);
  line-height: 1.7;
}
.name-card-meta .wuge-mini { color: var(--ink-soft); }

/* 点击候选名后的详情弹层 */
.name-detail-mask {
  position: fixed;
  inset: 0;
  background: rgba(40, 60, 90, .45);
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.name-detail {
  width: 100%;
  max-width: 720px;
  max-height: 82vh;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid var(--line-soft);
  border-bottom: none;
  border-radius: 18px 18px 0 0;
  padding: 18px 16px 24px;
}
.name-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.name-detail-title { font-size: 20px; font-weight: 700; color: var(--ink); }
.name-detail-close {
  appearance: none;
  border: none;
  background: rgba(47, 124, 232, .1);
  color: var(--bright);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.name-detail .sub-card { background: rgba(240, 246, 252, .75); }

/* ── 加载/错误 ── */
.state-tip {
  text-align: center;
  font-size: 13px;
  color: var(--ink-mute);
  padding: 18px 0 8px;
}
.err-tip {
  text-align: center;
  font-size: 13px;
  color: var(--warn);
  padding: 10px 0 0;
}

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

@media (max-width: 420px) {
  .name-grid { grid-template-columns: 1fr; }
  .field-row { flex-wrap: wrap; }
  .logo-title { margin-right: 0; }
}

/* ── 毛玻璃质感 ── */
.kind-tabs, .tab-panel, .paipan-card, .sub-card, .name-card, .name-detail, .birth-pick-btn {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}