/* 哇又起了个好名字 — H5 样式（沿用小程序视觉规范：白底 + 靛蓝 #3F51B5） */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root {
  --primary: #3F51B5;
  --primary-2: #5C6BC0;
  --primary-3: #7986CB;
  --ink: #212121;
  --ink-2: #424242;
  --muted: #9E9E9E;
  --line: #F0F1F5;
  --bg: #F6F7FB;
}
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(180deg, #EEF0FA 0%, var(--bg) 320px);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
#app { max-width: 520px; margin: 0 auto; min-height: 100vh; padding-bottom: 40px; }
.hidden { display: none !important; }

/* ---------- 授权页 ---------- */
.gate-wrap { padding: 80px 24px 24px; text-align: center; }
.gate-logo {
  font-size: 28px; font-weight: 800; letter-spacing: 2px;
  background: linear-gradient(135deg, var(--primary), var(--primary-3));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.gate-sub { margin-top: 8px; font-size: 13px; color: var(--muted); letter-spacing: 1px; }
.gate-card {
  margin-top: 36px; background: #fff; border-radius: 20px; padding: 28px 22px;
  box-shadow: 0 8px 30px rgba(63, 81, 181, .10);
}
.gate-label { font-size: 13px; color: var(--muted); margin-bottom: 10px; text-align: left; }
.gate-input {
  width: 100%; padding: 16px; border: 2px solid #ECEEF5; border-radius: 14px;
  font-size: 20px; letter-spacing: 3px; text-align: center; text-transform: uppercase;
  outline: none; transition: border-color .15s;
}
.gate-input:focus { border-color: var(--primary); }
.gate-error { color: #C62828; font-size: 13px; margin-top: 12px; min-height: 18px; }
.gate-foot { margin-top: 28px; font-size: 12px; color: #C0C4CC; }

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 12px;
}
.brand { font-size: 18px; font-weight: 800; color: var(--primary); letter-spacing: 1px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.quota-chip {
  font-size: 12px; color: var(--primary); background: #E8EAF6;
  padding: 5px 12px; border-radius: 999px; white-space: nowrap;
}
.icon-btn {
  border: none; background: #fff; color: var(--primary); font-size: 13px;
  padding: 7px 14px; border-radius: 999px; box-shadow: 0 2px 10px rgba(63,81,181,.10);
  cursor: pointer;
}

/* ---------- 分段 ---------- */
.seg {
  display: flex; margin: 6px 20px 14px; background: #fff; border-radius: 16px; padding: 5px;
  box-shadow: 0 3px 14px rgba(63,81,181,.08);
}
.seg-item {
  flex: 1; border: none; background: transparent; padding: 11px 0; font-size: 15px;
  color: #757575; border-radius: 12px; cursor: pointer; transition: all .15s;
}
.seg-on {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff; font-weight: 700; box-shadow: 0 4px 12px rgba(63,81,181,.28);
}

/* ---------- 卡片与表单 ---------- */
.card {
  background: #fff; border-radius: 18px; margin: 14px 20px; padding: 22px 20px;
  box-shadow: 0 4px 20px rgba(63,81,181,.06);
}
.field { margin-bottom: 20px; }
.field:last-of-type { margin-bottom: 8px; }
.field label { display: block; font-size: 14px; font-weight: 600; color: #3A3F51; margin-bottom: 8px; }
.hint { font-size: 12px; font-weight: 400; color: var(--muted); }
.input {
  width: 100%; padding: 13px 15px; border: 2px solid transparent; border-radius: 12px;
  background: var(--bg); font-size: 15px; outline: none; transition: border-color .15s;
}
.input:focus { border-color: var(--primary); background: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chip {
  padding: 7px 16px; border-radius: 999px; background: var(--bg); color: #616161;
  font-size: 13px; border: 2px solid transparent; cursor: pointer; transition: all .15s;
  user-select: none;
}
.chip-on { background: #E8EAF6; color: var(--primary); border-color: var(--primary); font-weight: 600; }

/* ---------- 按钮 ---------- */
.btn-primary {
  width: 100%; border: none; border-radius: 16px; padding: 15px; font-size: 16px; font-weight: 600;
  color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 8px 22px rgba(63,81,181,.26); cursor: pointer; transition: opacity .15s;
}
.btn-primary:active { opacity: .86; }
.btn-primary:disabled { background: rgba(63,81,181,.38); box-shadow: none; cursor: not-allowed; }
.btn-block { margin-top: 10px; }
.btn-row { display: flex; gap: 12px; margin: 16px 20px; }
.btn-ghost {
  flex: 1; padding: 12px; border-radius: 14px; border: 2px solid #C5CAE9; background: #fff;
  color: var(--primary); font-size: 14px; font-weight: 600; cursor: pointer;
}
.btn-ghost:active { background: #EEF0FA; }

/* ---------- 结果卡 ---------- */
.name-card {
  background: #fff; border-radius: 18px; margin: 12px 20px; padding: 18px 20px;
  box-shadow: 0 4px 18px rgba(63,81,181,.06); cursor: pointer; transition: transform .12s;
}
.name-card:active { transform: scale(.985); }
.nc-top { display: flex; align-items: center; justify-content: space-between; }
.nc-left { display: flex; align-items: center; gap: 10px; }
.rank { font-size: 11px; font-weight: 800; color: #fff; background: linear-gradient(135deg,#FF9F43,#FF7E5F); border-radius: 6px; padding: 3px 8px; }
.nc-name { font-size: 25px; font-weight: 800; letter-spacing: 3px; }
.score-badge {
  display: flex; align-items: baseline; gap: 3px;
  padding: 7px 12px; border-radius: 12px; flex-shrink: 0;
}
.score-badge .v { font-size: 19px; font-weight: 800; line-height: 1; }
.score-badge .k { font-size: 11px; opacity: .72; }
.nc-line { margin-top: 10px; font-size: 13px; color: #5A5F6F; }
.nc-why-mark { color: #8A6D3B; margin-right: 2px; }
.llm-why { font-size: 14px; color: #4A4F5E; line-height: 1.7; }
.llm-card .season-note { margin-top: 8px; }
.nc-imp { margin-top: 5px; font-size: 12px; color: var(--primary-2); }
.nc-glyph { margin-top: 4px; font-size: 12px; color: #B26A00; }
.nc-tags { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 7px; }
.tag { font-size: 11px; padding: 3px 10px; border-radius: 8px; background: #EEF0FA; color: var(--primary); }
.tag-dim { background: #F4F5F7; color: var(--muted); }

/* ---------- 季节卡 ---------- */
.season { border-left: 6px solid var(--primary-3); }
.season-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.season-tag { background: linear-gradient(135deg,var(--primary),var(--primary-2)); color: #fff; font-size: 12px; font-weight: 700; padding: 3px 12px; border-radius: 6px; }
.season-meta { font-size: 12px; color: var(--muted); }
.season-nature { margin-top: 10px; font-size: 14px; font-weight: 600; }
.season-sug { margin-top: 6px; font-size: 13px; color: #616161; }
.season-note { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 11px; color: #B0B4C0; }

/* ---------- 详情 ---------- */
.detail-head {
  margin: 14px 20px; padding: 28px 22px; border-radius: 20px; text-align: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-2) 65%, var(--primary-3));
  color: #fff; box-shadow: 0 10px 28px rgba(63,81,181,.28); position: relative;
}
.detail-name { font-size: 34px; font-weight: 800; letter-spacing: 6px; }
.detail-py { margin-top: 4px; font-size: 13px; opacity: .88; }
.detail-total { margin-top: 12px; font-size: 40px; font-weight: 800; line-height: 1; }
.detail-total small { font-size: 12px; font-weight: 400; opacity: .8; margin-left: 4px; }
.back-btn {
  position: absolute; left: 16px; top: 16px; background: rgba(255,255,255,.18);
  border: none; color: #fff; padding: 6px 14px; border-radius: 999px; font-size: 12px; cursor: pointer;
}
.card-title { font-size: 15px; font-weight: 700; color: #2E3A8C; margin-bottom: 12px; display: flex; align-items: center; }
.card-title::before { content: ''; width: 4px; height: 14px; border-radius: 2px; background: linear-gradient(180deg,var(--primary),var(--primary-3)); margin-right: 8px; }
.row { display: flex; align-items: center; padding: 7px 0; font-size: 13px; }
.row .lbl { width: 62px; color: #3A3F51; }
.track { flex: 1; height: 7px; background: var(--line); border-radius: 4px; overflow: hidden; margin: 0 10px; }
.fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg,var(--primary-2),var(--primary)); }
.row .val { width: 40px; text-align: right; font-weight: 700; color: #2E3A8C; }
.grid-row { display: flex; align-items: center; padding: 8px 4px; border-bottom: 1px solid var(--line); font-size: 13px; }
.grid-row:nth-child(even) { background: #FAFBFE; }
.grid-row .g-lbl { width: 52px; color: #616161; }
.grid-row .g-num { width: 42px; font-weight: 800; font-size: 15px; }
.luck { width: 46px; text-align: center; border-radius: 999px; font-size: 12px; padding: 1px 0; }
.luck-ji { color: #2E7D32; background: #E8F5E9; }
.luck-ban { color: #B26A00; background: #FFF8E1; }
.luck-xiong { color: #C62828; background: #FFEBEE; }
.luck-na { color: var(--muted); background: #F4F5F7; }
.grid-row .g-title { flex: 1; color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.warn { color: #C62828; font-size: 13px; padding: 7px 0 7px 10px; border-left: 3px solid #FFCDD2; margin-bottom: 8px; background: #FFFBFB; }
.imp-tag { display: inline-block; font-size: 12px; color: var(--primary); background: #EEF0FA; border-radius: 999px; padding: 3px 12px; margin: 0 6px 6px 0; }
.char-item { background: #FAFBFE; border-radius: 14px; padding: 14px 16px; margin-bottom: 10px; border-left: 4px solid #C5CAE9; }
.char-head { display: flex; align-items: center; gap: 14px; }
.char-big { font-size: 32px; font-weight: 800; color: #2E3A8C; }
.char-py { font-size: 13px; color: var(--primary-2); }
.char-tags { display: flex; gap: 6px; margin-top: 3px; }
.char-tag { font-size: 10px; background: #EEF0FA; color: var(--primary-2); border-radius: 4px; padding: 1px 7px; }
.char-body { margin-top: 8px; font-size: 13px; color: var(--ink-2); }
.dup-num { font-size: 24px; font-weight: 800; color: #2E3A8C; }

/* ---------- 历史 ---------- */
.hist-item { background: #fff; border-radius: 16px; margin: 12px 20px; padding: 16px 18px; box-shadow: 0 3px 14px rgba(63,81,181,.06); cursor: pointer; }
.hist-top { display: flex; align-items: center; gap: 8px; }
.hist-kind { font-size: 11px; font-weight: 700; border-radius: 5px; padding: 2px 8px; background: #E8EAF6; color: var(--primary); }
.hist-kind.ev { background: #FFF3E0; color: #B26A00; }
.hist-title { font-size: 14px; font-weight: 600; }
.hist-time { margin-left: auto; font-size: 11px; color: #BDBDBD; }
.hist-names { margin-top: 8px; font-size: 16px; font-weight: 700; color: #2E3A8C; letter-spacing: 1px; }

/* ---------- loading ---------- */
.loading {
  position: fixed; inset: 0; z-index: 999;
  background: rgba(20, 24, 45, .55);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.spinner {
  width: 34px; height: 34px; border: 3px solid rgba(255,255,255,.35);
  border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
#loading-text { color: #fff; font-size: 14px; margin-top: 14px; letter-spacing: 1px; }

.foot { text-align: center; font-size: 11px; color: #C0C4CC; padding: 24px 32px 0; line-height: 1.7; }
.empty { text-align: center; padding: 60px 24px; color: var(--muted); font-size: 14px; }

/* 视图头（结果/历史页顶部） */
.view-head {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px 4px;
}
.back-chip {
  border: none; background: #fff; color: var(--primary); font-size: 13px; font-weight: 600;
  padding: 7px 14px; border-radius: 999px; box-shadow: 0 2px 10px rgba(63,81,181,.10); cursor: pointer;
}
.back-chip:active { background: #EEF0FA; }
.view-title { font-size: 15px; font-weight: 700; color: #2E3A8C; }

/* 日期选择（自定义显示层，避免原生 date 的 yyyy/mm/dd 灰字与清空后空白） */
.date-wrap {
  position: relative; display: flex; align-items: center;
  background: var(--bg); border: 2px solid transparent; border-radius: 12px;
  padding: 13px 15px; transition: border-color .15s; cursor: pointer;
}
.date-wrap:focus-within { border-color: var(--primary); background: #fff; }
.date-text { flex: 1; font-size: 15px; color: var(--ink); }
.date-empty { color: #B0B4C0; }
.date-icon { font-size: 12px; color: #C5CAE9; margin-left: 8px; }
.date-native {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; border: none; cursor: pointer;
}
.date-native::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.date-clear {
  font-size: 12px; color: var(--muted); padding: 2px 8px; margin-left: 6px;
  background: #fff; border-radius: 6px; z-index: 2; position: relative;
}

/* 生辰四柱面板 */
.bazi {
  margin-top: 6px; padding: 14px 16px; border-radius: 14px;
  background: #FAFBFE; border-left: 4px solid #C5CAE9;
}
.bazi-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.bazi-title { font-size: 13px; font-weight: 700; color: #2E3A8C; }
.bazi-sub { font-size: 11px; color: var(--muted); }
.bazi-pillars { display: flex; gap: 8px; margin-bottom: 10px; }
.bazi-col { flex: 1; text-align: center; background: #fff; border-radius: 10px; padding: 8px 4px; }
.bazi-col .lab { font-size: 10px; color: var(--muted); }
.bazi-col .gz { font-size: 17px; font-weight: 700; color: #2E3A8C; letter-spacing: 1px; margin-top: 2px; }
.bazi-elems { display: flex; flex-direction: column; gap: 5px; }
.elem-row { display: flex; align-items: center; font-size: 12px; }
.elem-name { width: 18px; color: #616161; }
.elem-track { flex: 1; height: 8px; background: #EEF0FA; border-radius: 4px; overflow: hidden; margin: 0 8px; }
.elem-fill { height: 100%; border-radius: 4px; }
.elem-cnt { width: 28px; text-align: right; color: #616161; }
.elem-wx-mu { background: #66BB6A; } .elem-wx-huo { background: #EF5350; }
.elem-wx-tu { background: #FFA726; } .elem-wx-jin { background: #B0BEC5; }
.elem-wx-shui { background: #42A5F5; }
.bazi-note { margin-top: 10px; font-size: 11px; color: #B0B4C0; line-height: 1.5; }

/* 出生日辰：日期 + 时辰 并排 */
.date-row { display: flex; gap: 10px; }
.date-row .date-wrap { flex: 1.6; }
.hour-wrap {
  position: relative; flex: 1; display: flex; align-items: center;
  background: var(--bg); border: 2px solid transparent; border-radius: 12px;
  padding: 13px 14px; transition: border-color .15s; cursor: pointer;
}
.hour-wrap:focus-within { border-color: var(--primary); background: #fff; }
.hour-text { flex: 1; font-size: 15px; color: var(--ink); white-space: nowrap; }
.hour-empty { color: #B0B4C0; }
.hour-native {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; border: none; cursor: pointer; font-size: 16px;
}

/* 喜用神块 */
.fav-block { margin-top: 12px; padding-top: 12px; border-top: 1px dashed #E4E7F0; }
.fav-row { display: flex; align-items: center; margin-bottom: 7px; font-size: 12px; }
.fav-lab { width: 52px; color: var(--muted); }
.fav-val { color: #2E3A8C; font-weight: 600; }
.fav-tags { display: flex; gap: 6px; }
.fav-tag { padding: 2px 10px; border-radius: 6px; font-weight: 600; }
.fav-good { background: #E8F5E9; color: #2E7D32; }
.fav-bad { background: #FFEBEE; color: #C62828; }
.fav-advice { margin-top: 8px; font-size: 12px; color: #424242; line-height: 1.6; }
.fav-method { margin-top: 6px; font-size: 10px; color: #B0B4C0; line-height: 1.5; }

/* 起名建议卡 */
.adv { margin-top: 8px; padding: 14px 16px; border-radius: 14px; background: #EEF0FA; }
.adv-title { font-size: 13px; font-weight: 700; color: #2E3A8C; margin-bottom: 6px; }
.adv-body { font-size: 12px; color: #424242; line-height: 1.7; }
.adv-body b { color: #2E3A8C; }
.adv-btn {
  margin-top: 10px; width: 100%; padding: 11px; border: none; border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff;
  font-size: 13px; font-weight: 600; cursor: pointer;
}

/* 生辰分析页（独立整屏） */
.ana-nav {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px 10px; position: sticky; top: 0; z-index: 20;
  background: rgba(246,247,251,.94); backdrop-filter: blur(8px);
}
.ana-back {
  width: 34px; height: 34px; border-radius: 50%; border: none; background: #fff;
  color: var(--primary); font-size: 19px; line-height: 1; cursor: pointer;
  box-shadow: 0 2px 10px rgba(63,81,181,.12);
}
.ana-nav-title { font-size: 16px; font-weight: 700; color: var(--ink); }
.ana-nav-step { margin-left: auto; font-size: 12px; color: var(--muted); }

.ana-hero {
  margin: 4px 20px 0; padding: 30px 24px 26px; border-radius: 22px; text-align: center;
  background: linear-gradient(135deg, #3F51B5 0%, #5C6BC0 58%, #7986CB 100%);
  color: #fff; box-shadow: 0 12px 32px rgba(63,81,181,.26);
}
.ana-hero-label { font-size: 11px; opacity: .72; letter-spacing: 3px; }
.ana-hero-main { margin-top: 8px; font-size: 27px; font-weight: 800; letter-spacing: 1px; }
.ana-hero-sub { margin-top: 8px; font-size: 12px; opacity: .85; }

.ana-foot { padding: 4px 20px 8px; position: sticky; bottom: 0; background: linear-gradient(180deg, rgba(246,247,251,0) 0%, rgba(246,247,251,.96) 30%); }
/* 下一步按钮：药丸形 + 右侧箭头，主副文案单行层级（替代原两行堆叠的大色块） */
.ana-cta {
  width: 100%; border: none; border-radius: 999px; padding: 15px 22px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 60%, var(--primary-3) 100%);
  color: #fff;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  box-shadow: 0 10px 26px rgba(63, 81, 181, .30), inset 0 1px 0 rgba(255,255,255,.18);
  cursor: pointer; transition: transform .14s ease, box-shadow .14s ease;
}
.ana-cta:active { transform: scale(.985); box-shadow: 0 4px 14px rgba(63,81,181,.24); }
.ana-cta span:first-child {
  font-size: 16px; font-weight: 700; letter-spacing: 1px;
}
/* 副文案已移除（信息冗余且导致拥挤）；按钮只保留主文案 + 箭头 */
.ana-cta-sub { display: none; }
/* 右侧箭头 */
.ana-cta::after {
  content: '›'; font-size: 20px; line-height: 1; opacity: .9;
  margin-left: 2px; transform: translateY(-1px);
}

/* 名字五行契合度 */
.fit-box { margin-top: 10px; padding: 10px 12px; background: #fff; border-radius: 10px; border-left: 3px solid var(--primary-3); }
.fit-head { font-size: 12px; color: #2E3A8C; margin-bottom: 4px; }
.fit-head b { font-size: 13px; }
.fit-body { font-size: 11px; color: #616161; line-height: 1.6; }



/* 典籍出处 */
.classic-card { border-left: 6px solid #C5A46D; background: linear-gradient(180deg, #FFFDF8 0%, #FFFFFF 60%); }
.cls-src { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.cls-badge {
  font-size: 11px; font-weight: 700; color: #8D6E3F; background: #F5EBDC;
  padding: 2px 10px; border-radius: 5px;
}
.cls-title { font-size: 12px; color: #9A8B70; }
.cls-verse {
  font-size: 16px; line-height: 1.9; color: #3E3325; letter-spacing: 1px;
  padding: 10px 0 10px 14px; border-left: 3px solid #E8D9BE;
}
.cls-verse em { font-style: normal; font-weight: 800; color: #8D6E3F; background: #FFF3DC; padding: 0 2px; }
.cls-note { margin-top: 8px; font-size: 11px; color: #B0A48E; }
.tag-classic { background: #F5EBDC !important; color: #8D6E3F !important; }

/* 同句出处的卡片样式弱一档 */
.classic-same { border-left-color: #E8D9BE; }
.classic-same .cls-badge { background: #F1EFEA; color: #A99B7E; }

/* ===== 甄选加载页 v2 ===== */
.loading {
  position: fixed; inset: 0; z-index: 999;
  background: #FFFFFF;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.ld-wrap {
  width: 100%; max-width: 360px; text-align: center;
  animation: ldFadeIn .3s ease-out;
}
@keyframes ldFadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* 八卦演卦：大尺寸卦环，八卦轮转 · 中心姓氏字 */
.ld-bagua { position: relative; width: 216px; height: 216px; margin: 0 auto 30px; }
.ld-bagua-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid rgba(63,81,181,.22);
  animation: baguaSpin 18s linear infinite;
}
.ld-bagua-ring::before {
  content: ''; position: absolute; inset: 12px; border-radius: 50%;
  border: 1px dashed rgba(63,81,181,.30);
}
.ld-bagua-dash {
  position: absolute; inset: 34px; border-radius: 50%;
  border: 1px solid rgba(201,166,107,.45);
  animation: baguaSpin 11s linear infinite reverse;
}
@keyframes baguaSpin { to { transform: rotate(360deg); } }
.ld-gua {
  position: absolute; left: 50%; top: 50%;
  font-size: 30px; line-height: 1; color: #8D6E3F;
  /* 径向排布：卦画垂直于半径（传统八卦画法），随 --a 旋转定位 */
  transform: translate(-50%, -50%) rotate(var(--a)) translateY(-88px);
  animation: guaPulse 2.4s ease-in-out infinite;
}
.ld-gua:nth-of-type(2) { animation-delay: .3s; }
.ld-gua:nth-of-type(3) { animation-delay: .6s; }
.ld-gua:nth-of-type(4) { animation-delay: .9s; }
.ld-gua:nth-of-type(5) { animation-delay: 1.2s; }
.ld-gua:nth-of-type(6) { animation-delay: 1.5s; }
.ld-gua:nth-of-type(7) { animation-delay: 1.8s; }
.ld-gua:nth-of-type(8) { animation-delay: 2.1s; }
@keyframes guaPulse {
  0%, 34%, 100% { opacity: .35; color: #8D6E3F; }
  14% { opacity: 1; color: var(--primary); text-shadow: 0 0 14px rgba(63,81,181,.35); }
}
.ld-bagua .ld-core {
  position: absolute; left: 50%; top: 50%; width: 96px; height: 96px;
  transform: translate(-50%, -50%); border-radius: 50%;
  background: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 42px; font-weight: 800; color: #2E3A8C;
  box-shadow: 0 6px 26px rgba(63,81,181,.14);
}

/* 五行环（五步甄选场景）：五颗圆珠绕中心旋转 */
.ld-ring-zone { position: relative; width: 110px; height: 110px; margin: 0 auto 22px; }
.ld-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 1px solid #E8EAF6;
  animation: ringSpin 9s linear infinite;
}
@keyframes ringSpin { to { transform: rotate(360deg); } }
.ld-bead {
  position: absolute; left: 50%; top: 50%;
  width: 14px; height: 14px; border-radius: 50%;
  margin: -7px 0 0 -7px;
}
.ld-b1 { background: #66BB6A; transform: rotate(0deg)   translateY(-41px); }
.ld-b2 { background: #EF5350; transform: rotate(72deg)  translateY(-41px); }
.ld-b3 { background: #FFA726; transform: rotate(144deg) translateY(-41px); }
.ld-b4 { background: #90A4AE; transform: rotate(216deg) translateY(-41px); }
.ld-b5 { background: #42A5F5; transform: rotate(288deg) translateY(-41px); }
.ld-bead { animation: beadPulse 1.8s ease-in-out infinite; }
.ld-b2 { animation-delay: .18s; } .ld-b3 { animation-delay: .36s; }
.ld-b4 { animation-delay: .54s; } .ld-b5 { animation-delay: .72s; }
@keyframes beadPulse { 0%,100% { opacity: .4; } 50% { opacity: 1; } }
.ld-ring-zone .ld-core {
  position: absolute; inset: 22px; border-radius: 50%;
  background: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 30px; font-weight: 800; color: #2E3A8C;
  box-shadow: 0 4px 20px rgba(63,81,181,.10);
}

/* 步骤清单（左对齐，垂直节奏） */
.ld-list { text-align: left; width: 220px; margin: 0 auto; }
.ld-step {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 4px; font-size: 14px; color: #C3C7D4;
  border-bottom: 1px solid #F4F5F9; transition: color .25s;
}
.ld-step:last-child { border-bottom: none; }
.ld-idx {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; border: 1.5px solid #E4E7F0;
  color: #C3C7D4; transition: all .25s;
}
.ld-step.done { color: #9FA5B8; }
.ld-step.done .ld-idx { background: #EEF0FA; border-color: #EEF0FA; color: #8C97D6; }
.ld-step.now  { color: #2E3A8C; font-weight: 700; }
.ld-step.now .ld-idx { background: linear-gradient(135deg, var(--primary), var(--primary-2)); border-color: transparent; color: #fff; box-shadow: 0 3px 10px rgba(63,81,181,.3); }
.ld-step .ld-sub { margin-left: auto; font-size: 11px; color: #C3C7D4; font-weight: 400; }
.ld-step.now .ld-sub { color: #8C97D6; }

/* 底部提示 */
.ld-tip {
  margin-top: 22px; font-size: 12px; color: #B0B4C0; letter-spacing: .5px;
  animation: tipPulse 1.6s ease-in-out infinite;
}
@keyframes tipPulse { 0%,100% { opacity: .55; } 50% { opacity: 1; } }

/* 主标题 */
.ld-heading {
  font-size: 20px; font-weight: 800; letter-spacing: 2px; color: #2E3A8C;
  margin-bottom: 26px;
}
.ld-heading::after {
  content: '';
  display: block; width: 36px; height: 3px; border-radius: 2px;
  background: linear-gradient(90deg, var(--primary), var(--primary-3));
  margin: 14px auto 0;
}


/* 底部提示 */
.ld-tip {
  margin-top: 22px; font-size: 12px; color: #B0B4C0; letter-spacing: .5px;
  animation: tipPulse 1.6s ease-in-out infinite;
}
@keyframes tipPulse { 0%,100% { opacity: .55; } 50% { opacity: 1; } }

/* 姓氏解读块 */
.sur-item { border-left-color: #A8B2D8; }
.sur-stats {
  margin-top: 8px; display: flex; gap: 14px;
  font-size: 12px; color: #616161;
}
.sur-stats b { color: #2E3A8C; }

/* 放宽数理：诊断卡内的重试按钮与数理瑕疵标签 */
.tag-num { background: #FFFBFB !important; color: #C62828 !important; }
.relax-banner { background: #FFF8E1 !important; border: 1px solid #FFE082; }
.relax-banner .card-title { color: #8D6E3F; }

/* 八卦加载页副标题 */
.ld-subline {
  font-size: 12px; letter-spacing: 3px; color: #9FA5B8;
  margin-top: -16px; margin-bottom: 8px;
}

/* 历史/收藏：置顶返回栏（sticky，长列表不用滚到底） */
.pane-topbar {
  position: sticky; top: 0; z-index: 6;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 2px; margin-bottom: 6px;
  background: var(--bg);
}
.pane-topbar .back-btn {
  position: static; color: var(--primary); background: #fff;
  border: 1px solid #E4E7F0; padding: 6px 14px; font-size: 13px;
}
.pane-title { font-size: 15px; font-weight: 700; color: var(--ink); }
.pane-count { font-size: 12px; color: var(--muted); margin-left: auto; }

/* 收藏星标 */
.nc-right { display: flex; align-items: center; gap: 8px; }
.fav-btn {
  background: none; border: 1px solid #E4E7F0; border-radius: 50%;
  width: 30px; height: 30px; line-height: 1; font-size: 15px;
  color: #B0B4C0; cursor: pointer; padding: 0; flex-shrink: 0;
  transition: all .2s;
}
.fav-btn.on { color: #F5A623; border-color: #F8DFAE; background: #FFF9EC; }
.fav-btn.detail-fav {
  position: absolute; right: 14px; top: 14px;
  width: auto; height: auto; border-radius: 999px;
  padding: 6px 14px; font-size: 12px;
  background: rgba(255,255,255,.18); border: none; color: #fff;
}
.fav-btn.detail-fav.on { background: rgba(255,255,255,.30); border: none; color: #FFE082; }

/* 收藏小卡片网格：一行三卡，卡内逐字对齐（字/拼音/五行三行同列） */
.fav-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.fav-card {
  background: #fff; border: 1px solid #EDEFF6; border-radius: 12px;
  padding: 12px 6px 10px; cursor: pointer; transition: box-shadow .2s;
}
.fav-card:active { box-shadow: 0 4px 14px rgba(63,81,181,.12); }
.fc-cols { display: flex; justify-content: center; gap: 6px; }
.fc-col { min-width: 30px; text-align: center; }
.fc-py { font-size: 10px; color: var(--muted); white-space: nowrap; line-height: 1.2; }
.fc-char { font-size: 19px; font-weight: 800; color: #2E3A8C; line-height: 1.25; margin-top: 2px; }
.fc-wx { font-size: 10px; color: #8D6E3F; margin-top: 3px; }

/* 不可选的 chip（引经模式下的 单名/不限） */
.chip.chip-off { opacity: .35; pointer-events: none; }

/* ==================== 视觉精修（2026-11-01 美化轮）====================
   设计语言：靛蓝（专业）× 金棕（典籍/印章）双色；名字与品牌用宋体系衬线；
   卡片柔和双层阴影；输入聚焦光环；TOP 金银铜徽章。 */

:root {
  --gold: #8D6E3F;
  --gold-soft: #F5EBDC;
  --serif: 'Songti SC', 'STSong', 'Noto Serif SC', 'SimSun', serif;
  --shadow-card: 0 1px 2px rgba(30, 40, 90, .04), 0 6px 18px rgba(30, 40, 90, .06);
}
html, body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

/* 品牌头：印章标 + 衬线名，不换行 */
.brand {
  display: flex; align-items: center; gap: 9px;
  white-space: nowrap; font-family: var(--serif);
  font-size: 19px; letter-spacing: 1.5px; font-weight: 700;
}
/* 印章标：朱印红（传统印泥色），衬线白字 */
.brand-seal {
  width: 30px; height: 30px; border-radius: 7px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #C4473E, #A63530);
  color: #fff; font-size: 16px; font-weight: 700;
  font-family: var(--serif);
  box-shadow: 0 2px 6px rgba(166, 53, 48, .32);
}
.icon-btn { border-radius: 999px; }

/* 卡片：柔和双层阴影 */
.card, .name-card, .fav-card, .hist-item {
  border-radius: 16px;
  box-shadow: var(--shadow-card);
}
.name-card { transition: transform .18s ease, box-shadow .18s ease; }
.name-card:active { transform: translateY(1px); box-shadow: 0 1px 6px rgba(30, 40, 90, .08); }

/* 名字衬线字：国学质感 */
.nc-name { font-family: var(--serif); letter-spacing: 2px; }
.fc-char { font-family: var(--serif); }
.detail-name { font-family: var(--serif); letter-spacing: 6px; }
.ld-heading { font-family: var(--serif); }
.ana-hero-main { font-family: var(--serif); letter-spacing: 4px; }
.hist-title { font-family: var(--serif); }

/* TOP 徽章：金银铜 */
.rank { border-radius: 999px; padding: 3px 9px; letter-spacing: .5px; }
.rank-1 { background: linear-gradient(135deg, #E8C15A, #C29A3A); box-shadow: 0 2px 6px rgba(180, 140, 50, .35); }
.rank-2 { background: linear-gradient(135deg, #A9B4C4, #8E9BAD); box-shadow: 0 2px 6px rgba(140, 150, 170, .3); }
.rank-3 { background: linear-gradient(135deg, #D3A67A, #B98757); box-shadow: 0 2px 6px rgba(185, 135, 87, .3); }

/* chips 选中态：白底描边 + 光晕 */
.chip-on {
  background: #fff; border-color: var(--primary); color: var(--primary);
  box-shadow: 0 2px 8px rgba(63, 81, 181, .12);
}

/* 输入聚焦光环 */
.input:focus {
  outline: none; border-color: var(--primary-3);
  box-shadow: 0 0 0 3px rgba(63, 81, 181, .10);
}

/* 主按钮渐变 + 按压反馈 */
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 4px 14px rgba(63, 81, 181, .28);
}
.btn-primary:active { transform: scale(.985); }

.foot { letter-spacing: 1px; }

/* 头部紧凑化（移动端 390px 内品牌+按钮一行放下） */
.topbar { padding: 14px 16px 10px; }
.brand { font-size: 15px; letter-spacing: 1px; gap: 6px; }
.brand-seal { width: 24px; height: 24px; font-size: 13px; border-radius: 6px; }
.icon-btn { padding: 6px 10px; font-size: 12px; }
.quota-chip { padding: 4px 9px; font-size: 11px; }

/* ==================== 排版修整（2026-11-01）==================== */

/* 候选卡描述两端对齐：避免行尾孤字 */
.nc-line, .hist-names, .muted { text-align: justify; }

/* 收藏页：左右留白 + 收紧卡片间隙 */
#favs-area { padding: 0 16px; }
.fav-grid { gap: 8px; }
.fav-card { padding: 10px 6px 9px; }

/* 收藏数量：小徽章样式替代纯文字 */
.pane-count {
  margin-left: auto; font-size: 11px; color: var(--gold);
  background: var(--gold-soft); padding: 3px 10px; border-radius: 999px;
}

/* CJK 孤字控制：两端对齐 + 现代浏览器防孤行（不支持的浏览器自然换行） */
.nc-line, .hist-names, .muted { text-wrap: pretty; }

/* 结果卡：收藏星标落位标签行右端；综合分药丸微调 */
.score-badge { padding: 6px 11px; border-radius: 10px; border: 1px solid transparent; }
.nc-fav { margin-left: auto; width: 26px; height: 26px; font-size: 13px; }

/* 详情页五格剖象：五列小塔（与小程序同构） */
.wuge-tiles { display: flex; gap: 8px; }
.wuge-tile {
  flex: 1; border-radius: 12px; padding: 12px 2px 10px;
  text-align: center; border: 1px solid #EDEFF6; background: #FAFBFE;
}
.wt-label { font-size: 11px; color: #616161; }
.wt-num { font-size: 24px; font-weight: 800; color: #2E3A8C; line-height: 1.35; }
.wt-luck {
  display: inline-block; font-size: 10px; padding: 2px 8px;
  border-radius: 999px; background: #F4F5F7; color: #9E9E9E;
}
.wt-title { font-size: 9px; color: #B0B4C0; margin-top: 4px; min-height: 12px; line-height: 1.3; }
.tile-ji { background: linear-gradient(180deg, #F2F9F2, #FAFBFE); border-color: #DCEEDC; }
.tile-ji .wt-luck { background: #E8F5E9; color: #2E7D32; }
.tile-ban { background: linear-gradient(180deg, #FFF9EA, #FAFBFE); border-color: #F3E5BB; }
.tile-ban .wt-luck { background: #FFF8E1; color: #B26A00; }
.tile-xiong { background: linear-gradient(180deg, #FFF5F4, #FAFBFE); border-color: #F5D4D0; }
.tile-xiong .wt-luck { background: #FFFBFB; color: #C62828; }
.tile-na { opacity: .75; }
.sancai-pill {
  margin-top: 14px; text-align: center; font-size: 12px;
  color: var(--gold); background: var(--gold-soft);
  border-radius: 999px; padding: 6px 0;
}

/* 顶部入口区分：收藏=金棕♡+数量角标；历史=白底靛蓝；高亮当前所在页 */

/* 激活态 = 页签连体：白底、下角方、桥接块与页面顶栏融为一体 */
.icon-btn { position: relative; }
/* 激活态：圆角白底 + 极淡状态标识（不再用直角连体，与白卡圆角风格统一） */
.icon-btn.on {
  background: #fff; color: var(--primary); font-weight: 700;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(63, 81, 181, .12);
  border: 1px solid #E4E7F0;
}
.icon-btn.on::after { content: none; }
body.pane-open .topbar { padding-bottom: 0; }
/* 页头带：圆角白卡（与名字卡同 16px 圆角），几乎纯白底只留极淡状态标识；
   与顶部品牌行之间保持与「起名/测名切换栏」一致的 10px 间距 */
.pane-topbar {
  background: linear-gradient(180deg, rgba(255,255,255,.96) 0%, rgba(255,255,255,.86) 100%);
  /* 与「起名/测名」切换栏完全同高同位置（切换时不跳动）：
     切换栏 = 10px 上边距 + 6px 内距 + 47px 内容 + 6px 内距 = 65px 高，top 57px */
  height: 65px; box-sizing: border-box;
  padding: 6px 14px;
  margin: 16px 0 16px;             /* 上 16 = 10(切换栏上边距) + 6(切换栏内距)；下 16 同切换栏 */
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(30, 40, 90, .03);
  display: flex; align-items: center;
}
.pane-topbar .back-btn {
  position: static; background: #fff; color: var(--primary);
  border: 1px solid #E4E7F0; padding: 5px 12px; font-size: 12px;
  box-shadow: 0 1px 4px rgba(30, 40, 90, .06);
}
.pane-title {
  font-family: var(--serif); font-size: 21px; font-weight: 800;
  color: #2E3A8C; letter-spacing: 2px;
  display: inline-flex; align-items: center; gap: 8px;
  margin-left: 10px; vertical-align: middle;
}
.pane-title::before {
  content: ''; width: 4px; height: 18px; border-radius: 2px;
  background: linear-gradient(180deg, var(--primary), var(--primary-3));
}
.pane-count {
  margin-left: auto; font-size: 11px; color: var(--gold);
  background: var(--gold-soft); padding: 4px 12px; border-radius: 999px;
  font-weight: 700;
}

/* 小屏头部适配：一行容纳 品牌+配额+收藏+历史 */
@media (max-width: 420px) {
  .topbar { padding: 12px 12px 8px; gap: 6px; }
  .brand { font-size: 15px; letter-spacing: 1px; gap: 6px; }
  .brand-seal { width: 25px; height: 25px; font-size: 13px; border-radius: 6px; }
  .quota-chip { padding: 3px 7px; font-size: 10px; }
  .icon-btn { padding: 6px 8px; font-size: 11px; white-space: nowrap; }
  .fav-entry .fv-n { padding: 1px 5px; font-size: 9px; }
}

/* 日期/时辰控件：单行不换行（并排时不被长文本挤断） */
.date-row { align-items: center; }
.date-row .date-text, .date-row .hour-text {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-size: 14px; min-width: 0;
}
.date-row .date-wrap { flex: 1.35; padding: 12px 12px; }
.date-row .hour-wrap { padding: 12px 12px; }
.date-row .date-icon, .date-row .hour-clear { flex-shrink: 0; }

/* 进人名寓意块（字义卡）：金棕左标 + 正文本义在下 */
/* 寓意行：接在本义之后，左金线 + 淡底，轻量不抢主视觉 */
.char-name-meaning {
  margin-top: 9px; padding: 8px 11px;
  border-left: 3px solid var(--gold); border-radius: 0 8px 8px 0;
  background: rgba(245, 235, 220, .55); color: #5F4A2A;
  font-size: 13px; line-height: 1.75;
}
.cnm-label {
  font-size: 12px; font-weight: 700; color: var(--gold);
  margin-right: 6px;
}
.cnm-label::after { content: '·'; margin-left: 6px; color: #C9B79A; }

/* ==================== UI 精修（2026-11-01 第三轮）==================== */

/* 1) 起名/测名切换栏加强：更大更醒目，作为页面主导航 */
.seg {
  margin: 10px 20px 16px; padding: 6px;
  border-radius: 18px;
  box-shadow: 0 4px 18px rgba(63, 81, 181, .10);
  border: 1px solid #EDEFF6;
}
.seg-item {
  padding: 14px 0; font-size: 16px; letter-spacing: 2px;
  border-radius: 14px;
}
.seg-on { box-shadow: 0 5px 16px rgba(63, 81, 181, .30); }

/* 2) 三组单选统一：同高同圆点同间距 */
.chips { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 8px; }
.chips .chip {
  display: flex; align-items: center; justify-content: center;
  height: 40px; padding: 0 10px; border-radius: 12px;
  font-size: 13px; line-height: 1;
}

/* 3) 风格偏好：等宽 3 列网格（6 个正好 2 行对齐） */
#f-styles { grid-template-columns: repeat(3, 1fr); gap: 9px; }

/* 4) 五行偏好：5 钮通栏等距 */
#f-elements { grid-template-columns: repeat(5, 1fr); gap: 8px; }

/* 5) 日期 / 时辰：等宽等高 */
.date-row { display: flex; gap: 10px; align-items: stretch; }
.date-row .date-wrap,
.date-row .hour-wrap {
  flex: 1 1 0; min-width: 0; height: 46px;
  padding: 0 13px; display: flex; align-items: center;
  border-radius: 12px;
}
.date-row .date-text, .date-row .hour-text { font-size: 14px; }
.date-row .date-icon, .date-row .hour-clear { margin-left: 6px; }

/* 6) 输入框：统一浅描边（不再是透明边框） */
.input, .date-wrap, .hour-wrap {
  border: 1px solid #E3E6F0;
  background: #FCFCFE;
}
.input:focus, .date-wrap:focus-within, .hour-wrap:focus-within {
  border-color: var(--primary-3); background: #fff;
  box-shadow: 0 0 0 3px rgba(63, 81, 181, .08);
}

/* 7) 生成按钮上方多留白，整体透气 */
#btn-generate, #btn-evaluate { margin-top: 22px; }
#form-name .field:last-of-type, #form-evaluate .field:last-of-type { margin-bottom: 4px; }
.btn-primary { padding: 15px 0; font-size: 16px; letter-spacing: 1px; }

/* 8) 轻提示 + 解锁引导 */
#soft-tip {
  position: fixed; left: 50%; top: 76px; transform: translate(-50%, -8px);
  background: rgba(30, 40, 70, .88); color: #fff;
  padding: 9px 18px; border-radius: 999px; font-size: 13px;
  opacity: 0; pointer-events: none; transition: all .22s ease; z-index: 900;
  white-space: nowrap;
}
#soft-tip.show { opacity: 1; transform: translate(-50%, 0); }
#unlock-mask {
  position: fixed; inset: 0; background: rgba(20, 25, 45, .45);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 1000; padding: 24px;
}
#unlock-mask.show { opacity: 1; pointer-events: auto; }
.unlock-card {
  background: #fff; border-radius: 20px; padding: 28px 24px 24px; max-width: 340px; width: 100%;
  text-align: center;
  box-shadow: 0 18px 48px rgba(20, 25, 45, .22);
}
.unlock-title {
  font-family: var(--serif); font-size: 19px; font-weight: 800; color: #2E3A8C;
  margin-bottom: 12px; text-align: center;
}
.unlock-body { font-size: 13px; color: #5A5F6F; line-height: 1.8; text-align: center; }

/* ==================== 生辰分析页精修（2026-11-01）==================== */

/* 1) 五行分布：彩条右端与数字右缘对齐（统一列宽 + 右对齐基线） */
.elem-row { display: grid; grid-template-columns: 20px 1fr 30px; align-items: center; column-gap: 10px; }
.elem-row .elem-name { width: auto; text-align: left; }
.elem-row .elem-track { margin: 0; width: 100%; }
.elem-row .elem-cnt { width: auto; text-align: right; font-variant-numeric: tabular-nums; }

/* 2) 农历卡副标题降字重，与大日期拉开层级 */
.ana-hero-sub { font-weight: 400; opacity: .72; letter-spacing: .3px; font-size: 12px; }
.ana-hero-main { font-weight: 700; }

/* 3) 喜用神/忌神标签圆角统一为 12px（与按钮、chip 一致） */
.fav-tag { border-radius: 12px; padding: 3px 11px; font-size: 12px; }

/* 4) 起名建议项目符号左对齐（悬挂缩进） */
.adv-body {
  padding-left: 7px; text-indent: -7px;
  word-break: break-word;
}

/* 5) 出生季节标签与文字基线对齐 */
.season-head { align-items: baseline; }
.season-tag { display: inline-flex; align-items: center; line-height: 1.5; padding: 3px 12px; border-radius: 12px; }

/* 6) 生辰页各卡片统一上下间距 */
#detail-area > .card { margin: 12px 20px; }
#detail-area > .ana-hero { margin: 4px 20px 12px; }

/* ==================== 候选结果页精修（2026-11-01）==================== */

/* 1) 列表连贯：所有卡片同背景、同左右边距、同内距，TOP1-3 不做特殊盒子 */
#result-list .name-card {
  background: #fff;
  margin: 0 16px 10px;
  padding: 15px 16px 13px;
  border-radius: 16px;
}
#result-list { padding-top: 4px; }
#result-list .name-card:last-of-type { margin-bottom: 16px; }

/* 2) 字形等偏负面提示：浅灰小字，弱于正面释义 */
#result-list .nc-glyph {
  margin-top: 5px; font-size: 11px; color: #A9AEBB; font-weight: 400;
}
#result-list .nc-glyph::before {
  content: '字形提示 '; color: #C4C8D2;
}

/* 3) 非 TOP 的浅灰序号：与金银铜徽章同列同位、同字号，形成层级 */
.rank-no {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; height: 19px; padding: 0 6px;
  font-size: 11px; font-weight: 700; letter-spacing: .5px;
  color: #C2C6D2; font-variant-numeric: tabular-nums;
}
.rank {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; height: 19px; padding: 0 6px; box-sizing: border-box;
}

/* 4) 基线与间距统一：标题行、描述行、标签行节奏一致 */
#result-list .nc-top { align-items: baseline; }
#result-list .nc-left { align-items: baseline; gap: 8px; }
#result-list .nc-name { font-size: 22px; line-height: 1.3; }
#result-list .nc-line { margin-top: 7px; line-height: 1.65; }
#result-list .nc-imp { margin-top: 4px; line-height: 1.5; }
#result-list .nc-tags { margin-top: 10px; gap: 6px; align-items: center; }
#result-list .tag { line-height: 1.5; }

/* 结果卡左标记列 + 顶部行：固定宽度、水平居中、三元素垂直居中对齐 */
#result-list .nc-top { align-items: center; }
#result-list .nc-left { align-items: center; gap: 10px; min-width: 0; }

/* 序号与 TOP 徽章：统一固定宽 46px、高 20px，内容不被撑开（宽度不随文字变化） */
#result-list .rank,
#result-list .rank-no {
  width: 46px; height: 20px; flex: 0 0 46px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0; box-sizing: border-box;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0;
  line-height: 1;
}
#result-list .rank-no { color: #C2C6D2; font-variant-numeric: tabular-nums; }

/* 名字与评分卡同一水平线垂直居中 */
#result-list .nc-name { line-height: 1.15; }
#result-list .nc-right { display: flex; align-items: center; }
#result-list .score-badge { align-items: center; }

/* 字形提示：暖灰细线 + 浅灰小字（与第一印象辅助文字统一，去掉红色警示观感） */
.glyph-note {
  font-size: 12px; line-height: 1.7;
  color: #8F96A5;
  padding: 3px 0 3px 11px;
  border-left: 2px solid #E6E2DA;
  margin-bottom: 6px;
  background: transparent;
}
.glyph-note:last-child { margin-bottom: 0; }

/* 第一印象证据行：悬挂缩进（缩进量 = 「· 」实际宽度，实测 7px），换行后与首行正文左缘对齐 */
.imp-ev {
  display: block;
  padding-left: 7px; text-indent: -7px;
  font-size: 13px; line-height: 1.7; color: #5A5F6F;
  margin-top: 3px;
}
.imp-ev:first-of-type { margin-top: 9px; }

/* ==================== 收藏页收尾精修（2026-11-01）==================== */

/* 1) 右上角数量徽章：底色更柔、字色更淡，不与标题抢视觉 */
#favs-area .pane-count {
  background: #F7F4EE; color: #A89579;
  font-weight: 600; font-size: 11px; padding: 3px 10px;
}

/* 2) 收藏卡：极淡 hover 边框（1px），提示可点击；触屏用 :active 同效 */
.fav-card {
  border: 1px solid #EDEFF6;
  border-radius: 14px;                     /* 4) 圆角 12 → 14px，更柔和 */
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
@media (hover: hover) {
  .fav-card:hover {
    border-color: #D5DBEC;
    background: #FAFBFF;                       /* 极淡浅蓝底，悬浮反馈 */
    box-shadow: 0 3px 12px rgba(63, 81, 181, .07);
  }
}
.fav-card:active {
  border-color: #C9D0E4;
  background: #F4F6FF;                         /* 按下时浅蓝再深一阶 */
  box-shadow: 0 3px 12px rgba(63, 81, 181, .09);
}

/* 3) 卡片底部五行行：再浅半阶，视觉重心落在名字上 */
.fav-card .fc-wx { color: #B0A48F; }

/* 名字保持最强对比，作为卡片视觉核心 */
.fav-card .fc-char { color: #2E3A8C; }
.fav-card .fc-py { color: #B6BAC6; }

/* 收藏页空底部：极淡品牌水印（印章标 + 衬线品牌名，强化辨识但不抢内容） */
#favs-area::after {
  content: '名 · 哇又起了个好名字';
  display: block;
  text-align: center;
  margin: 26px 0 6px;
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 3px;
  color: #C9CEDB;
  opacity: .55;
  user-select: none;
}
#favs-area .fav-grid:empty + * { margin-top: 0; }

/* 收藏卡内容不溢出网格（长拼音原为 nowrap 会撑破卡片右缘 6px） */
#favs-area .fav-card { overflow: hidden; box-sizing: border-box; }
#favs-area .fc-cols { overflow: hidden; }
#favs-area .fc-col { min-width: 0; }
#favs-area .fc-py,
#favs-area .fc-char,
#favs-area .fc-wx {
  max-width: 100%; overflow: hidden;
}
#favs-area .fc-py { text-overflow: ellipsis; }

/* ==================== 历史页对齐收藏页（2026-11-01）==================== */

/* 列表容器：与收藏页同样 16px 左右留白 */
#history-area { padding: 0 16px; }

/* 历史卡：16px 边距、16px 圆角、极淡投影、hover 浅蓝反馈 —— 与 .fav-card 同规格 */
#history-area .hist-item {
  margin: 0 0 10px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid #EDEFF6;
  background: #fff;
  box-shadow: 0 1px 2px rgba(30, 40, 90, .03);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
@media (hover: hover) {
  #history-area .hist-item:hover {
    border-color: #D5DBEC;
    background: #FAFBFF;
    box-shadow: 0 3px 12px rgba(63, 81, 181, .07);
  }
}
#history-area .hist-item:active {
  border-color: #C9D0E4;
  background: #F4F6FF;
}

/* 卡片内部：字号 / 颜色 / 圆角与收藏页统一 */
#history-area .hist-kind {
  border-radius: 12px; padding: 2px 9px; font-size: 10.5px; letter-spacing: .3px;
}
#history-area .hist-title { font-family: var(--serif); font-size: 14px; font-weight: 700; }
#history-area .hist-time { font-size: 11px; color: #B6BAC6; }
#history-area .hist-names {
  margin-top: 7px; font-family: var(--serif);
  font-size: 15px; font-weight: 700; color: #2E3A8C;
  line-height: 1.5; letter-spacing: .5px;
}

/* 底部品牌水印：与收藏页同款 */
#history-area::after {
  content: '名 · 哇又起了个好名字';
  display: block; text-align: center;
  margin: 26px 0 6px;
  font-family: var(--serif); font-size: 12px;
  letter-spacing: 3px; color: #C9CEDB; opacity: .55;
  user-select: none;
}

/* 历史卡性别：右下角轻量图标签（符号 + 文字，低饱和，不铺底色） */
#history-area .hist-bottom {
  display: flex; align-items: flex-end; gap: 10px; margin-top: 7px;
}
#history-area .hist-bottom .hist-names { flex: 1; min-width: 0; margin-top: 0; }
#history-area .hist-gender {
  display: inline-flex; align-items: center; gap: 3px;
  flex-shrink: 0; font-size: 11px; font-weight: 600;
  padding: 1px 8px; border-radius: 999px;
  background: transparent; letter-spacing: .3px;
}
#history-area .hist-gender i {
  font-style: normal; font-size: 13px; line-height: 1; font-weight: 700;
}
#history-area .g-m { color: #5C6BC0; background: #F3F5FD; }
#history-area .g-f { color: #C8788A; background: #FDF3F5; }

/* 详情页性别标识（与历史卡同色系，在深色英雄区内用半透明白底） */
.detail-gender {
  display: inline-block; margin-left: 8px; padding: 1px 9px;
  border-radius: 999px; font-size: 11px; font-weight: 700;
  background: rgba(255, 255, 255, .22); color: #fff;
  vertical-align: 1px;
}

/* 详情页：逐字注音对齐（拼音在上、姓名在下，同列对齐） */
.name-stack {
  display: flex; justify-content: center; align-items: flex-end;
  gap: 10px; margin-top: 6px;
}
.ns-col { display: flex; flex-direction: column; align-items: center; }
.ns-py {
  font-size: 12px; line-height: 1; letter-spacing: 0;
  color: rgba(255, 255, 255, .72); margin-bottom: 6px;
  white-space: nowrap;
}
.ns-char {
  font-family: var(--serif); font-size: 34px; font-weight: 800;
  line-height: 1.15; letter-spacing: 0; color: #fff;
}

/* 性别独立成行（姓名下方、综合分上方），与历史卡同色系但用半透明白底 */
.detail-gender {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 10px; padding: 2px 11px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .5px;
  background: rgba(255, 255, 255, .18); color: #fff;
}
.detail-gender i { font-style: normal; font-size: 12.5px; line-height: 1; font-weight: 700; }

/* 详情页姓名块：方案A——主标大气、副标轻盈、性别极简角标 */
.name-block { position: relative; display: inline-block; margin-top: 8px; }
#detail-area .detail-name {
  font-family: var(--serif);
  font-size: 38px; font-weight: 800;
  letter-spacing: 10px; text-indent: 10px;   /* 字距左右对称 */
  line-height: 1.2; color: #fff;
}
#detail-area .detail-py {
  margin-top: 8px;
  font-size: 11px; font-weight: 500;
  letter-spacing: 3.5px; text-indent: 3.5px;
  color: rgba(255, 255, 255, .62);
}
/* 性别：名字右上角极简圆角标 */
.name-gender {
  position: absolute; top: -4px; right: -13px;
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; line-height: 1;
  background: rgba(255, 255, 255, .92);
}
.name-gender.g-m { color: #4A5AB5; }
.name-gender.g-f { color: #C8788A; }

/* 方案C：姓名卡容器 —— 半透明白圆角卡承载「拼音/姓名/性别」，与页面白卡语言呼应 */
.name-card-box {
  position: relative;
  margin: 14px auto 6px;
  padding: 16px 28px 14px;
  width: fit-content; min-width: 200px; max-width: 100%;
  text-align: center;
  border-radius: 18px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 8px 24px rgba(20, 30, 70, .14);
}
.ncb-py {
  font-size: 10.5px; font-weight: 600;
  letter-spacing: 3px; text-indent: 3px;
  color: #A8AFC2;
}
.ncb-name {
  margin-top: 3px;
  font-family: var(--serif);
  font-size: 34px; font-weight: 800;
  letter-spacing: 8px; text-indent: 8px;
  line-height: 1.25; color: #2E3A8C;
}
.ncb-gender {
  position: absolute; right: 12px; bottom: 11px;
  display: inline-flex; align-items: center; gap: 2px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .3px;
  padding: 2px 8px; border-radius: 999px;
}
.ncb-gender.g-m { color: #5C6BC0; background: #F1F3FC; }
.ncb-gender.g-f { color: #C8788A; background: #FDF3F5; }

/* 卡内姓名覆盖旧的白色大标题样式（卡内需深色字） */
.name-card-box .ncb-name { color: #2E3A8C !important; }

/* 详情页姓名：字在上、逐字拼音在下（逐字对齐）；性别只留图标独立成行 */
.name-stack { display: flex; justify-content: center; align-items: flex-start; gap: 12px; margin-top: 6px; }
.ns-col { display: flex; flex-direction: column; align-items: center; }
.ns-char {
  font-family: var(--serif); font-size: 36px; font-weight: 800;
  line-height: 1.15; color: #fff;
}
.ns-py {
  margin-bottom: 6px; font-size: 11px; line-height: 1;
  color: rgba(255, 255, 255, .66); white-space: nowrap;
}
/* 性别图标：只有 ♂/♀，独立一行，半透明白底小圆 */
.detail-gender {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; margin-top: 10px;
  border-radius: 50%; background: rgba(255, 255, 255, .20);
  font-size: 14px; font-weight: 700; line-height: 1;
}
.detail-gender.g-m { color: #C5CBFF; }
.detail-gender.g-f { color: #FFC9D4; }

/* ==================== 交互反馈补充（2026-11-01）==================== */

/* 1) 候选结果卡：悬浮极淡浅蓝（与收藏卡一致） */
@media (hover: hover) {
  #result-list .name-card:hover {
    background: #FAFBFF;
    box-shadow: 0 3px 14px rgba(63, 81, 181, .09);
  }
  /* 顶部「收藏」入口：金棕系色调反馈 */
  #nav-favs:hover {
    background: #FFF9EC; color: #8D6E3F;
    box-shadow: 0 2px 10px rgba(141, 110, 63, .18);
  }
  /* 顶部「历史」入口：靛蓝系色调反馈 */
  #nav-history:hover {
    background: #F2F4FD; color: var(--primary);
    box-shadow: 0 2px 10px rgba(63, 81, 181, .16);
  }
}
/* 已激活的页签保持自身高亮，不被 hover 覆盖 */
@media (hover: hover) {
  #nav-favs.on:hover { background: #fff; color: var(--primary); }
  #nav-history.on:hover { background: #fff; color: var(--primary); }
}

/* 收藏卡悬浮反馈按性别区分：男宝极淡浅蓝 / 女宝极淡浅粉 / 未指定中性浅蓝 */
@media (hover: hover) {
  #favs-area .fav-card:hover {
    background: #FAFBFF; border-color: #D5DBEC;
  }
  #favs-area .fav-card.fav-m:hover {
    background: #F7F9FF; border-color: #D3DCF2;
    box-shadow: 0 3px 12px rgba(92, 107, 192, .10);
  }
  #favs-area .fav-card.fav-f:hover {
    background: #FFFAFB; border-color: #F2DCE2;
    box-shadow: 0 3px 12px rgba(200, 120, 138, .10);
  }
}
/* 按下态同样按性别 */
#favs-area .fav-card.fav-m:active { background: #EFF3FF; }
#favs-area .fav-card.fav-f:active { background: #FFF3F6; }

/* ==================== 出生日辰控件重设计（2026-11-03）====================
   原为两块灰底框 + ▾ 箭头，扁平无层次；改为白底描边卡片 + 前置图标胶囊 +
   分段分隔 + 聚焦光晕，与输入框体系统一。 */

.date-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: stretch;
}

.date-row .date-wrap,
.date-row .hour-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: none;
  width: 100%;
  height: 46px;
  padding: 0 8px 0 8px;
  box-sizing: border-box;
  background: #FFFFFF;
  border: 1px solid #E3E6F0;
  border-radius: 12px;
  transition: border-color .16s ease, box-shadow .16s ease;
}

.date-row .date-wrap:focus-within,
.date-row .hour-wrap:focus-within {
  border-color: var(--primary-3);
  box-shadow: 0 0 0 3px rgba(63, 81, 181, .09);
}

/* 前置图标胶囊：日历 / 时钟 */
.date-row .date-wrap::before,
.date-row .hour-wrap::before {
  content: '';
  width: 20px;
  height: 20px;
  margin-right: 7px;
  flex-shrink: 0;
  border-radius: 6px;
  background: #EEF0FA;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 12px;
}
.date-row .date-wrap::before {
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233F51B5' stroke-width='2' stroke-linecap='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M8 3v4M16 3v4M3 10h18'/%3E%3C/svg%3E");
}
.date-row .hour-wrap::before {
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233F51B5' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E");
}

.date-row .date-text,
.date-row .hour-text {
  flex: 1 1 auto;
  min-width: 0;
  /* 日期文本 84px + 图标 24px + 间距/padding 约 40px = 148px，恰好卡在临界值会触发省略号；
     收紧图标与间距后留出余量 */
  font-size: 13.5px;
  font-weight: 600;
  color: #2E3A8C;
  white-space: nowrap;
  overflow: visible;
  letter-spacing: 0;
}
.date-row .date-empty,
.date-row .hour-empty {
  color: #B6BAC6;
  font-weight: 400;
}

/* 右侧箭头改为细 chevron，弱化存在感 */
.date-row .date-icon {
  margin-left: 4px;
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  border-right: 1.5px solid #C5CAE9;
  border-bottom: 1.5px solid #C5CAE9;
  transform: rotate(-45deg) translateY(-1px);
  font-size: 0;
  color: transparent;
}

/* 清除按钮：小圆点样式 */
.date-row .date-clear {
  margin-left: 6px;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #EEF0FA;
  color: #8C97D6;
  font-size: 11px;
  line-height: 16px;
  text-align: center;
}

/* ==================== 出生日辰交互优化（2026-11-03）==================== */

/* 清除按钮：标签行右侧小圆点（原来 DOM 缺失，选了日期无法清除） */
.field label .date-clear {
  float: right;
  width: 20px;
  height: 20px;
  margin-top: -2px;
  border: none;
  border-radius: 50%;
  background: #EEF0FA;
  color: #7C86C4;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: background .15s ease, color .15s ease;
}
.field label .date-clear:hover { background: #E3E6F6; color: var(--primary); }
.field label .date-clear.hidden { display: none; }

/* 时辰未选时：给一个更明确的引导文案样式 */
.date-row .hour-empty {
  color: #B6BAC6;
  font-weight: 500;
}

/* 日期已选：主色加粗，视觉上「已生效」 */
.date-row .date-text:not(.date-empty),
.date-row .hour-text:not(.hour-empty) {
  color: #2E3A8C;
  font-weight: 700;
}

/* 时辰原生 select 层：覆盖整个卡片保证点击热区 */
.date-row .hour-native {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  border: none;
  cursor: pointer;
  appearance: none;
}

/* ==================== 选字查字（2026-11-17）==================== */

/* 表单页入口卡 */
.charlib-entry {
  display: flex; align-items: center; gap: 12px;
  width: calc(100% - 40px); margin: 0 20px; padding: 12px 14px;
  background: #fff; border: 1px solid #EDEFF6; border-radius: 16px;
  box-shadow: var(--shadow-card); cursor: pointer; text-align: left;
  font: inherit; color: inherit;
  transition: border-color .18s ease, box-shadow .18s ease, transform .12s ease;
}
.charlib-entry:active { transform: scale(.99); }
@media (hover: hover) {
  .charlib-entry:hover {
    border-color: #D5DBEC; background: #FAFBFF;
    box-shadow: 0 3px 12px rgba(63, 81, 181, .08);
  }
}
.cl-entry-seal {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #C4473E, #A63530); color: #fff;
  font-family: var(--serif); font-size: 19px; font-weight: 700;
  box-shadow: 0 2px 7px rgba(166, 53, 48, .28);
}
.cl-entry-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cl-entry-title {
  font-family: var(--serif); font-size: 15px; font-weight: 700;
  color: #2E3A8C; letter-spacing: 1px;
}
.cl-entry-sub {
  font-size: 11px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cl-entry-arrow { flex-shrink: 0; font-size: 20px; line-height: 1; color: #B0B4C0; }

/* 字库页 */
#charlib-area { padding: 0 16px 28px; }
.cl-search {
  display: flex; align-items: center; gap: 8px;
  height: 46px; padding: 0 12px; margin-bottom: 10px;
  background: #fff; border: 1px solid #E4E7F0; border-radius: 14px;
  box-shadow: var(--shadow-card);
}
.cl-search-icon { font-size: 18px; line-height: 1; color: #B0B4C0; }
.cl-search-input {
  flex: 1; min-width: 0; border: none; outline: none; background: transparent;
  font: inherit; font-size: 14px; color: var(--ink);
}
.cl-search-input::placeholder { color: #B6BAC6; }
.cl-clear {
  width: 22px; height: 22px; padding: 0; flex-shrink: 0;
  border: none; border-radius: 50%; background: #F1F3F8; color: #8F96A5;
  font-size: 11px; line-height: 1; cursor: pointer;
}

/* 横向滚动筛选条：不复用表单的 grid chips */
.cl-filters {
  display: flex; align-items: center; gap: 7px; overflow-x: auto;
  padding: 1px 2px 10px; scrollbar-width: none;
}
.cl-filters::-webkit-scrollbar { display: none; }
.cl-chip {
  flex: 0 0 auto; height: 30px; padding: 0 13px; border-radius: 999px;
  border: 1px solid #E4E7F0; background: #fff; color: #616161;
  font-size: 12px; cursor: pointer; white-space: nowrap;
  transition: border-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.cl-chip.on {
  border-color: var(--primary); color: var(--primary); font-weight: 700;
  box-shadow: 0 2px 8px rgba(63, 81, 181, .12);
}
.cl-divider { flex: 0 0 auto; width: 1px; height: 16px; margin: 0 1px; background: #E8EAF6; }

.cl-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 2px 2px 10px; font-size: 11px; color: var(--muted);
}
.cl-sort {
  border: none; background: #EEF0FA; color: var(--primary);
  font-size: 11px; padding: 5px 11px; border-radius: 999px; cursor: pointer;
}
.cl-legend {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  padding: 0 2px 8px; font-size: 10px; color: var(--muted);
}
.cl-legend-item { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.cl-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.cl-dot.m { background: rgba(63, 81, 181, .55); }
.cl-dot.f { background: rgba(200, 120, 138, .55); }
.cl-dot.n { background: rgba(176, 138, 79, .45); }
.cl-legend-note { flex-basis: 100%; color: #B6BAC6; line-height: 1.5; }

/* 6 列字网格 */
.cl-grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px;
  min-height: 80px; padding: 8px 6px;
  background: #fff; border-radius: 16px; box-shadow: var(--shadow-card);
}
.cl-cell {
  position: relative; height: 62px; padding: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; border: none; border-radius: 10px;
  background: var(--cl-bg, transparent);
  font: inherit; cursor: pointer; transition: background .12s ease;
}
.cl-cell:active { background: #EEF0FA; }
@media (hover: hover) { .cl-cell:hover { background: #FAFBFF; } }
.cl-char {
  font-family: var(--serif); font-size: 22px; font-weight: 700;
  color: var(--ink); line-height: 1.1;
}
.cl-stroke { font-size: 9px; line-height: 1; color: #B0B4C0; }
.cl-lv {
  position: absolute; top: 4px; right: 5px;
  font-size: 8px; line-height: 1; color: #C2C6D2;
}
.cl-lv.lv2 { color: var(--gold); }
.cl-loading {
  grid-column: 1 / -1; padding: 28px 0;
  text-align: center; font-size: 12px; color: var(--muted);
}
.cl-empty { padding: 54px 24px 60px; text-align: center; }
.cl-empty-icon { font-size: 34px; line-height: 1; color: #C5CAE9; }
.cl-empty-title { margin-top: 8px; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.cl-empty-desc { margin-top: 4px; font-size: 12px; color: var(--muted); }
.cl-more {
  display: block; width: 100%; margin-top: 10px; padding: 12px;
  border: 1px solid #E4E7F0; border-radius: 12px; background: #fff;
  color: var(--primary); font-size: 12px; font-weight: 600; cursor: pointer;
  box-shadow: 0 1px 2px rgba(30, 40, 90, .03);
}
.cl-more:active { background: #EEF0FA; }
.cl-more:disabled { opacity: .55; cursor: default; }

/* 字详情底部弹层 */
.cl-sheet-wrap { position: fixed; inset: 0; z-index: 120; }
.cl-mask {
  position: absolute; inset: 0; background: rgba(20, 24, 40, .44);
  animation: clFade .18s ease-out;
}
.cl-panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-height: 84vh; overflow-y: auto;
  padding: 10px 22px calc(24px + env(safe-area-inset-bottom));
  background: #fff; border-radius: 22px 22px 0 0;
  box-shadow: 0 -12px 36px rgba(20, 30, 60, .18);
  animation: clUp .22s ease-out;
}
@keyframes clFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes clUp { from { transform: translateY(24px); opacity: .4; } to { transform: none; opacity: 1; } }
.cl-panel-loading { padding: 48px 0; text-align: center; font-size: 13px; color: var(--muted); }
.cl-handle { width: 36px; height: 4px; border-radius: 2px; background: #E4E7F0; margin: 0 auto 16px; }
.cl-sheet-head { display: flex; align-items: center; gap: 18px; }
.cl-sheet-char {
  font-family: var(--serif); font-size: 58px; font-weight: 700;
  color: #2E3A8C; line-height: 1;
}
.cl-sheet-py { font-size: 16px; color: var(--primary); letter-spacing: 1px; }
.cl-sheet-py span { font-size: 11px; color: var(--muted); margin-left: 6px; }
.cl-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cl-badge {
  font-size: 10px; padding: 3px 8px; border-radius: 6px;
  background: #F4F5F7; color: #757575;
}
.cl-badge.lv1 { background: #E8F5E9; color: #2E7D32; }
.cl-badge.lv2 { background: #FFF8E1; color: #B26A00; }
.cl-badge.rec { background: var(--gold-soft); color: var(--gold); }
.cl-stats {
  display: flex; align-items: center;
  margin: 18px 0 4px; padding: 14px 0;
  background: #FAFBFE; border-radius: 14px;
}
.cl-stat { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.cl-stat b { font-size: 20px; font-weight: 800; color: var(--ink); line-height: 1.2; }
.cl-stat span { font-size: 10px; color: var(--muted); }
.cl-section { margin-top: 18px; }
.cl-label { font-size: 12px; font-weight: 700; color: var(--primary); margin-bottom: 6px; }
.cl-body { font-size: 14px; color: var(--ink-2); line-height: 1.75; text-align: justify; text-wrap: pretty; }
.cl-note { font-size: 13px; color: #616161; line-height: 1.8; }
.cl-sheet-actions { display: flex; gap: 10px; margin-top: 22px; }
.cl-copy, .cl-close {
  flex: 1; padding: 12px; border-radius: 12px;
  font-size: 13px; font-weight: 600; cursor: pointer;
}
.cl-copy { border: 1px solid #C5CAE9; background: #fff; color: var(--primary); }
.cl-copy:active { background: #EEF0FA; }
.cl-close {
  border: none; color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 4px 14px rgba(63, 81, 181, .24);
}
.cl-close:active { transform: scale(.985); }

body.cl-lock { overflow: hidden; }

/* 字库滚动时：置顶栏近实底 + 模糊，避免密集字格从半透明栏后透出 */
#charlib-area .pane-topbar {
  z-index: 7;
  background: rgba(255, 255, 255, .98);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

@media (max-width: 360px) {
  .charlib-entry { width: calc(100% - 32px); margin: 0 16px; padding: 11px 12px; }
  .cl-entry-seal { width: 34px; height: 34px; font-size: 17px; }
  .cl-entry-title { font-size: 14px; }
  .cl-entry-sub { font-size: 10px; }
  #charlib-area { padding: 0 12px 24px; }
  .cl-grid { gap: 2px; padding: 7px 4px; }
  .cl-cell { height: 56px; }
  .cl-char { font-size: 20px; }
  .cl-sheet-char { font-size: 50px; }
}

/* ==================== 名字期望 / 决赛圈 / 定名报告（2026-11-17）==================== */

#f-wishes { grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tag-wish { background: var(--gold-soft); color: var(--gold); }

/* 名字由来 / 期望标签 */
.origin-card { border-left: 4px solid #C5A46D; }
.origin-text { font-size: 14px; line-height: 1.85; color: #424242; }
.origin-note { margin-top: 8px; font-size: 12px; color: var(--gold); }
.wish-line { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.wish-tag {
  display: inline-block; font-size: 10px; padding: 2px 8px;
  border-radius: 999px; background: #F4F5F7; color: #9E9E9E;
}
.wish-tag.on { background: var(--gold-soft); color: var(--gold); font-weight: 700; }

/* 详情页操作行 */
.detail-actions {
  display: flex; gap: 10px; margin: 0 20px 12px;
}
.detail-actions .btn-ghost { flex: 1; padding: 10px; font-size: 12px; }
.detail-actions .btn-ghost.on { background: #EEF0FA; border-color: #C5CAE9; color: var(--primary); }

/* 寓意优先：结果页只保留轻量标识，不展示技术加权说明 */
.result-mode { padding: 0 16px 2px; }
.mode-badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 10px; font-weight: 600; color: var(--gold);
  background: var(--gold-soft);
}

/* 结果卡：收藏 + 决赛圈按钮同组靠右 */
.nc-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.nc-actions .nc-fav { margin-left: 0; }
.cmp-btn {
  width: 26px; height: 26px; padding: 0; flex-shrink: 0;
  border: 1px solid #E4E7F0; border-radius: 50%; background: #fff;
  color: #7C86C4; font-size: 11px; font-weight: 700; line-height: 1;
  cursor: pointer; transition: all .18s ease;
}
.cmp-btn.on { background: #EEF0FA; border-color: #C5CAE9; color: var(--primary); }

/* 决赛圈浮动条 */
.final-bar {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%);
  z-index: 80; display: flex; align-items: center; gap: 10px;
  padding: 8px 10px 8px 16px; border-radius: 999px;
  background: rgba(30, 40, 70, .92); color: #fff;
  box-shadow: 0 8px 24px rgba(20, 30, 60, .28);
}
.fb-text { font-size: 12px; letter-spacing: .5px; white-space: nowrap; }
.fb-btn {
  border: none; border-radius: 999px; padding: 7px 14px;
  background: #fff; color: var(--primary); font-size: 12px; font-weight: 700; cursor: pointer;
}
body.has-final-bar { padding-bottom: 84px; }

/* 决赛圈对比 */
#compare-area { padding: 0 16px 28px; }
/* 对比表格/结论与名字头卡、名字由来卡保持同宽；用底色+左色条区分结论，不靠缩窄 */
#compare-area > .cmp-table,
#compare-area > .cmp-conclusion,
#compare-area > .cmp-empty {
  margin: 0 0 10px;
}
#compare-area > .cmp-conclusion {
  background: linear-gradient(180deg, #FAFBFF, #fff);
  border-left: 4px solid var(--primary-3);
}
.cmp-mini-list { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.cmp-mini {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px; background: #FAFBFE; border-radius: 10px;
  font-family: var(--serif); font-size: 14px; color: #2E3A8C;
}
.cmp-empty { padding: 12px 10px 16px; }
.cmp-heads {
  display: grid; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr));
  gap: 8px; margin-bottom: 10px;
}
.cmp-head {
  position: relative; text-align: center; padding: 14px 6px 12px;
  background: #fff; border: 1px solid #EDEFF6; border-radius: 14px;
  box-shadow: var(--shadow-card);
}
.cmp-head.best {
  border-color: #D9C08A;
  background: linear-gradient(180deg, #FFFDF8, #fff);
}
.cmp-name {
  font-family: var(--serif); font-size: 18px; font-weight: 800;
  color: #2E3A8C; letter-spacing: 1px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.cmp-py {
  margin-top: 2px; font-size: 9px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cmp-head-total { margin-top: 7px; font-size: 22px; font-weight: 800; line-height: 1.1; color: var(--ink); }
.cmp-head-total small { margin-left: 2px; font-size: 9px; font-weight: 400; color: var(--muted); }
.cmp-best {
  position: absolute; top: -7px; left: 50%; transform: translateX(-50%);
  padding: 2px 7px; border-radius: 999px; white-space: nowrap;
  background: linear-gradient(135deg, #E8C15A, #C29A3A); color: #fff;
  font-size: 9px; font-weight: 700; box-shadow: 0 2px 6px rgba(180, 140, 50, .3);
}
.cmp-table { padding: 8px 10px; }
.cmp-row {
  display: grid; grid-template-columns: 66px repeat(var(--n, 2), minmax(0, 1fr));
  align-items: center; gap: 4px; padding: 7px 0; border-bottom: 1px solid #F4F5F9;
}
.cmp-row:last-child { border-bottom: none; }
.cmp-label { display: flex; flex-direction: column; font-size: 11px; line-height: 1.25; color: #5A5F6F; }
.cmp-label span { font-size: 8px; color: #B6BAC6; }
.cmp-val {
  padding: 3px 0; border-radius: 6px; text-align: center;
  font-size: 12px; font-weight: 700; color: #3A3F51;
  font-variant-numeric: tabular-nums;
}
.cmp-val.best { background: #EEF0FA; color: #2E3A8C; box-shadow: inset 0 0 0 1px #DDE2F5; }
.cmp-conclusion-text {
  font-size: 13px; line-height: 1.8; color: #424242;
  text-align: justify; text-wrap: pretty;
}
.cmp-origins { display: flex; flex-direction: column; gap: 10px; }
.cmp-origin { margin: 0; }
.cmp-origin-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cmp-origin-name { font-family: var(--serif); font-size: 16px; font-weight: 800; color: #2E3A8C; }
.cmp-origin-head .wish-line { margin-top: 0; }
.cmp-origin-text {
  margin-top: 7px; font-size: 12.5px; line-height: 1.75; color: #5A5F6F;
  text-align: justify; text-wrap: pretty;
}
.cmp-origin-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.cmp-origin-actions .btn-ghost { flex: 1; min-width: 88px; padding: 9px; font-size: 12px; }
.cmp-report-btn { flex: 1.4 !important; min-width: 118px !important; padding: 9px !important; font-size: 12px !important; }
.cmp-remove {
  border: none; background: transparent; color: #B0B4C0;
  font-size: 11px; cursor: pointer; padding: 4px; flex-shrink: 0;
}
.cmp-foot { margin-top: 14px; text-align: center; }
.cmp-clear { border: none; background: transparent; color: #B0B4C0; font-size: 11px; cursor: pointer; }

/* 定名报告 */
#report-area { padding: 0 16px 28px; }
.report-sheet {
  padding: 22px 18px 18px; background: #fff; border-radius: 18px;
  box-shadow: var(--shadow-card); overflow: hidden;
}
.report-cover { padding-bottom: 18px; border-bottom: 1px solid #F0F1F5; text-align: center; }
.report-brand {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--serif); font-size: 13px; font-weight: 700;
  color: #2E3A8C; letter-spacing: 1px;
}
.report-kicker { margin-top: 12px; font-size: 10px; letter-spacing: 4px; color: var(--gold); }
.report-name {
  margin-top: 8px; font-family: var(--serif); font-size: 40px; font-weight: 800;
  line-height: 1.2; letter-spacing: 6px; text-indent: 6px; color: #2E3A8C;
}
.report-py { margin-top: 4px; font-size: 12px; letter-spacing: 2px; color: #8A93A8; }
.report-cover-meta { margin-top: 6px; font-size: 11px; color: var(--muted); }
.report-total { margin-top: 10px; font-size: 30px; font-weight: 800; line-height: 1; color: #2E3A8C; }
.report-total small { margin-left: 4px; font-size: 10px; font-weight: 400; color: var(--muted); }
.report-section { padding: 16px 0; border-bottom: 1px solid #F4F5F9; }
.report-section:last-of-type { border-bottom: none; }
.report-section-title {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 8px; font-size: 13px; font-weight: 700; color: var(--primary);
}
.report-section-title::before {
  content: ''; width: 3px; height: 13px; border-radius: 2px;
  background: linear-gradient(180deg, var(--primary), var(--primary-3));
}
.report-origin { font-size: 13.5px; line-height: 1.85; color: #424242; text-align: justify; text-wrap: pretty; }
.report-note { margin-top: 5px; font-size: 11px; line-height: 1.7; color: #8F96A5; }
.report-classic-src { margin-bottom: 6px; font-size: 12px; color: var(--gold); }
.report-classic-verse {
  padding: 8px 0 8px 12px; border-left: 3px solid #E8D9BE;
  background: #FFFDF8; font-family: var(--serif); font-size: 15px;
  line-height: 1.9; color: #3E3325;
}
.report-classic-verse em { padding: 0 2px; background: #FFF3DC; color: var(--gold); font-style: normal; font-weight: 800; }
.report-rare { font-size: 13px; color: #424242; }
.report-rare b { font-size: 20px; color: #2E3A8C; }
.report-sheet .char-item { margin-bottom: 8px; }
.report-sheet .row { padding: 5px 0; }
.report-sheet .wuge-tiles { gap: 4px; }
.report-sheet .wuge-tile { padding: 9px 1px 8px; }
.report-sheet .wt-num { font-size: 20px; }
.report-sheet .wt-title { display: none; }
.report-footer {
  margin-top: 14px; padding-top: 12px; border-top: 1px solid #F0F1F5;
  text-align: center; font-size: 10px; line-height: 1.8; color: #B6BAC6;
}
.report-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.report-actions-row { display: flex; gap: 8px; }
.report-actions-row .btn-ghost { flex: 1; padding: 10px; font-size: 12px; }

/* 长图预览层 */
.report-img-mask {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(20, 24, 40, .62);
}
.report-img-card {
  display: flex; flex-direction: column; gap: 10px;
  width: 100%; max-width: 420px; max-height: 92vh;
  padding: 14px; background: #fff; border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .25);
}
.report-img-title { text-align: center; font-size: 14px; font-weight: 700; color: #2E3A8C; }
.report-img-preview {
  width: 100%; max-height: 70vh; object-fit: contain;
  border-radius: 10px; background: #F6F7FB;
}
.report-img-hint { text-align: center; font-size: 11px; color: var(--muted); }
.report-img-download { display: block; text-align: center; text-decoration: none; }

/* 打印备用：只保留报告主体 */
@media print {
  @page { margin: 12mm; }
  html, body { background: #fff !important; }
  body { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #view-gate, #view-main > .topbar, #view-main > .foot,
  #loading, #soft-tip, #unlock-mask, #final-bar, .report-img-mask,
  .report-actions, .pane-topbar, #charlib-area, #compare-area,
  #detail-area, #result-area, #history-area, #favs-area, #view-form {
    display: none !important;
  }
  #app { max-width: none; padding: 0; }
  #view-main { display: block !important; }
  #report-area { display: block !important; padding: 0; }
  .report-sheet {
    padding: 0; border: none; border-radius: 0; box-shadow: none;
  }
  .report-section, .card, .char-item { break-inside: avoid; }
  .report-sheet .card { box-shadow: none; }
}
