/* ==========================================================================
   捡手机文学模拟器
   设备内部严格还原 iOS；设计主张只落在"外围环境"上：
   一间关了灯的房间，屏幕是唯一光源。
   ========================================================================== */

:root {
  /* 外围：房间 */
  --room:      #0B0D0F;
  --desk:      #14171A;
  --glow:      rgba(190, 215, 255, .10);
  --glow-far:  rgba(190, 215, 255, .04);
  --chalk:     rgba(235, 240, 245, .55);
  --chalk-dim: rgba(235, 240, 245, .28);

  /* 设备内：iOS 系统色 */
  --ios-bg:       #F2F2F7;
  --ios-card:     #FFFFFF;
  --ios-label:    #000000;
  --ios-label-2:  rgba(60, 60, 67, .60);
  --ios-label-3:  rgba(60, 60, 67, .30);
  --ios-sep:      rgba(60, 60, 67, .29);
  --ios-sep-thin: rgba(60, 60, 67, .18);
  --ios-fill:     rgba(120, 120, 128, .12);
  --ios-fill-2:   rgba(120, 120, 128, .20);
  --blue:         #007AFF;
  --green:        #34C759;
  --red:          #FF3B30;
  --orange:       #FF9500;

  /* 微信 */
  --wx-green:   #07C160;
  --wx-bg:      #EDEDED;
  --wx-bar:     #EDEDED;
  --wx-bubble:  #FFFFFF;
  --wx-mine:    #95EC69;

  --safe-top: 54px;
  --safe-bot: 34px;

  --ease-ios: cubic-bezier(.32, .72, 0, 1);
}

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

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--room);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
               "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: var(--chalk);
  overscroll-behavior: none;
}

/* --------------------------------------------------------------------------
   舞台：桌面端把手机放在暗房间的桌面上
   -------------------------------------------------------------------------- */
.stage {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% 42%, var(--desk) 0%, var(--room) 62%, #060708 100%);
}
/* 桌面上一圈几乎看不见的细颗粒，避免纯色塑料感 */
.stage::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .035;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(0deg,  rgba(255,255,255,.6) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(255,255,255,.4) 0 1px, transparent 1px 4px);
}
/* 屏幕在桌面上投下的冷光 */
.stage::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 780px;
  height: 780px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  background: radial-gradient(closest-side, var(--glow), var(--glow-far) 55%, transparent 78%);
}

/* --------------------------------------------------------------------------
   手机外壳
   -------------------------------------------------------------------------- */
.scaler { transform-origin: center center; will-change: transform; }

.phone {
  position: relative;
  width: 390px;
  height: 844px;
  border-radius: 54px;
  background: #000;
  padding: 11px;
  box-shadow:
    0 0 0 2px #2C2F33,
    0 0 0 6px #101214,
    0 0 0 7px #3A3E43,
    0 44px 90px -20px rgba(0,0,0,.9),
    0 4px 14px rgba(0,0,0,.7);
  isolation: isolate;
}
/* 机身顶部一道极淡的高光，暗示有环境光存在 */
.phone::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 54px;
  pointer-events: none;
  z-index: 60;
  background: linear-gradient(150deg, rgba(255,255,255,.10) 0%, transparent 26%, transparent 74%, rgba(255,255,255,.05) 100%);
}

.screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 44px;
  overflow: hidden;
  background: #000;
  color: var(--ios-label);
  font-size: 17px;
  line-height: 1.35;
}

/* 各层：壁纸 / 主屏 / 锁屏 / 应用 */
.layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.wallpaper { z-index: 0; }
#homeLayer { z-index: 10; background: transparent; }
#lockLayer { z-index: 30; }
#appLayer  { z-index: 20; background: var(--ios-bg); }

/* 壁纸预设 */
.wallpaper[data-wall="dusk"] {
  background:
    radial-gradient(90% 60% at 22% 12%, #6E5CC6 0%, transparent 60%),
    radial-gradient(80% 70% at 82% 26%, #C65C93 0%, transparent 58%),
    radial-gradient(120% 90% at 50% 96%, #2B2340 0%, #171326 70%, #0E0B18 100%);
}
.wallpaper[data-wall="aurora"] {
  background:
    radial-gradient(70% 50% at 18% 20%, #2EC5A8 0%, transparent 62%),
    radial-gradient(75% 60% at 84% 34%, #3E7BF6 0%, transparent 60%),
    linear-gradient(180deg, #0B1F2A 0%, #101A33 60%, #0A0F1E 100%);
}
.wallpaper[data-wall="mono"] {
  background:
    radial-gradient(80% 60% at 30% 10%, #55585E 0%, transparent 64%),
    linear-gradient(180deg, #26282C 0%, #16181B 60%, #0C0D0F 100%);
}
.wallpaper[data-wall="warm"] {
  background:
    radial-gradient(80% 60% at 20% 16%, #E08A4B 0%, transparent 62%),
    radial-gradient(70% 60% at 86% 30%, #B4562F 0%, transparent 60%),
    linear-gradient(180deg, #2A1A17 0%, #1A1210 62%, #0E0908 100%);
}
.wallpaper { filter: saturate(1.05) brightness(.92); }

/* --------------------------------------------------------------------------
   状态栏 / 灵动岛 / Home 条
   -------------------------------------------------------------------------- */
.statusbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: var(--safe-top);
  z-index: 45;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 30px 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .2px;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  color: #000;
}
.statusbar.is-light { color: #fff; }
.statusbar .sb-right { display: flex; align-items: center; gap: 6px; }
.statusbar svg { display: block; }
.statusbar svg * { fill: currentColor; }
.statusbar svg [stroke] { fill: none; stroke: currentColor; }

.island {
  position: absolute;
  top: 11px; left: 50%;
  transform: translateX(-50%);
  width: 124px; height: 35px;
  border-radius: 20px;
  background: #000;
  z-index: 50;
  pointer-events: none;
}

/* 点击区：比横条本身大，方便手指按到 */
.homebar-zone {
  position: absolute;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 176px; height: 34px;
  display: grid;
  place-items: center;
  z-index: 48;
  cursor: pointer;
}
.homebar {
  width: 139px; height: 5px;
  border-radius: 3px;
  background: #000;
  opacity: .85;
  pointer-events: none;
}
.homebar.is-light { background: #fff; }

/* --------------------------------------------------------------------------
   锁屏
   -------------------------------------------------------------------------- */
#lockLayer {
  display: flex;
  flex-direction: column;
  color: #fff;
}
.lock-clock {
  padding: 62px 0 0;
  text-align: center;
  text-shadow: 0 1px 20px rgba(0,0,0,.25);
}
.lock-time {
  font-size: 82px;
  font-weight: 350;
  letter-spacing: -2px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.lock-date {
  margin-top: 2px;
  font-size: 17px;
  font-weight: 500;
  opacity: .95;
}

.lock-notes {
  flex: 1;
  min-height: 0;
  padding: 26px 16px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  scrollbar-width: none;
}
.lock-notes::-webkit-scrollbar { display: none; }

.note-card {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(28, 28, 30, .62);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  animation: noteIn .5s var(--ease-ios) both;
}
@keyframes noteIn {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to   { opacity: 1; transform: none; }
}
.note-icon {
  flex: 0 0 34px; height: 34px;
  border-radius: 9px;
  display: grid; place-items: center;
  font-size: 18px;
  color: #fff;
}
.note-body { flex: 1; min-width: 0; }
.note-top { display: flex; align-items: baseline; gap: 6px; }
.note-app { font-size: 13px; font-weight: 600; opacity: .75; text-transform: uppercase; letter-spacing: .3px; }
.note-when { margin-left: auto; font-size: 12px; opacity: .65; font-variant-numeric: tabular-nums; }
.note-title { font-size: 15px; font-weight: 600; margin-top: 1px; }
.note-text  { font-size: 14px; opacity: .82; margin-top: 2px; line-height: 1.35; }

.lock-foot {
  padding: 0 0 46px;
  text-align: center;
}
.lock-hint {
  font-size: 14px;
  opacity: .9;
  animation: breathe 2.6s ease-in-out infinite;
}
@keyframes breathe { 0%,100% { opacity: .45 } 50% { opacity: .95 } }

/* 锁屏底部两个圆钮（手电筒/相机） */
.lock-tools {
  position: absolute;
  bottom: 26px; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  padding: 0 52px;
  pointer-events: none;
}
.lock-tool {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(0,0,0,.28);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: grid; place-items: center;
  color: #fff;
  font-size: 19px;
}

/* --------------------------------------------------------------------------
   PIN 解锁
   -------------------------------------------------------------------------- */
.pin-wrap {
  position: absolute;
  inset: 0;
  z-index: 70;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(10, 11, 13, .55);
  backdrop-filter: blur(30px) saturate(1.4);
  -webkit-backdrop-filter: blur(30px) saturate(1.4);
  color: #fff;
  padding-top: 108px;
  animation: fadeIn .28s ease both;
}
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }

.pin-title { font-size: 20px; font-weight: 600; }
.pin-sub   { font-size: 13px; opacity: .6; margin-top: 4px; }
.pin-dots  { display: flex; gap: 16px; margin: 26px 0 34px; }
.pin-dot {
  width: 13px; height: 13px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,.55);
  transition: background .12s ease, transform .12s ease;
}
.pin-dot.on { background: #fff; transform: scale(1.06); }
.pin-wrap.err .pin-dots { animation: shake .38s ease; }
@keyframes shake {
  0%,100% { transform: translateX(0) }
  22% { transform: translateX(-9px) }
  44% { transform: translateX(8px) }
  66% { transform: translateX(-5px) }
  88% { transform: translateX(3px) }
}
.pin-wrap.err .pin-dot { border-color: rgba(255, 99, 89, .9); }

.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 74px);
  gap: 18px 24px;
}
.pin-key {
  width: 74px; height: 74px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.14);
  color: #fff;
  font-size: 30px;
  font-weight: 400;
  font-family: inherit;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .12s ease;
}
.pin-key:active { background: rgba(255,255,255,.32); }
.pin-key.fn { font-size: 15px; background: transparent; }

/* --------------------------------------------------------------------------
   主屏
   -------------------------------------------------------------------------- */
.home-scroll {
  height: 100%;
  overflow: hidden;
  display: flex;
}
.home-page {
  flex: 0 0 100%;
  padding: calc(var(--safe-top) + 18px) 22px 0;
  display: flex;
  flex-direction: column;
}
.app-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px 18px;
  align-content: start;
}
.app-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  transition: transform .16s var(--ease-ios);
}
.app-item:active { transform: scale(.9); }
.app-icon {
  position: relative;
  width: 61px; height: 61px;
  border-radius: 14.5px;
  overflow: visible;
  box-shadow: 0 3px 10px rgba(0,0,0,.28);
}
.app-icon svg { width: 100%; height: 100%; display: block; border-radius: 14.5px; }
.app-label {
  font-size: 11.5px;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,.6);
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.app-badge {
  position: absolute;
  top: -6px; right: -7px;
  min-width: 22px; height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  background: var(--red);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 1.5px rgba(255,255,255,.25);
  font-variant-numeric: tabular-nums;
}

.dock {
  position: absolute;
  left: 14px; right: 14px;
  bottom: calc(var(--safe-bot) + 6px);
  padding: 12px 10px 10px;
  border-radius: 32px;
  background: rgba(255,255,255,.16);
  backdrop-filter: blur(26px) saturate(1.5);
  -webkit-backdrop-filter: blur(26px) saturate(1.5);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.dock .app-item { gap: 5px; }

.page-dots {
  position: absolute;
  bottom: calc(var(--safe-bot) + 88px);
  left: 0; right: 0;
  display: flex;
  justify-content: center;
  gap: 7px;
}
.page-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,.35);
}
.page-dot.on { background: #fff; }

/* --------------------------------------------------------------------------
   应用通用框架
   -------------------------------------------------------------------------- */
#appLayer { display: none; flex-direction: column; }
#appLayer.on { display: flex; }

.app-nav {
  flex: 0 0 auto;
  padding: calc(var(--safe-top) + 2px) 12px 8px;
  background: var(--ios-card);
  border-bottom: .5px solid var(--ios-sep-thin);
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  position: relative;
  z-index: 5;
}
.app-back {
  display: flex;
  align-items: center;
  gap: 2px;
  background: none;
  border: none;
  color: var(--blue);
  font-size: 17px;
  font-family: inherit;
  cursor: pointer;
  padding: 4px 6px 4px 0;
  margin-left: -6px;
}
.app-back svg { width: 11px; height: 19px; }
.app-nav-title {
  position: absolute;
  left: 0; right: 0;
  text-align: center;
  font-size: 17px;
  font-weight: 600;
  pointer-events: none;
}
.app-nav-action {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--blue);
  font-size: 17px;
  font-family: inherit;
  cursor: pointer;
  padding: 4px 2px;
}

.app-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding-bottom: calc(var(--safe-bot) + 12px);
  background: var(--ios-bg);
}

/* 自身不滚动，供聊天页这类需要固定底栏的应用使用 */
.app-body--fixed {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding-bottom: 0;
}

.app-title-lg {
  padding: 6px 20px 10px;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: .3px;
  background: var(--ios-bg);
}

/* 列表 */
.list {
  background: var(--ios-card);
  margin: 0 0 18px;
  border-top: .5px solid var(--ios-sep-thin);
  border-bottom: .5px solid var(--ios-sep-thin);
}
.list-hd {
  padding: 16px 16px 6px;
  font-size: 13px;
  color: var(--ios-label-2);
  background: var(--ios-bg);
  text-transform: none;
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  background: var(--ios-card);
  border: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  font-size: 17px;
  color: var(--ios-label);
  cursor: pointer;
  position: relative;
}
.row + .row::before {
  content: "";
  position: absolute;
  top: 0; left: 16px; right: 0;
  height: .5px;
  background: var(--ios-sep-thin);
}
.row:active { background: #E5E5EA; }
.row-static { cursor: default; }
.row-static:active { background: var(--ios-card); }
.row-main { flex: 1; min-width: 0; }
.row-title { font-size: 17px; }
.row-sub {
  font-size: 13px;
  color: var(--ios-label-2);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row-meta {
  font-size: 13px;
  color: var(--ios-label-3);
  text-align: right;
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
}
.chev { flex: 0 0 auto; color: var(--ios-label-3); }
.chev svg { width: 8px; height: 13px; display: block; }

/* 头像 */
.avatar {
  flex: 0 0 auto;
  width: 46px; height: 46px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 17px;
  font-weight: 500;
  overflow: hidden;
  background: linear-gradient(145deg, #8E9AAF, #6B7690);
}
.avatar.sm { width: 38px; height: 38px; border-radius: 10px; font-size: 15px; }
.avatar.lg { width: 62px; height: 62px; border-radius: 16px; font-size: 22px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.grp-badge {
  position: relative;
  width: 46px; height: 46px;
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
}
.grp-badge i {
  border-radius: 4px;
  background: linear-gradient(145deg, #9AA6BB, #707C93);
}
.grp-badge.sm { width: 38px; height: 38px; gap: 1.5px; }

/* --------------------------------------------------------------------------
   微信
   -------------------------------------------------------------------------- */
.wx-root { background: var(--ios-card); min-height: 100%; }
.wx-search {
  padding: 6px 12px 10px;
  background: var(--ios-card);
}
.wx-search span {
  display: block;
  text-align: center;
  padding: 7px;
  border-radius: 10px;
  background: var(--ios-fill);
  color: var(--ios-label-2);
  font-size: 15px;
}

.wx-row { padding: 10px 14px; }
.wx-row .row-main { min-width: 0; }
.wx-name { font-size: 16.5px; font-weight: 400; }
.wx-preview {
  font-size: 14px;
  color: var(--ios-label-2);
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wx-row .row-meta { align-self: flex-start; padding-top: 3px; font-size: 12.5px; }
.wx-pin { background: #F7F7F9; }
.wx-pin:active { background: #EDEDF1; }
.wx-pin .row-main { padding-left: 16px; position: relative; }
.wx-pin .row-main::before {
  content: "";
  position: absolute;
  left: 2px; top: 6px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ios-label-3);
}

/* 聊天页 */
.chat-root {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--wx-bg);
}
.chat-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding: 12px 12px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.msg {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  animation: msgIn .38s var(--ease-ios) both;
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(9px); }
  to   { opacity: 1; transform: none; }
}
.msg.mine { flex-direction: row-reverse; }
.msg-bd { max-width: 232px; display: flex; flex-direction: column; gap: 3px; }
.msg.mine .msg-bd { align-items: flex-end; }
.msg-sender { font-size: 11.5px; color: var(--ios-label-2); padding: 0 2px; }
.bubble {
  position: relative;
  padding: 9px 12px;
  border-radius: 16px;
  background: var(--wx-bubble);
  font-size: 16px;
  line-height: 1.38;
  word-break: break-word;
  white-space: pre-wrap;
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
.msg.mine .bubble { background: var(--wx-mine); }
/* 气泡小尖角 */
.bubble::before {
  content: "";
  position: absolute;
  top: 12px; left: -5px;
  width: 0; height: 0;
  border: 5px solid transparent;
  border-right-color: var(--wx-bubble);
  border-left: 0;
}
.msg.mine .bubble::before {
  left: auto; right: -5px;
  border-right: 0;
  border-left: 5px solid var(--wx-mine);
}

.msg-center {
  align-self: center;
  max-width: 78%;
  text-align: center;
  font-size: 12px;
  color: #fff;
  background: rgba(0,0,0,.16);
  padding: 3px 10px;
  border-radius: 6px;
  animation: msgIn .38s var(--ease-ios) both;
}
.msg-center.plain { background: none; color: var(--ios-label-2); padding: 2px 4px; }

/* 图片消息 */
.bubble.img { padding: 3px; overflow: hidden; }
.bubble.img .ph { border-radius: 13px; display: block; width: 176px; height: 216px; }

/* 语音消息 */
.bubble.voice {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 74px;
  cursor: pointer;
}
.bubble.voice .wave {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 17px;
}
.bubble.voice .wave i {
  width: 2px;
  border-radius: 1px;
  background: currentColor;
  opacity: .55;
}
.bubble.voice .sec { font-size: 13px; opacity: .7; font-variant-numeric: tabular-nums; }
.bubble.voice .unread {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--red);
  flex: 0 0 auto;
}

/* 转账 */
.bubble.transfer {
  width: 214px;
  padding: 0;
  overflow: hidden;
  background: #FA9D3B;
  color: #fff;
}
.bubble.transfer .t-top {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 13px 14px;
}
.bubble.transfer .t-ico {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,.24);
  display: grid; place-items: center;
  font-size: 17px;
  flex: 0 0 auto;
}
.bubble.transfer .t-amt { font-size: 19px; font-weight: 600; line-height: 1.15; }
.bubble.transfer .t-note { font-size: 12px; opacity: .92; margin-top: 1px; }
.bubble.transfer .t-bot {
  padding: 7px 14px;
  background: rgba(0,0,0,.1);
  font-size: 12px;
}

/* 通话记录消息 */
.bubble.call {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14.5px;
  color: var(--ios-label-2);
}

/* 表情 */
.bubble.sticker { background: none; box-shadow: none; font-size: 62px; padding: 0; line-height: 1; }
.bubble.sticker::before { display: none; }

/* 输入条 */
.chat-input {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px calc(var(--safe-bot) + 4px);
  background: var(--wx-bar);
  border-top: .5px solid var(--ios-sep-thin);
}
.chat-input .fake {
  flex: 1;
  height: 38px;
  border-radius: 19px;
  background: var(--ios-card);
  display: flex;
  align-items: center;
  padding: 0 15px;
  color: var(--ios-label-3);
  font-size: 15px;
}
.chat-input .ico { font-size: 23px; opacity: .75; }

.chat-nav-name { display: flex; flex-direction: column; align-items: center; line-height: 1.15; }
.chat-nav-name small { font-size: 11.5px; color: var(--ios-label-2); font-weight: 400; }

/* --------------------------------------------------------------------------
   朋友圈
   -------------------------------------------------------------------------- */
.mm-root { background: var(--ios-card); min-height: 100%; }
.mm-cover {
  position: relative;
  height: 232px;
  margin-bottom: 46px;
}
.mm-cover .ph { width: 100%; height: 100%; display: block; }
.mm-me {
  position: absolute;
  right: 14px; bottom: -30px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.mm-me-name { font-size: 19px; font-weight: 600; color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,.5); padding-bottom: 16px; }

.mm-post { display: flex; gap: 11px; padding: 14px 15px 6px; }
.mm-post-bd { flex: 1; min-width: 0; }
.mm-author { font-size: 16px; font-weight: 600; color: #576B95; }
.mm-text { font-size: 16px; margin-top: 3px; white-space: pre-wrap; word-break: break-word; }
.mm-imgs { display: grid; gap: 4px; margin-top: 7px; }
.mm-imgs.c1 { grid-template-columns: 148px; }
.mm-imgs.c2, .mm-imgs.c4 { grid-template-columns: repeat(2, 92px); }
.mm-imgs.c3 { grid-template-columns: repeat(3, 92px); }
.mm-imgs .ph { width: 100%; height: 92px; border-radius: 3px; }
.mm-foot { display: flex; align-items: center; gap: 8px; margin-top: 7px; font-size: 12.5px; color: var(--ios-label-2); }
.mm-loc { color: #576B95; font-size: 12.5px; margin-top: 5px; }
.mm-box { margin: 8px 0 0; background: #F7F7F7; border-radius: 4px; padding: 8px 10px; font-size: 14px; }
.mm-likes { display: flex; flex-wrap: wrap; gap: 3px; padding-bottom: 6px; border-bottom: .5px solid rgba(0,0,0,.06); }
.mm-like { color: #576B95; }
.mm-cm { padding-top: 6px; }
.mm-cm + .mm-cm { padding-top: 4px; }
.mm-cm b { color: #576B95; font-weight: 600; }

/* --------------------------------------------------------------------------
   照片
   -------------------------------------------------------------------------- */
.ph-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  padding: 3px;
}
.ph-cell {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: #D8D8DC;
  border: none;
  padding: 0;
  cursor: pointer;
}
.ph-cell .ph { width: 100%; height: 100%; object-fit: cover; display: block; }

.viewer {
  position: absolute;
  inset: 0;
  z-index: 80;
  background: #000;
  display: flex;
  flex-direction: column;
  animation: fadeIn .2s ease both;
}
.viewer-top {
  flex: 0 0 auto;
  padding: calc(var(--safe-top) + 4px) 16px 8px;
  display: flex;
  align-items: center;
  color: #fff;
}
.viewer-stage {
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 0 12px;
}
.viewer-stage .ph { max-width: 100%; max-height: 100%; border-radius: 6px; }
.viewer-cap {
  flex: 0 0 auto;
  padding: 12px 20px calc(var(--safe-bot) + 18px);
  color: rgba(255,255,255,.75);
  font-size: 13.5px;
  text-align: center;
}

/* 占位图：用柔和渐变生成，避免依赖外部图片 */
.ph {
  background-image: var(--ph-bg, linear-gradient(140deg, #9AA6BB, #6B7690));
  background-size: cover;
  background-position: center;
  position: relative;
}
.ph::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.10), transparent 42%, rgba(0,0,0,.16));
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   备忘录
   -------------------------------------------------------------------------- */
.notes-root { background: var(--ios-card); min-height: 100%; }
.note-item { padding: 13px 16px; }
.note-item .row-title { font-size: 16.5px; font-weight: 600; }
.note-item .row-sub { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.note-detail { padding: 16px 20px 30px; }
.note-detail .t { font-size: 24px; font-weight: 700; margin-bottom: 4px; }
.note-detail .d { font-size: 12.5px; color: var(--ios-label-2); margin-bottom: 16px; }
.note-detail .b { font-size: 16px; line-height: 1.62; white-space: pre-wrap; word-break: break-word; }

/* --------------------------------------------------------------------------
   音乐
   -------------------------------------------------------------------------- */
.mu-track { padding: 10px 16px; }
.mu-track .row-title { font-size: 16px; }
.mu-track .row-sub { font-size: 13px; }
.mu-playing { color: var(--red); }
/* 贴着内容底部，滚动时粘住 */
.mu-player {
  position: sticky;
  bottom: 0;
  margin: 16px 12px 0;
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(250,250,250,.82);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: flex;
  align-items: center;
  gap: 11px;
  box-shadow: 0 6px 22px rgba(0,0,0,.14);
}

/* --------------------------------------------------------------------------
   Safari
   -------------------------------------------------------------------------- */
.sf-item { padding: 12px 16px; }
.sf-item .row-title { font-size: 15.5px; font-weight: 400; }
.sf-item .row-sub { font-size: 12.5px; color: var(--ios-label-3); }

/* --------------------------------------------------------------------------
   天气
   -------------------------------------------------------------------------- */
.we-root {
  min-height: 100%;
  padding: 8px 20px 24px;
  background: linear-gradient(180deg, #2C3E63 0%, #1B2942 52%, #101A2C 100%);
  color: #fff;
  text-align: center;
}
.we-city { font-size: 33px; font-weight: 400; }
.we-temp { font-size: 92px; font-weight: 200; letter-spacing: -3px; line-height: 1.05; }
.we-cond { font-size: 19px; opacity: .8; margin-top: -4px; }
.we-hl { font-size: 18px; opacity: .75; margin-top: 3px; }
.we-hours {
  margin-top: 20px;
  padding: 12px 14px;
  border-radius: 15px;
  background: rgba(255,255,255,.12);
  display: flex;
  justify-content: space-between;
}
.we-hour { display: flex; flex-direction: column; align-items: center; gap: 7px; font-size: 14px; }
.we-hour span:first-child { opacity: .75; }
.we-hour span:last-child { font-weight: 500; }
.we-note {
  margin-top: 16px;
  padding: 11px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,.1);
  font-size: 14px;
  text-align: left;
  line-height: 1.45;
}

/* --------------------------------------------------------------------------
   时钟
   -------------------------------------------------------------------------- */
.ck-row { padding: 12px 16px; }
.ck-row .row-title { font-size: 22px; font-weight: 300; font-variant-numeric: tabular-nums; }
.ck-row .row-sub { font-size: 14px; }
.ck-alarm { padding: 11px 16px; }
.ck-alarm .row-title { font-size: 34px; font-weight: 300; font-variant-numeric: tabular-nums; }
.ck-alarm.off .row-title, .ck-alarm.off .row-sub { opacity: .35; }

/* --------------------------------------------------------------------------
   抖音
   -------------------------------------------------------------------------- */
.dy-root { background: #161823; min-height: 100%; padding-bottom: calc(var(--safe-bot) + 8px); }
.dy-card { position: relative; }
.dy-card .ph { width: 100%; height: 300px; display: block; filter: brightness(.82); }
.dy-overlay {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 14px 15px;
  color: #fff;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.62));
}
.dy-author { font-size: 14px; font-weight: 600; }
.dy-text { font-size: 14.5px; margin-top: 3px; line-height: 1.35; }

/* --------------------------------------------------------------------------
   地图
   -------------------------------------------------------------------------- */
.mp-root {
  position: relative;
  min-height: 100%;
  background:
    linear-gradient(180deg, #E8E6E1 0%, #DEDCD6 100%);
}
.mp-root::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(0deg,  rgba(0,0,0,.05) 0 1px, transparent 1px 46px),
    repeating-linear-gradient(90deg, rgba(0,0,0,.05) 0 1px, transparent 1px 46px),
    repeating-linear-gradient(54deg, rgba(0,0,0,.035) 0 1px, transparent 1px 78px);
}
.mp-pins { position: relative; padding: calc(var(--safe-top) + 16px) 16px 20px; display: flex; flex-direction: column; gap: 10px; }
.mp-pin {
  background: var(--ios-card);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 2px 10px rgba(0,0,0,.08);
  display: flex;
  align-items: center;
  gap: 11px;
}

/* 相机 */
.cam-root {
  min-height: 100%;
  background: #000;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  padding: 0 30px;
}
.cam-frame {
  width: 210px; height: 280px;
  border: 2px solid rgba(255,255,255,.3);
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 15px;
  color: rgba(255,255,255,.6);
}

/* --------------------------------------------------------------------------
   设置
   -------------------------------------------------------------------------- */
.st-about {
  padding: 20px 20px 0;
  font-size: 13.5px;
  color: var(--ios-label-2);
  line-height: 1.55;
  white-space: pre-wrap;
}

/* --------------------------------------------------------------------------
   外围：房间里的注解文字
   -------------------------------------------------------------------------- */
.room-note {
  position: fixed;
  left: 0; right: 0;
  bottom: 22px;
  text-align: center;
  font-size: 11.5px;
  letter-spacing: .6px;
  color: var(--chalk-dim);
  pointer-events: none;
  z-index: 2;
  font-variant-numeric: tabular-nums;
}
.room-note b { color: var(--chalk); font-weight: 500; }

.update-flag {
  position: fixed;
  left: 50%;
  top: 28px;
  transform: translateX(-50%);
  padding: 7px 15px;
  border-radius: 20px;
  background: rgba(20, 23, 26, .78);
  border: 1px solid rgba(235,240,245,.10);
  color: var(--chalk);
  font-size: 12.5px;
  letter-spacing: .3px;
  z-index: 5;
  display: none;
  animation: flagIn .6s var(--ease-ios) both;
  font-variant-numeric: tabular-nums;
}
.update-flag.on { display: block; }
@keyframes flagIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@media (min-width: 701px) {
  .room-note { display: block; }
}

/* --------------------------------------------------------------------------
   移动端：去掉外壳，手机界面铺满屏幕
   -------------------------------------------------------------------------- */
@media (max-width: 700px) {
  .stage { background: #000; }
  .stage::before, .stage::after { display: none; }
  .room-note, .update-flag { display: none !important; }
  .phone {
    width: 100%;
    height: 100dvh;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
  }
  .phone::after { display: none; }
  .screen { border-radius: 0; }
  .island { top: 0; width: 112px; height: 30px; border-radius: 16px; }
  :root { --safe-top: 48px; --safe-bot: 22px; }
  #homeLayer .home-page { padding-top: calc(var(--safe-top) + 26px); }
  .lock-clock { padding-top: 54px; }
  .lock-time { font-size: 74px; }
  .msg-bd { max-width: 74%; }
}

/* --------------------------------------------------------------------------
   可访问性
   -------------------------------------------------------------------------- */
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 6px;
}
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .lock-hint { opacity: .8; }
}

/* --------------------------------------------------------------------------
   作者模式（浏览器内编辑）
   -------------------------------------------------------------------------- */
.ed-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 200;
  width: 50px; height: 50px;
  border-radius: 25px;
  border: 1px solid rgba(235,240,245,.14);
  background: rgba(20, 23, 26, .9);
  color: var(--chalk);
  font-size: 17px;
  cursor: pointer;
  display: grid;
  place-items: center;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.ed-fab:hover { color: #fff; border-color: rgba(235,240,245,.3); }

.ed-panel {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 460px;
  max-width: 100vw;
  z-index: 300;
  background: #101215;
  border-left: 1px solid rgba(235,240,245,.1);
  color: rgba(235,240,245,.88);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .3s var(--ease-ios);
  font-size: 13px;
}
.ed-panel.on { transform: none; }
.ed-head {
  flex: 0 0 auto;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(235,240,245,.09);
  display: flex;
  align-items: center;
  gap: 10px;
}
.ed-head h2 { margin: 0; font-size: 15px; font-weight: 600; }
.ed-head .sp { margin-left: auto; display: flex; gap: 7px; }
.ed-body { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 18px 30px; }
.ed-sec { margin-bottom: 20px; }
.ed-sec > h3 {
  margin: 0 0 9px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(235,240,245,.4);
}
.ed-field { margin-bottom: 11px; }
.ed-field label {
  display: block;
  font-size: 11.5px;
  color: rgba(235,240,245,.5);
  margin-bottom: 3px;
}
.ed-field input, .ed-field textarea, .ed-field select {
  width: 100%;
  padding: 7px 9px;
  border-radius: 7px;
  border: 1px solid rgba(235,240,245,.13);
  background: rgba(255,255,255,.04);
  color: inherit;
  font-family: inherit;
  font-size: 13px;
}
.ed-field textarea { min-height: 66px; resize: vertical; line-height: 1.5; }
.ed-field input:focus, .ed-field textarea:focus, .ed-field select:focus {
  outline: none;
  border-color: rgba(120,170,255,.55);
}
.ed-btn {
  padding: 7px 13px;
  border-radius: 7px;
  border: 1px solid rgba(235,240,245,.16);
  background: rgba(255,255,255,.05);
  color: inherit;
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
}
.ed-btn:hover { background: rgba(255,255,255,.1); }
.ed-btn.primary { background: rgba(60,120,220,.85); border-color: transparent; color: #fff; }
.ed-btn.primary:hover { background: rgba(70,135,240,.95); }
.ed-btn.danger { color: #FF8A80; border-color: rgba(255,138,128,.3); }
.ed-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 9px;
  border-radius: 8px;
  background: rgba(255,255,255,.035);
  margin-bottom: 7px;
}
.ed-row .grow { flex: 1; min-width: 0; }
.ed-row .nm { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-row .mt { font-size: 11px; color: rgba(235,240,245,.4); }
.ed-empty { font-size: 12.5px; color: rgba(235,240,245,.35); padding: 8px 0; }
.ed-hint { font-size: 11.5px; color: rgba(235,240,245,.4); line-height: 1.6; }

@media (max-width: 700px) {
  .ed-panel { width: 100vw; }
  .ed-fab { right: 14px; bottom: 14px; }
}

/* 加载 / 错误状态 */
.boot {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--room);
  color: var(--chalk-dim);
  font-size: 13px;
  z-index: 999;
}
.boot.err {
  color: rgba(255, 138, 128, .8);
  padding: 30px;
  text-align: center;
  line-height: 1.7;
}
