/* ============================================================
 * OMNE · PREMIUM_SKIN_V1（/assets/css/premium.css）
 * ------------------------------------------------------------
 * 定位：H5 功能页（乐园 / 星命 / 推演 / AI 员工 / 占卜 / 后台）的
 *       「只增强、不改布局」视觉层。
 * 硬约束（踩过就回滚不干净）：
 *   · 不写 width/height/margin/padding/display/position/z-index
 *   · 不在 body / html 上挂 transform、filter、opacity 动画
 *     （transform 会给 fixed 后代造包含块，直接打崩浮层定位）
 *   · 不动业务色与字号，只动阴影、过渡、滚动条、字体渲染、焦点态
 * 回滚：删掉各页面 <head> 里那行 <link> 即可完全恢复。
 * ============================================================ */

/* ---------- 1. 渲染与文字 ---------- */
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection {
  background: rgba(150, 16, 255, .45);
  color: #fff;
}

/* 移动端滚动链：避免页面滚到底后带动外层 */
body {
  overscroll-behavior-y: contain;
}

/* ---------- 2. 卡片 / 面板：多层阴影 + 顶部内高光（不动尺寸） ---------- */
[class*="card"]:not(canvas):not(img),
[class*="Card"]:not(canvas):not(img),
[class*="panel"]:not(canvas),
[class*="Panel"]:not(canvas),
[class*="sheet"]:not(canvas) {
  box-shadow:
    0 10px 28px rgba(0, 0, 0, .32),
    inset 0 1px 0 rgba(255, 255, 255, .10);
  transition:
    box-shadow .22s ease,
    transform .18s cubic-bezier(.2, .9, .3, 1),
    border-color .22s ease;
}

[class*="card"]:active,
[class*="panel"]:active {
  transform: scale(.985);
}

/* ---------- 3. 按钮 / 可点元素：按压回弹 ---------- */
button,
[role="button"],
[class*="btn"],
[class*="Btn"] {
  -webkit-tap-highlight-color: transparent;
  transition:
    transform .13s cubic-bezier(.2, 1.4, .4, 1),
    filter .16s ease,
    box-shadow .18s ease;
}

button:active,
[role="button"]:active,
[class*="btn"]:active,
[class*="Btn"]:active {
  transform: scale(.96);
  filter: brightness(.97);
}

button:focus-visible,
[role="button"]:focus-visible,
a:focus-visible {
  outline: 2px solid rgba(127, 233, 255, .7);
  outline-offset: 2px;
}

button:disabled,
[class*="btn"][disabled] {
  filter: grayscale(.35) brightness(.9);
}

/* ---------- 4. 链接 / 输入 ---------- */
a {
  transition: color .18s ease, opacity .18s ease;
}

a:active {
  opacity: .72;
}

input,
textarea,
select {
  transition: border-color .18s ease, box-shadow .18s ease;
}

input:focus,
textarea:focus,
select:focus {
  box-shadow: 0 0 0 3px rgba(150, 16, 255, .22);
}

/* 深色底上的自动填充不要变白底 */
input:-webkit-autofill,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: currentColor;
  -webkit-box-shadow: 0 0 0 1000px rgba(20, 15, 34, .9) inset;
}

/* ---------- 5. 滚动条 ---------- */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(196, 107, 255, .55) transparent;
}

::-webkit-scrollbar {
  width: 3px;
  height: 3px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #C46BFF, #7FE9FF);
  border-radius: 99px;
}

/* ---------- 6. 数字等宽（统计 / 分数不跳动） ---------- */
[class*="score"], [class*="Score"],
[class*="num"], [class*="Num"],
[class*="count"], [class*="Count"],
[class*="price"], [class*="Price"],
[class*="rank"], [class*="Rank"],
[class*="coin"], [class*="Coin"] {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

/* ---------- 7. 图片 / Canvas 观感 ---------- */
canvas {
  filter: saturate(1.05) contrast(1.02);
}

img {
  -webkit-user-drag: none;
}

/* ---------- 8. 降低动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
