/* base.css —— 全局基底:配色、字体、氛围层 */

:root {
  --ink: #c9c2b2;
  --ink-dim: #8f887a;
  --ink-faint: #5f5a50;
  --paper: #12100d;
  --paper-raised: #1a1713;
  --paper-edge: #26221b;
  --line: #35302a;
  --accent: #9a5b3c;
  --accent-dim: #6e4430;
  --danger: #7d3a2f;
  --safe: #6b7a5a;
  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.9;
}

body {
  /* 低饱和纸面质感:细微噪点 + 底部渐暗 */
  background-image:
    radial-gradient(ellipse at 50% 30%, rgba(58, 50, 38, 0.18), transparent 65%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
}

#app { min-height: 100vh; display: flex; flex-direction: column; }

h1, h2, h3 { font-weight: 600; letter-spacing: 0.12em; color: var(--ink); }

a { color: var(--accent); }

button {
  font-family: var(--serif);
  font-size: 1rem;
  color: var(--ink);
  background: var(--paper-raised);
  border: 1px solid var(--line);
  padding: 0.55rem 1.1rem;
  cursor: pointer;
  letter-spacing: 0.08em;
  min-height: 44px;
  transition: border-color 0.25s, color 0.25s, background 0.25s;
}

button:hover { border-color: var(--accent-dim); color: #e6ddc8; }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button:disabled { opacity: 0.4; cursor: default; }

/* 加载态 */
.loading-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.loading-text { color: var(--ink-dim); letter-spacing: 0.3em; }

/* 雨与暗角氛围层(不拦截交互) */
#fx-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 40;
}
#fx-layer .vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
}
#fx-layer .rain {
  position: absolute;
  inset: -10%;
  opacity: 0.14;
  background-image: repeating-linear-gradient(
    12deg,
    transparent 0 7px,
    rgba(180, 190, 205, 0.35) 7px 8px
  );
  animation: rainfall 0.9s linear infinite;
}
@keyframes rainfall {
  from { transform: translateY(-12px); }
  to { transform: translateY(12px); }
}
body.fx-off #fx-layer .rain { display: none; }

@media (prefers-reduced-motion: reduce) {
  #fx-layer .rain { animation: none; }
  * { transition: none !important; }
}

/* 提示气泡 */
#toast-root {
  position: fixed;
  left: 50%;
  bottom: 6.5rem;
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
  pointer-events: none;
}
.toast {
  background: rgba(18, 16, 13, 0.92);
  border: 1px solid var(--accent-dim);
  color: #d8cfba;
  padding: 0.45rem 1.2rem;
  font-size: 0.92rem;
  letter-spacing: 0.1em;
  animation: toast-in 0.3s ease-out;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
