/* ==========================================================================
   像素迷宫 · 雫猫版 —— 工具页样式
   深蓝夜空 / 冰蓝 + 薰衣草 + 樱粉 / 玻璃拟态
   ========================================================================== */

:root {
  --bg: #070b16;
  --bg-2: #0b1224;
  --panel: rgba(17, 26, 48, .72);
  --panel-solid: #111a30;
  --line: rgba(140, 200, 255, .14);
  --line-strong: rgba(140, 200, 255, .3);
  --text: #e8f1ff;
  --muted: #93a6c8;
  --dim: #64769a;
  --blue: #7cc8ff;
  --blue-deep: #3a8fd6;
  --lav: #b49cff;
  --pink: #ff9ed2;
  --ok: #6ee7b7;
  --warn: #ffd18a;
  --err: #ff8ba0;
  --radius: 20px;
  --radius-sm: 12px;
  --font: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Source Han Sans SC", "Noto Sans SC", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "Cascadia Mono", "Cascadia Code", Consolas,
          "Liberation Mono", Menlo, monospace;
  --header-h: 68px;
  --shadow-card: 0 26px 70px -38px rgba(0, 0, 0, .95);
  --shadow-glow: 0 0 0 1px rgba(124, 200, 255, .06), 0 20px 50px -30px rgba(58, 143, 214, .55);
}

*,
*::before,
*::after { box-sizing: border-box; }

[hidden],
.is-hidden { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 18px);
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(900px 620px at 10% -10%, rgba(58, 143, 214, .3), transparent 62%),
    radial-gradient(820px 560px at 92% 2%, rgba(180, 156, 255, .24), transparent 64%),
    radial-gradient(760px 520px at 52% 108%, rgba(255, 158, 210, .15), transparent 62%),
    linear-gradient(180deg, #070b16 0%, #0b1224 46%, #070b16 100%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  opacity: .55;
  background-image:
    linear-gradient(rgba(140, 200, 255, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(140, 200, 255, .05) 1px, transparent 1px);
  background-size: 68px 68px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 12%, #000 10%, transparent 78%);
  mask-image: radial-gradient(ellipse 80% 60% at 50% 12%, #000 10%, transparent 78%);
}

img { max-width: 100%; }
svg { display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: #a9dcff; }

body.modal-open { overflow: hidden; }

.btn.is-dragover {
  border-color: rgba(255, 158, 210, .8);
  background: rgba(255, 158, 210, .16);
  color: #ffe3f2;
  box-shadow: 0 0 0 4px rgba(255, 158, 210, .12) inset;
}

:focus-visible {
  outline: 3px solid rgba(124, 200, 255, .9);
  outline-offset: 2px;
  border-radius: 10px;
}

::selection { background: rgba(124, 200, 255, .35); color: #fff; }

h1, h2, h3 { margin: 0; line-height: 1.25; font-weight: 700; letter-spacing: .01em; }
p { margin: 0; }
code { font-family: var(--mono); }

/* ---------- 工具类 ---------- */

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.wrap {
  width: 100%;
  max-width: 1340px;
  margin-inline: auto;
  padding-inline: clamp(14px, 3vw, 36px);
}

.ico {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  pointer-events: none;
}
.ico-lg { width: 26px; height: 26px; }
.ico-xl { width: 34px; height: 34px; }

.mono { font-family: var(--mono); font-size: .8em; letter-spacing: .01em; }
.note { color: var(--muted); font-size: .82rem; line-height: 1.55; }
.note.center { text-align: center; }
.note + .note { margin-top: .2rem; }

.link-note {
  display: block;
  width: 100%;
  margin-top: .5rem;
  padding: 0;
  border: 0;
  background: none;
  font-family: inherit;
  text-align: left;
  color: var(--blue);
  cursor: pointer;
  text-decoration: underline dotted rgba(124, 200, 255, .5);
  text-underline-offset: 3px;
}
.link-note:hover { color: #bfe7ff; }
.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 200;
  padding: .6rem 1rem;
  border-radius: 999px;
  background: var(--panel-solid);
  border: 1px solid var(--line-strong);
  color: var(--text);
  transition: top .2s ease;
}
.skip-link:focus-visible { top: 12px; }

/* ---------- 背景装饰 ---------- */

.sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.paw {
  position: absolute;
  width: 90px;
  height: 90px;
  color: var(--blue);
  opacity: .055;
  animation: drift 22s ease-in-out infinite;
}
.paw-1 { top: 16%; left: 3%; transform: rotate(-18deg); animation-delay: -3s; }
.paw-2 { top: 56%; right: 4%; width: 120px; height: 120px; color: var(--lav); transform: rotate(14deg); animation-delay: -9s; }
.paw-3 { bottom: 8%; left: 32%; width: 70px; height: 70px; color: var(--pink); transform: rotate(24deg); animation-delay: -14s; }

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .3;
  animation: float 18s ease-in-out infinite;
}
.orb-1 { width: 320px; height: 320px; top: 6%; left: -8%; background: radial-gradient(circle, rgba(124, 200, 255, .6), transparent 65%); }
.orb-2 { width: 380px; height: 380px; top: 28%; right: -12%; background: radial-gradient(circle, rgba(180, 156, 255, .55), transparent 65%); animation-delay: -6s; }
.orb-3 { width: 300px; height: 300px; bottom: -6%; left: 40%; background: radial-gradient(circle, rgba(255, 158, 210, .4), transparent 65%); animation-delay: -11s; }

@keyframes drift {
  0%, 100% { transform: translateY(0) rotate(-16deg); }
  50% { transform: translateY(-18px) rotate(-11deg); }
}
@keyframes float {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(12px, -22px, 0) scale(1.06); }
}

/* ---------- 顶栏 ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: linear-gradient(180deg, rgba(7, 11, 22, .86), rgba(7, 11, 22, .58));
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  backdrop-filter: blur(18px) saturate(130%);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: clamp(10px, 2vw, 22px);
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  color: var(--text);
  min-width: 0;
  border-radius: 14px;
}
.brand:hover { color: var(--text); }

.brand-mark {
  width: 42px;
  height: 42px;
  flex: none;
  filter: drop-shadow(0 6px 16px rgba(124, 200, 255, .35));
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}
.brand-text strong {
  font-size: 1.12rem;
  letter-spacing: .06em;
  background: linear-gradient(120deg, #e8f1ff 20%, #a9dcff 55%, #d6c4ff 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-sub {
  font-size: .68rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--dim);
  white-space: nowrap;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: .3rem;
  margin-left: auto;
}

.nav-link {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: .88rem;
  font-weight: 600;
  padding: .45rem .7rem;
  border-radius: 999px;
  cursor: pointer;
  transition: color .18s ease, background .18s ease;
  white-space: nowrap;
}
.nav-link:hover { color: var(--text); background: rgba(124, 200, 255, .1); }
.nav-link.is-active { color: var(--blue); background: rgba(124, 200, 255, .1); }

.version-badge {
  font-family: var(--mono);
  font-size: .7rem;
  color: var(--muted);
  border: 1px solid var(--line);
  background: rgba(124, 200, 255, .07);
  padding: .2rem .5rem;
  border-radius: 999px;
  white-space: nowrap;
}

/* ---------- Hero ---------- */

.page-main { padding-bottom: clamp(40px, 6vw, 80px); }

.hero {
  max-width: 860px;
  margin-inline: auto;
  padding: clamp(34px, 6vw, 72px) 0 clamp(26px, 4vw, 46px);
  text-align: center;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: .78rem;
  letter-spacing: .18em;
  color: var(--muted);
  padding: .32rem .9rem .32rem .7rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(17, 26, 48, .55);
  margin-bottom: 1.1rem;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 0 rgba(110, 231, 183, .6);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(110, 231, 183, .55); }
  70% { box-shadow: 0 0 0 9px rgba(110, 231, 183, 0); }
  100% { box-shadow: 0 0 0 0 rgba(110, 231, 183, 0); }
}

.hero h1 {
  font-size: clamp(2rem, 5.6vw, 3.4rem);
  letter-spacing: .01em;
  text-wrap: balance;
}

.grad-text {
  background: linear-gradient(115deg, #9bd8ff 8%, #b9a9ff 48%, #ffb7dd 92%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 12px 34px rgba(180, 156, 255, .28));
}

.hero-sub {
  max-width: 640px;
  margin: 1rem auto 0;
  color: var(--muted);
  font-size: clamp(.9rem, 1.6vw, 1.02rem);
  text-wrap: pretty;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .55rem;
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-size: .82rem;
  color: #c3d6f5;
  padding: .42rem .85rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: linear-gradient(150deg, rgba(23, 34, 62, .72), rgba(12, 19, 36, .6));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
}
.chip .ico { width: 16px; height: 16px; color: var(--blue); }

/* ---------- 布局 ---------- */

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(16px, 2vw, 26px);
  align-items: start;
}

.panel {
  position: relative;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background:
    linear-gradient(158deg, rgba(26, 38, 68, .84) 0%, rgba(13, 21, 40, .8) 46%, rgba(9, 15, 30, .86) 100%);
  -webkit-backdrop-filter: blur(18px) saturate(125%);
  backdrop-filter: blur(18px) saturate(125%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), var(--shadow-card);
  padding: clamp(15px, 2.1vw, 26px);
  min-width: 0;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    radial-gradient(520px 130px at 16% 0%, rgba(124, 200, 255, .1), transparent 72%),
    radial-gradient(420px 160px at 100% 0%, rgba(180, 156, 255, .08), transparent 72%);
  opacity: .9;
}

.panel > * { position: relative; }

.preview {
  position: sticky;
  top: calc(var(--header-h) + 20px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ---------- Tabs ---------- */

.tabs {
  display: flex;
  gap: 6px;
  padding: 6px;
  margin-bottom: 20px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(7, 11, 22, .55);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, .3);
}

.tab {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .62rem .8rem;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  transition: color .18s ease, background .2s ease, box-shadow .2s ease, transform .18s ease;
  min-height: 42px;
}
.tab:hover { color: var(--text); background: rgba(124, 200, 255, .08); }
.tab .ico { width: 18px; height: 18px; }
.tab.is-active {
  color: #06101f;
  background: linear-gradient(135deg, #8fd3ff, #b9a8ff 68%, #f3b6e0);
  box-shadow: 0 10px 26px -14px rgba(124, 200, 255, .95), inset 0 1px 0 rgba(255, 255, 255, .55);
}

.tab-panel[hidden] { display: none; }

/* ---------- 表单通用 ---------- */

.field { margin-bottom: 20px; }
.field:last-child { margin-bottom: 0; }
.field-tight { margin-bottom: 12px; }

.field-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .6rem;
  flex-wrap: wrap;
  margin-bottom: .55rem;
}

.field-label {
  display: block;
  font-size: .82rem;
  font-weight: 650;
  letter-spacing: .06em;
  color: #c7d8f4;
}
label.field-label { margin-bottom: .35rem; }

.field-hint { font-size: .74rem; color: var(--dim); }

input[type="text"],
input[type="number"],
textarea,
select {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: rgba(7, 11, 22, .62);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: .58rem .7rem;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
  min-height: 42px;
}

input[type="text"]:hover,
input[type="number"]:hover,
textarea:hover,
select:hover { border-color: rgba(140, 200, 255, .28); }

input[type="text"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
  border-color: rgba(124, 200, 255, .65);
  background: rgba(7, 11, 22, .82);
  box-shadow: 0 0 0 3px rgba(124, 200, 255, .16);
  outline: none;
}

textarea { resize: vertical; min-height: 62px; line-height: 1.55; }

select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2rem;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}
select option { background: var(--panel-solid); color: var(--text); }
select option:disabled { color: var(--dim); }

.text-input { font-weight: 600; }
.text-input.mono { font-size: .86rem; letter-spacing: .02em; }

/* 分段按钮 */
.seg {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(7, 11, 22, .5);
}

.seg-btn {
  flex: 1 1 0;
  min-width: 0;
  padding: .48rem .5rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: .84rem;
  font-weight: 600;
  cursor: pointer;
  transition: color .16s ease, background .16s ease, box-shadow .16s ease;
  white-space: nowrap;
}
.seg-btn:hover { color: var(--text); background: rgba(124, 200, 255, .08); }
.seg-btn.is-active {
  color: #06101f;
  background: linear-gradient(135deg, #9ad7ff, #c0aeff);
  box-shadow: 0 6px 18px -12px rgba(124, 200, 255, .9), inset 0 1px 0 rgba(255, 255, 255, .5);
}

/* 滑块 */
.slider-row {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin-top: .45rem;
}
.slider-row + .field-label { margin-top: .8rem; }

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  flex: 1 1 auto;
  min-width: 0;
  height: 24px;
  background: transparent;
  cursor: pointer;
  margin: 0;
}
input[type="range"]:disabled { cursor: not-allowed; opacity: .45; }

input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(124, 200, 255, .75), rgba(180, 156, 255, .7) 55%, rgba(255, 158, 210, .65));
  border: 1px solid rgba(255, 255, 255, .08);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -7px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #7cc8ff;
  box-shadow: 0 0 0 4px rgba(124, 200, 255, .16), 0 2px 8px rgba(0, 0, 0, .45);
  transition: transform .15s ease;
}
input[type="range"]:hover::-webkit-slider-thumb { transform: scale(1.08); }
input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(124, 200, 255, .75), rgba(180, 156, 255, .7) 55%, rgba(255, 158, 210, .65));
}
input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #7cc8ff;
  box-shadow: 0 0 0 4px rgba(124, 200, 255, .16);
}
input[type="range"]:focus-visible { outline: none; }
input[type="range"]:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 6px rgba(124, 200, 255, .35), 0 2px 8px rgba(0, 0, 0, .45);
}
input[type="range"]:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 6px rgba(124, 200, 255, .35);
}

.num-wrap {
  display: flex;
  align-items: center;
  gap: .2rem;
  flex: none;
  width: 92px;
  padding: .1rem .4rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(7, 11, 22, .6);
}
.num-wrap.wide { width: 116px; }
.num-wrap:focus-within { border-color: rgba(124, 200, 255, .55); box-shadow: 0 0 0 3px rgba(124, 200, 255, .13); }
.num-wrap input[type="number"] {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: .2rem 0;
  min-height: 30px;
  font-family: var(--mono);
  font-size: .84rem;
  text-align: right;
  min-width: 0;
}
.num-wrap input[type="number"]:focus { box-shadow: none; background: transparent; }
.num-wrap input[type="number"]::-webkit-outer-spin-button,
.num-wrap input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.num-wrap input[type="number"] { -moz-appearance: textfield; }
.num-unit { font-size: .72rem; color: var(--dim); flex: none; }

.num-out {
  flex: none;
  min-width: 52px;
  text-align: right;
  font-family: var(--mono);
  font-size: .8rem;
  color: #cfe2ff;
  background: rgba(124, 200, 255, .08);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .15rem .4rem;
}

/* 折叠块 */
.fold {
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(9, 15, 30, .45);
  overflow: hidden;
}
.fold[open] { background: rgba(9, 15, 30, .62); }

.fold-head {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .72rem .85rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background .18s ease;
  min-height: 48px;
}
.fold-head::-webkit-details-marker { display: none; }
.fold-head:hover { background: rgba(124, 200, 255, .07); }
.fold-head:focus-visible { outline-offset: -3px; border-radius: 14px; }

.fold-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 10px;
  background: rgba(124, 200, 255, .1);
  border: 1px solid var(--line);
  color: var(--blue);
}

.fold-title { font-weight: 650; font-size: .94rem; letter-spacing: .03em; }

.fold-state {
  margin-left: auto;
  font-size: .74rem;
  color: var(--dim);
  font-family: var(--mono);
  padding: .12rem .5rem;
  border-radius: 999px;
  background: rgba(124, 200, 255, .07);
  border: 1px solid var(--line);
}
.fold-state.is-on { color: #0a1729; background: linear-gradient(135deg, #9ad7ff, #c6b4ff); border-color: transparent; }

.fold-arrow {
  width: 18px;
  height: 18px;
  color: var(--dim);
  transition: transform .22s ease;
  flex: none;
}
.fold[open] .fold-arrow { transform: rotate(180deg); }

.fold-body {
  padding: .2rem .85rem 1rem;
  border-top: 1px solid rgba(140, 200, 255, .1);
  padding-top: .85rem;
}

/* 开关 */
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .7rem;
  flex-wrap: wrap;
  margin-bottom: .9rem;
}

.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  cursor: pointer;
  user-select: none;
}
.switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.switch-track {
  position: relative;
  width: 46px;
  height: 26px;
  flex: none;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(148, 163, 184, .22);
  transition: background .22s ease, border-color .22s ease;
}
.switch-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #cbd5e1;
  transition: transform .22s cubic-bezier(.2, .8, .3, 1.2), background .22s ease;
}
.switch input:checked + .switch-track {
  background: linear-gradient(135deg, #7cc8ff, #b49cff);
  border-color: transparent;
}
.switch input:checked + .switch-track::after {
  transform: translateX(20px);
  background: #071020;
}
.switch input:focus-visible + .switch-track {
  outline: 3px solid rgba(124, 200, 255, .85);
  outline-offset: 3px;
}
.switch-label { font-weight: 650; font-size: .9rem; }

.wm-fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
  transition: opacity .2s ease, filter .2s ease;
}
.wm-fieldset.is-dim { opacity: .42; filter: saturate(.6); }
.wm-fieldset:disabled { pointer-events: none; }

.wm-pane { margin-top: .9rem; }
.wm-grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: .9rem 1.1rem;
}
.wm-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .8rem 1rem;
  align-items: end;
  margin-top: .2rem;
}
.wm-shadow { margin-bottom: 0; align-self: center; padding-top: 1.2rem; }

.color-row {
  display: flex;
  align-items: center;
  gap: .55rem;
  flex-wrap: wrap;
  margin-top: .3rem;
}
input[type="color"] {
  -webkit-appearance: none;
  appearance: none;
  width: 44px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
}
input[type="color"]::-webkit-color-swatch-wrapper { padding: 3px; }
input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 7px; }
input[type="color"]::-moz-color-swatch { border: 0; border-radius: 7px; }

.color-hex {
  font-family: var(--mono);
  font-size: .76rem;
  color: var(--muted);
  background: rgba(7, 11, 22, .6);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .28rem .45rem;
}

.swatches { display: inline-flex; gap: .35rem; }
.swatch {
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .25);
  background: var(--sw, #8fd7ff);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.swatch:hover { transform: scale(1.14); box-shadow: 0 0 0 3px rgba(255, 255, 255, .12); }
.swatch.is-active { box-shadow: 0 0 0 2px #0b1224, 0 0 0 4px var(--sw, #8fd7ff); }

.check-row {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: .84rem;
  color: #c3d6f5;
  cursor: pointer;
  user-select: none;
  margin: .7rem 0 .2rem;
}
.check-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #7cc8ff;
  cursor: pointer;
  flex: none;
}
.check-row.wm-shadow { margin: 0; }

/* 九宫格 */
.pos-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: .4rem 0 .2rem;
}

.pos-grid {
  display: grid;
  grid-template-columns: repeat(3, 40px);
  grid-auto-rows: 40px;
  gap: 6px;
}

.pos-btn {
  position: relative;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(124, 200, 255, .045);
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
  padding: 0;
}
.pos-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  transition: background .16s ease, box-shadow .16s ease;
}
.pos-btn:hover { border-color: rgba(124, 200, 255, .4); background: rgba(124, 200, 255, .12); }
.pos-btn.is-active {
  border-color: rgba(124, 200, 255, .8);
  background: rgba(124, 200, 255, .18);
  box-shadow: 0 0 0 1px rgba(124, 200, 255, .4) inset, 0 6px 18px -12px rgba(124, 200, 255, .8);
}
.pos-btn.is-active::after {
  background: #eaf5ff;
  box-shadow: 0 0 10px 2px rgba(124, 200, 255, .8);
}

.pos-tile {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  height: 40px;
  padding: 0 .8rem;
  border-radius: 10px;
  border: 1px dashed var(--line-strong);
  background: rgba(124, 200, 255, .05);
  color: var(--muted);
  font: inherit;
  font-size: .8rem;
  cursor: pointer;
  transition: color .16s ease, background .16s ease, border-color .16s ease;
}
.pos-tile:hover { color: var(--text); background: rgba(124, 200, 255, .12); }
.pos-tile.is-active {
  color: #06101f;
  border-style: solid;
  border-color: transparent;
  background: linear-gradient(135deg, #9ad7ff, #c6b4ff);
}

/* 单选卡片 */
.radio-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .6rem;
  margin-top: .35rem;
}

.radio-card {
  position: relative;
  display: flex;
  gap: .55rem;
  align-items: flex-start;
  padding: .7rem .75rem;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: rgba(124, 200, 255, .035);
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}
.radio-card:hover { background: rgba(124, 200, 255, .08); }
.radio-card input {
  margin: .18rem 0 0;
  accent-color: #7cc8ff;
  flex: none;
  width: 16px;
  height: 16px;
}
.radio-card-body { display: flex; flex-direction: column; gap: .1rem; }
.radio-card-body strong { font-size: .84rem; }
.radio-card-body span { font-size: .74rem; color: var(--muted); line-height: 1.45; }
.radio-card:has(input:checked) {
  border-color: rgba(124, 200, 255, .6);
  background: rgba(124, 200, 255, .1);
  box-shadow: 0 0 0 1px rgba(124, 200, 255, .25) inset;
}

/* ---------- 上传 ---------- */

.dropzone {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .3rem;
  padding: clamp(18px, 3.4vw, 30px) 16px;
  border-radius: 16px;
  border: 1.5px dashed rgba(140, 200, 255, .32);
  background:
    radial-gradient(400px 120px at 50% 0%, rgba(124, 200, 255, .09), transparent 70%),
    rgba(7, 11, 22, .42);
  color: var(--muted);
  font: inherit;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, transform .2s ease, box-shadow .2s ease;
}
.dropzone:hover {
  border-color: rgba(124, 200, 255, .6);
  background: rgba(124, 200, 255, .08);
  transform: translateY(-1px);
}
.dropzone.is-dragover {
  border-color: rgba(255, 158, 210, .8);
  background: rgba(255, 158, 210, .1);
  box-shadow: 0 0 0 4px rgba(255, 158, 210, .1) inset;
}
.dropzone-sm { padding: 16px 12px; }

.dz-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  color: var(--blue);
  background: radial-gradient(circle at 30% 20%, rgba(124, 200, 255, .22), rgba(124, 200, 255, .06));
  border: 1px solid rgba(124, 200, 255, .24);
  margin-bottom: .25rem;
}
.dz-title { font-weight: 650; color: #d7e7ff; font-size: .9rem; }
.dz-sub { font-size: .75rem; color: var(--dim); }

.file-chip {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin-top: .65rem;
  padding: .55rem .6rem;
  border-radius: 14px;
  border: 1px solid rgba(124, 200, 255, .22);
  background: linear-gradient(140deg, rgba(24, 36, 64, .8), rgba(11, 18, 34, .8));
}

.chip-thumb {
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(7, 11, 22, .6);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
}
.chip-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.chip-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1 1 auto;
  gap: .1rem;
}
.chip-name {
  font-size: .86rem;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chip-meta { font-size: .73rem; color: var(--dim); font-family: var(--mono); }

.icon-btn {
  width: 38px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .04);
  color: var(--muted);
  cursor: pointer;
  transition: color .16s ease, background .16s ease, border-color .16s ease;
}
.icon-btn:hover { color: #fff; background: rgba(255, 139, 160, .16); border-color: rgba(255, 139, 160, .4); }
.icon-btn .ico { width: 18px; height: 18px; }

/* ---------- 偏移 ---------- */

.offset-body {
  margin-top: .7rem;
  padding: .8rem .9rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(7, 11, 22, .45);
}

.golden-readout {
  display: flex;
  align-items: baseline;
  gap: .35rem;
  padding: .1rem 0 .2rem;
}
.big-value {
  font-family: var(--mono);
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 700;
  letter-spacing: .02em;
  background: linear-gradient(120deg, #bfe7ff, #c9b8ff 65%, #ffc9e6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.big-unit { font-family: var(--mono); font-size: .8rem; color: var(--dim); }

/* ---------- 按钮 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 44px;
  padding: .62rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, .04);
  color: var(--text);
  font: inherit;
  font-weight: 650;
  font-size: .9rem;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease, color .2s ease;
  text-align: center;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); background: rgba(124, 200, 255, .1); border-color: rgba(140, 200, 255, .5); }
.btn:active:not(:disabled) { transform: translateY(0) scale(.995); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn-primary {
  border-color: transparent;
  color: #06101f;
  background: linear-gradient(135deg, #93d6ff 0%, #a9a8ff 52%, #fface0 100%);
  box-shadow: 0 16px 40px -18px rgba(124, 200, 255, .9), inset 0 1px 0 rgba(255, 255, 255, .55);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #a9e0ff 0%, #bcb4ff 52%, #ffbde8 100%);
  box-shadow: 0 20px 46px -18px rgba(124, 200, 255, 1), inset 0 1px 0 rgba(255, 255, 255, .65);
}

.btn-soft {
  color: #d8e8ff;
  background: rgba(180, 156, 255, .13);
  border-color: rgba(180, 156, 255, .32);
}
.btn-soft:hover:not(:disabled) { background: rgba(180, 156, 255, .2); border-color: rgba(180, 156, 255, .55); }

.btn-ghost { background: rgba(124, 200, 255, .06); color: #cfe2ff; }

.btn-sm { min-height: 36px; padding: .35rem .72rem; font-size: .8rem; border-radius: 10px; gap: .35rem; }
.btn-sm .ico { width: 16px; height: 16px; }

.btn-block { width: 100%; }
.btn-primary.btn-block { min-height: 52px; font-size: 1rem; }

.action-bar { margin-top: 18px; }
.action-bar .btn-block { margin-bottom: .55rem; }

/* ---------- 结果 ---------- */

.result-card {
  margin-top: 16px;
  padding: .85rem .9rem;
  border-radius: 14px;
  border: 1px solid rgba(124, 200, 255, .25);
  background:
    radial-gradient(300px 100px at 10% 0%, rgba(124, 200, 255, .12), transparent 70%),
    rgba(7, 11, 22, .55);
  animation: rise .3s ease-out;
}

.code-row {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin: .5rem 0 .45rem;
  flex-wrap: wrap;
}

.code {
  flex: 1 1 180px;
  min-width: 0;
  font-size: .84rem;
  letter-spacing: .03em;
  color: #d9ecff;
  background: rgba(124, 200, 255, .08);
  border: 1px solid rgba(124, 200, 255, .22);
  border-radius: 10px;
  padding: .5rem .65rem;
  word-break: break-all;
}

.code-input-row {
  display: flex;
  gap: .5rem;
  align-items: stretch;
  flex-wrap: wrap;
}
.code-input-row .text-input { flex: 1 1 210px; }
.code-input-row .btn { flex: none; }

.sub-card {
  margin-top: 16px;
  padding: .85rem .9rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(7, 11, 22, .4);
}
.sub-card .field-label { margin-bottom: .45rem; }

/* ---------- 资源列表 ---------- */

.res-list {
  list-style: none;
  margin: .7rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .45rem;
}

.res-item {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .45rem .5rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(124, 200, 255, .045);
}
.res-thumb {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 9px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: rgba(7, 11, 22, .6);
  border: 1px solid var(--line);
  color: var(--muted);
}
.res-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.res-info { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.res-name {
  font-size: .82rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.res-size { font-size: .7rem; color: var(--dim); font-family: var(--mono); }
.res-remove {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 9px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  background: transparent;
  color: var(--dim);
  cursor: pointer;
  transition: color .16s ease, background .16s ease;
}
.res-remove:hover { color: var(--err); background: rgba(255, 139, 160, .12); }
.res-remove .ico { width: 16px; height: 16px; }

.empty-note {
  font-size: .8rem;
  color: var(--dim);
  padding: .7rem .2rem .2rem;
  line-height: 1.55;
}

.res-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: .55rem;
  margin-top: .55rem;
}

.res-card {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  padding: .4rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(124, 200, 255, .05);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
  min-width: 0;
}
.res-card:hover {
  transform: translateY(-2px);
  border-color: rgba(124, 200, 255, .5);
  background: rgba(124, 200, 255, .12);
}
.res-card-thumb {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(7, 11, 22, .7);
  color: var(--muted);
  border: 1px solid rgba(140, 200, 255, .12);
}
.res-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.res-card-thumb .ico { width: 26px; height: 26px; }
.res-card-name {
  font-size: .74rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.res-card-meta { font-size: .66rem; color: var(--dim); font-family: var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- 预览 ---------- */

.preview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
}

.panel-title {
  font-size: 1.02rem;
  letter-spacing: .04em;
  margin-bottom: .1rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .72rem;
  font-family: var(--mono);
  color: var(--muted);
  padding: .2rem .55rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(124, 200, 255, .06);
  white-space: nowrap;
}
.badge-accent {
  color: #071020;
  background: linear-gradient(135deg, #9ad7ff, #c6b4ff);
  border-color: transparent;
  font-weight: 700;
}

.preview-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: clamp(220px, 34vh, 320px);
  max-height: 62vh;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid var(--line);
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}

.checker {
  background-color: #0a1220;
  background-image:
    linear-gradient(45deg, rgba(255, 255, 255, .045) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, .045) 75%),
    linear-gradient(45deg, rgba(255, 255, 255, .045) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, .045) 75%);
  background-size: 22px 22px;
  background-position: 0 0, 11px 11px;
}

.preview-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  padding: 18px 12px;
  text-align: center;
  color: var(--dim);
  font-size: .86rem;
}
.empty-cat {
  width: clamp(96px, 18vw, 132px);
  height: auto;
  opacity: .95;
  filter: drop-shadow(0 16px 30px rgba(124, 200, 255, .18));
  animation: bob 5.5s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

.preview-img {
  max-width: 100%;
  max-height: 54vh;
  object-fit: contain;
  border-radius: 10px;
  cursor: zoom-in;
  animation: fade-in .25s ease-out;
  background: transparent;
}
.preview-img:focus-visible { outline: 3px solid rgba(124, 200, 255, .9); outline-offset: 4px; }

.compare-flag {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: .72rem;
  font-family: var(--mono);
  color: #071020;
  background: linear-gradient(135deg, #ffd6ec, #ffb3d9);
  padding: .18rem .55rem;
  border-radius: 999px;
  font-weight: 700;
  pointer-events: none;
}

.preview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}

.preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.preview-actions .btn { flex: 1 1 auto; }
.preview-actions .btn-primary { flex: 1 1 100%; }

.preview-res { border-top: 1px solid rgba(140, 200, 255, .1); padding-top: .75rem; }
.preview-res .note { margin-top: .35rem; }

/* ---------- 页脚 ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  background: rgba(7, 11, 22, .55);
  padding: 26px 0 34px;
  margin-top: clamp(30px, 5vw, 56px);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  align-items: center;
  text-align: center;
}

.foot-main { font-size: .82rem; color: var(--muted); }
.foot-meta {
  display: flex;
  align-items: center;
  gap: .45rem;
  flex-wrap: wrap;
  justify-content: center;
  font-size: .76rem;
  color: var(--dim);
}
.dot-sep { color: var(--dim); }

/* ---------- Toast ---------- */

.toasts {
  position: fixed;
  top: calc(var(--header-h) + 14px);
  right: clamp(10px, 2vw, 24px);
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  width: min(370px, calc(100vw - 20px));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  padding: .65rem .7rem;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: rgba(12, 19, 36, .95);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: 0 20px 44px -22px rgba(0, 0, 0, .95);
  font-size: .85rem;
  line-height: 1.5;
  animation: toast-in .24s cubic-bezier(.2, .8, .3, 1.1);
}
.toast.is-leaving { animation: toast-out .2s ease-in forwards; }
.toast--ok { border-color: rgba(110, 231, 183, .45); }
.toast--err { border-color: rgba(255, 139, 160, .55); }
.toast--info { border-color: rgba(124, 200, 255, .45); }

.toast-icon {
  width: 24px;
  height: 24px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  margin-top: 1px;
}
.toast--ok .toast-icon { color: #052e21; background: linear-gradient(135deg, #7ff0c4, #4fdcae); }
.toast--err .toast-icon { color: #3a0713; background: linear-gradient(135deg, #ff9fb1, #ff708c); }
.toast--info .toast-icon { color: #06101f; background: linear-gradient(135deg, #9ad7ff, #c6b4ff); }
.toast-icon .ico { width: 14px; height: 14px; stroke-width: 2.4; }

.toast-body { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }

.toast-close {
  flex: none;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--dim);
  cursor: pointer;
}
.toast-close:hover { color: var(--text); background: rgba(255, 255, 255, .08); }
.toast-close .ico { width: 14px; height: 14px; }

@keyframes toast-in {
  from { opacity: 0; transform: translate3d(14px, -6px, 0) scale(.97); }
  to { opacity: 1; transform: none; }
}
@keyframes toast-out {
  to { opacity: 0; transform: translate3d(14px, 0, 0) scale(.97); }
}

/* ---------- 加载层 ---------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 7, 14, .74);
  -webkit-backdrop-filter: blur(9px);
  backdrop-filter: blur(9px);
  animation: fade-in .2s ease-out;
}

.overlay-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  padding: 26px 34px;
  border-radius: 22px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(160deg, rgba(23, 34, 62, .96), rgba(10, 17, 32, .96));
  box-shadow: 0 40px 90px -40px rgba(0, 0, 0, .95), inset 0 1px 0 rgba(255, 255, 255, .08);
  text-align: center;
  max-width: 340px;
}

.paw-spinner {
  width: 62px;
  height: 62px;
  color: var(--blue);
  animation: paw-spin 1.7s cubic-bezier(.5, .1, .5, .9) infinite;
  filter: drop-shadow(0 0 18px rgba(124, 200, 255, .55));
}
@keyframes paw-spin {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.12); }
  100% { transform: rotate(360deg) scale(1); }
}

.overlay-text { font-weight: 650; font-size: .96rem; margin-top: .3rem; }
.overlay-sub { font-size: .76rem; color: var(--dim); }

/* ---------- 拖拽提示 ---------- */

.drag-veil {
  position: fixed;
  inset: 12px;
  z-index: 92;
  display: grid;
  place-items: center;
  border-radius: 24px;
  border: 2px dashed rgba(255, 158, 210, .7);
  background: rgba(7, 11, 22, .8);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  pointer-events: none;
  animation: fade-in .15s ease-out;
}
.drag-veil-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .6rem;
  color: #ffd6ec;
  font-weight: 650;
  letter-spacing: .06em;
}

/* ---------- Modal ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: clamp(10px, 2.5vw, 24px);
}
.modal[hidden] { display: none !important; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 6, 12, .8);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
  animation: fade-in .2s ease-out;
}

.modal-panel {
  position: relative;
  width: min(920px, 100%);
  max-height: min(90vh, 940px);
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(160deg, #131d36 0%, #0a1120 72%);
  box-shadow: 0 60px 120px -50px #000, inset 0 1px 0 rgba(255, 255, 255, .08);
  overflow: hidden;
  animation: pop-in .24s cubic-bezier(.2, .8, .3, 1.05);
}

.modal-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .8rem .9rem;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 11, 22, .5);
}
.modal-head h2 {
  font-size: .95rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.modal-head .icon-btn { margin-left: auto; }
.modal-head .icon-btn:hover { color: #fff; background: rgba(255, 255, 255, .08); border-color: var(--line-strong); }

.modal-body {
  padding: 14px;
  overflow: auto;
  display: grid;
  place-items: center;
  min-height: 120px;
}
.modal-media {
  max-width: 100%;
  max-height: 68vh;
  border-radius: 12px;
  display: block;
  background: #060a12;
}
video.modal-media { width: min(100%, 860px); }

.modal-file {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  padding: 24px 16px;
  text-align: center;
}
.modal-file-icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  border: 1px solid var(--line-strong);
  background: rgba(124, 200, 255, .1);
  color: var(--blue);
}
.modal-file-icon .ico { width: 32px; height: 32px; }
.modal-file-name { font-weight: 650; word-break: break-all; max-width: 100%; }
.modal-file-meta { font-size: .76rem; color: var(--dim); font-family: var(--mono); }
.modal-file-hint { font-size: .78rem; color: var(--muted); max-width: 34ch; }

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .5rem;
  padding: .7rem .9rem;
  border-top: 1px solid var(--line);
  background: rgba(7, 11, 22, .45);
  flex-wrap: wrap;
}
.modal-foot:empty { display: none; }

/* ---------- Dialog ---------- */

.dialog {
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background: linear-gradient(160deg, #131d36, #0a1120 75%);
  color: var(--text);
  width: min(600px, calc(100vw - 28px));
  max-height: min(86vh, 820px);
  overflow: auto;
  box-shadow: 0 60px 130px -50px #000;
}
.dialog::backdrop {
  background: rgba(3, 6, 12, .78);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
}
.dialog-inner {
  position: relative;
  padding: clamp(18px, 3vw, 30px);
}
.dialog-close { position: absolute; top: 14px; right: 14px; }
.dialog-close:hover { color: #fff; background: rgba(255, 255, 255, .08); border-color: var(--line-strong); }
.dialog h2 { font-size: 1.24rem; padding-right: 44px; }
.dialog-lead { color: var(--muted); margin-top: .4rem; font-size: .9rem; }
.dialog h3 {
  font-size: .95rem;
  margin: 1.25rem 0 .35rem;
  color: #cfe2ff;
  letter-spacing: .02em;
}
.dialog p, .dialog li { color: var(--muted); font-size: .86rem; }
.dialog ul { margin: .2rem 0 0; padding-left: 1.2rem; display: grid; gap: .25rem; }
.dialog code {
  font-size: .82em;
  padding: .1rem .35rem;
  border-radius: 6px;
  background: rgba(124, 200, 255, .12);
  color: #cfe2ff;
}
.dialog strong { color: #dcebff; }
.dialog-foot { margin-top: 1.4rem; font-size: .76rem; color: var(--dim); border-top: 1px solid var(--line); padding-top: .8rem; }

.noscript {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 120;
  padding: .7rem 1.1rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 209, 138, .5);
  background: rgba(20, 16, 8, .95);
  color: var(--warn);
  font-size: .85rem;
  max-width: calc(100vw - 28px);
}

/* ---------- 动画 ---------- */

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-in {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to { opacity: 1; transform: none; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* ---------- 响应式 ---------- */

@media (max-width: 1050px) {
  .wm-grid-2 { grid-template-columns: minmax(0, 1fr); }
  .wm-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wm-shadow { padding-top: 0; }
}

@media (max-width: 980px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .preview { position: static; top: auto; }
  .preview-img { max-height: 48vh; }
  .preview-stage { min-height: 220px; }
}

@media (max-width: 760px) {
  :root { --header-h: 62px; }
  .brand-sub { display: none; }
  .brand-mark { width: 36px; height: 36px; }
  .brand-text strong { font-size: 1rem; }
  .site-nav { gap: 0; }
  .nav-link { padding: .4rem .5rem; font-size: .82rem; }
  .version-badge { display: none; }
  .hero { padding-top: 30px; }
  .hero-eyebrow { letter-spacing: .12em; font-size: .72rem; }
  .radio-cards { grid-template-columns: minmax(0, 1fr); }
  .res-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
}

@media (max-width: 560px) {
  body { font-size: 14.5px; }
  .wrap { padding-inline: 13px; }
  .panel { border-radius: 17px; padding: 13px; }
  .brand-mark { width: 32px; height: 32px; }
  .brand { gap: .45rem; }
  .brand-text strong { font-size: .95rem; letter-spacing: .03em; }
  .nav-link { font-size: .78rem; padding: .4rem .38rem; }
  .header-inner { gap: .35rem; min-height: var(--header-h); }
  .hero h1 { font-size: clamp(1.7rem, 9vw, 2.4rem); }
  .hero-sub { font-size: .85rem; }
  .chip { font-size: .74rem; padding: .35rem .65rem; }
  .field { margin-bottom: 16px; }
  .field-head { gap: .3rem; }
  .field-hint { width: 100%; }
  .slider-row { gap: .45rem; }
  .num-wrap { width: 80px; }
  .wm-grid-3 { grid-template-columns: minmax(0, 1fr); }
  .pos-grid { grid-template-columns: repeat(3, 38px); grid-auto-rows: 38px; }
  .code-input-row .btn { width: 100%; }
  .preview-actions .btn { flex: 1 1 100%; }
  .toasts { top: calc(var(--header-h) + 8px); right: 8px; width: calc(100vw - 16px); }
  .toast { font-size: .82rem; }
  .modal-panel { border-radius: 18px; max-height: 92vh; }
  .modal-media { max-height: 62vh; }
  .modal-foot { justify-content: stretch; }
  .modal-foot .btn { flex: 1 1 auto; }
  .dialog h2 { font-size: 1.1rem; }
  .foot-main { font-size: .74rem; }
}

@media (max-width: 380px) {
  .wrap { padding-inline: 10px; }
  .panel { padding: 11px; }
  .tabs { gap: 3px; padding: 4px; }
  .tab { gap: .3rem; padding: .5rem .3rem; }
  .seg-btn { font-size: .78rem; padding: .45rem .25rem; }
  .dz-title { font-size: .84rem; }
  .dz-sub { font-size: .7rem; }
  .pos-wrap { gap: 7px; }
  .pos-grid { grid-template-columns: repeat(3, 34px); grid-auto-rows: 34px; gap: 4px; }
  .pos-tile { padding: 0 .55rem; font-size: .74rem; height: 34px; }
  .brand-mark { width: 28px; height: 28px; }
  .brand-text strong { font-size: .88rem; }
  .nav-link { font-size: .74rem; padding: .35rem .25rem; }
  .chip { font-size: .7rem; }
}

/* ---------- 降低动态 ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .empty-cat, .paw, .orb, .paw-spinner { animation: none !important; }
}

/* ---------- 打印 ---------- */

@media print {
  .sky, .site-nav, .site-header, .site-footer, .toasts, .overlay, .drag-veil,
  .preview-actions, .controls .tabs, .dropzone, .action-bar { display: none !important; }
  body { background: #fff; color: #000; }
  .panel { border-color: #ccc; box-shadow: none; background: #fff; }
}
