/* 家庭管理：顶部家庭名 + 加入码，四个标签；孩子卡片 + 右侧抽屉（新建 / 绑定）。同一排按钮同高同字号；控件文字不换行。 */
.fm-main { width: 100%; max-width: 960px; margin: 0 auto; }
.fm-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.fm-head-l { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.fm-head .page-title { margin: 0; }
.fm-tags { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.fm-tag { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 0.74rem; font-weight: 800; background: #eef1f6; color: #5a6475; white-space: nowrap; }
.fm-tag.adm { background: #FFF1C2; color: #8A6400; }
.fm-tag.dev { background: #7C5CFF; color: #fff; }
.fm-tag.ok { background: #E7F8EF; color: #00692A; }
.fm-tag.no { background: #FFECEC; color: #9B2C2C; }
.fm-code-box { display: flex; align-items: center; gap: 10px; }
.fm-tabs { display: flex; gap: 4px; padding: 4px; background: #eef1f6; border-radius: 12px; width: max-content; max-width: 100%; overflow-x: auto; margin-bottom: 16px; }
.fm-tab { height: 34px; padding: 0 14px; border: none; border-radius: 9px; background: transparent; font-family: inherit; font-size: 0.88rem; font-weight: 800; color: #6b7280; cursor: pointer; white-space: nowrap; }
.fm-tab.on { background: #fff; color: var(--dark); box-shadow: var(--shadow-sm); }
.fm-body { display: flex; flex-direction: column; gap: 14px; }
.fm-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.fm-kpi { background: #fff; border: 1.5px solid #e6eaf1; border-radius: 14px; padding: 12px 14px; }
.fm-kpi b { display: block; font-size: 1.6rem; font-weight: 900; color: var(--dark); line-height: 1.2; }
.fm-kpi span { font-size: 0.78rem; font-weight: 700; color: #8a93a3; }
.fm-kpi.hot { border-color: #FFD93D; }
.fm-kpi.hot b { color: #B7791F; }
.fm-tablewrap { overflow-x: auto; background: #fff; border: 1.5px solid #e6eaf1; border-radius: 14px; }
.fm-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.fm-table th { text-align: left; font-size: 0.76rem; font-weight: 800; color: #8a93a3; background: #f5f7fa; padding: 9px 12px; white-space: nowrap; }
.fm-table td { padding: 10px 12px; border-top: 1px solid #eef1f6; vertical-align: middle; }
.fm-table th.c, .fm-table td.c { text-align: center; }
.fm-table .fm-actions { justify-content: flex-end; }
.fm-apps tr.off td { color: #9aa3b0; }
.fm-src { font-size: 0.72rem; color: #8a93a3; margin-top: 3px; }
.fm-lock { font-size: 0.7rem; }
.fm-avatar.sm { width: 34px; height: 34px; }
.fm-names em { font-style: normal; font-weight: 600; color: #8a93a3; font-size: 0.8rem; }
.fm-sub { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.fm-sub h3 { font-size: 1rem; font-weight: 900; margin: 0; }
.fm-hint { font-size: 0.8rem; font-weight: 600; color: #8a93a3; margin: 0; }
.fm-hint b { color: #5B3FE0; letter-spacing: 1px; }
.fm-set { background: #fff; border: 1.5px solid #e6eaf1; border-radius: 16px; padding: 6px 16px; }
.fm-set-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 0; border-top: 1px solid #eef1f6; }
.fm-set-row:first-child { border-top: 0; }
.fm-set > .fm-inline { padding-bottom: 12px; }
/* 开关 */
.fm-switch { position: relative; width: 40px; height: 24px; border: none; border-radius: 999px; background: #d5dce4; cursor: pointer; padding: 0; transition: background 0.15s; }
.fm-switch i { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: left 0.15s; }
.fm-switch.on { background: #2EB872; }
.fm-switch.on i { left: 19px; }
.fm-switch:disabled { cursor: not-allowed; opacity: 0.55; }
.fm-list { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.fm-empty { color: #8a93a3; font-weight: 600; padding: 20px 0; }

/* 「新增」按钮：细加号 + 文字、1px 虚线、圆角 8、30 高 13 字，列表顶部靠左当第一项 */
.fm-add { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 12px; font-family: inherit; font-size: 13px; font-weight: 600; color: #5a6475; background: #fff; border: 1px dashed #b8c1cf; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.fm-add svg { width: 14px; height: 14px; }
.fm-add:hover { color: var(--blue); border-color: var(--blue); }

.fm-card { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 16px; padding: 14px 16px; background: #fff; border: 1.5px solid #e6eaf1; border-radius: 16px; }
.fm-who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.fm-avatar { width: 46px; height: 46px; border-radius: 50%; background: #f3f5f9; flex-shrink: 0; }
.fm-names { display: flex; flex-direction: column; min-width: 0; }
.fm-names b { font-size: 1.05rem; color: var(--dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fm-names span { font-size: 0.8rem; font-weight: 600; color: #8a93a3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fm-stats { display: flex; gap: 14px; }
.fm-stats span { display: flex; flex-direction: column; align-items: center; font-size: 0.75rem; font-weight: 700; color: #8a93a3; white-space: nowrap; }
.fm-stats b { font-size: 1.25rem; color: var(--dark); line-height: 1.2; }
.fm-stats .hot b { color: #5B3FE0; }
.fm-stats.muted { font-size: 0.8rem; color: #b6bfcc; }
.fm-actions { display: flex; gap: 8px; }
.fm-btn { height: 34px; padding: 0 14px; font-size: 0.84rem; border-radius: 10px; box-shadow: none; white-space: nowrap; flex-shrink: 0; }
.fm-btn-line { background: #fff; color: var(--dark); border: 1.5px solid #e6eaf1; }
.fm-btn-line:hover { color: var(--blue); border-color: var(--blue); }
.fm-btn-ghost { background: transparent; color: #8a93a3; border: 1.5px solid transparent; }
.fm-btn-danger { background: #F0524F; color: #fff; border: 1.5px solid #F0524F; }
.fm-inline { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 10px; border-top: 1px dashed #e6eaf1; }
.fm-inline-input { height: 34px; flex: 1; min-width: 160px; font-family: inherit; font-size: 0.9rem; border: 1.5px solid var(--blue); border-radius: 10px; padding: 0 10px; }
.fm-inline-q { font-size: 0.86rem; font-weight: 600; color: #5a6475; flex: 1; min-width: 160px; }
.fm-inline-q.ok b { color: var(--dark); }

.fm-family { width: 100%; background: #fff; border: 1.5px solid #e6eaf1; border-left: 5px solid #7C5CFF; border-radius: 0 16px 16px 0; padding: 14px 16px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 8px; }
.fm-family:empty { display: none; }
.fm-fam-main { display: flex; align-items: center; gap: 10px; }
.fm-fam-name { font-size: 1.15rem; font-weight: 900; color: var(--dark); cursor: text; border-radius: 6px; }
.fm-fam-name:hover { background: #f3f6fb; }
.fm-dev { height: 22px; line-height: 22px; padding: 0 9px; border-radius: 999px; font-size: 0.74rem; font-weight: 800; color: #fff; background: #7C5CFF; white-space: nowrap; }
.fm-fam-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fm-fam-label { font-size: 0.82rem; font-weight: 700; color: #8a93a3; min-width: 72px; white-space: nowrap; }
.fm-code { font-family: ui-monospace, Menlo, monospace; font-size: 1.15rem; letter-spacing: 3px; color: #5B3FE0; }
.fm-parents { font-size: 0.9rem; font-weight: 700; color: var(--dark); flex: 1; min-width: 0; }

/* 抽屉 */
.fm-drawer-mask { position: fixed; inset: 0; z-index: 300; background: rgba(20, 26, 38, 0.35); }
.fm-drawer-mask[hidden] { display: none; }
.fm-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 310; width: min(420px, 100vw); background: #fff; box-shadow: -10px 0 30px rgba(0, 0, 0, 0.12); padding: 18px 20px; display: flex; flex-direction: column; gap: 16px; transform: translateX(105%); transition: transform 0.25s ease; overflow-y: auto; }
.fm-drawer.open { transform: none; }
.fm-drawer-head { display: flex; align-items: center; justify-content: space-between; }
.fm-drawer-head h3 { font-size: 1.15rem; font-weight: 900; }
.fm-icon-btn { width: 34px; height: 34px; display: grid; place-items: center; border: 1.5px solid #e6eaf1; border-radius: 50%; background: #fff; color: #5a6475; cursor: pointer; }
.fm-icon-btn svg { width: 16px; height: 16px; }
.fm-seg { display: flex; gap: 4px; padding: 4px; background: #eef1f6; border-radius: 12px; }
.fm-seg-btn { flex: 1; height: 34px; border: none; border-radius: 9px; background: transparent; font-family: inherit; font-size: 0.88rem; font-weight: 800; color: #6b7280; cursor: pointer; white-space: nowrap; }
.fm-seg-btn.active { background: #fff; color: var(--dark); box-shadow: var(--shadow-sm); }
.fm-form { display: flex; flex-direction: column; gap: 14px; }
.fm-field { display: flex; flex-direction: column; gap: 6px; }
.fm-field > span { font-size: 0.84rem; font-weight: 800; color: #5a6475; }
.fm-field input { height: 40px; font-family: inherit; font-size: 0.95rem; border: 1.5px solid #e6eaf1; border-radius: 10px; padding: 0 12px; width: 100%; }
.fm-field input:focus { outline: none; border-color: var(--blue); }
.fm-pw-row { display: flex; gap: 8px; }
.fm-mini { height: 40px; padding: 0 12px; font-family: inherit; font-size: 0.84rem; font-weight: 700; color: #5a6475; background: #f5f7fa; border: 1.5px solid #e6eaf1; border-radius: 10px; cursor: pointer; white-space: nowrap; flex-shrink: 0; }
.fm-submit { height: 42px; font-size: 0.95rem; }
.fm-error { color: #e03131; font-size: 0.85rem; font-weight: 700; min-height: 1em; }
.fm-done { display: flex; flex-direction: column; gap: 10px; }
.fm-done-title { font-size: 1.05rem; font-weight: 900; color: var(--dark); margin-bottom: 4px; }
.fm-cred { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; background: #f5f7fa; border-radius: 12px; }
.fm-cred span { font-size: 0.84rem; font-weight: 700; color: #8a93a3; }
.fm-cred b { font-size: 1.15rem; color: var(--dark); letter-spacing: 0.5px; }

/* 手机端更简：卡片竖排，统计和按钮各占一行 */
@media (max-width: 640px) {
  .fm-kpis { grid-template-columns: 1fr; }
  .fm-card { grid-template-columns: 1fr auto; gap: 10px; }
  .fm-actions { grid-column: 1 / -1; }
  .fm-actions .fm-btn { flex: 1; }
}
