* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--f-body);
  color: var(--c-ink);
  background: #CFDDF0;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
h1, h2, p { margin: 0; }

/* 手机外框：电脑上看时居中成 390 宽 */
.app {
  position: relative;
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  margin: 0 auto;
  overflow: hidden;
  background-image: var(--bg-image);
  /* 深色背景图时，靠这层半透明白把字托起来（JS 看图算出来后调 --bg-mask-opacity） */
  position: relative;
  background-size: cover;
  background-position: center;
}

.glass {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.25);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.25);
  border: 1px solid var(--glass-line);
  box-shadow: inset 0 1px 0 var(--glass-highlight), var(--glass-shadow);
}

.cap { font-size: var(--fs-cap); line-height: 16px; color: var(--c-ink-2); }
.mono { font-family: var(--f-mono); }
.serif { font-family: var(--f-title); }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* 底栏 */
.tabbar {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: calc(min(100vw, 430px) - 48px);
  height: 60px;
  border-radius: var(--r-pill);
  padding: 6px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  background: var(--glass-bg-strong);
  z-index: 10;
}
.tabbar a {
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 11px;
  line-height: 14px;
  color: var(--c-ink-3);
  transition: background 0.2s, color 0.2s;
}
.tabbar a[aria-current="page"] { background: var(--c-whale); color: #FFFFFF; }

/* 还没做的页 */
.todo-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--page-x) 120px;
}
.todo-page .glass { border-radius: var(--r-card); padding: 24px; text-align: center; }

/* 装饰：海雪、光线、鲸骨，只在首页用，放在这里方便别的页复用 */
.deco { position: absolute; pointer-events: none; }
.snow { position: absolute; border-radius: 50%; background: #FFFFFF; pointer-events: none; }

/* 背景图上面那层白雾：默认 0（透明）。深色图时由 JS 调高，字就压得住。 */
.app::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: #fff;
  opacity: var(--bg-mask-opacity, 0);
  transition: opacity .25s ease;
}
