/* TroveFrame 小程序仿真演示 · iPhone 15 Pro 外壳 — 对齐 PWA 视觉 */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  background: radial-gradient(1200px 800px at 50% -10%, #2a2620 0%, #1a1712 55%, #0e0c09 100%);
  color: #221F1B;
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
.stage { position: relative; }
.hint {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  color: rgba(255,255,255,.4); font-size: 12px; letter-spacing: .5px;
  pointer-events: none; white-space: nowrap;
}

/* ==================== iPhone 15 Pro 外壳 ==================== */
.phone {
  width: 412px; height: 872px;
  background: linear-gradient(145deg, #b8b3ac 0%, #8c8780 30%, #6b6660 55%, #9a948c 80%, #7a7570 100%);
  border-radius: 58px; padding: 14px;
  box-shadow: 0 0 0 2px #3a3632, 0 40px 80px -20px rgba(0,0,0,.7), 0 20px 40px -10px rgba(0,0,0,.5),
    inset 0 2px 4px rgba(255,255,255,.5), inset 0 -2px 4px rgba(0,0,0,.3);
  position: relative;
}
.phone::before {
  content: ""; position: absolute; inset: 4px;
  border-radius: 54px;
  background: linear-gradient(145deg, #c9c3ba, #7a756f);
  z-index: 0;
}
.screen {
  position: relative; width: 384px; height: 844px;
  border-radius: 48px; background: #F7F2EA;
  overflow: hidden; z-index: 1;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.15);
}

.phone .btn {
  position: absolute; background: linear-gradient(90deg, #6b6660, #8c8780, #6b6660);
  border-radius: 2px; z-index: 3;
  box-shadow: inset 0 1px 1px rgba(255,255,255,.4);
}
.btn-power { right: -2px; top: 180px; width: 3px; height: 96px; border-radius: 0 2px 2px 0; }
.btn-vol-up { left: -2px; top: 168px; width: 3px; height: 38px; border-radius: 2px 0 0 2px; }
.btn-vol-dn { left: -2px; top: 218px; width: 3px; height: 38px; border-radius: 2px 0 0 2px; }
.btn-action { left: -2px; top: 130px; width: 3px; height: 24px; border-radius: 2px 0 0 2px; }

.dynamic-island {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  width: 126px; height: 37px; background: #000; border-radius: 20px; z-index: 50;
}

/* 状态栏 */
.statusbar {
  position: absolute; top: 0; left: 0; right: 0; height: 50px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px 0 30px;
  font-size: 15px; font-weight: 600; color: #221F1B;
  z-index: 40; pointer-events: none;
}
.statusbar .time { padding-top: 4px; }
.statusbar .right { display: flex; align-items: center; gap: 6px; padding-top: 4px; }

/* 小程序胶囊 */
.capsule {
  position: absolute; top: 54px; right: 14px;
  width: 87px; height: 32px;
  background: rgba(255,255,255,.6);
  border: 0.5px solid rgba(34,31,27,.08);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: space-around;
  z-index: 40; backdrop-filter: blur(10px);
}
.capsule .dot { font-size: 16px; color: #221F1B; line-height: 1; }
.capsule .circle { width: 18px; height: 18px; border: 1.5px solid #221F1B; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.capsule .circle::after { content: ""; width: 7px; height: 7px; border: 1.5px solid #221F1B; border-radius: 1px; }

/* 左上角品牌 LOGO */
.screen-logo {
  position: absolute; top: 60px; left: 20px;
  height: 22px; width: auto; z-index: 40;
  pointer-events: none;
}

/* 内容区 */
.content {
  position: absolute; inset: 0;
  padding-top: 96px; padding-bottom: 78px;
  overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.content::-webkit-scrollbar { display: none; }

/* ==================== 通用 ==================== */
.section { padding: 20px 18px 12px; }
.section h2 {
  font-size: 17px; font-weight: 700; color: #221F1B;
  margin-bottom: 14px; display: flex; align-items: center; gap: 8px;
}
.muted { color: #7C7368; }
.chip {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 600;
}
.chip-coral { background: #FDE8EC; color: #DE3D57; }
.chip-gray { background: rgba(34,31,27,.05); color: #7C7368; }
.chip-green { background: rgba(7,206,146,.12); color: #06A574; }

/* 顶部品牌条 */
.topbar {
  position: absolute; top: 96px; left: 0; right: 0;
  height: 48px; display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; color: #221F1B;
  z-index: 30;
}
.topbar .back {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  color: #221F1B; font-size: 20px;
}
.topbar .action {
  position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  font-size: 14px; color: #FF4F6F; font-weight: 600;
}

/* 渐变头像（对齐 PWA a-1..a-6） */
.grad-1 { background: linear-gradient(135deg, #FF8FA6, #DE3D57); }
.grad-2 { background: linear-gradient(135deg, #6FD3FF, #1D7BD8); }
.grad-3 { background: linear-gradient(135deg, #B49AFF, #6C48D7); }
.grad-4 { background: linear-gradient(135deg, #5EE6BF, #06A574); }
.grad-5 { background: linear-gradient(135deg, #FFC06B, #E0791B); }
.grad-6 { background: linear-gradient(135deg, #8C8477, #4C453D); }

/* ==================== 首页 ==================== */
.hero { padding: 0 18px 16px; }
.hero .fam-card {
  background: linear-gradient(135deg, #221F1B 0%, #3a342c 100%);
  border-radius: 20px; padding: 18px;
  color: #fff; display: flex; align-items: center; gap: 14px;
  box-shadow: 0 10px 30px -8px rgba(34,31,27,.4);
  position: relative; overflow: hidden;
}
.hero .fam-card::after {
  content: ""; position: absolute; right: -30px; top: -30px;
  width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,79,111,.4), transparent 70%);
}
.hero .fam-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; flex-shrink: 0; color: #fff;
}
.hero .fam-info .name { font-size: 18px; font-weight: 700; position: relative; }
.hero .fam-info .meta { font-size: 12px; opacity: .7; margin-top: 3px; position: relative; }

.quick {
  display: flex; gap: 10px; padding: 4px 18px 16px;
}
.quick .q {
  flex: 1; background: #fff; border-radius: 16px;
  padding: 16px 0; display: flex; flex-direction: column;
  align-items: center; gap: 6px;
  box-shadow: 0 1px 2px rgba(34,31,27,.04), 0 8px 20px -6px rgba(34,31,27,.07);
}
.quick .q-icon { width: 36px; height: 36px; display: block; }
.quick .q-label { font-size: 12px; color: #4C453D; font-weight: 600; }

.photos-header {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 0 18px 10px;
}
.photos-header .title { font-size: 17px; font-weight: 700; color: #221F1B; }
.photos-header .more { font-size: 12px; color: #7C7368; }

.grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 4px; padding: 0 14px 20px;
}
.grid .cell {
  aspect-ratio: 1/1; border-radius: 8px; overflow: hidden;
  background: #ECE5DB; position: relative;
}
.grid .cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.grid .cell.fav::after {
  content: "♥"; position: absolute; top: 6px; right: 6px;
  color: #FF4F6F; font-size: 14px; text-shadow: 0 1px 2px rgba(0,0,0,.3);
}

/* ==================== 大图查看 ==================== */
.lightbox {
  position: absolute; inset: 0; background: #000; z-index: 100;
  display: flex; flex-direction: column;
}
.lightbox .lb-bar {
  height: 96px; display: flex; align-items: flex-end;
  justify-content: space-between; padding: 0 16px 12px; color: #fff;
}
.lightbox .lb-bar .x { font-size: 24px; width: 32px; text-align: center; }
.lightbox .lb-bar .title { font-size: 14px; font-weight: 600; }
.lightbox .lb-img { flex: 1; display: flex; align-items: center; justify-content: center; }
.lightbox .lb-img img { max-width: 100%; max-height: 100%; }
.lightbox .lb-info { padding: 16px; color: #fff; }
.lightbox .lb-info .cap { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.lightbox .lb-info .by { font-size: 12px; opacity: .6; }

/* ==================== 家人页 ==================== */
.invite-card {
  margin: 0 18px 16px;
  background: #fff; border-radius: 16px; padding: 16px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 1px 2px rgba(34,31,27,.04), 0 8px 20px -6px rgba(34,31,27,.07);
}
.invite-card .lbl { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #7C7368; margin-bottom: 4px; }
.invite-card .code { font-size: 22px; font-weight: 700; letter-spacing: 2px; color: #221F1B; }
.invite-card .copy {
  background: #221F1B; color: #fff; border: none; border-radius: 999px;
  padding: 8px 18px; font-size: 13px; font-weight: 700;
}

.member {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: #fff; margin: 0 18px 8px; border-radius: 14px;
  box-shadow: 0 1px 2px rgba(34,31,27,.03);
}
.member .av {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 15px; flex-shrink: 0;
}
.member .info { flex: 1; }
.member .info .nm { font-size: 15px; font-weight: 600; color: #221F1B; }
.member .info .rl { font-size: 12px; color: #7C7368; margin-top: 2px; }
.member .tag { font-size: 11px; padding: 3px 10px; border-radius: 999px; font-weight: 600; }
.tag-owner { background: #FFF3E0; color: #E0791B; }
.tag-admin { background: rgba(7,206,146,.12); color: #06A574; }
.tag-mem { background: #F0EDE7; color: #7C7368; }

/* ==================== 相框页 ==================== */
.frame-card {
  margin: 0 18px 12px;
  background: #fff; border-radius: 16px; padding: 16px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: 0 1px 2px rgba(34,31,27,.04), 0 8px 20px -6px rgba(34,31,27,.07);
}
.frame-card .ficon {
  width: 48px; height: 48px; border-radius: 14px;
  background: linear-gradient(135deg, #FF8FA6, #DE3D57);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 22px; flex-shrink: 0;
}
.frame-card .finfo { flex: 1; }
.frame-card .finfo .nm { font-size: 15px; font-weight: 600; color: #221F1B; }
.frame-card .finfo .meta { font-size: 12px; color: #7C7368; margin-top: 3px; }
.frame-card .stat { font-size: 12px; font-weight: 700; }
.stat-online { color: #06A574; }
.stat-offline { color: #A79D90; }

.scan-btn {
  margin: 16px 18px;
  background: #221F1B; color: #fff; border: none; border-radius: 999px;
  padding: 14px; font-size: 15px; font-weight: 700; width: calc(100% - 36px);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}

/* ==================== 我的页 ==================== */
.me-header {
  padding: 20px 18px 16px;
  display: flex; align-items: center; gap: 14px;
}
.me-header .av {
  width: 60px; height: 60px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 24px; font-weight: 700;
}
.me-header .info .nm { font-size: 20px; font-weight: 700; color: #221F1B; }
.me-header .info .em { font-size: 13px; color: #7C7368; margin-top: 3px; }

.cell-row {
  background: #fff; margin: 0 18px 10px; border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(34,31,27,.03);
}
.cell-row .row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border-bottom: 0.5px solid rgba(34,31,27,.06);
}
.cell-row .row:last-child { border-bottom: none; }
.cell-row .row .ic {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  color: #221F1B;
  flex-shrink: 0;
}
.cell-row .row .txt { flex: 1; font-size: 15px; color: #221F1B; font-weight: 500; }
.cell-row .row .val { font-size: 13px; color: #7C7368; }
.cell-row .row .arr { color: #C8C0B4; font-size: 16px; }

/* ==================== 底部 tab bar ==================== */
.tabbar {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 70px; background: rgba(255,255,255,.92);
  backdrop-filter: blur(20px);
  border-top: 0.5px solid rgba(34,31,27,.06);
  display: flex; padding-bottom: 16px;
  z-index: 40;
}
.tabbar .tab {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px;
  color: #A79D90; font-size: 10px; font-weight: 600;
}
.tabbar .tab.on { color: #FF4F6F; }
.tabbar .tab svg { width: 22px; height: 22px; }

.home-indicator {
  position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%);
  width: 134px; height: 5px; border-radius: 3px;
  background: rgba(34,31,27,.3); z-index: 60;
}

/* ==================== 登录屏 ==================== */
.login-screen {
  position: absolute; inset: 0; background: #F7F2EA;
  display: flex; flex-direction: column; align-items: center;
  padding: 100px 32px 40px; z-index: 200;
}
.login-screen .logo-mark {
  width: 160px; margin-bottom: 28px;
}
.login-screen .brand {
  font-family: "Bricolage Grotesque", "Manrope", sans-serif;
  font-size: 28px; font-weight: 700; color: #221F1B;
  letter-spacing: -.02em;
}
.login-screen .slogan {
  font-size: 13px; color: #7C7368; margin-top: 10px; text-align: center;
  line-height: 1.6; max-width: 260px;
}
.login-screen .btns { margin-top: auto; width: 100%; display: flex; flex-direction: column; gap: 12px; }
.login-screen .btn-wechat {
  background: #07c160; color: #fff; border: none; border-radius: 999px;
  padding: 14px; font-size: 15px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.login-screen .btn-email {
  background: #fff; color: #221F1B; border: 1px solid #E8DFD3;
  border-radius: 999px; padding: 14px; font-size: 15px; font-weight: 600;
}

/* 过渡 */
.screen-fade { animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (max-width: 440px) {
  body { align-items: flex-start; padding: 8px 0; }
  .phone { transform: scale(.92); transform-origin: top center; }
}
@media (max-height: 900px) {
  .phone { transform: scale(.85); transform-origin: center; }
}
