/* =========================================================
   屿光桌面 · 基础样式
   ========================================================= */
#uiScaleRoot {
  position: relative;
  width: 100%;
  height: 100%;
  transform-origin: top left;
}

:root {
  --app-vw: 100vw;
  --app-vh: 100vh;
  --font-ui: "Microsoft YaHei", "微软雅黑", "Microsoft YaHei UI", "PingFang SC", "HarmonyOS Sans SC", system-ui, sans-serif;
  --font-mono: "Cascadia Code", "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  --ink: #f6f5f2;
  --ink-soft: rgba(246, 245, 242, 0.72);
  --ink-faint: rgba(246, 245, 242, 0.48);
  --line: rgba(255, 255, 255, 0.13);
  --line-strong: rgba(255, 255, 255, 0.22);
  --glass: rgba(17, 24, 33, 0.42);
  --glass-strong: rgba(16, 23, 31, 0.68);
  --glass-soft: rgba(255, 255, 255, 0.07);
  --accent-hi: #ffd795;
  --accent: #f1ad5d;
  --accent-deep: #d98a3e;
  --accent-ink: #38240a;
  --accent-rgb: 241, 173, 93;
  --danger: #ff8c82;
  --shadow-lg: 0 28px 80px rgba(2, 8, 14, 0.36);
  --shadow-md: 0 16px 42px rgba(2, 8, 14, 0.26);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 15px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

body[data-accent="mint"] {
  --accent-hi: #c4f4d4;
  --accent: #85dfa5;
  --accent-deep: #4bb77a;
  --accent-ink: #0b3620;
  --accent-rgb: 133, 223, 165;
}

body[data-accent="rose"] {
  --accent-hi: #ffd3d9;
  --accent: #f099a7;
  --accent-deep: #d76b7d;
  --accent-ink: #3c1019;
  --accent-rgb: 240, 153, 167;
}

body[data-accent="violet"] {
  --accent-hi: #e1d5ff;
  --accent: #b6a0ef;
  --accent-deep: #8d73dc;
  --accent-ink: #241544;
  --accent-rgb: 182, 160, 239;
}

body[data-accent="ocean"] {
  --accent-hi: #bcebff;
  --accent: #7bcfee;
  --accent-deep: #47a9cc;
  --accent-ink: #062a39;
  --accent-rgb: 123, 207, 238;
}

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

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100%;
  overflow: hidden;
  color: var(--ink);
  background: #253542;
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.modal-open {
  overflow: hidden;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  color: inherit;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  display: block;
}

h1, h2, h3, h4, p, blockquote, figure {
  margin: 0;
}

button,
a,
input,
textarea,
select {
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

::selection {
  color: #22190c;
  background: var(--accent-hi);
}

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

::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.2);
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.34);
  background-clip: content-box;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 背景 ---------- */
.wallpaper {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: #2a3b49;
  pointer-events: none;
}

.wallpaper__image {
  position: absolute;
  inset: -2.5%;
  background-image: var(--wallpaper-custom, url("../assets/wallpaper.svg"));
  background-position: center;
  background-size: cover;
  transform: scale(1.035);
  animation: wallpaperDrift 34s var(--ease) infinite alternate;
  transition: filter 0.7s ease;
}

body[data-wallpaper="dusk"] .wallpaper__image {
  filter: sepia(0.2) hue-rotate(-17deg) saturate(1.18) brightness(0.88);
}

body[data-wallpaper="mist"] .wallpaper__image {
  filter: saturate(0.64) hue-rotate(7deg) brightness(1.1) contrast(0.94);
}

body[data-wallpaper="night"] .wallpaper__image {
  filter: saturate(0.54) hue-rotate(9deg) brightness(0.5) contrast(1.12);
}

body[data-wallpaper="custom"] .wallpaper__image {
  filter: none;
  animation: none;
  transform: scale(1.02);
}

.wallpaper__veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(8, 15, 23, 0.36) 0%, transparent 35%, transparent 65%, rgba(7, 13, 19, 0.46) 100%),
    linear-gradient(90deg, rgba(8, 14, 21, 0.42) 0%, rgba(9, 15, 22, 0.08) 44%, rgba(8, 14, 21, 0.28) 100%);
}

.wallpaper__glow {
  position: absolute;
  left: 46%;
  top: 40%;
  width: 64vw;
  height: 58vh;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 227, 183, 0.13), transparent 68%);
  transform: translate(-30%, -30%);
}

.wallpaper__noise {
  position: absolute;
  inset: 0;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("../assets/noise.svg");
}

@keyframes wallpaperDrift {
  from { transform: scale(1.035) translate3d(-0.35%, -0.25%, 0); }
  to { transform: scale(1.07) translate3d(0.5%, 0.35%, 0); }
}

/* ---------- 通用文字 ---------- */
.eyebrow {
  margin: 0;
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.24em;
  line-height: 1.4;
  text-transform: uppercase;
}

.muted {
  color: var(--ink-soft);
}

kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink-soft);
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 550;
  line-height: 1;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 550;
  line-height: 1;
  white-space: nowrap;
  transition: border-color 0.2s, background 0.2s, transform 0.2s var(--ease), opacity 0.2s;
}

.btn svg {
  width: 16px;
  height: 16px;
  flex: none;
}

.btn:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.13);
}

.btn:active {
  transform: scale(0.975);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.btn--primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent-hi), var(--accent));
  color: var(--accent-ink);
  box-shadow: 0 8px 22px rgba(var(--accent-rgb), 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.btn--primary:hover {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent-hi), var(--accent));
  filter: brightness(1.05);
}

.btn--ghost {
  border-color: transparent;
  background: transparent;
  color: var(--ink-soft);
}

.btn--ghost:hover {
  border-color: transparent;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
}

.btn--danger {
  border-color: rgba(255, 124, 113, 0.24);
  background: rgba(255, 124, 113, 0.12);
  color: #ffb0a8;
}

.btn--danger:hover {
  border-color: rgba(255, 124, 113, 0.4);
  background: rgba(255, 124, 113, 0.19);
}

.btn--sm {
  height: 32px;
  padding: 0 11px;
  border-radius: 9px;
  font-size: 11.5px;
}

.btn--lg {
  height: 46px;
  padding: 0 20px;
  border-radius: 13px;
  font-size: 13.5px;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-soft);
  transition: background 0.2s, color 0.2s, transform 0.2s;
}

.icon-btn svg {
  width: 17px;
  height: 17px;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--ink);
}

.icon-btn:active {
  transform: scale(0.93);
}

/* ---------- 图标底板 ---------- */
.icon-tile {
  --tile-size: 58px;
  position: relative;
  display: grid;
  flex: none;
  place-items: center;
  width: var(--tile-size);
  height: var(--tile-size);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: calc(var(--tile-size) * 0.29);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.22), transparent 38%),
    linear-gradient(145deg, var(--tone-a), var(--tone-b));
  color: #fff;
  box-shadow:
    0 9px 20px rgba(3, 10, 16, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.38);
  isolation: isolate;
  transition: transform 0.28s var(--ease), box-shadow 0.28s var(--ease);
}

.icon-tile > svg {
  width: 47%;
  height: 47%;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.15));
}

.icon-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: linear-gradient(120deg, transparent 36%, rgba(255, 255, 255, 0.13) 49%, transparent 60%);
  opacity: 0.7;
}

.icon-tile.is-folder {
  border-color: rgba(255, 255, 255, 0.5);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.55), transparent 43%),
    linear-gradient(150deg, #fffdf5, #e8deca);
  color: #826136;
  box-shadow:
    0 9px 20px rgba(3, 10, 16, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.icon-tile.is-folder::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 8%;
  width: 42%;
  height: 14%;
  min-height: 6px;
  border-radius: 5px 5px 2px 2px;
  background: linear-gradient(145deg, var(--tone-a), var(--tone-b));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.icon-tile.is-folder > svg {
  width: 49%;
  height: 49%;
  color: #8c6b3f;
  filter: none;
}

.icon-tile.is-folder::after {
  background: linear-gradient(120deg, transparent 40%, rgba(255, 255, 255, 0.4) 50%, transparent 60%);
}

.folder-count {
  position: absolute;
  right: -4px;
  bottom: -4px;
  display: grid;
  place-items: center;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border: 2px solid rgba(31, 40, 48, 0.85);
  border-radius: 99px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 9px;
  font-weight: 750;
  line-height: 1;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.22);
}

.icon-tile--sm {
  --tile-size: 38px;
  border-radius: 11px;
}

.icon-tile--xs {
  --tile-size: 28px;
  border-radius: 8px;
}

.tone-amber { --tone-a: #ffd998; --tone-b: #e69a43; }
.tone-sky { --tone-a: #9bd8fa; --tone-b: #4f9ed3; }
.tone-mint { --tone-a: #b6ebd2; --tone-b: #61b895; }
.tone-iris { --tone-a: #c6bdf7; --tone-b: #8177cc; }
.tone-rose { --tone-a: #f7b8c8; --tone-b: #ce718c; }
.tone-coral { --tone-a: #ffba9e; --tone-b: #df7e62; }
.tone-slate { --tone-a: #aebdca; --tone-b: #617587; }
.tone-ocean { --tone-a: #91d9da; --tone-b: #3b929d; }
.tone-sand { --tone-a: #edd8b4; --tone-b: #bd9a69; }

/* ---------- 弹层 ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 22px;
}

.modal__scrim {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(5, 10, 15, 0.52);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  animation: scrimIn 0.28s ease both;
}

.dialog {
  position: relative;
  z-index: 1;
  width: min(540px, 100%);
  max-height: calc(var(--app-vh, 100vh) - 44px);
  max-height: calc(var(--app-vh, 100dvh) - 44px);
  overflow: auto;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.08), transparent 34%),
    rgba(20, 27, 36, 0.9);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  -webkit-backdrop-filter: blur(36px) saturate(1.2);
  backdrop-filter: blur(36px) saturate(1.2);
  animation: dialogIn 0.36s var(--ease) both;
}

.dialog--wide {
  width: min(680px, 100%);
}

.dialog--narrow {
  width: min(420px, 100%);
}

.dialog__head {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  margin-bottom: 22px;
}

.dialog__head-main {
  flex: 1;
  min-width: 0;
}

.dialog__head h2 {
  margin-top: 3px;
  font-size: 19px;
  font-weight: 620;
  letter-spacing: -0.02em;
}

.dialog__head p {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 12px;
}

.dialog__icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent-hi);
}

.dialog__icon svg {
  width: 21px;
  height: 21px;
}

.dialog__close {
  flex: none;
  margin: -5px -5px 0 0;
}

.dialog__foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.dialog__foot-note {
  margin-right: auto;
  color: var(--ink-faint);
  font-size: 11px;
}

@keyframes dialogIn {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes scrimIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---------- 表单 ---------- */
.field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.field + .field {
  margin-top: 15px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
  margin-top: 15px;
}

.field-row .field + .field {
  margin-top: 0;
}

.field > label,
.field-label {
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 540;
}

.field > small {
  color: var(--ink-faint);
  font-size: 10.5px;
  line-height: 1.55;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-width: 0;
  min-height: 43px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 11px;
  outline: 0;
  background: rgba(255, 255, 255, 0.055);
  color: var(--ink);
  font-size: 13px;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.field input::placeholder,
.field textarea::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: rgba(var(--accent-rgb), 0.65);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.1);
}

.field textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.6;
}

.field select {
  appearance: none;
  padding-right: 34px;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(255, 255, 255, 0.5) 50%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.5) 50%, transparent 50%);
  background-position:
    calc(100% - 16px) calc(50% - 1px),
    calc(100% - 11px) calc(50% - 1px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.field select option {
  color: #f3f2ef;
  background: #202b35;
}

.form-error {
  margin-top: 13px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 124, 113, 0.2);
  border-radius: 10px;
  background: rgba(255, 124, 113, 0.09);
  color: #ffc0b9;
  font-size: 11.5px;
}

/* 图标 / 色调选择器 */
.icon-picker {
  display: grid;
  grid-template-columns: repeat(11, minmax(0, 1fr));
  gap: 6px;
  max-height: 192px;
  overflow: auto;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
}

.icon-picker input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.icon-choice {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid transparent;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 0.18s, color 0.18s, border-color 0.18s, transform 0.18s;
}

.icon-choice svg {
  width: 17px;
  height: 17px;
}

.icon-choice:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--ink);
}

.icon-picker input:checked + .icon-choice {
  border-color: rgba(var(--accent-rgb), 0.3);
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.16);
}

.tone-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.tone-picker input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.tone-dot {
  display: block;
  width: 27px;
  height: 27px;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  background: linear-gradient(145deg, var(--tone-a), var(--tone-b));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: transform 0.18s, box-shadow 0.18s;
}

.tone-dot:hover {
  transform: scale(1.08);
}

.tone-picker input:checked + .tone-dot {
  box-shadow: 0 0 0 2px rgba(18, 25, 33, 0.9), 0 0 0 4px var(--accent-hi);
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 13px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.switch-row:last-child {
  border-bottom: 0;
}

.switch-copy strong {
  display: block;
  font-size: 12.5px;
  font-weight: 550;
}

.switch-copy span {
  display: block;
  margin-top: 2px;
  color: var(--ink-faint);
  font-size: 10.5px;
}

.switch {
  position: relative;
  flex: none;
  width: 40px;
  height: 23px;
}

.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch span {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: background 0.22s, border-color 0.22s;
}

.switch span::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.24);
  transition: transform 0.22s var(--ease), background 0.22s;
}

.switch input:checked + span {
  border-color: transparent;
  background: var(--accent);
}

.switch input:checked + span::before {
  background: var(--accent-ink);
  transform: translateX(17px);
}

/* ---------- 右键菜单 ---------- */
.context-menu {
  position: fixed;
  z-index: 120;
  min-width: 196px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  background: rgba(22, 29, 38, 0.92);
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: blur(28px) saturate(1.15);
  backdrop-filter: blur(28px) saturate(1.15);
  animation: menuIn 0.16s var(--ease) both;
}

.context-menu__item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  height: 34px;
  padding: 0 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 12px;
  text-align: left;
  transition: background 0.14s, color 0.14s;
}

.context-menu__item svg {
  width: 15px;
  height: 15px;
  flex: none;
  opacity: 0.8;
}

.context-menu__item span {
  flex: 1;
}

.context-menu__item kbd {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--ink-faint);
  font-size: 9px;
}

.context-menu__item:hover {
  background: rgba(255, 255, 255, 0.09);
  color: var(--ink);
}

.context-menu__item.is-danger {
  color: #ffaba3;
}

.context-menu__item.is-danger:hover {
  background: rgba(255, 124, 113, 0.12);
}

.context-menu__sep {
  height: 1px;
  margin: 5px 7px;
  background: var(--line);
}

@keyframes menuIn {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 112px;
  z-index: 150;
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: min(440px, calc(var(--app-vw, 100vw) - 40px));
  padding: 11px 16px 11px 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: rgba(20, 27, 36, 0.9);
  box-shadow: var(--shadow-md);
  color: var(--ink);
  font-size: 12px;
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  transform: translate(-50%, 14px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s, transform 0.32s var(--ease);
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast__icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 23px;
  height: 23px;
  border-radius: 7px;
  background: rgba(var(--accent-rgb), 0.18);
  color: var(--accent-hi);
}

.toast__icon svg {
  width: 13px;
  height: 13px;
}

.toast.is-error .toast__icon {
  background: rgba(255, 124, 113, 0.16);
  color: #ffb3ab;
}

@media (max-width: 640px) {
  .dialog {
    padding: 20px;
    border-radius: 22px;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .field-row .field + .field {
    margin-top: 15px;
  }

  .icon-picker {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }

  .toast {
    bottom: 88px;
  }
}

/* ---------- 自定义图标 ---------- */
.custom-icon__main {
  display: flex;
  align-items: flex-start;
  gap: 11px;
}

.custom-icon__preview {
  display: grid;
  flex: none;
  place-items: center;
  width: 48px;
  height: 48px;
  overflow: hidden;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.28);
}

.custom-icon__preview.has-image {
  border-style: solid;
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
}

.custom-icon__preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.custom-icon__ph {
  display: grid;
  place-items: center;
}

.custom-icon__ph svg {
  width: 20px;
  height: 20px;
}

.custom-icon__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.custom-icon__buttons {
  display: flex;
  align-items: center;
  gap: 6px;
}

.custom-icon__upload {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.custom-icon__upload.is-busy {
  opacity: 0.6;
  pointer-events: none;
}

.custom-icon__upload input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.custom-icon__url {
  width: 100%;
  height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.035);
  color: rgba(255, 255, 255, 0.82);
  font-size: 10px;
  outline: none;
  transition: border-color 0.18s, background 0.18s;
}

.custom-icon__url:focus {
  border-color: rgba(var(--accent-rgb), 0.4);
  background: rgba(255, 255, 255, 0.06);
}

.custom-icon__url::placeholder {
  color: rgba(255, 255, 255, 0.24);
}

.custom-icon__hint {
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.26);
  font-size: 8.5px;
  line-height: 1.5;
}

.custom-icon__error {
  margin-top: 4px;
}

.custom-icon + .field,
.field + .custom-icon {
  margin-top: 0;
}

/* 自定义图标渲染 */
.icon-tile.has-custom {
  padding: 0;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.icon-tile .icon-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.engine-static {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.42);
  font-size: 8px;
  letter-spacing: 0.02em;
}

@media (max-width: 560px) {
  .custom-icon__main {
    align-items: stretch;
  }

  .custom-icon__preview {
    width: 42px;
    height: 42px;
  }
}

/* ---------- 阿里云图标库 ---------- */
.icon-library {
  width: min(820px, calc(var(--app-vw, 100vw) - 36px));
}

.icon-library__search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  padding: 0 12px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  color: rgba(255, 255, 255, 0.34);
}

.icon-library__search svg {
  flex: none;
  width: 14px;
  height: 14px;
}

.icon-library__search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 11px;
  outline: none;
}

.icon-library__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(74px, 1fr));
  gap: 6px;
  max-height: min(52vh, 430px);
  overflow: auto;
  padding: 2px;
}

.icon-library__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 9px 4px 7px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  color: rgba(255, 255, 255, 0.6);
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.icon-library__item:hover {
  border-color: rgba(var(--accent-rgb), 0.35);
  background: rgba(var(--accent-rgb), 0.09);
  color: var(--accent-hi);
}

.icon-library__item.is-selected {
  border-color: rgba(var(--accent-rgb), 0.55);
  background: rgba(var(--accent-rgb), 0.15);
  color: var(--accent-hi);
}

.icon-library__item svg {
  width: 22px;
  height: 22px;
}

.icon-library__item span {
  max-width: 100%;
  overflow: hidden;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-library__empty {
  grid-column: 1 / -1;
  padding: 26px;
  color: rgba(255, 255, 255, 0.34);
  font-size: 10px;
  text-align: center;
}

.icon-library__foot {
  flex-wrap: wrap;
}

.icon-library__note {
  flex: 1;
  min-width: 140px;
  color: rgba(255, 255, 255, 0.24);
  font-size: 8px;
}

/* ---------- 分类图标 ---------- */
.category-icon-field {
  display: flex;
  align-items: center;
  gap: 10px;
}

.category-icon-preview,
.category-icon-badge {
  display: grid;
  flex: none;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--accent-hi);
  overflow: hidden;
}

.category-icon-preview svg,
.category-icon-badge svg {
  width: 22px;
  height: 22px;
}

.category-icon-preview img,
.category-icon-badge img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.category-icon-preview .cat-dot,
.category-icon-badge .cat-dot {
  width: 14px;
  height: 14px;
}

.category-icon-actions {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.rail-cat-icon {
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  overflow: hidden;
  border-radius: 6px;
  color: var(--accent-hi);
}

.rail-cat-icon svg {
  width: 18px;
  height: 18px;
}

.rail-cat-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
