/* 整体布局：顶栏 / 视图 / 底部导航 / 弹层 */
#app {
  max-width: 760px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
#topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 10px 14px 0;
}
.topbar-row { display: flex; align-items: center; gap: 8px; }
#app-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  flex: 1;
  user-select: none;
  -webkit-user-select: none;
}
.date-label { color: var(--dim); font-size: 13px; white-space: nowrap; }
.topbar-actions { display: flex; gap: 2px; }
#search-row { display: flex; align-items: center; padding: 8px 0 10px; }
#view-root { flex: 1; padding: 14px 14px 96px; }

#bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 760px;
  display: flex;
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  padding: 4px 2px calc(6px + env(safe-area-inset-bottom));
  z-index: 20;
}
#bottom-nav button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 0;
  color: var(--dim);
  font-size: 11px;
  border-radius: 8px;
}
#bottom-nav button.active { color: var(--accent); }

#fab-root {
  position: fixed;
  bottom: calc(78px + env(safe-area-inset-bottom));
  right: max(16px, calc(50% - 380px + 16px));
  z-index: 15;
}
#overlay-root, #toast-root { position: fixed; inset: 0; pointer-events: none; z-index: 50; }

#boot-hint {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text);
  font-size: 16px;
  z-index: 200;
  background: var(--bg);
  padding: 20px;
  text-align: center;
}
.boot-sub { color: var(--dim); font-size: 13px; }

#lock-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.lock-box {
  width: 100%;
  max-width: 340px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 24px;
  text-align: center;
}
.lock-box h2 { margin: 0 0 4px; font-size: 20px; }
.lock-sub { color: var(--dim); margin: 0 0 16px; font-size: 14px; }
.lock-box .dialog-actions { justify-content: space-between; }
