/* =============================================================
   社区生活 · APP 壳（独立安装包外观）
   - 桌面：深色舞台 + 手机外框，便于演示与截图
   - 手机：自动铺满全屏，模拟状态栏与外框全部隐藏
   - 三个 APP（用户端 / 商家接单端 / 跑腿接单端）共用本文件，
     仅通过 CSS 变量覆盖品牌色与文案
   ============================================================= */

:root {
  --shell-brand: #FFD100;
  --shell-brand-2: #FFB000;
  --shell-ink: #1A1A1A;
  /* 状态栏配色：随各 APP 顶部主色调调整，避免白底状态栏压在深色 header 上显得割裂 */
  --shell-status-bg: #fff;
  --shell-status-ink: #000;
  --shell-frame-h: min(844px, calc(100vh - 88px));
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

/* html 必须同步底色：body 内容不足一屏时，否则会露出浏览器默认白底 */
html { background: #070A12; }

body.shell {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  /* 舞台底色抽成变量：导航页在手机端也要沿用同款深色，不能落到白底 */
  --shell-stage-bg:
    radial-gradient(900px 520px at 50% -8%, #24314B 0%, rgba(36,49,75,0) 62%),
    radial-gradient(700px 500px at 88% 108%, rgba(255,209,0,.10) 0%, rgba(255,209,0,0) 60%),
    linear-gradient(180deg, #0C1322 0%, #070A12 100%);
  background: var(--shell-stage-bg);
  color: #E5E7EB;
  overflow: hidden;
}

/* ---------------------------------------------------------------- 舞台 */
.shell-stage {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 46px;
  padding: 24px;
}

/* ---------------------------------------------------------------- 手机外框 */
.device {
  position: relative;
  height: var(--shell-frame-h);
  aspect-ratio: 390 / 844;
  padding: 11px;
  border-radius: 56px;
  background: linear-gradient(155deg, #4A4A4E 0%, #242427 18%, #101012 52%, #000 100%);
  box-shadow:
    0 50px 90px -28px rgba(0, 0, 0, .92),
    0 0 0 1px rgba(255, 255, 255, .10),
    inset 0 0 0 1px rgba(255, 255, 255, .07),
    inset 0 1px 2px rgba(255, 255, 255, .22);
  flex: 0 0 auto;
}

/* 侧边实体键 */
.device::before,
.device::after {
  content: "";
  position: absolute;
  width: 3px;
  border-radius: 2px;
  background: linear-gradient(180deg, #3A3A3E, #1A1A1C);
}
.device::before { left: -3px; top: 132px; height: 62px; box-shadow: 0 82px 0 #2A2A2E; }
.device::after  { right: -3px; top: 158px; height: 96px; }

.device-screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 45px;
  overflow: hidden;
  background: #fff;
  display: flex;
  flex-direction: column;
  isolation: isolate;
}

/* ---------------------------------------------------------------- 状态栏 */
.status-bar {
  flex: 0 0 44px;
  height: 44px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 26px;
  background: var(--shell-status-bg);
  color: var(--shell-status-ink);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .2px;
  z-index: 5;
  user-select: none;
}

.status-bar .notch {
  position: absolute;
  left: 50%;
  top: 7px;
  transform: translateX(-50%);
  width: 106px;
  height: 29px;
  border-radius: 20px;
  background: #000;
}

.status-bar .sb-right {
  display: flex;
  align-items: center;
  gap: 5px;
}
.status-bar .sb-right svg { display: block; }
.status-bar .sb-battery { margin-left: 1px; }

/* ---------------------------------------------------------------- 屏幕主体 */
.screen-body {
  position: relative;
  flex: 1;
  min-height: 0;
  background: #F6F6F6;
}

.screen-body iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #F6F6F6;
}

/* Home 指示条：浮在 iframe 之上，模拟 iOS */
.home-indicator {
  position: absolute;
  left: 50%;
  bottom: 7px;
  transform: translateX(-50%);
  width: 134px;
  height: 5px;
  border-radius: 3px;
  background: rgba(0, 0, 0, .32);
  z-index: 6;
  pointer-events: none;
}

/* ---------------------------------------------------------------- 启动页 */
.splash {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  background:
    radial-gradient(520px 380px at 50% 22%, rgba(255, 255, 255, .34) 0%, rgba(255, 255, 255, 0) 62%),
    linear-gradient(168deg, var(--shell-brand-2) 0%, var(--shell-brand) 48%, var(--shell-brand-2) 100%);
  color: var(--shell-ink);
  transition: opacity .42s ease, visibility .42s ease;
}
.splash.hide { opacity: 0; visibility: hidden; }

.splash-logo {
  width: 96px;
  height: 96px;
  border-radius: 24px;
  box-shadow: 0 16px 34px rgba(0, 0, 0, .22), 0 0 0 1px rgba(255, 255, 255, .28);
  overflow: hidden;
  animation: splash-pop .55s cubic-bezier(.2, .9, .3, 1.2) both;
}
.splash-logo img { width: 100%; height: 100%; display: block; }

@keyframes splash-pop {
  from { opacity: 0; transform: scale(.82); }
  to   { opacity: 1; transform: scale(1); }
}

.splash-name {
  margin-top: 20px;
  font-size: 23px;
  font-weight: 800;
  letter-spacing: 1px;
}
.splash-sub {
  margin-top: 9px;
  font-size: 12.5px;
  letter-spacing: 2px;
  opacity: .72;
}

.splash-bar {
  margin-top: 40px;
  width: 108px;
  height: 3px;
  border-radius: 2px;
  background: rgba(0, 0, 0, .14);
  overflow: hidden;
}
.splash-bar i {
  display: block;
  width: 38%;
  height: 100%;
  border-radius: 2px;
  background: currentColor;
  opacity: .55;
  animation: splash-run 1.15s ease-in-out infinite;
}
@keyframes splash-run {
  0%   { transform: translateX(-110%); }
  100% { transform: translateX(300%); }
}

.splash-tip {
  margin-top: 14px;
  font-size: 11.5px;
  letter-spacing: 1px;
  opacity: .55;
}

.splash-foot {
  position: absolute;
  bottom: 34px;
  font-size: 10.5px;
  letter-spacing: .6px;
  opacity: .45;
}

/* ---------------------------------------------------------------- 右侧信息卡（桌面） */
.shell-meta {
  width: 268px;
  flex: 0 0 auto;
  align-self: center;
}

.shell-meta .badge-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.shell-meta .badge-row img {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .45);
}
.shell-meta h1 {
  margin: 0;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: .3px;
  color: #F3F4F6;
}
.shell-meta .sub {
  margin: 3px 0 0;
  font-size: 12px;
  color: #8A94A6;
  letter-spacing: .5px;
}

.shell-meta .url-box {
  margin: 20px 0 16px;
  padding: 12px 13px;
  border-radius: 11px;
  background: rgba(255, 255, 255, .045);
  border: 1px solid rgba(255, 255, 255, .09);
}
.shell-meta .url-box .lbl {
  font-size: 10.5px;
  letter-spacing: 1.2px;
  color: #6B7688;
  text-transform: uppercase;
  margin-bottom: 7px;
}
.shell-meta .url-box code {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: #CBD5E1;
  line-height: 1.65;
}
.shell-meta .url-box code .host {
  color: #8B96A9;
  font-size: 11px;
}
.shell-meta .url-box code .path {
  display: block;
  color: #E2E8F0;
  font-weight: 600;
}

.shell-meta .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.shell-meta .actions button,
.shell-meta .actions a {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .06);
  color: #D5DAE3;
  font-size: 12px;
  padding: 8px 14px;
  border-radius: 9px;
  cursor: pointer;
  text-decoration: none;
  transition: all .15s;
  font-family: inherit;
}
.shell-meta .actions button:hover,
.shell-meta .actions a:hover {
  background: rgba(255, 255, 255, .12);
  border-color: rgba(255, 255, 255, .24);
  color: #fff;
}
.shell-meta .actions button:active { transform: translateY(1px); }

.shell-meta .tips {
  margin-top: 20px;
  font-size: 11.5px;
  line-height: 1.85;
  color: #6B7688;
}
.shell-meta .tips b { color: #9AA5B6; font-weight: 600; }

/* ---------------------------------------------------------------- 手机 / 平板：铺满全屏 */
@media (max-width: 900px) {
  body.shell {
    background: #fff;
    overflow: auto;
  }
  /* 导航页没有 iframe，保持深色舞台，否则白底上的浅色文字会看不见 */
  body.shell.hub-page {
    background: var(--shell-stage-bg);
    background-attachment: fixed;
  }
  .shell-stage {
    display: block;
    padding: 0;
    height: 100%;
    gap: 0;
  }
  .device {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    aspect-ratio: auto;
    padding: 0;
    border-radius: 0;
    background: #fff;
    box-shadow: none;
  }
  .device::before,
  .device::after { display: none; }
  .device-screen {
    border-radius: 0;
  }
  /* 真机用系统状态栏，隐藏模拟状态栏 */
  .status-bar { display: none; }
  .home-indicator { display: none; }
  .shell-meta { display: none; }
  /* 「添加到主屏幕」后内容会延伸到系统状态栏下，按安全区留白 */
  .screen-body {
    padding-top: constant(safe-area-inset-top);
    padding-top: env(safe-area-inset-top, 0px);
  }
}

/* 横屏手机：保持可用 */
@media (max-width: 900px) and (orientation: landscape) {
  .device { height: 100vh; height: 100dvh; }
}
