* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

*:focus-visible {
  outline: 1px solid var(--color-accent);
  outline-offset: 2px;
}

html, body {
  height: 100%;
  width: 100%;
  overflow-x: hidden;
  overscroll-behavior-y: contain;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  background-color: var(--color-bg-primary);
  background-image: var(--bg-image, none);
  background-attachment: fixed;
  background-size: cover;
  color: var(--color-text-primary);
  font-size: 15px;
  line-height: 1.6;
  transition: background-color var(--transition-speed), color var(--transition-speed);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

#app {
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  position: relative;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  user-select: none;
}

a { color: inherit; text-decoration: none; }

input, textarea, select {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}

::selection { background: var(--color-accent); color: var(--color-bg-primary); }

.page {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  overflow-x: hidden;
}

.hidden { display: none !important; }

/* 桌面端居中夹住宽度，模拟手机窗口 */
@media (min-width: 640px) {
  body {
    display: flex;
    justify-content: center;
    background-color: #000;
  }
  #app {
    max-width: 480px;
    min-height: 100vh;
    background-color: var(--color-bg-primary);
    background-image: var(--bg-image, none);
    background-size: cover;
    box-shadow: 0 0 60px rgba(0,0,0,0.6);
  }
}
