/* ═══════════════════════════════════════════════════════════
   展厅系统 · 全局高档质感增强 premium.css v4.0
   由本地服务器以 /premium.css 提供所有系统页面自动加载。
   file:// 直开时加载不到只是少了氛围效果，不影响功能。
   设计原则：低特异性注入 —— 提质感、不改布局、不抢各系统配色。
   v3.0：表单字体统一继承（消灭宋体按钮）、指针语义、卡片层次深化、
         鎏金焦点环、更细腻的动效曲线。
   v4.0：入场鎏金光束扫过、悬浮鎏金描边加深抬升、图片浮现动画、
         平滑滚动、标题流光提速，全部 transform/opacity/filter 合成层动画。
   ═══════════════════════════════════════════════════════════ */

/* ── 全局渲染与触控品质 ── */
html {
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}
img { image-rendering: -webkit-optimize-contrast; }

/* ── 表单控件品质统一：字体继承（避免按钮/下拉回退宋体）、指针语义 ── */
:is(button, input, select, textarea) {
  font-family: inherit;
}
button:not(:disabled),
[role="button"]:not(:disabled),
select:not(:disabled),
label:has(input[type="checkbox"], input[type="radio"]),
.donate-pointer {
  cursor: pointer;
}
input[type="text"], input[type="search"], textarea { cursor: text; }

/* 电影级暗角氛围 */
body::after {
  content: '';
  position: fixed; inset: 0; z-index: 9999; pointer-events: none;
  background:
    radial-gradient(ellipse 120% 90% at 50% 42%, transparent 55%, rgba(0, 0, 0, .30) 100%);
  mix-blend-mode: multiply;
}

/* 页面入场：一次性的「大幕拉开」呼吸感（纯 opacity——不在 body 残留
   transform，避免改变 position:fixed 子元素的定位基准） */
body {
  animation: pz-enter .8s cubic-bezier(.22, .8, .3, 1) both;
}
@keyframes pz-enter {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* 顶部环境光：一缕极淡的鎏金从顶部洒下 */
body::before {
  content: '';
  position: fixed; top: 0; left: 0; right: 0; height: 130px;
  z-index: 9998; pointer-events: none;
  background: linear-gradient(180deg, rgba(233, 200, 119, .05), transparent);
}

/* 细腻胶片颗粒（大屏近看不发"塑料感"） */
html::before {
  content: '';
  position: fixed; inset: -50%; z-index: 9997; pointer-events: none;
  width: 200%; height: 200%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  opacity: .035;
  animation: pz-grain 1.4s steps(4) infinite;
}
@keyframes pz-grain {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-2%, 1.4%); }
  50% { transform: translate(1.6%, -1.2%); }
  75% { transform: translate(-1.2%, -1.8%); }
  100% { transform: translate(0, 0); }
}

/* 入场鎏金光束：页面加载后一道极淡金光斜向扫过（一次性，1.5s） */
html::after {
  content: '';
  position: fixed; inset: -35%; z-index: 9999; pointer-events: none;
  background: linear-gradient(115deg, transparent 40%, rgba(233, 200, 119, .09) 50%, transparent 60%);
  transform: translateX(-62%);
  animation: pz-sweep 1.5s cubic-bezier(.4, 0, .2, 1) .12s 1 both;
}
@keyframes pz-sweep {
  0%   { transform: translateX(-62%); opacity: 0; }
  25%  { opacity: 1; }
  100% { transform: translateX(62%);  opacity: 0; }
}

/* ── 按钮 universal 质感（低特异性：只增强，不改底色、不加位移，
      避免覆盖各系统自带的 CSS transform，如扇形卡片倾斜） ── */
:is(button, .btn) {
  transition:
    filter .25s cubic-bezier(.33, 1, .68, 1),
    box-shadow .25s cubic-bezier(.33, 1, .68, 1),
    background-color .25s ease, color .25s ease, border-color .25s ease;
}
:is(button, .btn):hover {
  filter: brightness(1.12) saturate(1.05);
}
:is(button, .btn):active {
  filter: brightness(.94) saturate(.98);
  transition-duration: .08s;
}
/* 键盘焦点鎏金环（触屏不受影响） */
:is(button, .btn):focus-visible {
  outline: 2px solid rgba(214, 178, 94, .85);
  outline-offset: 2px;
}
/* 主按钮（primary）鎏金浮影 */
:is(button, .btn)[class*="primary"]:hover:not(:disabled) {
  box-shadow: 0 6px 24px rgba(214, 178, 94, .35), 0 2px 6px rgba(0, 0, 0, .4);
}
button:disabled, .btn:disabled {
  opacity: .38; cursor: not-allowed;
  filter: grayscale(.4);
}

/* ── 卡片悬浮抬升（仅限明确的卡片类名，避免误伤 JS 定位元素） ──
   v4.0：更深抬升 + 鎏金描边光环 + 双层投影（transition 仍留在 :hover 态，
   避免 transform 过渡拖慢 JS 逐帧定位的卡片） */
:is(.card, .cell):hover {
  transform: translateY(-5px) scale(1.012);
  transition: transform .32s cubic-bezier(.33, 1, .68, 1), box-shadow .32s ease;
  box-shadow:
    0 26px 60px rgba(0, 0, 0, .5),
    0 10px 26px rgba(0, 0, 0, .35),
    0 0 0 1px rgba(233, 200, 119, .5),
    0 0 34px rgba(214, 178, 94, .22);
}

/* ── 标题排版微调（只加字距气质，不改字号） ── */
h1, h2, h3 {
  letter-spacing: .06em;
  text-rendering: optimizeLegibility;
}

/* ── 鎏金标题流光：渐变文字标题周期性扫过一道亮光（v4.0 提速提亮）──
   仅对"渐变+clip 填字"的标题生效（无 background-image 的普通标题无感） */
h1 {
  background-size: auto 240%;
  animation: pz-title-sheen 4.2s ease-in-out infinite;
}
@keyframes pz-title-sheen {
  0%, 100% { background-position: 0 0; }
  50%      { background-position: 0 26%; }
}

/* ── 文本选择与滚动条 ── */
::selection { background: rgba(214, 178, 94, .35); color: #fff; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: rgba(255, 255, 255, .04); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #d6b25e, #8a6d2f); border-radius: 6px;
  border: 2px solid rgba(0, 0, 0, .2);
}
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #e9c877, #a8842f); }

/* ── 输入控件聚焦金光 ── */
:is(input, textarea, select):focus-visible {
  outline: 2px solid rgba(214, 178, 94, .6); outline-offset: 1px;
}
:is(input, textarea, select) {
  transition: box-shadow .25s ease, border-color .25s ease;
}
:is(input, textarea, select):focus {
  box-shadow: 0 0 0 4px rgba(214, 178, 94, .12);
}

/* ── 链接下划线柔化 ── */
a { transition: color .2s ease, opacity .2s ease; }

/* ── 图片浮现（插入时轻柔淡入上浮一次；照片墙增量插图也自然柔和）
   fill 用 backwards：动画结束即归还样式，不覆盖 JS 设置的内联 transform ── */
img {
  transition: opacity .4s ease;
  animation: pz-img-in .55s ease backwards;
}
@keyframes pz-img-in {
  from { opacity: 0; transform: translateY(6px) scale(.985); }
  to   { opacity: 1; transform: none; }
}

/* ── 减弱动态偏好（无障碍）──
   展厅娱乐系统以动效为核心体验，且演示机常因 RDP/系统设置误报 reduce，
   故不再全局熔断动画；仅停用可引发细密闪烁的胶片颗粒循环。
   各系统自身的 @media (prefers-reduced-motion) 仍按其原有设计生效。 */
@media (prefers-reduced-motion: reduce) {
  html::before { animation: none !important; }
}

/* ═══════════════════════════════════════════════════════════
   标题隐藏开关（v2.1 保留）
   根目录 site-config.json 设 "hideTitle": true，或页面 URL 加 ?hideTitle=1
   时，attract.js 会为页面挂上 html.hide-title，此处在所有系统统一生效。
   只隐藏标题元素本身（h1 / 专属标题容器），保留 header 内的主页按钮、
   筛选栏、HUD 等功能控件。
   ═══════════════════════════════════════════════════════════ */
html.hide-title h1,
html.hide-title #brand,
html.hide-title #dTitle { display: none !important; }
