@import url('https://fonts.googleapis.com/css2?family=Doto:wght@500;700;900&family=Atkinson+Hyperlegible+Next:wght@300..700&family=Noto+Sans+SC:wght@400;500;700&display=swap');
/* 点阵 Lattice — tokens (Night world). Points of light on deep ink.
   Roles: ink = points at rest · hot = action, attention, "what it needs" · hot-2 = secondary, "what it enables". */
:root {
  --bg: #07080b;
  --bg-2: #0d0f14;
  --ink: #ece7da;
  --text: #ece7da;
  --text-dim: #9d988c;      /* 7.4:1 on --bg */
  --text-faint: #6c685f;    /* 3.6:1, large text and decoration only */
  --hot: #ff5a1f;           /* 5.9:1 on --bg */
  --hot-2: #7fd8ff;         /* 11:1 on --bg */
  --line: rgb(236 231 218 / 0.14);
  --line-strong: rgb(236 231 218 / 0.3);
  --panel: rgb(7 8 11 / 0.78);

  --f-ui: "Atkinson Hyperlegible Next", "Noto Sans SC", system-ui, sans-serif;
  --f-dot: "Doto", "Atkinson Hyperlegible Next", monospace;
  --f-zh: "Noto Sans SC", "Microsoft YaHei", "PingFang SC", sans-serif;

  --t-12: 12px; --t-13: 13px; --t-15: 15px; --t-17: 17px; --t-21: 21px;
  --t-28: clamp(24px, 2.4vw, 30px); --t-40: clamp(28px, 3vw, 40px); --t-64: clamp(40px, 6vw, 64px);

  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px;
  --r-1: 6px; --r-2: 12px; --r-pill: 999px;

  --pitch: 9px;             /* dot pitch for DOM dot patterns (underlines, rules) */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --t-fast: 160ms; --t-mid: 320ms; --t-slow: 700ms;

  color-scheme: dark;
}
@media (prefers-reduced-motion: reduce) { :root { --t-fast: 0ms; --t-mid: 0ms; --t-slow: 0ms; } }

/* 点阵 Lattice — components. Every control keeps native semantics; the dots are drawn on top. */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 var(--t-17)/1.6 var(--f-ui); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
[lang="zh"] { font-family: var(--f-zh); }
:focus-visible { outline: 1.5px solid var(--hot); outline-offset: 4px; border-radius: var(--r-1); }
.has-cursor :focus-visible { outline-color: transparent; } /* the cursor halo draws focus */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.matrix { font-family: var(--f-dot); font-weight: 900; letter-spacing: 0.06em; }
.hot { color: var(--hot); font-weight: 600; }
.hot2 { color: var(--hot-2); font-weight: 600; }
.lx-canvas { display: block; }

/* the field canvas and the cursor overlay */
.lx-stage { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; z-index: 0; }
.lx-cursor { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 80; }
.has-cursor, .has-cursor * { cursor: none !important; }
.has-cursor input[type="text"], .has-cursor input[type="email"], .has-cursor textarea { cursor: text !important; }

/* ---------- buttons ---------- */
.lx-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 44px; padding: 0 20px; border: 0; border-radius: var(--r-pill);
  font: 600 var(--t-15)/1 var(--f-ui); letter-spacing: 0.005em; text-decoration: none; white-space: nowrap;
  transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast) var(--ease), box-shadow var(--t-fast);
  -webkit-tap-highlight-color: transparent;
}
.lx-btn:active { transform: scale(0.96); }
.lx-btn--primary { background: var(--text); color: var(--bg); }
.lx-btn--primary:hover { background: #fff; }
.lx-btn--accent { background: var(--hot); color: var(--bg); }
.lx-btn--accent:hover { background: #ff7440; }
.lx-btn--ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); }
.lx-btn--ghost:hover { box-shadow: inset 0 0 0 1px var(--text); }
.lx-btn:disabled, .lx-btn[aria-disabled="true"] { background: transparent; color: var(--text-faint); box-shadow: inset 0 0 0 1px var(--line); transform: none; }
.lx-btn .matrix { font-size: 16px; }
.lx-icon { width: 18px; height: 18px; flex: none; fill: currentColor; }

/* ---------- tabs ---------- */
.lx-tabs { display: flex; gap: 4px; padding-bottom: 14px; flex-wrap: wrap; }
.lx-tabs [role="tab"] {
  padding: 10px 14px; border: 0; background: none; color: var(--text-dim);
  font: 500 var(--t-15)/1 var(--f-ui); border-radius: var(--r-1); transition: color var(--t-fast);
}
.lx-tabs [role="tab"]:hover { color: var(--text); }
.lx-tabs [role="tab"][aria-selected="true"] { color: var(--text); }
.lx-tabs [role="tab"] b { font-family: var(--f-zh); margin-right: 6px; color: var(--hot); }

/* ---------- switch ---------- */
.lx-switch { display: inline-flex; align-items: center; gap: 14px; padding: 4px 0; border: 0; background: none; color: var(--text); font: 500 var(--t-15)/1.2 var(--f-ui); text-align: left; }
.lx-switch__track { position: relative; flex: none; width: 64px; height: 30px; border-radius: var(--r-pill); box-shadow: inset 0 0 0 1px var(--line-strong); transition: box-shadow var(--t-mid); }
.lx-switch[aria-checked="true"] .lx-switch__track { box-shadow: inset 0 0 0 1px var(--hot); }
.lx-switch small { display: block; color: var(--text-dim); font-size: var(--t-13); font-weight: 400; }
.lx-switch--lg .lx-switch__track { width: 136px; height: 54px; }

/* ---------- slider ---------- */
.lx-slider { position: relative; height: 34px; }
.lx-slider input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.lx-slider input:focus-visible { opacity: 0; }
.lx-slider:focus-within { outline: 1.5px solid var(--hot); outline-offset: 4px; border-radius: var(--r-1); }
.has-cursor .lx-slider:focus-within { outline-color: transparent; }
.lx-range { display: grid; grid-template-columns: 110px 1fr 48px; align-items: center; gap: var(--s-4); font-size: var(--t-13); color: var(--text-dim); }
.lx-range output { font-family: var(--f-dot); font-weight: 900; color: var(--text); text-align: right; font-size: var(--t-15); }

/* ---------- progress ---------- */
.lx-progress { position: relative; height: 28px; }
.lx-progress.is-complete { filter: drop-shadow(0 0 6px rgb(255 90 31 / 0.5)); }

/* ---------- dot text + loader ---------- */
.lx-dottext { position: relative; display: inline-block; vertical-align: middle; }
.lx-loader { position: relative; width: 120px; height: 120px; }

/* ---------- text field ---------- */
.lx-field { display: grid; gap: 6px; }
.lx-field label { font-size: var(--t-13); color: var(--text-dim); }
.lx-field input {
  width: 100%; padding: 10px 0 12px; border: 0; background:
    radial-gradient(circle, var(--line-strong) 1px, transparent 1.6px) 0 100% / var(--pitch) 4px repeat-x;
  color: var(--text); font: 400 var(--t-17)/1.3 var(--f-ui); outline: none;
  transition: background-color var(--t-fast);
}
.lx-field input::placeholder { color: var(--text-dim); opacity: 1; }
.lx-field input:focus { background-image: radial-gradient(circle, var(--hot) 1.2px, transparent 1.8px); animation: dotflow 900ms linear infinite; }
.lx-field[data-invalid] input { background-image: radial-gradient(circle, var(--hot) 1.2px, transparent 1.8px); background-size: 5px 4px; }
.lx-field__msg { min-height: 1.3em; font-size: var(--t-13); color: var(--text-dim); }
.lx-field[data-invalid] .lx-field__msg { color: var(--hot); }
@keyframes dotflow { to { background-position: var(--pitch) 100%; } }
@media (prefers-reduced-motion: reduce) { .lx-field input:focus { animation: none; } }

/* ---------- panel + card ---------- */
.lx-panel { padding: 26px 26px 22px; border-radius: var(--r-2); background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); backdrop-filter: blur(10px); }
.lx-card { position: fixed; left: 0; top: 0; z-index: 70; width: min(320px, calc(100vw - 24px)); padding: 16px 18px; border-radius: var(--r-2); pointer-events: none;
  background: var(--panel); box-shadow: inset 0 0 0 1px var(--line), 0 18px 40px -20px rgb(0 0 0 / 0.7); backdrop-filter: blur(12px); }
.lx-card__kind { margin: 0; font-family: var(--f-dot); font-weight: 900; font-size: 12px; letter-spacing: 0.08em; color: var(--hot); text-transform: uppercase; }
.lx-card__title { margin: 4px 0 0; font-size: var(--t-17); font-weight: 600; line-height: 1.25; }
.lx-card__zh { margin: 2px 0 0; font-size: var(--t-13); color: var(--text-dim); }
.lx-card__st { margin: 10px 0 0; font-size: 14px; line-height: 1.5; }
.lx-card__rel { margin: 10px 0 0; font-size: 12.5px; color: var(--text-dim); line-height: 1.45; }

/* ---------- labels pinned to 3D points ---------- */
.fx-labels { position: fixed; inset: 0; pointer-events: none; z-index: 1; overflow: hidden; } /* above the field, below page content */
.fx-label { position: absolute; left: 0; top: 0; white-space: nowrap; font: 500 12px/1 var(--f-ui); color: var(--text); padding: 2px 0 0 12px; will-change: transform, opacity; transition: color var(--t-fast); }
.fx-label.is-root { font-size: 15px; font-weight: 600; padding-left: 18px; }
.fx-label.is-ref { color: var(--text-dim); }
.fx-label.is-hot { color: var(--hot); }
.fx-label.is-hot2 { color: var(--hot-2); }

/* ---------- command palette ---------- */
.lx-cmd { width: min(600px, calc(100vw - 32px)); padding: 0; border: 0; background: transparent; color: var(--text); overflow: visible; }
.lx-cmd::backdrop { background: rgb(7 8 11 / 0.7); backdrop-filter: blur(6px); }
.lx-cmd[open] { animation: cmd-in 420ms var(--ease); }
@keyframes cmd-in { from { opacity: 0; transform: translateY(14px) scale(0.98); } }
.lx-cmd__panel { margin: 0; border-radius: var(--r-2); background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line-strong), 0 30px 80px -30px rgb(0 0 0 / 0.9); overflow: hidden; }
.lx-cmd__field { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.lx-cmd__key { color: var(--hot); font-size: 15px; }
.lx-cmd__field input { flex: 1; min-width: 0; border: 0; background: none; color: var(--text); font: 400 var(--t-17)/1.3 var(--f-ui); outline: none; }
.lx-cmd__field input::placeholder { color: var(--text-dim); opacity: 1; }
.lx-cmd__list-wrap { position: relative; }
.lx-cmd__list { margin: 0; padding: 8px 8px 8px 26px; list-style: none; max-height: 360px; overflow: auto; }
.lx-cmd__list li[role="option"] { display: grid; grid-template-columns: 34px 1fr auto auto; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-2); color: var(--text-dim); }
.lx-cmd__list li[aria-selected="true"] { background: rgb(236 231 218 / 0.06); color: var(--text); }
.lx-cmd__glyph { color: var(--hot); font-size: 15px; }
.lx-cmd__zh { font-size: var(--t-13); color: var(--text-dim); }
.lx-cmd__hint { font-size: 12px; color: var(--text-dim); }
.lx-cmd__empty { padding: 14px 12px; color: var(--text-dim); font-size: 14px; }
.lx-cmd__foot { display: flex; gap: 18px; justify-content: flex-end; margin: 0; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--text-dim); }

/* ---------- toast ---------- */
.lx-toasts { position: fixed; right: 20px; bottom: 20px; z-index: 75; display: grid; gap: 10px; justify-items: end; }
.lx-toast { display: flex; align-items: center; gap: 14px; max-width: min(380px, calc(100vw - 40px)); padding: 12px 16px; border-radius: 12px; background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line-strong), 0 20px 40px -20px rgb(0 0 0 / 0.8); animation: toast-in 500ms var(--ease); }
.lx-toast__msg { font-size: 14px; line-height: 1.35; }
.lx-toast.is-leaving { animation: toast-out 500ms var(--ease-in-out) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-8px); filter: blur(4px); } }

/* hold-to-melt ring for touch screens (fine pointers get the cursor ring instead) */
.touch-heat { position: fixed; left: 0; top: 0; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%; pointer-events: none; z-index: 60; opacity: 0;
  background: conic-gradient(var(--hot) calc(var(--h, 0) * 360deg), transparent 0);
  -webkit-mask: radial-gradient(circle, transparent 27px, #000 28px); mask: radial-gradient(circle, transparent 27px, #000 28px); }

/* catalog previews: every card sits in the Night world */
html, body { background: var(--bg) !important; color: var(--text); }
.lx-pv { padding: 24px; }
.pv-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.pv-col { display: grid; gap: 14px; justify-items: start; }
.pv-note { margin: 0 0 14px; font-size: 14px; color: var(--text-dim); }
