/* ==========================================================
   Ritsuai 律合官网 · 全站基础样式（共享）
   包含：自定义滚动条、平滑滚动、字体渲染、图片保护、加载层
   ========================================================== */

/* ----- 自定义滚动条 ----- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* ----- 平滑滚动与字体渲染 ----- */
html { scroll-behavior: smooth; }
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ----- 移动端横向溢出保护（防止装饰元素/内容撑出视口） ----- */
html, body { overflow-x: hidden; }

/* ----- 文案平衡（原首页 @layer utilities） ----- */
.text-balance { text-wrap: balance; }

/* ----- 图片防拖拽 / 防选中 ----- */
img {
  -webkit-user-drag: none;
  user-drag: none;
  -webkit-user-select: none;
  user-select: none;
}

/* ----- 键盘焦点可见性（细节精修） ----- */
:focus-visible { outline: 2px solid #6366f1; outline-offset: 2px; }

/* ==========================================================
   站点加载层（Loading Screen）
   ========================================================== */
.site-loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
.site-loader.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.site-loader__inner { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.site-loader__logo {
  width: 104px;
  height: auto;
  animation: loaderPulse 1.8s ease-in-out infinite;
}
.site-loader__bar {
  position: relative;
  width: 132px;
  height: 2px;
  border-radius: 1px;
  background: rgba(0, 0, 0, 0.08);
  overflow: hidden;
}
.site-loader__bar::after {
  content: '';
  position: absolute;
  inset: 0;
  width: 42%;
  border-radius: 1px;
  background: linear-gradient(90deg, #6366f1, #8b5cf6, #ec4899);
  animation: loaderSlide 1.2s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}
@keyframes loaderPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.85; }
}
@keyframes loaderSlide {
  0% { left: -42%; }
  100% { left: 100%; }
}
body.loader-locked { overflow: hidden; }
