/* ============================================================
   启搜 · 样式表
   暗色为默认，[data-theme=light] 切换亮色
   ============================================================ */

:root {
  --bg: #07090e;
  --bg-2: #0b0f17;
  --panel: rgba(255, 255, 255, 0.045);
  --panel-2: rgba(255, 255, 255, 0.075);
  --panel-3: rgba(255, 255, 255, 0.12);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.18);
  --fg: #e9edf6;
  --fg-2: #a3adc2;
  --fg-3: #6d7689;
  --accent: #7b6cff;
  --accent-2: #35d6c6;
  --danger: #ff6b81;
  --ok: #38d39f;
  --radius: 18px;
  --shadow-lg: 0 30px 80px -40px rgba(0, 0, 0, 0.95);
  --shadow-sm: 0 10px 30px -18px rgba(0, 0, 0, 0.85);
  --ease: cubic-bezier(0.22, 0.8, 0.32, 1);
}

[data-theme="light"] {
  --bg: #eef1f8;
  --bg-2: #f6f8fc;
  --panel: rgba(255, 255, 255, 0.72);
  --panel-2: rgba(255, 255, 255, 0.95);
  --panel-3: #ffffff;
  --line: rgba(20, 28, 48, 0.09);
  --line-strong: rgba(20, 28, 48, 0.18);
  --fg: #101827;
  --fg-2: #4d5a6e;
  --fg-3: #8a94a8;
  --accent: #5b5bf5;
  --accent-2: #12b5a6;
  --danger: #e5484d;
  --ok: #12a97a;
  --shadow-lg: 0 30px 70px -40px rgba(40, 55, 110, 0.45);
  --shadow-sm: 0 10px 24px -16px rgba(40, 55, 110, 0.4);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
::selection { background: rgba(123, 108, 255, 0.35); }

/* ---------- 背景光晕 ---------- */
.bg { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.bg-orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.42; }
.o1 { width: 620px; height: 620px; left: -160px; top: -220px; background: #4a3cff; }
.o2 { width: 540px; height: 540px; right: -140px; top: -80px; background: #0f8f8a; opacity: 0.3; }
.o3 { width: 680px; height: 520px; left: 34%; bottom: -340px; background: #8a2be2; opacity: 0.2; }

[data-theme="light"] .bg { background: linear-gradient(180deg, #f7f9ff 0%, #eaeef8 100%); }
[data-theme="light"] .bg-orb { opacity: 0.3; filter: blur(110px); }
[data-theme="light"] .o1 { background: #a8b4ff; }
[data-theme="light"] .o2 { background: #9be3d8; }
[data-theme="light"] .o3 { background: #d8c4ff; opacity: 0.55; }

/* 顶部细网格质感 */
body::after {
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.5;
  mask-image: linear-gradient(180deg, #000 0%, transparent 55%);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 55%);
}
[data-theme="light"] body::after { display: none; }

/* ---------- 布局 ---------- */
.app {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px 28px 60px;
}

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px;
  min-width: 0;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 0; }
.brand-ico { width: 36px; height: 36px; border-radius: 10px; flex: 0 0 auto; }
.brand-txt { min-width: 0; }
.brand-name { font-size: 16px; font-weight: 700; letter-spacing: 0.5px; }
.brand-sub { font-size: 11px; color: var(--fg-3); letter-spacing: 1.5px; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }

.icon-btn {
  display: grid; place-items: center;
  width: 30px; height: 30px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--fg-3);
  transition: all 0.18s var(--ease);
}
.icon-btn:hover { color: var(--fg); background: var(--panel-2); border-color: var(--line); }
.icon-btn svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.cats {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  margin: 0;
  padding: 2px 2px 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.cats::-webkit-scrollbar { height: 6px; }
.cats::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 99px; }

.cat {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--fg-2);
  text-align: left;
  width: auto;
  flex: 0 0 auto;
  user-select: none;
  transition: background 0.16s var(--ease), color 0.16s var(--ease), border-color 0.16s;
}
.cat:hover { background: var(--panel-2); color: var(--fg); }
.cat:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.cat.active {
  color: var(--fg);
  background: linear-gradient(100deg, rgba(123, 108, 255, 0.22), rgba(53, 214, 198, 0.08));
  border-color: rgba(123, 108, 255, 0.35);
}
[data-theme="light"] .cat.active { background: linear-gradient(100deg, rgba(91, 91, 245, 0.13), rgba(18, 181, 166, 0.07)); }

.cat-ic {
  flex: 0 0 auto;
  width: 22px; height: 22px;
  display: grid; place-items: center;
  font-size: 14px;
  border-radius: 7px;
  background: var(--panel-2);
  line-height: 1;
}
.cat.active .cat-ic { background: rgba(255, 255, 255, 0.08); }
.cat-name { flex: 1; min-width: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-n { font-size: 11px; color: var(--fg-3); font-variant-numeric: tabular-nums; }
.cat-more {
  opacity: 0;
  width: 20px; height: 20px;
  display: grid; place-items: center;
  border: 0; border-radius: 6px;
  background: transparent; color: var(--fg-3);
  font-size: 13px; line-height: 1;
  transition: opacity 0.15s;
}
.cat:hover .cat-more { opacity: 1; }
.cat-more:hover { background: var(--panel-3); color: var(--fg); }
.cat.drag-over { border-color: var(--accent-2); background: rgba(53, 214, 198, 0.12); }
.cat.dragging { opacity: 0.45; }

.cat-add {
  justify-content: center;
  color: var(--fg-3);
  border: 1px dashed var(--line-strong);
  background: transparent;
  font-size: 12px;
}
.cat-add:hover { color: var(--fg); border-color: var(--accent); background: rgba(123, 108, 255, 0.1); }
@media (min-width: 861px) { .cat-add { display: none; } }

/* ---------- 分类条（搜索框下方） ---------- */
.catbar {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 1180px;
  margin: 18px auto 0;
  padding: 0 2px;
}
.catbar .cats { flex: 1; min-width: 0; }
.catbar-foot { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }

.stat { font-size: 11.5px; color: var(--fg-3); letter-spacing: 0.3px; white-space: nowrap; }
.ghost-btn {
  display: flex; align-items: center; gap: 6px;
  width: auto; height: 34px;
  padding: 0 13px;
  border: 1px dashed var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--fg-2);
  font-size: 12.5px;
  white-space: nowrap;
  transition: all 0.18s var(--ease);
}
.ghost-btn svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.ghost-btn:hover { color: var(--fg); border-color: var(--accent); background: rgba(123, 108, 255, 0.1); }

/* ---------- 主区 ---------- */
.main { min-width: 0; padding-top: clamp(24px, 6vh, 72px); }

.hero { max-width: 760px; margin: 0 auto; }

.engines {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-bottom: 18px;
}
.engine {
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 13px 0 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--fg-3);
  font-size: 12.5px;
  transition: all 0.18s var(--ease);
}
.engine:hover { color: var(--fg); background: var(--panel); }
.engine .dot {
  width: 20px; height: 20px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700; color: #fff;
  letter-spacing: -0.5px;
  box-shadow: 0 2px 8px -3px rgba(0, 0, 0, 0.8);
}
.engine.active {
  color: var(--fg);
  background: var(--panel-2);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}

.search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 64px;
  padding: 0 10px 0 20px;
  border-radius: 20px;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  box-shadow: var(--shadow-lg);
  transition: border-color 0.2s, box-shadow 0.25s var(--ease), transform 0.25s var(--ease);
}
.search:focus-within {
  border-color: rgba(123, 108, 255, 0.65);
  box-shadow: 0 0 0 4px rgba(123, 108, 255, 0.13), 0 26px 70px -30px rgba(123, 108, 255, 0.6);
}
.search-ico { flex: 0 0 auto; fill: none; stroke: var(--fg-3); stroke-width: 1.8; stroke-linecap: round; }
.search:focus-within .search-ico { stroke: var(--accent); }
.search input {
  flex: 1; min-width: 0;
  height: 100%;
  border: 0; outline: 0; background: transparent;
  font-size: 17px;
  letter-spacing: 0.2px;
}
.search input::placeholder { color: var(--fg-3); }
.search-go {
  flex: 0 0 auto;
  height: 46px;
  padding: 0 24px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
  background: linear-gradient(135deg, #7b6cff 0%, #5566ff 60%, #3dd6c4 140%);
  box-shadow: 0 12px 26px -12px rgba(110, 100, 255, 0.9);
  transition: transform 0.16s var(--ease), box-shadow 0.2s;
}
.search-go:hover { transform: translateY(-1px); box-shadow: 0 16px 30px -12px rgba(110, 100, 255, 1); }
.search-go:active { transform: translateY(0) scale(0.98); }

/* 本地书签联想 */
.suggest {
  position: absolute;
  left: 0; right: 0; top: calc(100% + 8px);
  padding: 6px;
  border-radius: 16px;
  background: var(--panel-2);
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: var(--shadow-lg);
  z-index: 30;
  max-height: 330px;
  overflow: auto;
}
.sug {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 8px 10px;
  border: 0; border-radius: 10px;
  background: transparent;
  text-align: left;
  color: var(--fg-2);
}
.sug:hover, .sug.sel { background: var(--panel-3); color: var(--fg); }
.sug .sug-ico { width: 22px; height: 22px; border-radius: 6px; object-fit: cover; flex: 0 0 auto; }
.sug .sug-name { flex: 1; min-width: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sug .sug-host { font-size: 11px; color: var(--fg-3); flex: 0 0 auto; }
.sug-empty { padding: 14px; text-align: center; color: var(--fg-3); font-size: 12px; }

.hints {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 14px;
  margin-top: 16px;
  font-size: 11.5px;
  color: var(--fg-3);
}
.hints span { display: inline-flex; align-items: center; gap: 4px; }
kbd {
  display: inline-block;
  min-width: 18px;
  padding: 1px 5px;
  border-radius: 5px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  font-family: inherit;
  font-size: 10.5px;
  line-height: 1.4;
  text-align: center;
  color: var(--fg-2);
}

/* ---------- 书签区 ---------- */
.board { width: 100%; max-width: 1180px; margin: clamp(30px, 5vh, 56px) auto 0; }

.board-head {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.board-title { margin: 0; font-size: 19px; font-weight: 650; letter-spacing: 0.4px; }
.board-tools { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.filter {
  display: flex; align-items: center; gap: 7px;
  height: 36px;
  padding: 0 12px;
  min-width: 190px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--panel);
  transition: border-color 0.18s, box-shadow 0.18s;
}
.filter svg { fill: none; stroke: var(--fg-3); stroke-width: 1.8; stroke-linecap: round; }
.filter:focus-within { border-color: rgba(123, 108, 255, 0.5); box-shadow: 0 0 0 3px rgba(123, 108, 255, 0.1); }
.filter input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 13px; }
.filter input::placeholder { color: var(--fg-3); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--fg-2);
  font-size: 13px;
  white-space: nowrap;
  transition: all 0.18s var(--ease);
}
.btn svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.btn:hover { color: var(--fg); border-color: var(--line-strong); background: var(--panel-2); }
.btn.primary {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, #7b6cff, #5a6bff);
  box-shadow: 0 10px 24px -14px rgba(110, 100, 255, 0.95);
}
.btn.primary:hover { transform: translateY(-1px); box-shadow: 0 14px 28px -14px rgba(110, 100, 255, 1); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); border-color: rgba(255, 107, 129, 0.35); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12px; border-radius: 9px; }

.group { margin-bottom: 30px; }
.group-head {
  display: flex; align-items: center; gap: 9px;
  margin: 0 0 12px 2px;
}
.group-head h2 { margin: 0; font-size: 13px; font-weight: 600; color: var(--fg-2); letter-spacing: 0.6px; }
.group-head .group-n { font-size: 11px; color: var(--fg-3); }
.group-head .line { flex: 1; height: 1px; background: var(--line); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 11px; }

/* 书签卡片 */
.bm {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  height: 68px;
  padding: 0 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  text-align: left;
  color: var(--fg);
  cursor: pointer;
  user-select: none;
  transition: transform 0.18s var(--ease), background 0.18s, border-color 0.18s, box-shadow 0.2s;
  animation: cardIn 0.35s var(--ease) both;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
.bm:hover {
  transform: translateY(-2px);
  background: var(--panel-2);
  border-color: rgba(123, 108, 255, 0.35);
  box-shadow: 0 16px 34px -22px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(123, 108, 255, 0.08) inset;
}
.bm:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.bm.dragging { opacity: 0.4; transform: scale(0.98); }
.bm.drop-before { box-shadow: -3px 0 0 0 var(--accent-2); }
.bm.drop-after { box-shadow: 3px 0 0 0 var(--accent-2); }

.bm-ico {
  position: relative;
  flex: 0 0 auto;
  width: 34px; height: 34px;
  border-radius: 10px;
  display: grid; place-items: center;
  overflow: hidden;
  background: var(--panel-2);
  border: 1px solid var(--line);
}
.bm-ico img { width: 100%; height: 100%; object-fit: cover; display: none; }
.bm-ico img.loaded { display: block; }
.bm-letter {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0;
  width: 100%; height: 100%;
  display: grid; place-items: center;
}
.bm-ico img.loaded + .bm-letter { display: none; }

.bm-txt { min-width: 0; flex: 1; padding-right: 4px; }
.bm-name {
  font-size: 13.5px;
  font-weight: 550;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bm-host { font-size: 11px; color: var(--fg-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.bm-note { font-size: 11px; color: var(--fg-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bm-tag {
  position: absolute; right: 10px; top: -7px;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  font-size: 10px;
  color: var(--fg-3);
  opacity: 0;
  transition: opacity 0.16s;
}
.bm[data-showtag="1"] .bm-tag { opacity: 1; }

.bm-more {
  position: absolute;
  right: 6px; top: 6px;
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border: 0; border-radius: 7px;
  background: transparent;
  color: var(--fg-3);
  font-size: 13px; line-height: 1;
  letter-spacing: 1px;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s, color 0.15s;
}
.bm:hover .bm-more { opacity: 1; }
.bm-more:hover { background: var(--panel-3); color: var(--fg); }

/* 空白状态 */
.empty {
  display: flex; flex-direction: column; align-items: center;
  padding: 54px 20px 60px;
  text-align: center;
  color: var(--fg-3);
}
.empty-art {
  width: 92px; height: 92px;
  margin-bottom: 16px;
  display: grid; place-items: center;
  border-radius: 26px;
  border: 1px dashed var(--line-strong);
  background: var(--panel);
  position: relative;
}
.empty-art svg { fill: none; stroke: var(--fg-3); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.empty-title { color: var(--fg-2); font-size: 14px; margin-bottom: 6px; }
.empty-sub { font-size: 12px; max-width: 340px; line-height: 1.7; }
.empty-acts { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; justify-content: center; }

/* ---------- 右键菜单 ---------- */
.ctx {
  position: fixed;
  z-index: 60;
  min-width: 172px;
  padding: 5px;
  border-radius: 13px;
  background: var(--panel-2);
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(26px);
  -webkit-backdrop-filter: blur(26px);
  box-shadow: var(--shadow-lg);
  animation: pop 0.14s var(--ease) both;
}
@keyframes pop { from { opacity: 0; transform: scale(0.96) translateY(-4px); } to { opacity: 1; transform: none; } }
.ctx button {
  display: block; width: 100%;
  padding: 8px 11px;
  border: 0; border-radius: 8px;
  background: transparent;
  color: var(--fg-2);
  font-size: 13px; text-align: left;
}
.ctx button:hover { background: var(--panel-3); color: var(--fg); }
.ctx button.danger:hover { background: rgba(255, 107, 129, 0.14); color: var(--danger); }
.ctx-sep { height: 1px; margin: 4px 6px; background: var(--line); }

/* ---------- 弹窗 ---------- */
.dlg {
  width: min(520px, 94vw);
  max-height: 86vh;
  overflow: auto;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: var(--panel-2);
  color: var(--fg);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
}
.dlg.wide { width: min(620px, 94vw); }
.dlg::backdrop { background: rgba(4, 6, 12, 0.6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.dlg-body { padding: 24px 24px 20px; }
.dlg-title { margin: 0 0 18px; font-size: 17px; font-weight: 650; letter-spacing: 0.3px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field > span { font-size: 12px; color: var(--fg-3); letter-spacing: 0.3px; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--fg);
  font-size: 13.5px;
  outline: 0;
  transition: border-color 0.16s, box-shadow 0.16s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: rgba(123, 108, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(123, 108, 255, 0.1);
}
.field textarea { resize: vertical; min-height: 60px; font-family: inherit; }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; min-width: 0; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }

.set-sec { margin-bottom: 22px; }
.set-sec h4 { margin: 0 0 10px; font-size: 12.5px; font-weight: 600; color: var(--fg-2); letter-spacing: 0.5px; }
.set-sec h4 .muted { font-weight: 400; margin-left: 6px; font-size: 11px; }

.engine-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.engine-row {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 9px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.engine-row .dot { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; }
.engine-row .ename { width: 76px; font-size: 13px; flex: 0 0 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.engine-row .eurl { flex: 1; min-width: 0; font-size: 11.5px; color: var(--fg-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.engine-row .icon-btn { width: 26px; height: 26px; }

.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.set-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.set-grid .btn { height: 38px; }
.muted { color: var(--fg-3); }
.tiny { font-size: 11.5px; margin: 10px 2px 0; line-height: 1.7; }
code {
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--panel-3);
  font-size: 11.5px;
}
.keys { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.keys li { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--fg-2); }
.keys li span { margin-left: 8px; color: var(--fg-3); }

/* ---------- Toast ---------- */
.toast-wrap {
  position: fixed;
  left: 50%; bottom: 26px;
  transform: translateX(-50%);
  z-index: 80;
  display: flex; flex-direction: column; gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--panel-3);
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: var(--fg);
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.24s var(--ease) both;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(0.97); } to { opacity: 1; transform: none; } }
.toast.out { animation: toastOut 0.22s var(--ease) forwards; }
.toast-act {
  border: 0;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(123, 108, 255, 0.18);
  color: var(--accent-2);
  font-size: 12.5px;
  font-weight: 600;
}
.toast-act:hover { background: rgba(123, 108, 255, 0.32); }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }

/* ---------- 滚动条 ---------- */
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 8px; }
*::-webkit-scrollbar-track { background: transparent; }

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) {
  .app { padding: 16px 20px 48px; }
}

@media (max-width: 860px) {
  .app { padding: 14px 16px 48px; }
  .brand-ico { width: 32px; height: 32px; }
  .brand-name { font-size: 15px; }
  .brand-sub { display: none; }
  .sync-chip { height: 28px; padding: 0 9px; font-size: 11.5px; }

  .main { display: block; padding-top: 6px; min-width: 0; }
  .main > * { min-width: 0; width: 100%; }
  .catbar { display: block; margin: 14px 0 0; padding: 0; max-width: 100%; min-width: 0; }
  .catbar .cats { width: 100%; min-width: 0; }
  .catbar-foot { display: none; }
  .cats { gap: 6px; margin: 0 -2px; padding: 2px 2px 6px; }
  .cat { height: 34px; padding: 0 11px; gap: 6px; }
  .cat-more { display: none; }
  .cat .cat-n { display: none; }

  .hero { width: 100%; max-width: 100%; align-self: stretch; }
  .search { height: 56px; padding: 0 8px 0 15px; }
  .search input { font-size: 16px; }
  .search-go { height: 40px; padding: 0 16px; }
  .hints { display: none; }
  .board { margin-top: 26px; }
  .board-title { font-size: 17px; }
  .board-tools { width: 100%; margin-left: 0; }
  .filter { flex: 1; min-width: 0; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 9px; }
  .bm { height: 62px; }
  .bm-ico { width: 30px; height: 30px; }
  .set-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .engines { gap: 2px; }
  .engine { padding: 0 9px 0 6px; height: 30px; font-size: 12px; }
  .engine .dot { width: 17px; height: 17px; font-size: 10px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); }
  .bm-name { font-size: 13px; }
  .btn.primary#btn-add { padding: 0 11px; }
  #sync-chip-txt { display: none; }
  .sync-chip { width: 28px; justify-content: center; padding: 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------- 云同步 ---------- */

.sync-chip {
  display: flex; align-items: center; gap: 7px;
  height: 30px; padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--fg-3);
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.18s var(--ease);
}
.sync-chip:hover { color: var(--fg-2); border-color: var(--line-strong); }
.sync-chip .sync-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--fg-3); flex: 0 0 auto; transition: background 0.3s; }
.sync-chip[data-state="ok"] .sync-dot { background: var(--ok); box-shadow: 0 0 0 2px rgba(56, 211, 159, 0.18); }
.sync-chip[data-state="ok"] { color: var(--fg-2); }
.sync-chip[data-state="syncing"] .sync-dot { background: #f3b73c; animation: sync-pulse 1s infinite; }
.sync-chip[data-state="error"] .sync-dot { background: var(--danger); }
.sync-chip[data-state="error"] { color: var(--danger); }

@keyframes sync-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.82); }
}

.sync-live {
  display: flex; align-items: center; gap: 10px;
  margin-top: 10px; padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-2);
}
.sync-live[hidden] { display: none !important; }
.sync-live .sync-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--fg-3); flex: 0 0 auto; }
.sync-live .sync-dot[data-state="ok"] { background: var(--ok); }
.sync-live .sync-dot[data-state="syncing"] { background: #f3b73c; animation: sync-pulse 1s infinite; }
.sync-live .sync-dot[data-state="error"] { background: var(--danger); }
.sync-info { flex: 1; min-width: 0; font-size: 12.5px; }
.sync-info > div:last-child { color: var(--fg-3); font-size: 11.5px; margin-top: 2px; }
.sync-form[hidden] { display: none !important; }
