/* ========== Reset ========== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* 横屏锁定 */
  overflow: hidden;
}

body {
  font-family: var(--sans);
  color: var(--text-main);
  background: var(--bg-base);
  line-height: 1.8;
  overflow: hidden;
  position: relative;
  width: 100dvw;
  height: 100dvh;
}

/* ========== Paper Grain ========== */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.022;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
}

/* ========== Ink Wash Ambient ========== */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: var(--z-bg);
  background:
    radial-gradient(ellipse 800px 600px at 10% 15%, rgba(74, 124, 89, 0.07), transparent 70%),
    radial-gradient(ellipse 600px 800px at 90% 75%, rgba(217, 74, 56, 0.05), transparent 70%),
    radial-gradient(ellipse 900px 500px at 50% 45%, rgba(139, 160, 148, 0.04), transparent 70%);
  pointer-events: none;
}

/* ========== Typography ========== */
h1, h2, h3 {
  font-family: var(--serif);
  letter-spacing: 2px;
}

/* ========== 横屏旋转引导 ========== */
.rotate-hint {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg-base);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 20px;
}

.rotate-hint-icon {
  font-size: 48px;
  animation: rotateHint 2s ease-in-out infinite;
}

.rotate-hint-text {
  font-family: var(--serif);
  font-size: 14px;
  color: var(--text-muted);
  letter-spacing: 4px;
}

@keyframes rotateHint {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(90deg); }
}

@media (orientation: portrait) {
  .rotate-hint { display: flex; }
  #app { display: none; }
}

/* ========== Utility ========== */
.hidden { display: none !important; }
.fade-out { opacity: 0; transition: opacity 0.6s var(--ease-out-expo); }
