* {
  box-sizing: border-box;
}

html {
  background: var(--page-bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  position: relative;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(120% 70% at 50% -10%, var(--bg-glow-top), transparent 55%),
    var(--paper-noise),
    var(--page-bg);
  color: var(--ink);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(80% 50% at 50% 100%, var(--bg-glow-bottom), transparent 70%);
  z-index: 0;
}

#app {
  position: relative;
  z-index: 1;
}
/* #bottom-nav 的定位/层级交给 .bottom-nav（fixed + z-index:20）处理，
   这里不要用 ID 选择器覆盖它的 position，否则导航会退回文档流、不再吸底。 */

/* —— 宇宙背景层（星象主题） —— */
@keyframes star-spin {
  to { transform: rotate(360deg); }
}

@keyframes star-spin-rev {
  to { transform: rotate(-360deg); }
}

#cosmos {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: none;
  overflow: hidden;
  pointer-events: none;
}

:root[data-theme="star"] #cosmos,
:root[data-theme="star-day"] #cosmos {
  display: block;
}

.cosmos-starfield {
  position: absolute;
  inset: 0;
  opacity: 0.7;
}

.cosmos-bagua {
  position: absolute;
  top: 50%;
  transform-origin: center;
}

.cosmos-bagua--outer {
  right: -190px;
  width: 560px;
  height: 560px;
  margin-top: -280px;
  opacity: 0.30;
  animation: star-spin 160s linear infinite;
}

.cosmos-bagua--inner {
  right: -110px;
  width: 380px;
  height: 380px;
  margin-top: -190px;
  opacity: 0.20;
  animation: star-spin-rev 220s linear infinite;
}

.cosmos-dipper {
  position: absolute;
  top: 64px;
  left: 14px;
  width: 320px;
  height: 190px;
  opacity: 0.9;
}

@media (prefers-reduced-motion: reduce) {
  .cosmos-bagua {
    animation: none;
  }
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  font-family: var(--font-sans);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

a {
  color: var(--gold);
  text-decoration: none;
}

p,
h1,
h2,
h3 {
  margin: 0;
  overflow-wrap: anywhere;
}

::selection {
  background: var(--select-bg);
  color: var(--ink);
}

::-webkit-scrollbar {
  width: 0;
  height: 0;
}
