/* 整套自定义光标 —— 由 scripts/cursors/install.py 生成，请勿手改。
 * 素材由 scripts/cursors/build.py 原创光栅化，未使用任何第三方图片像素。
 * 每条声明末尾的兜底关键字必须保留，否则 Firefox 整条失效。
 */
:root {
  --c-default: url("/cursors/cur-home-light-32.png") 3 1;
  --c-pointer: url("/cursors/cur-home-light-32-solid.png") 3 1;
  --c-text: url("/cursors/cur-home-light-32-text.png") 16 16;
  --c-wait: url("/cursors/cur-home-light-32-wait.png") 16 16;
  --c-crosshair: url("/cursors/cur-home-light-32-crosshair.png") 16 16;
  --c-cell: url("/cursors/cur-home-light-32-cell.png") 16 16;
  --c-move: url("/cursors/cur-home-light-32-move.png") 16 16;
  --c-not-allowed: url("/cursors/cur-home-light-32-not-allowed.png") 16 16;
  --c-help: url("/cursors/cur-home-light-32-help.png") 16 16;
  --c-zoom-in: url("/cursors/cur-home-light-32-zoom-in.png") 14 14;
  --c-zoom-out: url("/cursors/cur-home-light-32-zoom-out.png") 14 14;
  --c-copy: url("/cursors/cur-home-light-32-copy.png") 3 1;
  --c-ew-resize: url("/cursors/cur-home-light-32-ew-resize.png") 16 16;
  --c-ns-resize: url("/cursors/cur-home-light-32-ns-resize.png") 16 16;
  --c-nesw-resize: url("/cursors/cur-home-light-32-nesw-resize.png") 16 16;
  --c-nwse-resize: url("/cursors/cur-home-light-32-nwse-resize.png") 16 16;
  --cur-color: #b8841b;
  --cur-size: 32px;
  --glow-scale: 1.22;
  --glow-min: .09;
  --glow-dur: 3.2s;
}

html[data-cursor-theme="dark"] {
  --c-default: url("/cursors/cur-home-dark-32.png") 3 1;
  --c-pointer: url("/cursors/cur-home-dark-32-solid.png") 3 1;
  --c-text: url("/cursors/cur-home-dark-32-text.png") 16 16;
  --c-wait: url("/cursors/cur-home-dark-32-wait.png") 16 16;
  --c-crosshair: url("/cursors/cur-home-dark-32-crosshair.png") 16 16;
  --c-cell: url("/cursors/cur-home-dark-32-cell.png") 16 16;
  --c-move: url("/cursors/cur-home-dark-32-move.png") 16 16;
  --c-not-allowed: url("/cursors/cur-home-dark-32-not-allowed.png") 16 16;
  --c-help: url("/cursors/cur-home-dark-32-help.png") 16 16;
  --c-zoom-in: url("/cursors/cur-home-dark-32-zoom-in.png") 14 14;
  --c-zoom-out: url("/cursors/cur-home-dark-32-zoom-out.png") 14 14;
  --c-copy: url("/cursors/cur-home-dark-32-copy.png") 3 1;
  --c-ew-resize: url("/cursors/cur-home-dark-32-ew-resize.png") 16 16;
  --c-ns-resize: url("/cursors/cur-home-dark-32-ns-resize.png") 16 16;
  --c-nesw-resize: url("/cursors/cur-home-dark-32-nesw-resize.png") 16 16;
  --c-nwse-resize: url("/cursors/cur-home-dark-32-nwse-resize.png") 16 16;
  --cur-color: #dfb44f;
}

/* ---------- 主光标：纯 CSS 静态图，末尾关键字是必须兜底 ---------- */
html, body { cursor: var(--c-default), auto !important; }
a, button, [role="button"], label, summary, .clickable, [onclick] {
  cursor: var(--c-pointer), pointer !important;
}
button:disabled, [aria-disabled="true"], .disabled {
  cursor: var(--c-not-allowed), not-allowed !important;
}
/* 文本输入也用整套里的自定义 I-beam / 箭头，全站不回落系统光标 */
input, textarea, [contenteditable="true"] { cursor: var(--c-text), text !important; }
select, [data-cursor-native]              { cursor: var(--c-default), auto !important; }

/* ---------- 整套状态映射：组件按需加 data-cursor 即可 ---------- */
[aria-busy="true"], [data-cursor="wait"], [data-cursor="progress"] {
  cursor: var(--c-wait), wait !important;
}
[data-cursor="text"]                    { cursor: var(--c-text), text !important; }
[data-cursor="crosshair"], .canvas, .picker {
  cursor: var(--c-crosshair), crosshair !important;
}
[data-cursor="cell"], [role="gridcell"]  { cursor: var(--c-cell), cell !important; }
[data-cursor="move"], [data-cursor="all-scroll"], .draggable, [draggable="true"] {
  cursor: var(--c-move), move !important;
}
[data-cursor="not-allowed"]             { cursor: var(--c-not-allowed), not-allowed !important; }
[data-cursor="help"], [data-help]       { cursor: var(--c-help), help !important; }
[data-cursor="zoom-in"], .zoomable, [data-zoomable] {
  cursor: var(--c-zoom-in), zoom-in !important;
}
[data-cursor="zoom-out"], .lightbox img {
  cursor: var(--c-zoom-out), zoom-out !important;
}
[data-cursor="copy"], [data-copy]       { cursor: var(--c-copy), copy !important; }
[data-cursor="ew-resize"], .col-resizer { cursor: var(--c-ew-resize), ew-resize !important; }
[data-cursor="ns-resize"], .row-resizer { cursor: var(--c-ns-resize), ns-resize !important; }
[data-cursor="nesw-resize"], .handle-nesw {
  cursor: var(--c-nesw-resize), nesw-resize !important;
}
[data-cursor="nwse-resize"], .handle-nwse {
  cursor: var(--c-nwse-resize), nwse-resize !important;
}
/* 手型 / 菜单 / 文本方向等语义，系统实现识别度最高，有意回退 */
[data-cursor="grab"], .grabbable           { cursor: grab !important; }
[data-cursor="grabbing"]                   { cursor: grabbing !important; }
[data-cursor="context-menu"]               { cursor: context-menu !important; }
[data-cursor="alias"]                      { cursor: alias !important; }
[data-cursor="no-drop"]                    { cursor: no-drop !important; }
[data-cursor="vertical-text"]              { cursor: vertical-text !important; }
[data-cursor="none"]                       { cursor: none !important; }

/* ---------- 呼吸淡影：只在 default / pointer 出现 ---------- */
.bc-glow {
  position: fixed; left: 0; top: 0; z-index: 2147483647;
  pointer-events: none; opacity: 0;
  transform: translate3d(-200px, -200px, 0);
  will-change: transform;
}
.bc-glow svg { display: block; width: 32px; height: 32px; overflow: visible; }
.bc-glow path {
  fill: none; stroke: var(--cur-color); stroke-width: 2.4;
  stroke-linejoin: round; stroke-linecap: round;
  transform-box: view-box; transform-origin: 11.5% 4.5%;
  animation: bcBreathe var(--glow-dur) ease-in-out infinite;
}
@keyframes bcBreathe {
  0%, 100% { transform: scale(1); opacity: var(--glow-min); }
  55%      { transform: scale(var(--glow-scale)); opacity: 0; }
}
html.bc-visible .bc-glow { opacity: 1; }
html.bc-static .bc-glow,
html.bc-native .bc-glow,
html.bc-left .bc-glow { opacity: 0; }
html[data-cursor-breath="off"] .bc-glow { display: none !important; }
@media (prefers-reduced-motion: reduce) { .bc-glow { display: none !important; } }
@media (hover: none), (pointer: coarse) { .bc-glow { display: none !important; } }
