/* ============================================
   爱笑 APP — 全局设计系统
   ============================================ */

/* ---- 设计变量 ---- */
:root {
  /* 主色 */
  --primary: #FF7A45;
  --primary-light: #FFF2E8;
  --primary-dark: #D9531E;
  --secondary: #2A9D8F;
  --secondary-light: #E8F5F3;
  --accent: #FFB627;
  --danger: #E63946;
  --danger-light: #FDE8EA;
  --success: #06A77D;
  --success-light: #E3F7EF;

  /* 中性色 */
  --bg: #FAF7F4;
  --surface: #FFFFFF;
  --surface-alt: #F5F0EC;
  --text-primary: #2D2419;
  --text-secondary: #8A7E70;
  --text-disabled: #C4B8AC;
  --border: #EDE5DC;
  --divider: #F0EAE3;

  /* 老人端特大字号 */
  --elder-base: 18px;
  --elder-lg: 22px;
  --elder-xl: 28px;
  --elder-2xl: 36px;

  /* 圆角 */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-full: 999px;

  /* 阴影 */
  --shadow-sm: 0 1px 3px rgba(45, 36, 25, 0.06);
  --shadow-md: 0 4px 16px rgba(45, 36, 25, 0.08);
  --shadow-lg: 0 8px 32px rgba(45, 36, 25, 0.12);
  --shadow-primary: 0 4px 20px rgba(255, 122, 69, 0.3);

  /* 布局 */
  --app-width: 430px;
  --tab-height: 68px;
  --header-height: 56px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: #E8E0D8;
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* ---- 手机外壳 ---- */
#app {
  width: 100%;
  max-width: var(--app-width);
  height: 100dvh;
  max-height: 932px;
  margin: 0 auto;
  background: var(--bg);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.12);
}

@media (min-width: 500px) {
  body {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 0;
  }
  #app {
    height: 90dvh;
    border-radius: 40px;
    border: 8px solid #1a1a1a;
  }
}

/* ---- 页面容器 ---- */
#page-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}
.page {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  display: none;
  flex-direction: column;
  min-height: 0;
}
.page.active {
  display: flex;
}
.page.no-tab {
  padding-bottom: 24px;
}

/* ---- 通用头部 ---- */
.app-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 10;
}
.app-header .title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}
.app-header .icon-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: none;
  font-size: 22px;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-full);
  transition: background .15s;
}
.app-header .icon-btn:active {
  background: var(--surface-alt);
}

/* ---- 底部 Tab 栏 ---- */
.tab-bar {
  height: var(--tab-height);
  display: flex;
  align-items: stretch;
  background: var(--surface);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  padding-bottom: var(--safe-bottom);
  position: relative;
  z-index: 10;
}
.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-disabled);
  transition: color .15s;
  position: relative;
}
.tab-item .tab-icon {
  font-size: 24px;
  line-height: 1;
}
.tab-item .tab-label {
  font-size: 11px;
  font-weight: 500;
}
.tab-item.active {
  color: var(--primary);
}
.tab-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  width: 24px;
  height: 3px;
  background: var(--primary);
  border-radius: 0 0 3px 3px;
}

/* SOS 浮动按钮（老人端安全页） */
.sos-fab {
  position: fixed;
  bottom: calc(var(--tab-height) + 20px + var(--safe-bottom));
  right: 20px;
  width: 64px;
  height: 64px;
  border-radius: var(--r-full);
  background: var(--danger);
  color: #fff;
  border: 4px solid #fff;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 4px 20px rgba(230, 57, 70, 0.4);
  cursor: pointer;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: sos-pulse 2s infinite;
}
@keyframes sos-pulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(230, 57, 70, 0.4); }
  50% { box-shadow: 0 4px 30px rgba(230, 57, 70, 0.7); }
}

/* ============================================
   启动器
   ============================================ */
.launcher {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: linear-gradient(160deg, #FFF7F2 0%, #FAF7F4 50%, #F0EAE3 100%);
  text-align: center;
}
.launcher .logo {
  width: 88px;
  height: 88px;
  border-radius: var(--r-xl);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-primary);
}
.launcher .app-name {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.launcher .app-slogan {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 40px;
}
.launcher .role-cards {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.role-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: var(--surface);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all .2s;
  text-align: left;
}
.role-card:active {
  transform: scale(0.97);
  box-shadow: var(--shadow-md);
}
.role-card .rc-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
}
.role-card .rc-icon.parent { background: var(--primary-light); }
.role-card .rc-icon.child { background: var(--secondary-light); }
.role-card .rc-icon.community { background: #E8EEFC; }
.role-card .rc-info h3 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 2px;
}
.role-card .rc-info p {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ============================================
   老人端样式 — 大字大按钮
   ============================================ */
.elder-page {
  font-size: var(--elder-base);
}
.elder-page .app-header .title {
  font-size: 22px;
}
.elder-page .tab-item .tab-icon { font-size: 28px; }
.elder-page .tab-item .tab-label { font-size: 13px; }

.elder-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* 家庭成员横滚 */
.family-strip {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 0 8px;
  -webkit-overflow-scrolling: touch;
}
.family-strip::-webkit-scrollbar { display: none; }
.family-avatar {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.family-avatar .fa-img {
  width: 64px;
  height: 64px;
  border-radius: var(--r-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  background: var(--primary-light);
  border: 3px solid var(--surface);
  box-shadow: var(--shadow-sm);
  position: relative;
}
.family-avatar .fa-img.online::after {
  content: '';
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--success);
  border: 2px solid var(--surface);
}
.family-avatar .fa-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.family-avatar .fa-relation {
  font-size: 12px;
  color: var(--text-secondary);
}

/* 大功能按钮卡 */
.action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.action-btn-lg {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 24px 12px;
  border-radius: var(--r-lg);
  border: none;
  cursor: pointer;
  transition: all .15s;
  font-size: var(--elder-lg);
  font-weight: 700;
}
.action-btn-lg:active {
  transform: scale(0.95);
}
.action-btn-lg .ab-icon {
  font-size: 40px;
}
.action-btn-lg.intercom {
  background: var(--primary);
  color: #fff;
}
.action-btn-lg.share {
  background: var(--secondary);
  color: #fff;
}

/* 服务网格 */
.service-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.service-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 20px 14px;
  text-align: center;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all .15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.service-card:active {
  transform: scale(0.96);
  box-shadow: var(--shadow-md);
}
.service-card .sc-icon {
  width: 60px;
  height: 60px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}
.service-card .sc-name {
  font-size: var(--elder-lg);
  font-weight: 700;
  color: var(--text-primary);
}
.service-card .sc-desc {
  font-size: 13px;
  color: var(--text-secondary);
}

/* 留言/对讲列表 */
.message-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.message-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  background: var(--surface);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
}
.message-item.self {
  flex-direction: row-reverse;
}
.message-item .mi-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--r-full);
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}
.message-item .mi-body {
  flex: 1;
  min-width: 0;
}
.message-item .mi-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.message-item .mi-bubble {
  background: var(--surface-alt);
  padding: 12px 16px;
  border-radius: var(--r-md);
  font-size: var(--elder-base);
  line-height: 1.5;
  color: var(--text-primary);
}
.message-item.self .mi-bubble {
  background: var(--primary);
  color: #fff;
}
.voice-bubble {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 160px;
}
.voice-bubble .play-icon {
  font-size: 24px;
}
.voice-bubble .wave {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 2px;
  height: 24px;
}
.voice-bubble .wave span {
  flex: 1;
  background: currentColor;
  border-radius: 2px;
  opacity: 0.6;
}
.voice-bubble .duration {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

/* 分享动态 */
.share-feed {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.share-item {
  background: var(--surface);
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}
.share-item .si-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
}
.share-item .si-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--r-full);
  background: var(--secondary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.share-item .si-info {
  flex: 1;
}
.share-item .si-name {
  font-size: 15px;
  font-weight: 700;
}
.share-item .si-time {
  font-size: 12px;
  color: var(--text-secondary);
}
.share-item .si-image {
  width: 100%;
  aspect-ratio: 4/3;
  background: var(--surface-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
}
.share-item .si-text {
  padding: 12px 14px;
  font-size: var(--elder-base);
  line-height: 1.5;
}
.share-item .si-actions {
  display: flex;
  gap: 20px;
  padding: 8px 14px 12px;
}
.share-item .si-action {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text-secondary);
  border: none;
  background: none;
  cursor: pointer;
}

/* SOS 大按钮 */
.sos-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px 16px;
  gap: 20px;
}
.sos-big-btn {
  width: 200px;
  height: 200px;
  border-radius: var(--r-full);
  background: radial-gradient(circle at 30% 30%, #FF5566, var(--danger));
  color: #fff;
  border: 8px solid #fff;
  font-size: 36px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 8px 40px rgba(230, 57, 70, 0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  animation: sos-pulse 1.5s infinite;
  transition: transform .15s;
}
.sos-big-btn:active {
  transform: scale(0.92);
}
.sos-big-btn .sos-icon {
  font-size: 56px;
}
.sos-hint {
  font-size: var(--elder-base);
  color: var(--text-secondary);
  text-align: center;
}

/* 监控卡片 */
.monitor-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 18px;
  border: 1px solid var(--border);
}
.monitor-card .mc-title {
  font-size: var(--elder-lg);
  font-weight: 700;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.monitor-stats {
  display: flex;
  gap: 16px;
  justify-content: space-around;
}
.monitor-stat {
  text-align: center;
}
.monitor-stat .ms-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--primary);
}
.monitor-stat .ms-label {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* 活动图表条 */
.activity-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 80px;
  margin-top: 14px;
}
.activity-bars .bar {
  flex: 1;
  background: var(--primary-light);
  border-radius: 4px 4px 0 0;
  position: relative;
  min-height: 8px;
  transition: height .3s;
}
.activity-bars .bar.active {
  background: var(--primary);
}
.activity-bars .bar-label {
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* ============================================
   子女端样式
   ============================================ */
.child-content {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.child-content .app-header .title { font-size: 17px; }

/* 状态卡片 */
.status-banner {
  background: linear-gradient(135deg, var(--secondary), #38B6A8);
  border-radius: var(--r-lg);
  padding: 18px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 14px;
}
.status-banner .sb-avatar {
  width: 56px;
  height: 56px;
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  border: 2px solid rgba(255, 255, 255, 0.4);
}
.status-banner .sb-info { flex: 1; }
.status-banner .sb-name { font-size: 18px; font-weight: 700; }
.status-banner .sb-status {
  font-size: 13px;
  opacity: 0.9;
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.status-banner .sb-status .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6DFFB0;
}

/* 快捷操作 */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 6px;
  background: var(--surface);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all .15s;
}
.quick-action:active { transform: scale(0.94); }
.quick-action .qa-icon {
  font-size: 28px;
}
.quick-action .qa-label {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
}

/* 区块标题 */
.section-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px;
}
.section-title .more {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 400;
  cursor: pointer;
}

/* 订单卡片 */
.order-card {
  background: var(--surface);
  border-radius: var(--r-md);
  padding: 14px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: all .15s;
}
.order-card:active { box-shadow: var(--shadow-md); }
.order-card .oc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.order-card .oc-type {
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}
.order-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: var(--r-full);
  font-weight: 600;
}
.order-tag.pending { background: #FFF4E6; color: #E8910E; }
.order-tag.active { background: var(--primary-light); color: var(--primary-dark); }
.order-tag.done { background: var(--success-light); color: var(--success); }
/* 撮合成单：waiting=发布出价等接单 / expired=1小时无人接单 */
.order-tag.waiting { background: #FFF3D6; color: #B7791F; }
.order-tag.expired { background: #FDECEC; color: var(--danger); }
.oc-footer-match { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--divider); }
.order-card .oc-desc {
  font-size: 14px;
  color: var(--text-secondary);
}
.order-card .oc-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid var(--divider);
}
.order-card .oc-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
}
.order-card .oc-time {
  font-size: 12px;
  color: var(--text-secondary);
}

/* 提醒卡片 */
.alert-card {
  background: var(--surface);
  border-radius: var(--r-md);
  padding: 14px;
  border-left: 4px solid var(--danger);
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.alert-card.warning { border-left-color: var(--accent); }
.alert-card.info { border-left-color: var(--secondary); }
.alert-card .ac-icon { font-size: 24px; flex-shrink: 0; }
.alert-card .ac-body { flex: 1; }
.alert-card .ac-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 2px;
}
.alert-card .ac-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}
.alert-card .ac-time {
  font-size: 12px;
  color: var(--text-disabled);
  margin-top: 6px;
}

/* 动态时间线 */
.timeline-item {
  display: flex;
  gap: 12px;
  padding-bottom: 16px;
  position: relative;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 32px;
  bottom: 0;
  width: 2px;
  background: var(--divider);
}
.timeline-item:last-child::before { display: none; }
.timeline-item .ti-dot {
  width: 32px;
  height: 32px;
  border-radius: var(--r-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  z-index: 1;
}
.timeline-item .ti-body { flex: 1; padding-top: 2px; }
.timeline-item .ti-text {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.4;
}
.timeline-item .ti-time {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ============================================
   社区端样式
   ============================================ */
.community-content {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.community-content .app-header .title { font-size: 17px; }

/* 统计横条 */
.stat-bar {
  display: flex;
  gap: 10px;
}
.stat-card {
  flex: 1;
  background: var(--surface);
  border-radius: var(--r-md);
  padding: 14px;
  text-align: center;
  border: 1px solid var(--border);
}
.stat-card .sc-num {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
}
.stat-card .sc-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* 工单卡片 */
.work-card {
  background: var(--surface);
  border-radius: var(--r-md);
  padding: 14px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.work-card .wc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.work-card .wc-type {
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}
.work-card .wc-addr {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}
.work-card .wc-detail {
  font-size: 14px;
  color: var(--text-primary);
  background: var(--surface-alt);
  padding: 10px 12px;
  border-radius: var(--r-sm);
  line-height: 1.4;
}
.work-card .wc-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.work-card .wc-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
}

/* 通用按钮 */
.btn {
  border: none;
  border-radius: var(--r-md);
  padding: 10px 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn:active { transform: scale(0.96); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-secondary { background: var(--surface-alt); color: var(--text-primary); }
.btn-outline { background: transparent; border: 1.5px solid var(--primary); color: var(--primary); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-lg { padding: 14px 28px; font-size: 17px; width: 100%; justify-content: center; }
.btn-sm { padding: 6px 14px; font-size: 13px; }

/* ============================================
   通用组件
   ============================================ */

/* 空状态 */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 12px;
  color: var(--text-secondary);
}
.empty-state .es-icon { font-size: 56px; opacity: 0.4; }
.empty-state .es-text { font-size: 15px; }

/* 个人资料卡 */
.profile-header {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  padding: 30px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  color: #fff;
}
.profile-header .ph-avatar {
  width: 72px;
  height: 72px;
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  border: 3px solid rgba(255, 255, 255, 0.4);
}
.profile-header .ph-name { font-size: 20px; font-weight: 700; }
.profile-header .ph-sub { font-size: 13px; opacity: 0.9; margin-top: 2px; }

/* 设置列表 */
.settings-list {
  background: var(--surface);
  border-radius: var(--r-md);
  margin: 14px;
  overflow: hidden;
}
.settings-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--divider);
  cursor: pointer;
  font-size: 15px;
}
.settings-item:last-child { border-bottom: none; }
.settings-item .si-icon {
  font-size: 22px;
  width: 28px;
  text-align: center;
}
/* v19.1：设置项文字永不换行（与 APP v112 同源修复）。
   BUG：鸿蒙 / 窄屏下字体度量偏大时，`.si-label { flex: 1 }` 的 flex-basis:0 会让主标签
   被压成两行。策略：主标签优先完整显示（不换行、收缩权重极小、最后才省略），
   右侧副信息先承受收缩并出省略号。 */
.settings-item .si-label {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.settings-item .si-arrow {
  flex: 0 200 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
  color: var(--text-disabled);
  font-size: 14px;
}

/* 模态弹窗 */
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: none;
  align-items: flex-end;
  z-index: 100;
  animation: fade-in .2s;
}
.modal-overlay.show { display: flex; }
.modal-sheet {
  background: var(--surface);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  width: 100%;
  max-height: 85%;
  overflow-y: auto;
  padding: 20px 16px calc(20px + var(--safe-bottom));
  animation: slide-up .25s ease;
}
@keyframes fade-in { from { opacity: 0; } }
@keyframes slide-up { from { transform: translateY(100%); } }
.modal-sheet .ms-handle {
  width: 40px;
  height: 4px;
  background: var(--text-disabled);
  border-radius: var(--r-full);
  margin: 0 auto 16px;
}
.modal-sheet .ms-title {
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 16px;
}

/* 表单 */
.form-group {
  margin-bottom: 16px;
}
.form-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  display: block;
}
.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  font-size: 16px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text-primary);
  transition: border-color .15s;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary);
}
.form-textarea { resize: none; min-height: 80px; }

/* 语音输入按钮 */
.voice-input {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px;
}
.voice-input .vi-btn {
  width: 80px;
  height: 80px;
  border-radius: var(--r-full);
  background: var(--primary);
  color: #fff;
  border: none;
  font-size: 36px;
  cursor: pointer;
  box-shadow: var(--shadow-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .15s;
}
.voice-input .vi-btn:active { transform: scale(0.9); }
.voice-input .vi-btn.recording {
  background: var(--danger);
  animation: vi-pulse 1s infinite;
}
@keyframes vi-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}
.voice-input .vi-hint {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Toast */
.toast {
  position: absolute;
  bottom: calc(var(--tab-height) + 30px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: rgba(45, 36, 25, 0.9);
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--r-full);
  font-size: 14px;
  font-weight: 500;
  z-index: 200;
  white-space: nowrap;
  animation: toast-in .3s, toast-out .3s 2s forwards;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateX(-50%) translateY(-10px); }
}

/* 进度条 */
.progress-steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 16px 0;
}
.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
  position: relative;
}
.progress-step .ps-dot {
  width: 28px;
  height: 28px;
  border-radius: var(--r-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  z-index: 1;
}
.progress-step.done .ps-dot { background: var(--success); color: #fff; }
.progress-step.active .ps-dot { background: var(--primary); color: #fff; }
.progress-step.pending .ps-dot { background: var(--surface-alt); color: var(--text-disabled); }
.progress-step .ps-label { font-size: 11px; color: var(--text-secondary); }
.progress-step::after {
  content: '';
  position: absolute;
  top: 14px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: var(--divider);
  z-index: 0;
}
.progress-step:last-child::after { display: none; }
.progress-step.done::after { background: var(--success); }

/* 评价星星 */
.rating-stars {
  display: flex;
  gap: 6px;
  font-size: 28px;
}
.rating-stars .star { cursor: pointer; color: var(--text-disabled); }
.rating-stars .star.active { color: var(--accent); }

/* 标签选择 */
.tag-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tag-chip {
  padding: 8px 16px;
  border-radius: var(--r-full);
  border: 1.5px solid var(--border);
  font-size: 14px;
  cursor: pointer;
  transition: all .15s;
  background: var(--surface);
  white-space: nowrap;
  flex-shrink: 0;
}
.tag-chip.active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 600;
}

/* 返回按钮 */
.back-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}
.back-bar .back-btn {
  border: none;
  background: none;
  font-size: 22px;
  color: var(--text-primary);
  cursor: pointer;
  padding: 4px;
}
.back-bar .title { font-size: 18px; font-weight: 700; }

/* 分隔 */
.spacer { height: 8px; }
.divider { height: 1px; background: var(--divider); margin: 12px 0; }

/* 通用 flex */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.flex-1 { flex: 1; }
.text-center { text-align: center; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.text-sm { font-size: 13px; }
.text-secondary { color: var(--text-secondary); }
.font-bold { font-weight: 700; }

/* 隐藏滚动条 */
.page::-webkit-scrollbar { width: 0; }

/* ============================================
   邀请家人 / 拉新卡片（首页横幅、成长卡片）
   ============================================ */
.invite-banner {
  display: flex; align-items: center; gap: 12px; width: 100%;
  background: linear-gradient(135deg, #FF7A45, #FFB627); color: #fff;
  border: none; border-radius: 16px; padding: 16px; cursor: pointer;
  text-align: left; box-shadow: var(--shadow-primary);
  font-family: inherit;
}
.invite-banner.done {
  background: linear-gradient(135deg, #06A77D, #2A9D8F);
  box-shadow: 0 4px 20px rgba(42, 157, 143, .28);
}
.invite-banner:active { transform: scale(.99); }
.invite-banner .ib-icon {
  font-size: 24px; flex-shrink: 0; width: 46px; height: 46px;
  border-radius: 50%; background: rgba(255, 255, 255, .22);
  display: flex; align-items: center; justify-content: center;
}
.invite-banner .ib-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.invite-banner .ib-arrow { font-size: 24px; color: rgba(255, 255, 255, .85); flex-shrink: 0; }

.child-growth { display: flex; flex-direction: column; gap: 10px; }
.growth-card {
  display: flex; align-items: center; gap: 12px; width: 100%;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 14px 16px; cursor: pointer; text-align: left; box-shadow: var(--shadow-sm);
  font-family: inherit;
}
.growth-card:active { background: var(--surface-alt); }
.growth-card .gc-emoji {
  font-size: 22px; flex-shrink: 0; width: 44px; height: 44px; border-radius: 50%;
  background: var(--primary-light); display: flex; align-items: center; justify-content: center;
}
.growth-card .gc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 14px; color: var(--text-secondary); }
.growth-card .gc-main b { font-size: 16px; color: var(--text-primary); }
.growth-card .gc-cta { color: var(--primary); font-size: 15px; font-weight: 700; flex-shrink: 0; }

/* 关系标签（邀请家人可选关系） */
.relation-chip {
  cursor: pointer; user-select: none;
  border: 1.5px solid var(--border); background: var(--surface); color: var(--text-primary);
}
.relation-chip.active {
  border-color: var(--primary); background: var(--primary-light);
  color: var(--primary-dark); font-weight: 700;
}

/* ============================================
   邀请进度（家庭成员邀请齐全优化）
   ============================================ */
.inv-role-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.inv-role {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 10px 4px; border-radius: 12px; background: var(--surface-alt);
}
.inv-role .ir-ico { font-size: 22px; line-height: 1; }
.inv-role .ir-name { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.inv-role .ir-state { font-size: 12px; font-weight: 600; }
.inv-role.joined { background: var(--success-light); }
.inv-role.joined .ir-state { color: var(--success); }
.inv-role.invited { background: #FFF8E1; }
.inv-role.invited .ir-state { color: #B7791F; }
.inv-role.none { background: var(--surface-alt); }
.inv-role.none .ir-state { color: var(--text-disabled); }

.inv-progress {
  height: 12px; border-radius: 999px; background: var(--surface-alt);
  overflow: hidden; flex: 1;
}
.inv-progress > i {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width .5s ease;
}

.inv-sent-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; background: var(--surface-alt); border-radius: 12px;
}
.inv-accept {
  margin-left: auto; flex-shrink: 0;
  border: 1px solid var(--success); color: var(--success); background: #fff;
  border-radius: 999px; padding: 5px 10px; font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: inherit;
}
.inv-accept:active { background: var(--success-light); }

/* ============================================
   支付管理 / 分账直付 / 收付款
   ============================================ */
.pay-methods { display: flex; flex-direction: column; gap: 10px; }
.pay-method {
  display: flex; align-items: center; gap: 12px;
  padding: 14px; border-radius: 14px;
  background: var(--surface-alt); border: 1.5px solid transparent;
  cursor: pointer; transition: border-color .15s, background .15s;
}
.pay-method.selected { border-color: var(--primary); background: var(--primary-light); }
.pm-icon {
  width: 42px; height: 42px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.pm-body { flex: 1; min-width: 0; }
.pm-name { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.pm-sub { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.pm-radio {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--border); flex-shrink: 0;
  transition: all .15s; position: relative;
}
.pay-method.selected .pm-radio { border-color: var(--primary); background: var(--primary); }
.pay-method.selected .pm-radio::after {
  content: ''; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 12px; font-weight: 800;
}
.pay-method.selected .pm-radio::before {
  content: '✓'; position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -52%); color: #fff;
  font-size: 12px; font-weight: 800; line-height: 1;
}

/* 收付款金额 */
.recharge-amt {
  border: 1.5px solid var(--border); border-radius: 12px;
  background: var(--surface); padding: 14px 8px;
  text-align: center; cursor: pointer; color: var(--text-primary);
  transition: all .15s;
}
.recharge-amt.selected {
  border-color: var(--primary); background: var(--primary-light);
}

/* 运营后台渐变头 */
.app-header.admin-header { background: linear-gradient(135deg, #2B3A55, #0E1626); }
.app-header.admin-header .title { color: #fff; }

/* ============================================
   数据持久化状态徽标 — v10 已下线
   （原右下角「⏳ 正在连接…」飘标属多余视觉噪音，亮哥 2026-09-28 要求移除）
   ============================================ */

/* ============================================
   v9 登录遮罩（未登录 / 首次改密）
   ============================================ */
#admin-logout-btn, #admin-pwd-btn {
  position: fixed;
  top: 10px;
  z-index: 9001;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .3);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
}
#admin-logout-btn { right: 12px; }
#admin-pwd-btn { right: 72px; }
#admin-logout-btn:hover, #admin-pwd-btn:hover { background: rgba(255, 255, 255, .24); }
/* v23：改密表单「取消」次要按钮（覆盖 .admin-change button 的主色） */
.admin-change button#admin-change-cancel {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .3);
  color: rgba(255, 255, 255, .82);
  font-weight: 500;
}

.admin-login {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #16223A 0%, #1F2D4D 60%, #2A3B63 100%);
  padding: 20px;
}
.admin-login-card {
  width: 100%;
  max-width: 360px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 16px;
  padding: 28px 24px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .35);
  backdrop-filter: blur(6px);
}
.admin-login-logo {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  text-align: center;
  letter-spacing: .5px;
}
.admin-login-sub {
  font-size: 13px;
  color: rgba(255, 255, 255, .65);
  text-align: center;
  margin: 6px 0 18px;
}
.admin-login form, .admin-change { display: flex; flex-direction: column; gap: 12px; }
.admin-login input, .admin-change input {
  width: 100%;
  box-sizing: border-box;
  padding: 13px 14px;
  font-size: 16px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .92);
  color: #16223A;
  outline: none;
}
.admin-login input:focus, .admin-change input:focus { border-color: #4DA3FF; box-shadow: 0 0 0 3px rgba(77, 163, 255, .25); }
.admin-login button, .admin-change button {
  width: 100%;
  padding: 13px;
  font-size: 16px;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #FF6B35, #E85B1E);
  color: #fff;
  cursor: pointer;
}
.admin-login button:active, .admin-change button:active { transform: translateY(1px); }
.admin-login button:disabled, .admin-change button:disabled { opacity: .6; cursor: default; }
.admin-login-err, .admin-change-err {
  color: #FFD0C4;
  font-size: 13px;
  min-height: 16px;
  text-align: center;
}
.admin-change { margin-top: 14px; padding-top: 16px; border-top: 1px dashed rgba(255, 255, 255, .2); }
.admin-login-tip {
  margin-top: 16px;
  font-size: 11px;
  line-height: 1.5;
  color: rgba(255, 255, 255, .5);
  text-align: center;
}
