/* Context redesign · iOS 端样式
   画布 393 × 852（iPhone 16 Pro）。内容平铺在米白底上；
   悬浮的导航、标签栏和浮层用玻璃；彩色只给具体内容。 */

/* ---------- 舞台与设备 ---------- */
body.m {
  min-height: 100vh;
  background: radial-gradient(120% 80% at 70% 0%, #fbfbf9 0%, #efefeb 60%, #e8e8e3 100%);
  overflow-x: hidden;
}
.stage { min-height: 100vh; display: flex; align-items: center; justify-content: center; gap: 88px; padding: 40px 32px; }
.stage-note { width: 340px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font: 800 17px/1 var(--display); letter-spacing: 0.04em; }
.brand svg { width: 24px; height: 24px; }
.stage-h { font: 700 52px/1.06 var(--display); letter-spacing: -0.03em; margin: 38px 0 0; }
.stage-h .emboss { margin-top: 10px; font-size: 52px; }
.stage-p { margin: 26px 0 0; font-size: 16px; line-height: 1.6; color: var(--ink-2); max-width: 320px; }
.stage-try { margin: 26px 0 0; padding: 0; list-style: none; counter-reset: t; display: grid; gap: 10px; }
.stage-try li { counter-increment: t; display: flex; gap: 12px; align-items: center; font-size: 14px; color: var(--ink-2); }
.stage-try li::before { content: counter(t); font: 600 12px/1 var(--mono); width: 24px; height: 24px; border-radius: 12px; display: grid; place-items: center; background: #fff; box-shadow: var(--pill-shadow); flex: none; }
.stage-links { display: inline-flex; gap: 4px; margin-top: 30px; padding: 4px; border-radius: 22px; background: rgba(0, 0, 0, 0.05); }
.stage-links a { color: var(--ink-2); text-decoration: none; font-size: 14px; font-weight: 600; padding: 8px 16px; border-radius: 18px; }
.stage-links a.on { background: #fff; color: var(--ink); box-shadow: var(--pill-shadow); }

.device {
  flex: none;
  zoom: var(--fit, 1);
  padding: 11px;
  border-radius: 68px;
  background: linear-gradient(150deg, #2c2c2e, #0d0d0e 40%, #1c1c1e);
  box-shadow: 0 0 0 1px #48484a inset, 0 0 0 2px #0b0b0c, 0 30px 60px -40px rgba(0, 0, 0, 0.4);
}
.phone {
  --top: 54px;
  --gx: 20px;
  --tab-bg: #f6f6f4;
  width: 393px; height: 852px;
  border-radius: 57px;
  overflow: hidden;
  position: relative;
  background: var(--canvas);
  isolation: isolate;
  transform: translateZ(0);
}
.statusbar { position: absolute; z-index: 90; top: 0; left: 0; right: 0; height: 54px; display: flex; align-items: center; justify-content: space-between; padding: 4px 32px 0 54px; pointer-events: none; }
.sb-time { font: 600 17px/1 var(--display); letter-spacing: -0.01em; }
.sb-r { display: inline-flex; align-items: center; gap: 6px; }
.sb-r svg { fill: var(--ink); }
.sb-bat { width: 26px; height: 12.5px; border-radius: 4px; border: 1px solid rgba(19, 19, 19, 0.38); padding: 1.5px; position: relative; }
.sb-bat::after { content: ""; position: absolute; right: -3.5px; top: 4px; width: 1.6px; height: 4px; border-radius: 0 1px 1px 0; background: rgba(19, 19, 19, 0.4); }
.sb-bat i { display: block; height: 100%; width: 72%; border-radius: 2px; background: var(--ink); }
.island { position: absolute; z-index: 95; top: 11px; left: 50%; transform: translateX(-50%); width: 124px; height: 36px; border-radius: 20px; background: #000; }
.home-ind { position: absolute; z-index: 96; bottom: 8px; left: 50%; transform: translateX(-50%); width: 136px; height: 5px; border-radius: 3px; background: rgba(0, 0, 0, 0.85); pointer-events: none; }

@media (max-width: 1060px) { .stage-note { display: none; } }
/* 真机或窄窗口：去掉外框与模拟状态栏 */
@media (max-width: 500px) {
  body.m:not(.embed) .stage { padding: 0; }
  body.m:not(.embed) .device { padding: 0; border-radius: 0; background: none; box-shadow: none; }
  body.m:not(.embed) .phone { width: 100vw; height: 100dvh; border-radius: 0; --top: max(env(safe-area-inset-top), 12px); }
  body.m:not(.embed) .statusbar, body.m:not(.embed) .island, body.m:not(.embed) .home-ind { display: none; }
}
body.embed { background: var(--canvas); }
body.embed .stage { padding: 0; min-height: 0; display: block; }
body.embed .stage-note { display: none; }
body.embed .device { padding: 0; border-radius: 0; background: none; box-shadow: none; }
body.embed .phone { border-radius: 0; }


/* ---------- 页面与导航栈 ---------- */
#views { position: absolute; inset: 0; }
.tabview { position: absolute; inset: 0; display: none; }
.tabview.active { display: block; }
.page { position: absolute; inset: 0; background: var(--canvas); transition: transform 0.42s var(--ease), filter 0.42s var(--ease); overflow: hidden; }
.page.pushed { box-shadow: -1px 0 0 rgba(0, 0, 0, 0.06); }
.page.pushed.enter { transform: translateX(100%); }
.page.behind { transform: translateX(-26%); filter: brightness(0.96); }
.scroll { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; padding-top: calc(var(--top) + 50px); overscroll-behavior: contain; }
.scroll::-webkit-scrollbar { display: none; }
.tail { height: 132px; }
.has-hero .scroll { padding-top: 0; }

.nav { position: absolute; z-index: 30; top: var(--top); left: 0; right: 0; height: 48px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; pointer-events: none; }
.nav > * { pointer-events: auto; }
.nav-l, .nav-r { display: flex; gap: 8px; min-width: 44px; }
.nav-r { justify-content: flex-end; }
.ctitle { position: absolute; left: 50%; transform: translate(-50%, 4px); font: 600 17px/1 var(--display); letter-spacing: -0.01em; opacity: 0; transition: opacity 0.2s, transform 0.25s var(--ease); pointer-events: none; white-space: nowrap; max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.page.scrolled .ctitle { opacity: 1; transform: translate(-50%, 0); }
/* iOS 26 的滚动边缘：上方内容逐渐模糊，而不是一条实心导航栏 */
.edge { position: absolute; z-index: 25; top: 0; left: 0; right: 0; height: calc(var(--top) + 70px); pointer-events: none; opacity: 0; transition: opacity 0.25s;
  background: linear-gradient(180deg, rgba(244, 244, 241, 0.96) 0%, rgba(244, 244, 241, 0.9) 62%, rgba(244, 244, 241, 0) 100%);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent); mask-image: linear-gradient(180deg, #000 70%, transparent); }
.page.scrolled .edge { opacity: 1; }
.has-hero:not(.scrolled) .nav .gbtn, .has-hero:not(.scrolled) .nav .gcap { background: rgba(30, 30, 30, 0.28); border-color: rgba(255, 255, 255, 0.22); color: #fff; box-shadow: none; }

.ava { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1.5px #fff; }


/* ---------- 标题与分区 ---------- */
.hd { padding: 6px 20px 0; }
.h1 { margin: 6px 0 0; font: 700 34px/1.12 var(--display); letter-spacing: -0.02em; }
.hd-sub { margin: 8px 0 0; color: var(--mute); font-size: 15px; }
.hd-sub.pad { padding: 0 20px; margin-top: -2px; }
.sec { margin-top: 32px; }
.sec.first { margin-top: 18px; }
.sec-hd { display: flex; align-items: center; justify-content: space-between; padding: 0 20px; margin-bottom: 12px; }
.sec-hd h2 { margin: 0; font: 650 20px/1.2 var(--display); letter-spacing: -0.02em; }
.more { font-size: 14px; color: var(--mute); display: inline-flex; align-items: center; gap: 3px; }
.more .ph { font-size: 13px; }
.more.muted { cursor: default; font-size: 12.5px; }
.more.muted .ph { font-size: 13px; }


/* ---------- 标签栏与 ＋ ---------- */
.tabbar { position: absolute; z-index: 60; left: 18px; right: 92px; bottom: 25px; height: 64px; border-radius: 32px; display: flex; padding: 4px; }
.tab { flex: 1; border-radius: 28px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font-size: 10.5px; font-weight: 600; color: var(--ink-2); transition: background 0.25s, color 0.25s; }
.tab svg { width: 26px; height: 26px; }
.tab.on { background: rgba(19, 19, 19, 0.06); color: var(--ink); }
.fab { position: absolute; z-index: 60; right: 18px; bottom: 25px; width: 64px; height: 64px; border-radius: 32px; display: grid; place-items: center; font-size: 27px; color: var(--ink); }
.fab:active, .tab:active { transform: scale(0.95); }


/* ---------- 浮层 ---------- */
.sheet-wrap { position: absolute; inset: 0; z-index: 100; pointer-events: none; }
.sheet-wrap.open { pointer-events: auto; }
.scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.18); opacity: 0; transition: opacity 0.35s; }
.open .scrim { opacity: 1; }
.sheet { position: absolute; left: 8px; right: 8px; bottom: 8px; max-height: calc(100% - 64px); border-radius: 46px; background: #f7f7f5; transform: translateY(110%); transition: transform 0.48s var(--ease); overflow: hidden; display: flex; flex-direction: column;
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.06), 0 -6px 24px -12px rgba(0, 0, 0, 0.18); }
.open .sheet { transform: none; }
.sheet-in { overflow-y: auto; scrollbar-width: none; padding-bottom: 26px; }
.sheet-in::-webkit-scrollbar { display: none; }
.grabber { width: 36px; height: 5px; border-radius: 3px; background: rgba(0, 0, 0, 0.16); margin: 7px auto 0; }
.sh-hd { display: flex; align-items: center; justify-content: space-between; padding: 6px 14px 0; }
.sh-hd h3 { margin: 0; font: 650 17px var(--display); }
.sh-sec { padding: 20px 6px 0; }
.sh-sec h4 { margin: 0 0 8px; padding: 0 24px; font-size: 13px; font-weight: 600; color: var(--mute); }
.sh-sec > .card { margin: 0 14px; }
.sh-sec > .search, .sh-sec > .chips { margin: 0 14px 18px; width: auto; }
.sh-sec > .chips { padding: 0; }
.sh-note { margin: 8px 24px 0; font-size: 12.5px; color: var(--mute); line-height: 1.5; }
.sh-sec .dayd { margin: 0 14px; }
.sh-sec .seg { margin: 0 14px; }
.ag-hd { display: flex; gap: 14px; align-items: center; padding: 14px 24px 0; }
.ag-hd .logo { width: 62px; height: 62px; border-radius: 18px; font-size: 30px; }
.ag-hd .logo-kimi b { font-size: 28px; }
.ag-hd h2 { margin: 0; font: 700 24px var(--display); letter-spacing: -0.02em; }
.ag-hd p { margin: 3px 0 0; font-size: 13px; color: var(--mute); }
.perm { display: flex; align-items: center; gap: 12px; height: 50px; padding: 0 14px; font-size: 15px; }
.perm > .ph { font-size: 19px; color: var(--ink-2); }
.perm span { flex: 1; }
.perm small { font-size: 12.5px; color: var(--mute); }
.perm small.v { font-family: var(--mono); color: var(--ink-2); }
.danger { display: block; width: calc(100% - 28px); margin: 0 14px; height: 50px; border-radius: 16px; background: #fff; border: 0.5px solid var(--line); color: var(--red); font-size: 15px; font-weight: 600; }


.toast { position: absolute; z-index: 120; top: 62px; left: 50%; transform: translate(-50%, -16px); height: 44px; padding: 0 18px 0 14px; border-radius: 22px; display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; white-space: nowrap; opacity: 0; transition: opacity 0.25s, transform 0.35s var(--ease); pointer-events: none; }
.toast .ph { color: var(--green); font-size: 18px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  .page, .sheet, .rcard, .toast { transition-duration: 0.01ms !important; }
}

.stage-lang { display: inline-flex; gap: 4px; margin: 14px 0 0 0; padding: 4px; border-radius: 22px; background: rgba(0, 0, 0, 0.05); }
.stage-lang button { font-size: 14px; font-weight: 600; padding: 8px 16px; border-radius: 18px; color: var(--ink-2); }
html[lang="zh-CN"] #lz, html:not([lang="en"]) #lz, html[lang="en"] #le { background: #fff; color: var(--ink); }
html[lang="en"] #lz { background: none; color: var(--ink-2); }
