/* 外壳：桌面工具栏、手机边框、状态栏、模式切换 chrome、底部 Tab */
.app {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; padding: 20px;
}

/* 工具栏 */
.toolbar { width: 390px; display: flex; align-items: center; gap: 10px; }
.seg { display: flex; background: #1C1E22; border-radius: var(--r-pill); padding: 3px; flex: none; }
.seg button {
  color: #A9AFB8; padding: 6px 12px; border-radius: var(--r-pill); font-size: 12px; white-space: nowrap;
  transition: all .2s;
}
.seg button.on { background: #fff; color: #111; font-weight: 600; }
.jump {
  flex: 1; min-width: 0; height: 32px; border-radius: var(--r-sm); background: #1C1E22; color: #D8DBE0;
  border: 1px solid #34373D; padding: 0 8px; font-size: 12px; outline: none;
}

/* 手机边框 390×844 */
.phone {
  position: relative; width: 390px; height: 844px; flex: none; background: var(--bg);
  border-radius: 54px; overflow: hidden; display: flex; flex-direction: column;
  box-shadow: 0 0 0 12px #0B0B0C, 0 0 0 14px #3A3D42, 0 30px 80px rgba(0, 0, 0, .55);
}

/* 状态栏 */
.statusbar {
  height: 54px; flex: none; position: relative; background: #fff;
  display: flex; align-items: flex-end; justify-content: space-between;
  padding: 0 30px 10px 34px; font-size: 15px; font-weight: 600; color: var(--text);
  transition: background .2s, color .2s; z-index: 20;
}
.island {
  position: absolute; top: 11px; left: 50%; transform: translateX(-50%);
  width: 112px; height: 34px; border-radius: 20px; background: #000; z-index: 21;
}
.sicons { display: flex; align-items: center; gap: 6px; }
.sig { display: inline-flex; align-items: flex-end; gap: 1.5px; height: 11px; }
.sig b { width: 3px; background: currentColor; border-radius: 1px; }
.sig b:nth-child(1) { height: 4px; }
.sig b:nth-child(2) { height: 6px; }
.sig b:nth-child(3) { height: 8.5px; }
.sig b:nth-child(4) { height: 11px; }
.sicons .ic { width: 16px; height: 16px; }
.batt {
  width: 25px; height: 12px; border: 1.5px solid currentColor; border-radius: 3.5px; padding: 1.5px; position: relative;
}
.batt::after {
  content: ""; position: absolute; right: -4px; top: 3px; width: 2px; height: 4px;
  background: currentColor; border-radius: 0 1px 1px 0;
}
.batt b { display: block; height: 100%; width: 80%; background: currentColor; border-radius: 1.5px; }

/* 模式 chrome */
.chrome { flex: none; }
.chrome-h5 {
  height: 44px; background: #F2F3F5; border-bottom: 1px solid #E5E6E8;
  display: flex; align-items: center; padding: 0 10px; gap: 8px;
}
.addr {
  flex: 1; height: 30px; border-radius: var(--r-pill); background: #fff;
  display: flex; align-items: center; gap: 6px; padding: 0 12px; font-size: 13px; color: var(--text-2);
  overflow: hidden; white-space: nowrap;
}
.addr .ic { width: 14px; height: 14px; color: var(--text-3); }
.chrome-h5 > .ic { width: 18px; height: 18px; color: var(--text-2); }
.chrome-android {
  height: 44px; background: #fff; border-bottom: 1px solid var(--divider);
  display: flex; align-items: center; padding: 0 12px; gap: 10px; font-size: 16px; font-weight: 500;
}
.chrome-android .ic { width: 22px; height: 22px; }
.capsule {
  position: absolute; top: 60px; right: 8px; width: 87px; height: 32px; border-radius: var(--r-pill);
  background: rgba(255, 255, 255,.65); border: 1px solid rgba(0, 0, 0, .12); z-index: 40;
  display: flex; align-items: center; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.capsule span { flex: 1; display: flex; align-items: center; justify-content: center; color: #111; }
.capsule span:first-child { border-right: 1px solid rgba(0, 0, 0, .12); }
.capsule .ic { width: 18px; height: 18px; }
.capsule span[data-act="capsule"] { height: 100%; cursor: pointer; }

/* 页面容器与浮层 */
#page { flex: 1; min-height: 0; position: relative; overflow: hidden; }
#overlay { position: absolute; inset: 0; z-index: 100; pointer-events: none; }
#overlay > *:not(.toast-wrap) { pointer-events: auto; }

/* 边框内为 Home Indicator 预留空间 */
.phone .tabbar { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
.phone .page-foot { padding-bottom: calc(22px + env(safe-area-inset-bottom)); }

/* 底部 Tab */
.tabbar {
  flex: none; background: #fff; border-top: 1px solid var(--divider);
  display: flex; padding-bottom: env(safe-area-inset-bottom); z-index: 15;
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 7px 0 5px; color: var(--text-3); font-size: 10px; position: relative;
}
.tab .ic { width: 24px; height: 24px; stroke-width: 1.7; }
.tab.on { color: var(--primary); font-weight: 600; }
.tab .badge {
  position: absolute; top: 2px; left: 50%; margin-left: 6px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: var(--r-pill); background: var(--accent); color: #fff; font-size: 10px; line-height: 16px;
  text-align: center; font-weight: 600; border: 1.5px solid #fff; box-sizing: content-box;
}
.home-indicator {
  position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%);
  width: 134px; height: 5px; border-radius: 3px; background: rgba(0, 0, 0, .28); z-index: 30; pointer-events: none;
}
.tabbar + .home-indicator { background: #111; }

/* 全屏（真实手机 / ≤480px） */
@media (max-width: 480px) {
  .app { padding: 0; gap: 0; min-height: 100dvh; }
  .toolbar, .statusbar, .island, .home-indicator { display: none; }
  .phone {
    width: 100%; height: 100dvh; border-radius: 0; box-shadow: none; background: var(--bg);
  }
  .phone .tabbar { padding-bottom: calc(6px + env(safe-area-inset-bottom)); }
  .phone .page-foot { padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
  .capsule { top: calc(env(safe-area-inset-top) + 6px); }
}
