/* LUMEN · 归一 — 真机外壳 */
:root {
  --desk: #1a1b22;
  --desk2: #0e0f14;
  --ink: #e8e4f5;
  --muted: #8b84a3;
  --dim: #5c5570;
  --accent: #7cf0c8;
  --accent2: #a78bfa;
  --danger: #f07178;
  --warn: #e6c07b;
  --panel: rgba(28, 26, 40, 0.92);
  --line: rgba(180, 160, 255, 0.12);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --mono: "SF Mono", "Cascadia Code", Consolas, ui-monospace, monospace;
  --sb-h: 54px;
  --nav-h: 52px;
  --tab-h: 56px;
  --safe-b: 18px;
}

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

html, body {
  height: 100%;
  background: var(--desk);
  color: var(--ink);
  font-family: var(--font);
  overflow: hidden;
}

body {
  background:
    radial-gradient(ellipse 90% 60% at 50% 100%, rgba(80, 70, 120, 0.25), transparent),
    radial-gradient(ellipse 50% 40% at 50% 0%, rgba(40, 50, 80, 0.2), transparent),
    linear-gradient(160deg, #1c1d26, #0b0c10 60%);
}

/* ========== 开场 ========== */
.intro {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: #030308;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  transition: opacity 0.7s ease;
}
.intro.hide { opacity: 0; pointer-events: none; }
.intro-inner { width: min(480px, 100%); }
.intro-brand {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--accent2);
  margin-bottom: 18px;
}
.intro-log {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.85;
  color: var(--muted);
  min-height: 280px;
  white-space: pre-wrap;
  word-break: break-all;
}
.intro-log .ok { color: var(--accent); }
.intro-log .hot { color: var(--danger); }
.intro-log .dim { color: var(--dim); }
.intro-timer { margin-top: 16px; font-family: var(--mono); font-size: 12px; color: var(--warn); }
.intro-hint { margin-top: 6px; font-size: 12px; color: var(--dim); }
.intro-skip {
  margin-top: 20px;
  background: none;
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--dim);
  font-size: 12px;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--font);
}
.intro-skip:hover { color: var(--muted); border-color: rgba(255,255,255,0.15); }

/* ========== 桌面 + 机身 ========== */
#stage {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

#device {
  position: relative;
  width: min(393px, 100vw - 12px);
  height: min(852px, 100vh - 20px);
  max-height: 852px;
}

.device-glow {
  position: absolute;
  inset: 8% 5%;
  background: radial-gradient(ellipse, rgba(167, 139, 250, 0.18), transparent 70%);
  filter: blur(30px);
  pointer-events: none;
}

.device-body {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 54px;
  background: linear-gradient(145deg, #3a3a42, #0a0a0c 40%, #1c1c22);
  padding: 12px;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.06),
    0 0 0 3px #0a0a0b,
    0 40px 80px rgba(0,0,0,0.65),
    inset 0 1px 0 rgba(255,255,255,0.12);
}

.device-island {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 32px;
  background: #000;
  border-radius: 20px;
  z-index: 60;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
}
.device-island::after {
  content: "";
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #1a3a55, #0a1520);
  box-shadow: 0 0 4px rgba(80,160,255,0.35);
}

.device-screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 44px;
  overflow: hidden;
  background: #000;
  isolation: isolate;
}

/* ========== 状态栏 ========== */
.status-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: var(--sb-h);
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 28px 6px;
  pointer-events: none;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.status-bar.dark-ink { color: rgba(255,255,255,0.95); }

.sb-right {
  display: flex;
  align-items: center;
  gap: 5px;
}

.sb-signal {
  display: flex;
  align-items: flex-end;
  gap: 1.5px;
  height: 11px;
}
.sb-signal i {
  display: block;
  width: 3px;
  background: currentColor;
  border-radius: 1px;
  opacity: 0.35;
}
.sb-signal i:nth-child(1) { height: 4px; opacity: 1; }
.sb-signal i:nth-child(2) { height: 6px; opacity: 1; }
.sb-signal i:nth-child(3) { height: 8px; opacity: 1; }
.sb-signal i:nth-child(4) { height: 11px; }
.sb-signal.bars-1 i:nth-child(n + 2) { opacity: 0.25; }
.sb-signal.bars-2 i:nth-child(n + 3) { opacity: 0.25; }
.sb-signal.bars-3 i:nth-child(4) { opacity: 0.25; }
.sb-signal.no-sig i { opacity: 0.15; }

.sb-wifi { display: flex; color: currentColor; }

.sb-batt {
  display: flex;
  align-items: center;
  gap: 4px;
}
.sb-batt-pct { font-size: 12px; font-weight: 500; }
.sb-batt-icon {
  width: 25px;
  height: 12px;
  border: 1px solid currentColor;
  border-radius: 3px;
  position: relative;
  opacity: 0.9;
}
.sb-batt-icon::after {
  content: "";
  position: absolute;
  right: -3px;
  top: 3px;
  width: 2px;
  height: 5px;
  background: currentColor;
  border-radius: 0 1px 1px 0;
  opacity: 0.5;
}
.sb-batt-fill {
  position: absolute;
  left: 1px;
  top: 1px;
  bottom: 1px;
  width: 70%;
  background: currentColor;
  border-radius: 1.5px;
}

/* ========== 屏幕基座 ========== */
.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  background: #000;
  z-index: 1;
}
.screen.active {
  display: flex;
  z-index: 10;
  animation: screenIn 0.16s ease-out;
}
@keyframes screenIn {
  from {
    opacity: 0.35;
    transform: scale(0.985) translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.home-indicator {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 134px;
  height: 5px;
  border-radius: 3px;
  background: rgba(255,255,255,0.35);
  z-index: 55;
  pointer-events: auto;
  cursor: pointer;
  height: 22px;
  background: transparent;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 8px;
}
.home-indicator::after {
  content: "";
  width: 134px;
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.35);
}
.nav-exit {
  background: none;
  border: none;
  color: var(--accent2);
  font-size: 13px;
  font-family: var(--font);
  cursor: pointer;
  padding: 8px 4px;
  white-space: nowrap;
}
.home-indicator-space { height: 28px; flex-shrink: 0; }

/* ========== 锁屏 ========== */
.lock-wallpaper,
.home-wallpaper {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% 20%, rgba(167, 139, 250, 0.35), transparent 55%),
    radial-gradient(ellipse 60% 40% at 80% 90%, rgba(124, 240, 200, 0.12), transparent 50%),
    linear-gradient(180deg, #1a1430 0%, #0a0814 45%, #05050c 100%);
}

.lock-content {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding-top: calc(var(--sb-h) + 12px);
}

.lock-clock {
  text-align: center;
  padding: 12px 0 20px;
  color: #fff;
  text-shadow: 0 2px 20px rgba(0,0,0,0.35);
}
.lock-date {
  font-size: 16px;
  font-weight: 500;
  opacity: 0.9;
  margin-bottom: 2px;
}
.lock-time {
  font-size: 78px;
  font-weight: 300;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.lock-notifs {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scrollbar-width: none;
}
.lock-notifs::-webkit-scrollbar { display: none; }

.ios-notif {
  display: flex;
  gap: 10px;
  padding: 12px 12px 12px 10px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 0.5px solid rgba(255,255,255,0.12);
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
}
.ios-notif:active { transform: scale(0.98); }
.ios-notif.expanded { background: rgba(30, 28, 45, 0.75); }

.ios-notif-icon {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}
.notif-icon-sys {
  background: linear-gradient(145deg, #5eead4, #a78bfa);
  box-shadow: 0 2px 8px rgba(124,240,200,0.3);
}
.notif-icon-sys::after {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.9);
  box-shadow: 0 0 8px rgba(255,255,255,0.5);
}
.notif-icon-msg { background: #34c759; }

.ios-notif-body { flex: 1; min-width: 0; }
.ios-notif-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2px;
  font-size: 12px;
  color: rgba(255,255,255,0.7);
}
.ios-notif-title {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 2px;
}
.ios-notif-text {
  font-size: 13px;
  color: rgba(255,255,255,0.88);
  line-height: 1.4;
}
.ios-notif-expand { margin-top: 10px; }
.expand-rule {
  height: 0.5px;
  background: rgba(255,255,255,0.15);
  margin: 8px 0;
}
.expand-meta {
  font-size: 11px;
  color: rgba(255,255,255,0.55);
  font-family: var(--mono);
  margin-bottom: 6px;
}
.expand-code {
  font-family: var(--mono);
  font-size: 15px;
  color: #7cf0c8;
  background: rgba(124,240,200,0.1);
  border: 1px dashed rgba(124,240,200,0.35);
  padding: 10px 12px;
  border-radius: 10px;
  text-align: center;
  user-select: all;
  margin: 8px 0;
}
.chat-bubble-in {
  background: rgba(255,255,255,0.12);
  border-radius: 14px 14px 14px 4px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.55;
  color: #fff;
}

.lock-footer {
  padding: 10px 0 28px;
  color: rgba(255,255,255,0.55);
  font-size: 12px;
  text-align: center;
}
.lock-swipe {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.lock-swipe-bar {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.35);
  animation: swipeUp 1.8s ease-in-out infinite;
}
@keyframes swipeUp {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50% { transform: translateY(-6px); opacity: 1; }
}

/* ========== 主屏 ========== */
.home-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px 8px;
  padding: calc(var(--sb-h) + 28px) 20px 12px;
}

.app-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  font-family: var(--font);
  padding: 0;
}
.app-icon.muted { cursor: default; opacity: 0.55; }
.app-icon.small { gap: 0; }

.app-glyph {
  width: 60px;
  height: 60px;
  border-radius: 13.5px; /* iOS 近似 squircle */
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow:
    0 1px 1px rgba(255, 255, 255, 0.18) inset,
    0 6px 14px rgba(0, 0, 0, 0.35),
    0 0 0 0.5px rgba(0, 0, 0, 0.12);
  position: relative;
  overflow: hidden;
}
.app-glyph::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), transparent 42%);
  pointer-events: none;
  border-radius: inherit;
}
.app-icon.small .app-glyph { width: 52px; height: 52px; border-radius: 11.5px; }
.ico-svg {
  width: 72%;
  height: 72%;
  display: block;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.15));
}

.lumen-glyph {
  background:
    radial-gradient(ellipse 80% 60% at 50% 20%, rgba(255, 255, 255, 0.25), transparent 50%),
    linear-gradient(160deg, #2dd4bf 0%, #6366f1 48%, #a855f7 100%);
}
.msg-glyph {
  background: linear-gradient(180deg, #5cd87a 0%, #2faf4a 100%);
}
.photo-glyph {
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.15), transparent 40%),
    linear-gradient(145deg, #1c1c1e, #2c2c2e);
}
.photo-glyph .ico-svg { width: 78%; height: 78%; }
.note-glyph {
  background: linear-gradient(180deg, #ffd60a 0%, #f7b500 100%);
}
.cal-glyph {
  background: linear-gradient(180deg, #ffffff 0%, #f2f2f7 100%);
}
.brow-glyph {
  background: linear-gradient(180deg, #5ac8fa 0%, #007aff 55%, #0055d4 100%);
}
.music-glyph {
  background: linear-gradient(180deg, #fc5c7d 0%, #f2436a 45%, #e03050 100%);
}
.set-glyph {
  background: linear-gradient(180deg, #aeaeb2 0%, #8e8e93 50%, #636366 100%);
}
.phone-glyph {
  background: linear-gradient(180deg, #5cd87a 0%, #2faf4a 100%);
}

.app-label {
  font-size: 12px;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.45);
}

.app-icon { position: relative; }
.app-badge {
  position: absolute;
  top: -4px;
  right: 8px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #ff3b30;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.app-badge[hidden] { display: none; }

/* ========== 信息 App ========== */
.msg-list-body {
  background: #0b0a12;
  padding-top: 8px;
}
.msg-search {
  margin: 0 0 12px;
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(255,255,255,0.08);
  color: var(--dim);
  font-size: 14px;
  text-align: center;
}
.msg-row {
  width: 100%;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 4px;
  background: none;
  border: none;
  border-bottom: 0.5px solid var(--line);
  color: inherit;
  cursor: pointer;
  font-family: var(--font);
  text-align: left;
}
.msg-row.muted-row { opacity: 0.55; cursor: default; }
.msg-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(145deg, #a78bfa, #7cf0c8);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.msg-avatar.sys {
  background: linear-gradient(145deg, #64748b, #334155);
}
.msg-row-main { flex: 1; min-width: 0; }
.msg-row-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 3px;
}
.msg-name { font-size: 15px; font-weight: 600; }
.msg-time { font-size: 12px; color: var(--dim); }
.msg-preview {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 聊天 */
.nav-title-id {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.15;
}
.chat-title-name { font-size: 15px; font-weight: 600; }
.chat-title-sub {
  font-size: 10px;
  color: var(--dim);
  font-weight: 400;
  margin-top: 2px;
}

.chat-body {
  display: flex;
  flex-direction: column;
  background: #0b0a12;
  padding-bottom: 8px;
}
.chat-day {
  text-align: center;
  font-size: 11px;
  color: var(--dim);
  margin: 8px 0 14px;
}
.chat-row {
  display: flex;
  margin-bottom: 8px;
  padding: 0 2px;
}
.chat-row.in { justify-content: flex-start; }
.chat-row.out { justify-content: flex-end; }
.bubble {
  max-width: 82%;
  padding: 10px 13px;
  font-size: 14px;
  line-height: 1.5;
  border-radius: 18px;
  word-break: break-word;
}
.bubble.in {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border-bottom-left-radius: 5px;
}
.bubble.out {
  background: linear-gradient(135deg, #5eead4, #a78bfa);
  color: #0a0a12;
  border-bottom-right-radius: 5px;
  font-weight: 500;
}
.glitch-bubble {
  animation: bubbleGlitch 0.4s steps(2) 1;
  border: 1px solid rgba(240,113,120,0.4);
}
@keyframes bubbleGlitch {
  0% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  50% { transform: translateX(2px); }
  100% { transform: translateX(0); }
}

.chat-compose {
  margin-top: auto;
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 0 4px;
  position: sticky;
  bottom: 0;
  background: linear-gradient(transparent, #0b0a12 30%);
}
.chat-compose input {
  flex: 1;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--ink);
  padding: 10px 14px;
  font-size: 15px;
  outline: none;
  font-family: var(--font);
}
.chat-compose input:focus {
  border-color: rgba(167,139,250,0.45);
}
.chat-send {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #34c759;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}
.chat-send:disabled {
  opacity: 0.4;
  cursor: default;
}

/* 主屏新图标 — 已由上方 app-glyph 体系覆盖 */

/* 相册 */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
}
.photo-cell {
  aspect-ratio: 1;
  border: none;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  background: #111;
  border-radius: 2px;
}
.photo-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.photo-view-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 8px;
}
.photo-view-body img {
  width: 100%;
  max-height: 58vh;
  object-fit: contain;
  border-radius: 10px;
  background: #000;
}
.photo-meta {
  align-self: stretch;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
  margin-top: 12px;
}
.photo-cap {
  align-self: stretch;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  margin-top: 8px;
}
.photo-actions {
  align-self: stretch;
  margin-top: 14px;
}
.wall-clue {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 120px;
  z-index: 5;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(5, 5, 12, 0.72);
  border: 1px dashed rgba(124, 240, 200, 0.35);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
  backdrop-filter: blur(8px);
  pointer-events: none;
}

/* 恐怖：劫持遮罩 */
.hijack-veil {
  position: absolute;
  inset: 0;
  z-index: 90;
  background: rgba(5, 2, 10, 0.88);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  text-align: center;
  backdrop-filter: blur(6px);
}
.hijack-veil.show { display: flex; }
.hijack-veil h3 {
  color: var(--danger);
  font-size: 18px;
  letter-spacing: 0.2em;
  margin-bottom: 14px;
}
.hijack-veil p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
  max-width: 280px;
}
.hijack-veil .hj-n {
  margin-top: 22px;
  font-family: var(--mono);
  font-size: 28px;
  color: var(--warn);
}

/* 状态栏不对齐 / 观察中 */
.status-bar.batt-skew .sb-batt-pct {
  transform: translateY(2px);
  letter-spacing: 0.15em;
}
.status-bar.batt-skew .sb-batt-icon {
  transform: translateY(-2px) scaleX(1.15);
  opacity: 0.7;
}
.sb-watch {
  display: none;
  font-size: 10px;
  color: var(--danger);
  font-family: var(--mono);
  margin-right: 6px;
  letter-spacing: 0.08em;
}
.status-bar.watching .sb-watch { display: inline; }

/* 输入框被代打 */
input.ghost-typed {
  border-color: rgba(240, 113, 120, 0.55) !important;
  box-shadow: 0 0 0 3px rgba(240, 113, 120, 0.12) !important;
}

/* ========== 梦核 / 模拟恐怖 ========== */
.device-screen.dream-haze {
  filter: saturate(0.85) contrast(0.95) brightness(1.04);
}
.device-screen.dream-haze::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 95;
  background:
    radial-gradient(ellipse 120% 80% at 50% 30%, rgba(200, 180, 255, 0.08), transparent 55%),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(255, 255, 255, 0.015) 2px,
      rgba(255, 255, 255, 0.015) 3px
    );
  mix-blend-mode: soft-light;
}

.device-screen.vhs-on::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 94;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.12) 0px,
    rgba(0, 0, 0, 0.12) 1px,
    transparent 1px,
    transparent 3px
  );
  opacity: 0.55;
  animation: vhsRoll 7s linear infinite;
}
@keyframes vhsRoll {
  from { background-position: 0 0; }
  to { background-position: 0 36px; }
}

/* 测试卡 / 中断 */
.test-card {
  position: absolute;
  inset: 0;
  z-index: 120;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  background:
    linear-gradient(90deg, #c0c0c0 0 14.28%, #c0c000 14.28% 28.56%, #00c0c0 28.56% 42.84%, #00c000 42.84% 57.12%, #c000c0 57.12% 71.4%, #c00000 71.4% 85.68%, #0000c0 85.68% 100%),
    #111;
  font-family: var(--mono);
  color: #fff;
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.8);
}
.test-card.show {
  display: flex;
  animation: tcFlicker 0.12s steps(2) infinite;
}
.test-card .tc-t {
  background: rgba(0, 0, 0, 0.75);
  padding: 10px 16px;
  border-radius: 4px;
  font-size: 14px;
  letter-spacing: 0.2em;
}
.test-card .tc-s {
  font-size: 11px;
  opacity: 0.85;
  background: rgba(0, 0, 0, 0.55);
  padding: 4px 10px;
}
@keyframes tcFlicker {
  0% { filter: none; }
  50% { filter: contrast(1.2) brightness(1.05); }
  100% { filter: none; }
}

/* 录像带标签 */
.tape-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #e8e0d0;
  color: #1a1520;
  font-family: var(--mono);
  font-size: 11px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
  transform: rotate(-0.4deg);
}
.tape-bar img {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 2px;
  filter: contrast(1.1) saturate(0.7);
}
.tape-bar .tb-l {
  flex: 1;
  line-height: 1.4;
}
.burn-stamp {
  position: absolute;
  left: 10px;
  bottom: 52px;
  z-index: 4;
  font-family: var(--mono);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.75);
  text-shadow: 1px 1px 0 #000;
  pointer-events: none;
  letter-spacing: 0.08em;
}

/* 主屏图标错位 */
.home-grid.icons-drift .app-icon:nth-child(3) {
  transform: translateY(6px) rotate(1.5deg);
}
.home-grid.icons-drift .app-icon:nth-child(5) {
  transform: translateX(4px);
}
.home-grid.icons-drift .app-icon:nth-child(2) {
  opacity: 0.55;
}

/* 图标序列谜题 */
.home-grid.icon-puzzle-live .app-glyph {
  transition: box-shadow 0.2s, transform 0.2s;
}
.app-icon.pulse-seq .app-glyph {
  box-shadow:
    0 0 0 3px rgba(124, 240, 200, 0.85),
    0 0 22px rgba(124, 240, 200, 0.55),
    0 1px 1px rgba(255, 255, 255, 0.18) inset;
  transform: scale(1.06);
}
.app-icon.seq-hit .app-glyph {
  outline: 1px solid rgba(167, 139, 250, 0.6);
}
.app-icon.seq-fail .app-glyph {
  animation: seqShake 0.35s ease;
}
@keyframes seqShake {
  0%, 100% { transform: none; }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}

/* 备忘录 */
.note-body {
  font-size: 15px;
  line-height: 1.75;
  white-space: pre-wrap;
  color: var(--ink);
  background: var(--panel);
  border-radius: 12px;
  padding: 16px;
  border: 1px solid var(--line);
}

/* 日历 */
.cal-head {
  text-align: center;
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 12px;
}
.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 11px;
  color: var(--dim);
  margin-bottom: 6px;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 16px;
}
.cal-day {
  aspect-ratio: 1;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  cursor: default;
  font-family: var(--font);
  position: relative;
}
.cal-day.empty { visibility: hidden; }
.cal-day.event { cursor: pointer; font-weight: 600; }
.cal-day.event.dim { color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.cal-day.event.warn { color: var(--warn); box-shadow: inset 0 0 0 1px rgba(230,192,123,0.4); }
.cal-day.event.hot {
  color: #fff;
  background: rgba(240, 113, 120, 0.85);
  box-shadow: 0 0 12px rgba(240,113,120,0.35);
}
.cal-detail {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
  min-height: 72px;
}

/* 浏览器 */
.chrome-bar {
  padding: 8px 12px 10px;
  background: rgba(18, 16, 28, 0.92);
  border-bottom: 0.5px solid var(--line);
}
.url-box {
  background: rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--muted);
  font-family: var(--mono);
  text-align: center;
}
.browser-tabs {
  flex-shrink: 0;
  height: calc(48px + var(--safe-b));
  padding-bottom: var(--safe-b);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: rgba(14, 12, 22, 0.96);
  border-top: 0.5px solid var(--line);
}
.btab {
  background: none;
  border: none;
  color: var(--dim);
  font-size: 12px;
  font-family: var(--font);
  cursor: pointer;
}
.btab.active { color: var(--accent); font-weight: 600; }
.web-page h3 {
  font-size: 20px;
  margin-bottom: 12px;
  color: #c4b5fd;
}
.web-page p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
  margin-bottom: 10px;
}
.web-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.web-link {
  background: rgba(167,139,250,0.15);
  border: 1px solid rgba(167,139,250,0.3);
  color: var(--accent2);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  font-family: var(--font);
}

/* 设置关于 */
.about-panel {
  margin-top: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
}
.about-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
}
.about-dl {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 8px 10px;
  font-size: 12px;
  margin-bottom: 14px;
}
.about-dl dt { color: var(--dim); }
.about-dl dd { font-family: var(--mono); font-size: 11px; word-break: break-all; }
.mdm-box {
  border: 1px solid rgba(240,113,120,0.35);
  background: rgba(240,113,120,0.08);
  border-radius: 10px;
  padding: 12px;
}
.mdm-title { font-size: 13px; color: var(--danger); font-weight: 600; }
.mdm-sub { font-size: 11px; color: var(--dim); font-family: var(--mono); margin: 4px 0 8px; }
.mdm-body { font-size: 12px; color: var(--muted); line-height: 1.55; }

/* 缓存 */
.vault-sub-ok { color: var(--accent) !important; }

/* 音乐 */
.music-glyph { /* 已在 app-glyph 段定义 */ }
.music-now {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 14px;
}
.music-art {
  width: 96px;
  height: 96px;
  border-radius: 12px;
  background:
    url("assets/music-cover.jpg") center/cover no-repeat,
    linear-gradient(145deg, #2a1840, #0c0a14);
  border: 1px solid var(--line);
  margin-bottom: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}
.music-art.playing {
  animation: artPulse 1.6s ease-in-out infinite;
}
@keyframes artPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}
.music-now-t { font-size: 15px; font-weight: 600; }
.music-now-s { font-size: 12px; color: var(--dim); margin-top: 4px; }

/* 浏览器搜索 */
.search-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.search-row input {
  flex: 1;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  padding: 8px 12px;
  font-size: 13px;
  outline: none;
  font-family: var(--font);
}
.btn-search {
  border: none;
  border-radius: 10px;
  padding: 8px 14px;
  background: rgba(167,139,250,0.25);
  color: var(--accent2);
  font-size: 13px;
  cursor: pointer;
  font-family: var(--font);
  white-space: nowrap;
}
.web-search-result {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
}
.web-search-result.hot {
  border-color: rgba(240,113,120,0.4);
}
.web-search-result h4 {
  font-size: 14px;
  color: #c4b5fd;
  margin-bottom: 8px;
}
.web-search-result p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 4px;
}
.web-search-result.hot p { color: #f0a0a6; }

/* 见证旁路 — 极弱，非按钮样式 */
.witness-line {
  display: block;
  width: 100%;
  margin-top: 18px;
  padding: 8px 4px;
  background: none;
  border: none;
  border-top: 1px dashed rgba(255,255,255,0.06);
  color: rgba(232, 228, 245, 0.18);
  font-size: 11px;
  font-family: var(--font);
  cursor: pointer;
  text-align: left;
  letter-spacing: 0.02em;
}
.witness-line:hover {
  color: rgba(124, 240, 200, 0.55);
}
.witness-line[hidden] { display: none; }

/* ========== 缓存解锁后的邪典腐蚀 ========== */
.corrupted {
  color: #f0a0a6 !important;
  border-left: 2px solid rgba(240, 113, 120, 0.45);
  padding-left: 10px;
  animation: cultFlicker 3.2s ease-in-out infinite;
}
.corrupted-line {
  color: rgba(240, 160, 166, 0.95);
  animation: cultFlicker 4s ease-in-out infinite;
}
@keyframes cultFlicker {
  0%, 100% { opacity: 1; }
  48% { opacity: 1; }
  50% { opacity: 0.55; }
  52% { opacity: 1; }
  78% { opacity: 0.75; }
}
.wall-corrupt {
  filter: saturate(1.15) contrast(1.08) hue-rotate(-8deg);
}
.wall-corrupt::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 3px,
      rgba(240, 113, 120, 0.03) 3px,
      rgba(240, 113, 120, 0.03) 4px
    );
  pointer-events: none;
  mix-blend-mode: overlay;
}
body.cult-on .device-glow {
  background: radial-gradient(ellipse, rgba(240, 113, 120, 0.14), transparent 70%);
}
body.cult-on #device .device-body {
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.06),
    0 0 0 3px #0a0a0b,
    0 40px 80px rgba(0,0,0,0.65),
    0 0 60px rgba(240, 113, 120, 0.08),
    inset 0 1px 0 rgba(255,255,255,0.12);
}

.home-dock {
  position: relative;
  z-index: 2;
  margin-top: auto;
  margin-bottom: 36px;
  margin-left: 16px;
  margin-right: 16px;
  padding: 12px 16px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  display: flex;
  justify-content: space-around;
  border: 0.5px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2);
}

/* ========== App 导航 ========== */
.app-nav {
  flex-shrink: 0;
  height: calc(var(--sb-h) + var(--nav-h));
  padding: var(--sb-h) 8px 0;
  display: grid;
  grid-template-columns: minmax(44px, auto) 1fr minmax(44px, auto);
  align-items: center;
  background: rgba(18, 16, 28, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 0.5px solid var(--line);
  z-index: 20;
}
.app-nav.danger .nav-title { color: var(--danger); }

.nav-back {
  background: none;
  border: none;
  color: var(--accent2);
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
  font-family: var(--font);
  padding: 0 8px 4px;
  font-weight: 300;
}
.nav-title {
  text-align: center;
  font-size: 16px;
  font-weight: 600;
}
.nav-status {
  text-align: right;
  font-size: 11px;
  color: var(--dim);
  padding-right: 8px;
  font-family: var(--mono);
}
.nav-right { }

.app-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 18px 8px;
  background: #0b0a12;
  scrollbar-width: thin;
  scrollbar-color: #333 transparent;
  position: relative;
}
.app-body::-webkit-scrollbar { width: 3px; }
.app-body::-webkit-scrollbar-thumb { background: #333; }

.app-tabbar {
  flex-shrink: 0;
  height: calc(var(--tab-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: rgba(14, 12, 22, 0.96);
  backdrop-filter: blur(16px);
  border-top: 0.5px solid var(--line);
  z-index: 20;
}
.tab {
  background: none;
  border: none;
  color: var(--dim);
  font-size: 10px;
  font-family: var(--font);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 8px;
}
.tab.active { color: var(--accent); font-weight: 600; }

/* ========== App 内容 ========== */
.body-lead {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 14px;
}

.hub-hero {
  text-align: center;
  padding: 12px 8px 22px;
}
.hub-hero-ring {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 50%;
  border: 1px solid rgba(124,240,200,0.45);
  box-shadow: 0 0 28px rgba(124,240,200,0.15), inset 0 0 16px rgba(124,240,200,0.1);
  position: relative;
}
.hub-hero-ring::after {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124,240,200,0.55), transparent 70%);
  animation: breath 3s ease-in-out infinite;
}
@keyframes breath {
  0%, 100% { transform: scale(0.9); opacity: 0.55; }
  50% { transform: scale(1.05); opacity: 1; }
}
.hub-hero h2 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}
.hub-hero p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  padding: 0 8px;
}

.menu-list {
  background: var(--panel);
  border-radius: 16px;
  overflow: hidden;
  border: 0.5px solid var(--line);
}
.menu-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px;
  background: none;
  border: none;
  border-bottom: 0.5px solid var(--line);
  color: inherit;
  cursor: pointer;
  font-family: var(--font);
  text-align: left;
}
.menu-row:last-child { border-bottom: none; }
.menu-row.locked { opacity: 0.42; cursor: default; }
.menu-row:not(.locked):active { background: rgba(255,255,255,0.04); }

.menu-ico {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: rgba(167, 139, 250, 0.18);
  color: var(--accent2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.menu-main { flex: 1; min-width: 0; }
.menu-t { display: block; font-size: 15px; font-weight: 500; }
.menu-s { display: block; font-size: 12px; color: var(--dim); margin-top: 2px; }
.menu-chev { color: var(--dim); font-size: 18px; font-weight: 300; }

.memory-banner {
  background: rgba(167, 139, 250, 0.12);
  border: 1px solid rgba(167, 139, 250, 0.28);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.55;
  color: #c4b5fd;
  margin-bottom: 14px;
}

.section-label {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--dim);
  margin-bottom: 10px;
  text-transform: none;
}

.form-block {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  margin-top: 8px;
}

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.field label {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.06em;
}
.field input,
.query-box input,
.ritual input[type="text"] {
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  padding: 13px 14px;
  font-size: 16px;
  outline: none;
  font-family: var(--font);
  width: 100%;
}
.field input:focus,
.query-box input:focus {
  border-color: rgba(167, 139, 250, 0.5);
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.1);
}

.btn {
  appearance: none;
  border: none;
  border-radius: 12px;
  padding: 13px 16px;
  font-size: 15px;
  font-family: var(--font);
  cursor: pointer;
  width: 100%;
  transition: opacity 0.15s, transform 0.1s;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: linear-gradient(135deg, #5eead4, #a78bfa);
  color: #0a0a12;
  font-weight: 600;
}
.btn-ghost {
  background: rgba(255,255,255,0.06);
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn-danger {
  background: rgba(240, 113, 120, 0.18);
  color: var(--danger);
  border: 1px solid rgba(240, 113, 120, 0.4);
}
.dim-btn { opacity: 0.55; }
.ritual-cta { margin-top: 4px; }

.error-msg {
  color: var(--danger);
  font-size: 12px;
  min-height: 1.3em;
  margin-bottom: 8px;
  line-height: 1.4;
}

.meta-line {
  font-size: 10px;
  color: var(--dim);
  line-height: 1.55;
  font-family: var(--mono);
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 16px;
  user-select: text;
  word-break: break-all;
}

/* 誓言 */
.vow-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}
.vow-list li {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.55;
  display: flex;
  gap: 10px;
}
.vow-list li .idx {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 11px;
  flex-shrink: 0;
  padding-top: 3px;
}
.vow-list li .first {
  /* 与正文同色，避免剧透「每句第一个字」 */
  color: inherit;
  font-weight: inherit;
}

/* 透明运维字 */
.ghost-text {
  font-size: 11px;
  line-height: 1.65;
  color: transparent;
  margin-top: 18px;
  user-select: text;
  cursor: default;
}
.ghost-text::selection {
  color: #0a0a12;
  background: var(--accent);
}

.ops-note {
  margin-top: 18px;
  background: #07060c;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
}
.ops-label {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dim);
  letter-spacing: 0.2em;
  margin-bottom: 6px;
}

.terminal {
  background: #050508;
  border: 1px solid rgba(124, 240, 200, 0.15);
  border-radius: 12px;
  padding: 14px;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.7;
  color: var(--accent);
  margin-bottom: 14px;
}
.terminal .dim { color: var(--dim); }
.terminal .warn { color: var(--warn); }
.terminal .bad { color: var(--danger); }

/* 波形 / 播放器 */
.wave-canvas {
  width: 100%;
  height: 88px;
  background: #050508;
  border: 1px solid rgba(124, 240, 200, 0.18);
  border-radius: 10px;
  display: block;
}
.wave-controls {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.poster {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #0a0812;
  margin-bottom: 10px;
}
.poster-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 50% 28%, rgba(167, 139, 250, 0.4), transparent 68%),
    linear-gradient(180deg, #120e24, #05050c);
}
.poster-layer {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 24px 20px 28px;
  text-align: center;
  gap: 8px;
  transition: opacity 0.35s;
}
.poster-layer[hidden] {
  display: none !important;
}
#poster-mirrored { transform: scaleX(-1); }
.p-orb {
  position: absolute;
  top: 22%;
  left: 50%;
  transform: translateX(-50%);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 1px solid rgba(124,240,200,0.5);
  box-shadow: 0 0 30px rgba(124,240,200,0.25), inset 0 0 16px rgba(124,240,200,0.12);
}
.p-title {
  font-size: 26px;
  letter-spacing: 0.35em;
  text-indent: 0.35em;
  font-weight: 500;
}
.p-sub { font-size: 12px; color: var(--muted); letter-spacing: 0.16em; }
.p-foot { font-size: 10px; color: var(--dim); letter-spacing: 0.12em; }
.p-barcode {
  width: 70%;
  height: 28px;
  margin: 10px 0;
  background: repeating-linear-gradient(
    90deg,
    rgba(232,228,245,0.7) 0 2px,
    transparent 2px 4px,
    rgba(232,228,245,0.7) 4px 5px,
    transparent 5px 8px
  );
  opacity: 0.5;
}
.p-timeline { width: 100%; margin: 8px 0 4px; }
.p-tl-track {
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.12);
  position: relative;
  margin-bottom: 8px;
}
.p-tl-mark {
  position: absolute;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--danger);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 10px rgba(240,113,120,0.7);
}
.p-tl-labels {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dim);
}
.p-tl-labels .hot { color: var(--danger); font-weight: 600; }

.player {
  background: #050508;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  margin-bottom: 12px;
}
.stream-canvas {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  background: #000;
}
.stream-canvas[hidden] { display: none; }
.stream-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  background: #000;
  object-fit: cover;
}
.browser-hero {
  height: 120px;
  border-radius: 12px;
  margin-bottom: 14px;
  background:
    linear-gradient(180deg, transparent 40%, rgba(11,10,18,0.85)),
    url("assets/browser-hero.jpg") center/cover no-repeat;
  border: 1px solid var(--line);
}
.player-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 8px;
  border-top: 0.5px solid var(--line);
  background: #0a0910;
}
.player-time {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--accent);
  min-width: 58px;
}
.seek-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  height: 36px;
  padding: 0 2px;
}
.player-bar input[type="range"] {
  flex: 1;
  width: 100%;
  height: 28px;
  accent-color: var(--accent2);
  cursor: pointer;
  touch-action: none;
}
.player-bar input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}
.player-bar input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  margin-top: -8px;
  border-radius: 50%;
  background: #e8e4f5;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
  border: 2px solid var(--accent2);
  cursor: grab;
}
.btn-nudge {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  font-size: 14px;
  cursor: pointer;
  flex-shrink: 0;
  font-family: var(--font);
}
.btn-nudge:active { transform: scale(0.94); }
.btn-play {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-size: 11px;
  cursor: pointer;
}
.frame-overlay {
  position: absolute;
  right: 10px;
  top: 10px;
  background: rgba(5, 5, 10, 0.82);
  border: 1px solid rgba(240, 113, 120, 0.45);
  border-radius: 8px;
  padding: 8px 10px;
  z-index: 3;
  animation: glitchIn 0.15s steps(2);
}
.frame-code {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--danger);
  letter-spacing: 0.1em;
}
@keyframes glitchIn {
  from { opacity: 0; transform: translateX(4px); }
  to { opacity: 1; transform: none; }
}

/* 查询结果 */
.query-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.result-block {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
  display: none;
}
.result-block.show { display: block; }
.result-block h4 {
  font-size: 14px;
  margin-bottom: 10px;
  color: #c4b5fd;
}
.result-block dl {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 7px 10px;
  font-size: 12px;
}
.result-block dt { color: var(--dim); }
.result-block dd { font-family: var(--mono); font-size: 11px; }
.result-block dd.bad { color: var(--danger); }
.muted-p { font-size: 12px; color: var(--muted); line-height: 1.6; }

.alert-box {
  border: 1px solid rgba(240, 113, 120, 0.4);
  background: rgba(240, 113, 120, 0.08);
  border-radius: 12px;
  padding: 14px;
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--danger);
  display: none;
}
.alert-box.show { display: block; }

/* 仪式 */
.ritual { padding-top: 8px; }
.ritual h2 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 10px;
  letter-spacing: 0.06em;
}
.ritual .lead {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
  margin-bottom: 18px;
}
.ritual-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}
.countdown {
  font-family: var(--mono);
  color: var(--warn);
  font-size: 12px;
  margin-top: 16px;
  text-align: center;
}

.eyes {
  position: absolute;
  width: 80px;
  height: 30px;
  pointer-events: none;
  z-index: 5;
  display: none;
}
.eyes.show { display: block; }
.eye {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #1a1525;
  border: 1px solid rgba(240, 113, 120, 0.5);
  position: absolute;
  top: 4px;
  overflow: hidden;
}
.eye.l { left: 8px; }
.eye.r { right: 8px; }
.pupil {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* 结局 */
.ending .app-body { padding-top: 8px; }
.ending-code {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent2);
  letter-spacing: 0.18em;
  margin-bottom: 12px;
}
.ending h2 {
  font-size: 26px;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: 0.12em;
}
.ending .tagline {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 20px;
  line-height: 1.5;
}
.ending-body {
  font-size: 14px;
  line-height: 1.85;
}
.ending-body p { margin-bottom: 10px; }
.ending-footer {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ending-footer .note {
  font-size: 11px;
  color: var(--dim);
  line-height: 1.55;
  font-family: var(--mono);
}

/* Toast / Flash */
.toast {
  position: absolute;
  bottom: calc(var(--tab-h) + var(--safe-b) + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: rgba(30, 28, 42, 0.95);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 80;
  white-space: nowrap;
  max-width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.flash-scary {
  position: fixed;
  inset: 0;
  background: #0a0008;
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--danger);
  font-size: 18px;
  letter-spacing: 0.28em;
  text-align: center;
  padding: 40px;
  line-height: 2;
}
.flash-scary.show { display: flex; }

/* 通知中心 */
.nc-sheet {
  position: absolute;
  inset: 0;
  z-index: 70;
  background: rgba(8, 6, 14, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  padding: calc(var(--sb-h) + 8px) 14px 24px;
  animation: ncIn 0.2s ease-out;
}
.nc-sheet[hidden] { display: none !important; }
@keyframes ncIn {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: none; }
}
.nc-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.08em;
}
.nc-close {
  background: none;
  border: none;
  color: var(--accent2);
  font-size: 14px;
  cursor: pointer;
  font-family: var(--font);
  padding: 6px 4px;
}
.nc-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.nc-item {
  background: rgba(255, 255, 255, 0.1);
  border: 0.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 12px 14px;
}
.nc-item .nc-t {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 4px;
}
.nc-item .nc-b {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.45;
}
.nc-item .nc-time {
  font-size: 11px;
  color: var(--dim);
  margin-top: 6px;
  font-family: var(--mono);
}
.nc-item.hot {
  border-color: rgba(240, 113, 120, 0.35);
}
.nc-foot {
  text-align: center;
  font-size: 11px;
  color: var(--dim);
  padding-top: 12px;
}
.lock-blur {
  margin: 10px 12px 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(240, 113, 120, 0.15);
  border: 1px solid rgba(240, 113, 120, 0.35);
  color: #f0a0a6;
  font-size: 12px;
  text-align: center;
  font-family: var(--mono);
}
.witness-fade {
  animation: witIn 1.2s ease both;
}
@keyframes witIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ========== 响应式：桌面=机壳，手机=全屏内容 ========== */
/* 桌面默认已在上方定义：#device 有边框、Dynamic Island、桌面光晕 */

/* 手机 / 触控 / 窄屏：去掉机壳，铺满视口 */
@media (max-width: 520px),
  (max-height: 740px) and (max-width: 900px),
  (pointer: coarse) {
  html, body {
    background: #000;
    overflow: hidden;
    height: 100%;
    height: 100dvh;
  }
  body {
    background: #000;
  }
  #stage {
    padding: 0;
    height: 100%;
    height: 100dvh;
  }
  #device {
    width: 100vw;
    height: 100%;
    height: 100dvh;
    max-height: none;
  }
  .device-body {
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    background: #000;
    width: 100%;
    height: 100%;
  }
  .device-island { display: none; }
  .device-glow { display: none; }
  .device-screen {
    border-radius: 0;
    height: 100%;
  }
  .status-bar {
    padding-top: env(safe-area-inset-top, 0px);
    height: calc(var(--sb-h) + env(safe-area-inset-top, 0px));
  }
  .app-nav {
    padding-top: calc(var(--sb-h) + env(safe-area-inset-top, 0px));
    height: calc(var(--sb-h) + var(--nav-h) + env(safe-area-inset-top, 0px));
  }
  .lock-content {
    padding-top: calc(var(--sb-h) + 12px + env(safe-area-inset-top, 0px));
  }
  .home-grid {
    padding-top: calc(var(--sb-h) + 28px + env(safe-area-inset-top, 0px));
  }
  .home-dock {
    margin-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  }
  .app-tabbar,
  .browser-tabs {
    padding-bottom: calc(var(--safe-b) + env(safe-area-inset-bottom, 0px));
    height: calc(var(--tab-h) + var(--safe-b) + env(safe-area-inset-bottom, 0px));
  }
  .browser-tabs {
    height: calc(48px + var(--safe-b) + env(safe-area-inset-bottom, 0px));
  }
  .home-indicator { display: none; }
  .lock-time { font-size: 64px; }
}

/* 超宽桌面：机壳略放大 */
@media (min-width: 1100px) and (min-height: 860px) and (pointer: fine) {
  #device {
    width: min(414px, 100vw - 48px);
    height: min(896px, 100vh - 40px);
  }
}

/* 强制手机模式（body.is-handheld，JS 检测） */
body.is-handheld {
  background: #000 !important;
}
body.is-handheld #stage { padding: 0 !important; }
body.is-handheld #device {
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-height: none !important;
}
body.is-handheld .device-body {
  border-radius: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
  background: #000 !important;
}
body.is-handheld .device-island,
body.is-handheld .device-glow,
body.is-handheld .home-indicator { display: none !important; }
body.is-handheld .device-screen { border-radius: 0 !important; }
body.is-handheld .status-bar {
  padding-top: env(safe-area-inset-top, 0px) !important;
}
body.is-handheld .app-nav {
  padding-top: calc(var(--sb-h) + env(safe-area-inset-top, 0px)) !important;
  height: calc(var(--sb-h) + var(--nav-h) + env(safe-area-inset-top, 0px)) !important;
}
