/* ============================================================
   Mowovo · base
   字体 / 变量 / 重置 / 通用组件
   ============================================================ */

@font-face {
  font-family: "JetBrainsMono NF";
  src: url("/assets/fonts/jbm-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrainsMono NF";
  src: url("/assets/fonts/jbm-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-en: "JetBrainsMono NF", "JetBrainsMono Nerd Font", ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-zh: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif;
  --font: var(--font-en), var(--font-zh);

  --bg: #07080a;
  --bg-2: #0b0d11;
  --surface: #0e1014;
  --surface-2: #12151b;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.18);
  --fg: #e9edf2;
  --fg-dim: #98a1ad;
  --fg-faint: #5d6673;

  --accent: #00e5ff;
  --accent-2: #7c4dff;
  --ok: #3ddc97;
  --warn: #ffb020;
  --danger: #ff4d6d;

  --radius: 3px;
  --max: 1120px;

  --hero-fg: #ffffff;
  --hero-dim: rgba(255, 255, 255, 0.6);
  --veil: rgba(7, 8, 10, 0.92);
}

[data-theme="light"] {
  --bg: #f4f5f7;
  --bg-2: #ffffff;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --line: rgba(10, 12, 16, 0.1);
  --line-strong: rgba(10, 12, 16, 0.22);
  --fg: #0b0d10;
  --fg-dim: #4d5561;
  --fg-faint: #8a929d;

  --accent: #00a8bf;
  --accent-2: #5b3df5;
  --hero-fg: #0b0d10;
  --hero-dim: rgba(11, 13, 16, 0.55);
  --veil: rgba(244, 245, 247, 0.9);
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.7;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
img, video { display: block; max-width: 100%; }

::selection { background: var(--accent); color: #001014; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border: 3px solid transparent; background-clip: content-box; }

:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 3px;
}

[hidden] { display: none !important; }

/* ---------------------------- 排版工具 ---------------------------- */

.label {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-faint);
  font-weight: 400;
}
.mono { font-family: var(--font-en); font-variant-numeric: tabular-nums; }
.glyph { font-family: var(--font-en); font-weight: 400; line-height: 1; }

/* ---------------------------- 通用控件 ---------------------------- */

.icon-btn {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--fg-dim);
  transition: color 0.18s, border-color 0.18s, background 0.18s;
}
.icon-btn:hover {
  color: var(--fg);
  border-color: var(--line);
  background: var(--surface-2);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--fg);
  transition: 0.18s;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn[disabled] { opacity: 0.45; pointer-events: none; }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #001014;
  font-weight: 700;
}
.btn-primary:hover { filter: brightness(1.08); color: #001014; }

.btn-danger { border-color: rgba(255, 77, 109, 0.5); color: var(--danger); }
.btn-danger:hover { background: rgba(255, 77, 109, 0.1); border-color: var(--danger); color: var(--danger); }

.pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 0 rgba(61, 220, 151, 0.55);
  animation: pulse 2.4s infinite;
  display: inline-block;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(61, 220, 151, 0.5); }
  70% { box-shadow: 0 0 0 7px rgba(61, 220, 151, 0); }
  100% { box-shadow: 0 0 0 0 rgba(61, 220, 151, 0); }
}

.reveal {
  opacity: 0;
  animation: rise 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
  animation-delay: var(--d, 0s);
}
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { animation: none; opacity: 1; }
  .pulse { animation: none; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

[data-motion="reduce"] *,
[data-motion="reduce"] *::before,
[data-motion="reduce"] *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}
[data-motion="reduce"] .reveal { opacity: 1; }
