/* ========== Custom cursor (视觉中心 = 红点) ========== */
@media (hover: hover) and (pointer: fine) {
  body, a, button, [data-cursor], [data-href], input, textarea, select, label,
  p, h1, h2, h3, h4, h5, h6, dt, dd, span, mark, blockquote, li { cursor: none; }
}

.cursor {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 99999;
  display: none;
  will-change: transform;
}
@media (hover: hover) and (pointer: fine) {
  .cursor { display: block; }
}

.cursor__square {
  position: absolute;
  top: 0; left: 0;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  background: var(--accent);
  transition: width .28s cubic-bezier(.7,.05,.2,1),
              height .28s cubic-bezier(.7,.05,.2,1),
              background .25s,
              border .25s,
              border-radius .25s;
}
/* 虚线旋转外框 — 用于 active / loading 两态 */
.cursor__ring {
  position: absolute;
  top: 0; left: 0;
  transform: translate(-50%, -50%) rotate(0deg);
  width: 0; height: 0;
  border: 1.5px dashed var(--accent);
  border-radius: 2px;
  opacity: 0;
  filter: blur(0.4px) drop-shadow(0 0 6px rgba(230, 57, 70, 0.55));
  transition: width .28s cubic-bezier(.7,.05,.2,1),
              height .28s cubic-bezier(.7,.05,.2,1),
              opacity .25s,
              border-style .25s;
  pointer-events: none;
}

.cursor__label {
  position: absolute;
  top: 14px;
  left: 0;
  transform: translateX(-50%);
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--accent);
  text-transform: uppercase;
  opacity: 0.9;
  transition: top .25s, color .25s, font-size .25s;
}
.cursor__label::before {
  content: '>> ';
  opacity: 0;
  transition: opacity .25s;
}

/* Active state on interactive elements — 实线方框（不旋转，固定） */
.cursor.is-active .cursor__square {
  width: 56px;
  height: 56px;
  background: transparent;
  border: 1.5px solid var(--accent);
  border-radius: 0;
}
.cursor.is-active .cursor__ring { opacity: 0; width: 0; height: 0; }
.cursor.is-active .cursor__label {
  top: 40px;
  color: var(--accent);
  font-size: 10px;
  letter-spacing: 0.22em;
}
.cursor.is-active .cursor__label::before { opacity: 0; }

/* Loading state — 页面进入瞬间的临时形态：稍大旋转虚框 + EXAMINE 标签 */
.cursor.is-loading .cursor__square {
  width: 4px;
  height: 4px;
  background: var(--accent);
  border-radius: 50%;
}
.cursor.is-loading .cursor__ring {
  width: 88px;
  height: 88px;
  opacity: 1;
  animation: cursorSpin 4s linear infinite;
}
.cursor.is-loading .cursor__label {
  top: 56px;
  color: var(--accent);
  font-size: 10px;
  letter-spacing: 0.22em;
  opacity: 1;
}
.cursor.is-loading .cursor__label::before { opacity: 1; }

/* Text-select state — 红色 I-beam */
.cursor.is-textselect .cursor__square {
  width: 2px;
  height: 22px;
  background: var(--accent);
  border-radius: 0;
  box-shadow: 0 0 6px rgba(230, 57, 70, 0.55);
}
.cursor.is-textselect .cursor__square::before,
.cursor.is-textselect .cursor__square::after {
  content: '';
  position: absolute;
  left: -4px;
  width: 10px;
  height: 1.5px;
  background: var(--accent);
}
.cursor.is-textselect .cursor__square::before { top: 0; }
.cursor.is-textselect .cursor__square::after { bottom: 0; }
.cursor.is-textselect .cursor__ring { opacity: 0; width: 0; height: 0; }
.cursor.is-textselect .cursor__label {
  top: 22px;
  font-size: 9px;
  letter-spacing: 0.22em;
}
.cursor.is-textselect .cursor__label::before { opacity: 1; }

@keyframes cursorSpin {
  0%   { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.cursor.is-press .cursor__square {
  transform: translate(-50%, -50%) scale(0.7);
}
.cursor.is-press .cursor__ring {
  transform: translate(-50%, -50%) scale(0.92) rotate(0deg);
  border-style: solid;
}

.cursor.is-text { opacity: 0; }
.cursor.is-out { opacity: 0; transition: opacity .15s; }
