/* ───── buttons.css — 通用按钮(液态玻璃交互)─────
   .btn 实心赤陶 + 顶部高光 + 按压回弹;.btn-ghost 半透明液态玻璃。
   两者都有跟随指针的镜面高光(::before,由 ui/glass.js 写入 --gx/--gy)。 */

.btn,
.btn-ghost {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 24px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 550;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease),
    background .25s var(--ease), border-color .25s var(--ease), color .25s var(--ease);
}

/* 跟随指针的镜面高光:位于底色之上、文字之下 */
.btn::before,
.btn-ghost::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(90px circle at var(--gx, 50%) var(--gy, 50%), var(--glass-sheen), transparent 60%);
  opacity: 0;
  transition: opacity .35s var(--ease);
  pointer-events: none;
}
.btn:hover::before,
.btn-ghost:hover::before,
.btn:focus-visible::before,
.btn-ghost:focus-visible::before { opacity: 1; }

/* 实心主按钮:赤陶底 + 顶部高光,按压回弹 */
.btn {
  background: var(--accent);
  color: #fff;
  border: 1px solid transparent;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 6px 18px var(--glow);
}
.btn:hover {
  transform: translateY(-2px);
  background: var(--accent-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .32), 0 12px 28px var(--glow);
}
.btn:active { transform: translateY(0) scale(.97); }

/* 描边次按钮:半透明液态玻璃 */
.btn-ghost {
  color: var(--text);
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  border: 1px solid var(--glass-edge);
  box-shadow: inset 0 1px 0 var(--glass-sheen), var(--glass-shadow);
}
.btn-ghost:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  color: var(--accent);
}
.btn-ghost:active { transform: translateY(0) scale(.97); }

/* 无障碍聚焦描边 */
.btn:focus-visible,
.btn-ghost:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .btn:hover, .btn-ghost:hover,
  .btn:active, .btn-ghost:active { transform: none; }
}
