/* ============================================================
   Skill 工作台 · 晨白卡片风
   浅灰白底 · 白色大圆角卡片 · 大封面 · 每个 Skill 独立彩色标识
   ============================================================ */

:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --ink: #1a1d23;
  --ink-soft: #5c626e;
  --ink-faint: #9aa1ad;
  --line: #e6e8ec;
  --primary: #1f2937;
  --accent: #3b6ef6;
  --green: #16a34a;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 4px 14px -6px rgba(16, 24, 40, 0.1);
  --shadow-hover: 0 4px 10px rgba(16, 24, 40, 0.08), 0 16px 32px -12px rgba(16, 24, 40, 0.22);
  --sans: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei",
    "Noto Sans SC", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* ------------------------------------------------------------
   视图转换动画（板块切换 / 主题换肤）
   --vt-dir 由 JS 设置：1 = 切向收藏夹（左滑出），-1 = 切回广场
   ------------------------------------------------------------ */

::view-transition-old(root) {
  animation: vt-old 0.32s cubic-bezier(0.4, 0, 0.2, 1) both;
}
::view-transition-new(root) {
  animation: vt-new 0.32s cubic-bezier(0.4, 0, 0.2, 1) both;
}
@keyframes vt-old {
  to { opacity: 0; transform: translateX(calc(var(--vt-dir, 1) * -28px)) scale(0.99); }
}
@keyframes vt-new {
  from { opacity: 0; transform: translateX(calc(var(--vt-dir, 1) * 28px)) scale(0.99); }
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) { animation: none; }
}

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(59, 110, 246, 0.18); }

button { font-family: inherit; cursor: pointer; }

.wrap { max-width: 1280px; margin: 0 auto; padding: 0 28px; }

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

.topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 18px 0 14px;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; }

.brand .dot {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  background: linear-gradient(135deg, #3b6ef6, #8b5cf6);
  flex: none;
}

.brand .sub { font-weight: 400; font-size: 13px; color: var(--ink-faint); margin-left: 2px; }

#mode-badge {
  font-size: 12px;
  padding: 4px 11px;
  border-radius: 99px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  white-space: nowrap;
}
#mode-badge.server { color: var(--green); border-color: rgba(22, 163, 74, 0.35); background: rgba(22, 163, 74, 0.06); }
#mode-badge.local  { color: #b45309; border-color: rgba(180, 83, 9, 0.35); background: rgba(180, 83, 9, 0.06); }

.topbar .spacer { flex: 1; }

#today { font-size: 12.5px; color: var(--ink-faint); white-space: nowrap; }

/* ------------------------------------------------------------
   标题区 + 工具条
   ------------------------------------------------------------ */

.hero { padding: 10px 0 4px; }

h1.title { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; }

.issue-line { font-size: 14px; color: var(--ink-soft); margin-top: 4px; }
.issue-line b { color: var(--ink); font-weight: 700; }
.issue-line .em { color: var(--accent); }

.toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 0 22px;
  flex-wrap: wrap;
}

.search-wrap { position: relative; flex: 0 1 320px; }

#search {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 34px 9px 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
#search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59, 110, 246, 0.14); }
#search::placeholder { color: var(--ink-faint); }
.search-wrap::after {
  content: "⌕";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-52%);
  color: var(--ink-faint);
  font-size: 16px;
  pointer-events: none;
}

.btn {
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  border: none;
  background: var(--primary);
  color: #fff;
  padding: 10px 18px;
  border-radius: 10px;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 18px -8px rgba(16, 24, 40, 0.5); }
.btn:active { transform: translateY(0); }
.btn.ghost {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn.ghost:hover { border-color: #cfd4dc; box-shadow: var(--shadow); }
.btn.danger { background: #fff; color: #dc2626; border: 1px solid rgba(220, 38, 38, 0.35); }
.btn.danger:hover { background: rgba(220, 38, 38, 0.05); }
.btn:disabled { opacity: 0.45; cursor: default; transform: none; box-shadow: none; }
.btn.toggled {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(59, 110, 246, 0.08);
}
body.view-web .btn.toggled {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(45, 212, 191, 0.08);
}
.entry .meta .visits { color: var(--ink-soft); }

.toolbar .spacer { flex: 1; }
.toolbar .hint { font-size: 12.5px; color: var(--ink-faint); }

/* ------------------------------------------------------------
   分类筛选条
   ------------------------------------------------------------ */

.cats {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-bottom: 18px;
}

.chip {
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 6px 14px;
  transition: all 0.15s;
}
.chip:hover { border-color: #cfd4dc; color: var(--ink); }
.chip.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  font-weight: 600;
}

/* ------------------------------------------------------------
   板块切换：Skill 广场 / 网络收藏夹
   ------------------------------------------------------------ */

.views {
  display: inline-flex;
  gap: 5px;
  background: #e9ebef;
  border-radius: 14px;
  padding: 5px;
  margin-bottom: 14px;
}
.view-tab {
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink-soft);
  background: transparent;
  border: none;
  border-radius: 11px;
  padding: 11px 28px;
  transition: all 0.15s;
}
.view-tab:hover { color: var(--ink); }
.view-tab.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(16, 24, 40, 0.16);
}

/* ------------------------------------------------------------
   网络收藏夹 · 深色主题（整板块换肤，与 Skill 广场区分）
   ------------------------------------------------------------ */

body.view-web {
  --bg: #12171f;
  --card: #1b232e;
  --ink: #e9edf3;
  --ink-soft: #9aa6b6;
  --ink-faint: #5d6a7d;
  --accent: #2dd4bf;
  --primary: #0f9d8e;
  background: var(--bg);
  background-image:
    radial-gradient(1000px 500px at 85% -10%, rgba(45, 212, 191, 0.09), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(59, 110, 246, 0.08), transparent 55%);
}
body.view-web ::selection { background: rgba(45, 212, 191, 0.25); }
body.view-web #mode-badge { background: #1b232e; border-color: #2a3442; }
body.view-web #mode-badge.server { background: rgba(22, 163, 74, 0.12); }
body.view-web .views { background: #1e2734; }
body.view-web .view-tab { color: var(--ink-soft); }
body.view-web .view-tab:hover { color: var(--ink); }
body.view-web .view-tab.active { background: #2b3646; color: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4); }
body.view-web #search,
body.view-web #bm-url {
  background: #1b232e;
  border-color: #2a3442;
  color: var(--ink);
}
body.view-web #search:focus,
body.view-web #bm-url:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.15); }
body.view-web #search::placeholder,
body.view-web #bm-url::placeholder { color: var(--ink-faint); }
body.view-web .btn { color: #08120f; }
body.view-web .btn.ghost {
  background: #1b232e;
  color: var(--ink);
  border-color: #2a3442;
}
body.view-web .btn.ghost:hover { border-color: #3a4757; box-shadow: none; }
body.view-web .chip { background: #1b232e; border-color: #2a3442; color: var(--ink-soft); }
body.view-web .chip:hover { color: var(--ink); border-color: #3a4757; }
body.view-web .chip.active { background: var(--accent); border-color: var(--accent); color: #08120f; }
body.view-web .entry {
  border-color: #26303d;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px -10px rgba(0, 0, 0, 0.5);
}
body.view-web .entry:hover { border-color: #3a4757; }
body.view-web .entry .meta { border-top-color: #26303d; }
body.view-web .entry .meta .v { background: #242f3c; color: var(--ink-soft); }
body.view-web .entry .thumb { background: #151c25; }
body.view-web .entry .thumb::after { opacity: 0.75; }
body.view-web .import-tile {
  border-color: #313e4e;
  background: rgba(27, 35, 46, 0.5);
  color: var(--ink-faint);
}
body.view-web .import-tile:hover,
body.view-web .import-tile:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(45, 212, 191, 0.05);
}
body.view-web .colophon { border-top-color: #232d3a; }
body.view-web #toast { background: var(--accent); color: #08120f; }

/* 收藏夹板块的工具条显隐 */
.web-only { display: none !important; }
body.view-web .web-only { display: block !important; }
body.view-web button.web-only { display: inline-block !important; }
body.view-web #btn-import,
body.view-web #btn-edit { display: none !important; }
#bm-url {
  flex: 0 1 360px;
  font-family: inherit;
  font-size: 13.5px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
}
#bm-url:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59, 110, 246, 0.14); }

/* ------------------------------------------------------------
   网络收藏夹卡片
   ------------------------------------------------------------ */

.entry.bm .meta .favicon {
  width: 15px;
  height: 15px;
  border-radius: 4px;
  flex: none;
}
.entry.bm .meta .host { color: var(--ink-soft); max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 收藏夹卡片的删除按钮（与星标并排） */
.bmdel {
  position: absolute;
  top: 10px;
  right: 46px;
  z-index: 2;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(4px);
  box-shadow: 0 1px 4px rgba(16, 24, 40, 0.18);
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
}
.entry:hover .bmdel { opacity: 1; }
.bmdel:hover { color: #dc2626; }

/* ------------------------------------------------------------
   卡片网格
   ------------------------------------------------------------ */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(252px, 1fr));
  gap: 22px;
  padding-bottom: 40px;
}

.entry {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
}
.entry:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: #d8dce3;
}
.entry:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.entry.dragging { opacity: 0.45; transform: scale(0.97); }
.entry.drop-target { outline: 2px dashed var(--accent); outline-offset: -3px; }

/* ------------------------------------------------------------
   导入框（网格首格）
   ------------------------------------------------------------ */

.import-tile {
  border: 2px dashed #c9cfda;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 200px;
  cursor: pointer;
  color: var(--ink-faint);
  background: rgba(255, 255, 255, 0.5);
  transition: all 0.2s;
  user-select: none;
}
.import-tile:hover, .import-tile:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(59, 110, 246, 0.04);
}
.import-tile .plus {
  font-size: 38px;
  font-weight: 300;
  line-height: 1;
  transition: transform 0.2s;
}
.import-tile:hover .plus { transform: scale(1.15); }
.import-tile .t1 { font-size: 14.5px; font-weight: 600; }
.import-tile .t2 { font-size: 12px; }

/* 收藏星标（封面右上角） */
.star {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(4px);
  box-shadow: 0 1px 4px rgba(16, 24, 40, 0.18);
  color: #b9c0cb;
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s, transform 0.15s, color 0.15s;
}
.entry:hover .star, .star.on { opacity: 1; }
.star:hover { transform: scale(1.12); color: #f59e0b; }
.star.on { color: #f59e0b; }

/* 卡片上的标签片：点击即用该关键字搜索 */
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; align-items: center; }
.tag-chip {
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 99px;
  background: #eef1f6;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: all 0.12s;
}
.tag-chip:hover { color: var(--accent); border-color: var(--accent); background: rgba(59, 110, 246, 0.08); }
.tag-more { font-size: 11px; color: var(--ink-faint); }
body.view-web .tag-chip { background: #242f3c; border-color: #2a3442; color: var(--ink-soft); }
body.view-web .tag-chip:hover { color: var(--accent); border-color: var(--accent); background: rgba(45, 212, 191, 0.08); }

/* 卡片上的分类小标签 */
.entry .meta .cat-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: rgba(59, 110, 246, 0.08);
  border: 1px solid rgba(59, 110, 246, 0.25);
  border-radius: 6px;
  padding: 1px 7px;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* meta 行里的「详情」按钮 */
.entry .meta .meta-btn {
  font-family: inherit;
  font-size: 12px;
  color: var(--ink-soft);
  background: none;
  border: none;
  padding: 2px 4px;
  border-radius: 6px;
}
.entry .meta .meta-btn:hover { color: var(--accent); background: rgba(59, 110, 246, 0.08); }

/* ------------------------------------------------------------
   编辑模式（批量选择）
   ------------------------------------------------------------ */

.entry.selectable { cursor: pointer; }
.entry.picked {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(59, 110, 246, 0.35), var(--shadow);
}

.entry .check {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid #c4cad3;
  background: rgba(255, 255, 255, 0.92);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.entry.picked .check {
  background: var(--accent);
  border-color: var(--accent);
}
/* 编辑模式下星标让位给选中圈 */
body.editing .entry .star { display: none; }

/* 批量操作栏 */
#batch-bar {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 90px);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 20px 50px -12px rgba(16, 24, 40, 0.35);
  padding: 10px 14px;
  z-index: 65;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s, transform 0.22s;
  width: min(720px, calc(100vw - 32px));
}
#batch-bar.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }

#batch-bar #bb-count { font-size: 13px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.bb-chip {
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  background: #f4f5f7;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 6px 12px;
  transition: all 0.12s;
  white-space: nowrap;
}
.bb-chip:hover { background: #eaecf0; color: var(--ink); }
.bb-chip:disabled { opacity: 0.4; cursor: default; }
.bb-chip.danger { color: #dc2626; border-color: rgba(220, 38, 38, 0.35); background: #fff; }
.bb-chip.danger:hover { background: rgba(220, 38, 38, 0.06); }
.bb-chip.exit { background: var(--ink); color: #fff; border-color: var(--ink); }
.bb-chip.exit:hover { background: #000; color: #fff; }
#batch-bar .bb-sep { width: 1px; height: 20px; background: var(--line); }
#batch-bar #bb-cat {
  font-family: inherit;
  font-size: 12.5px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
  width: 130px;
}
#batch-bar #bb-cat:focus { border-color: var(--accent); }
body.editing .grid { padding-bottom: 110px; }

/* 封面区 */
.entry .thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #eef0f3;
  overflow: hidden;
}
.entry .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}
.entry:hover .thumb img { transform: scale(1.045); }

/* 封面顶部的彩色标识条（有图时也保留一点色彩线索） */
.entry .thumb::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--tone, var(--accent));
  opacity: 0.9;
}

/* 无图的字徽封面 */
.cover-mark {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 52px;
  font-weight: 800;
  color: var(--tone-ink, var(--ink));
  background: var(--tone-bg, #eef0f3);
}

/* 徽标：贴在封面左上角 */
.entry .badges {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  gap: 6px;
  z-index: 2;
}
.badge {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 99px;
  backdrop-filter: blur(6px);
}
.badge.new { color: #15803d; background: rgba(240, 253, 244, 0.92); border: 1px solid rgba(22, 163, 74, 0.35); }
.badge.updated { color: #15803d; background: rgba(240, 253, 244, 0.92); border: 1px solid rgba(22, 163, 74, 0.35); }
.badge.nopage { color: var(--ink-soft); background: rgba(244, 245, 247, 0.92); border: 1px solid var(--line); }
.badge.dead { color: #dc2626; background: rgba(254, 242, 242, 0.92); border: 1px solid rgba(220, 38, 38, 0.4); }
body.view-web .badge.dead { color: #f87171; background: rgba(60, 20, 20, 0.85); border-color: rgba(248, 113, 113, 0.45); }

/* ------------------------------------------------------------
   小书签弹窗
   ------------------------------------------------------------ */

#bm-dlg {
  position: fixed;
  inset: 0;
  z-index: 92;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(16, 24, 40, 0.45);
}
#bm-dlg.on { display: flex; }
#bm-dlg .box {
  background: #fff;
  border-radius: 16px;
  padding: 28px 30px;
  width: min(420px, 90vw);
  box-shadow: 0 24px 60px -12px rgba(16, 24, 40, 0.4);
}
#bm-dlg h3 { font-size: 19px; margin-bottom: 8px; }
#bm-dlg p { font-size: 13.5px; color: var(--ink-soft); margin-bottom: 16px; line-height: 1.7; }
#bm-dlg .fine { font-size: 12px; color: var(--ink-faint); }
#bmlet-link {
  display: block;
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: var(--ink);
  border: 2px dashed var(--ink-soft);
  border-radius: 12px;
  padding: 14px 10px;
  margin-bottom: 16px;
  cursor: grab;
  user-select: none;
  text-decoration: none;
}
#bmlet-link:active { cursor: grabbing; }

/* 卡片正文 */
.entry .body {
  padding: 15px 16px 6px;
  flex: 1;
}

.entry h3.name {
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.8em;
}

.entry .desc {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.6;
  margin-top: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 卡片底部元信息 */
.entry .meta {
  display: flex;
  align-items: center;
  gap: 6px 10px;
  flex-wrap: wrap;
  padding: 12px 16px 14px;
  font-size: 12px;
  color: var(--ink-faint);
  border-top: 1px solid var(--line);
  margin-top: 12px;
}
.entry .meta > span,
.entry .meta > button { white-space: nowrap; }
.entry .meta .v {
  font-weight: 700;
  color: var(--ink-soft);
  background: #f1f3f6;
  border-radius: 6px;
  padding: 1.5px 7px;
}
.entry .meta .grow { flex: 1; }
.entry .meta .arrow {
  color: var(--ink-faint);
  font-size: 15px;
  transition: transform 0.2s, color 0.2s;
}
.entry:hover .meta .arrow { transform: translateX(3px); color: var(--accent); }

/* 收藏夹搜不到时的跨板块提示 */
.empty-hint {
  grid-column: 1 / -1;
  text-align: center;
  padding: 30px 10px;
  color: var(--ink-soft);
  font-size: 14px;
}
.empty-hint .btn { margin-top: 10px; }

/* ------------------------------------------------------------
   速查表（一行一个 Skill）
   ------------------------------------------------------------ */

.skill-list {
  display: flex;
  flex-direction: column;
  border-top: 2px solid var(--ink);
  padding-bottom: 40px;
}
.lrow-head, .lrow {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) minmax(0, 240px) 110px 120px;
  gap: 14px;
  align-items: center;
  padding: 10px 8px;
}
.lrow-head {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  border-bottom: 1px solid var(--line);
}
.lrow {
  border-bottom: 1px solid var(--hair-soft, #eee);
  border-bottom: 1px solid #eee;
  cursor: pointer;
  transition: background 0.12s;
}
.lrow:hover { background: #fff; box-shadow: -3px 0 0 var(--accent); }
.lrow .idx { font-style: italic; color: var(--ink-faint); font-size: 12px; }
.lrow .s-main { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.lrow .s-name { font-weight: 700; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow .s-desc {
  font-size: 12.5px;
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lrow .s-tags { display: flex; gap: 5px; flex-wrap: wrap; }
.lrow .s-stat { font-size: 12.5px; color: var(--ink-soft); white-space: nowrap; }
.lrow .s-ops { display: flex; gap: 6px; justify-content: flex-end; }
.lnk-btn {
  font-family: inherit;
  font-size: 12.5px;
  color: var(--ink-soft);
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 10px;
  transition: all 0.12s;
  white-space: nowrap;
}
.lnk-btn:hover { color: var(--accent); border-color: var(--accent); background: rgba(59, 110, 246, 0.06); }

body.view-list #btn-import,
body.view-list #btn-edit { display: none !important; }

@media (max-width: 860px) {
  .lrow-head { display: none; }
  .lrow { grid-template-columns: 32px minmax(0, 1fr) 90px; }
  .lrow .s-tags, .lrow .s-ops .lnk-btn:first-child { display: none; }
  .lrow .s-ops { gap: 4px; }
}

/* ------------------------------------------------------------
   空状态
   ------------------------------------------------------------ */

.empty {
  padding: 90px 20px 60px;
  text-align: center;
  color: var(--ink-soft);
}
.empty .big {
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}
.empty .big em { color: var(--accent); font-style: normal; }
.empty p { font-size: 14.5px; color: var(--ink-faint); max-width: 480px; margin: 0 auto; line-height: 2; }
.empty .btn { margin-top: 18px; }

/* ------------------------------------------------------------
   拖放遮罩
   ------------------------------------------------------------ */

#drop-veil {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(59, 110, 246, 0.08);
  backdrop-filter: blur(4px);
}
#drop-veil.on { display: flex; }
#drop-veil .frame {
  position: absolute;
  inset: 16px;
  border: 2px dashed var(--accent);
  border-radius: 20px;
  pointer-events: none;
}
#drop-veil .text {
  text-align: center;
  font-size: clamp(26px, 4.5vw, 44px);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}
#drop-veil .text em { color: var(--accent); font-style: normal; }
#drop-veil .sub { margin-top: 12px; font-size: 14px; color: var(--ink-soft); }

/* ------------------------------------------------------------
   导入面板
   ------------------------------------------------------------ */

#import-panel {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 30px);
  width: min(560px, calc(100vw - 40px));
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 20px 14px;
  box-shadow: 0 20px 50px -12px rgba(16, 24, 40, 0.3);
  z-index: 70;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}
#import-panel.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }

#import-panel .head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
}
#import-panel .rows { display: flex; flex-direction: column; gap: 7px; max-height: 200px; overflow: auto; }
#import-panel .row { display: flex; align-items: center; gap: 12px; font-size: 13.5px; }
#import-panel .row .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
#import-panel .row .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
#import-panel .row .st { font-size: 12px; color: var(--ink-faint); }
#import-panel .bar {
  margin-top: 12px;
  height: 4px;
  border-radius: 99px;
  background: #edeff3;
  position: relative;
  overflow: hidden;
}
#import-panel .bar > i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  border-radius: 99px;
  background: var(--accent);
  transition: width 0.25s;
}
#import-panel .summary { margin-top: 10px; font-size: 13.5px; color: var(--ink-soft); }
#import-panel .summary b { color: var(--ink); }

.st-new { background: #22c55e; }
.st-upd { background: #3b6ef6; }
.st-same { background: #c4cad3; }
.st-err { background: #e5484d; }
.st-busy { background: #94a3b8; animation: pulse 1s infinite alternate; }
@keyframes pulse { from { opacity: 0.4; } to { opacity: 1; } }

/* ------------------------------------------------------------
   详情抽屉
   ------------------------------------------------------------ */

#drawer-mask {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, 0.4);
  z-index: 80;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
#drawer-mask.on { opacity: 1; pointer-events: auto; }

#drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(440px, 92vw);
  background: #fff;
  z-index: 81;
  transform: translateX(103%);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
  box-shadow: -20px 0 60px -20px rgba(16, 24, 40, 0.3);
}
#drawer.on { transform: none; }

.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
}
.drawer-head .smallcaps { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); letter-spacing: 0.06em; }
#drawer-close {
  border: none;
  background: #f1f3f6;
  border-radius: 8px;
  font-size: 14px;
  color: var(--ink-soft);
  width: 30px;
  height: 30px;
  line-height: 1;
}
#drawer-close:hover { background: #e6e9ee; color: var(--ink); }

.drawer-body { padding: 22px 24px 30px; overflow-y: auto; flex: 1; }

.drawer-cover {
  width: 100%;
  height: 190px;
  border-radius: 12px;
  object-fit: cover;
  background: #eef0f3;
  margin-bottom: 18px;
  border: 1px solid var(--line);
}

#drawer h2 { font-size: 21px; font-weight: 800; line-height: 1.35; letter-spacing: -0.01em; }
#drawer .slug-line { font-size: 12px; color: var(--ink-faint); margin: 4px 0 14px; }
#drawer .desc-full { font-size: 14px; color: var(--ink-soft); line-height: 1.8; margin-bottom: 20px; }

.kv {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 8px 14px;
  font-size: 13px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
}
.kv dt { color: var(--ink-faint); }
.kv dd { color: var(--ink); }

.drawer-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }

/* 抽屉里的整理区：收藏 + 分类 */
.organize {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: stretch;
  margin-bottom: 20px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fafbfc;
}
.organize .btn { flex: none; }
.organize .btn.faved { color: #b45309; border-color: rgba(245, 158, 11, 0.5); background: rgba(245, 158, 11, 0.07); }
.cat-input {
  flex: 1 1 140px;
  min-width: 0;
  font-family: inherit;
  font-size: 13px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  background: #fff;
}
.cat-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59, 110, 246, 0.12); }
.organize .btn.ghost { padding: 8px 14px; }

.vlist h4 { font-size: 12px; color: var(--ink-faint); margin-bottom: 10px; font-weight: 600; letter-spacing: 0.04em; }
.vrow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 2px;
  border-top: 1px solid #f0f2f5;
  font-size: 13.5px;
}
.vrow .vn { font-weight: 800; font-size: 14px; width: 40px; color: var(--ink-soft); }
.vrow.cur .vn { color: var(--accent); }
.vrow .vd { flex: 1; color: var(--ink-faint); font-size: 12px; }
.vrow .lnk {
  border: none;
  background: none;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
  padding: 3px 8px;
  border-radius: 7px;
}
.vrow .lnk:hover { background: rgba(59, 110, 246, 0.08); }
.vrow .lnk.dim { color: var(--ink-faint); background: #f5f6f8; cursor: default; }

/* ------------------------------------------------------------
   口令对话框 / toast
   ------------------------------------------------------------ */

#token-dlg {
  position: fixed;
  inset: 0;
  z-index: 92;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(16, 24, 40, 0.45);
}
#token-dlg.on { display: flex; }
#token-dlg .box {
  background: #fff;
  border-radius: 16px;
  padding: 28px 30px;
  width: min(380px, 90vw);
  box-shadow: 0 24px 60px -12px rgba(16, 24, 40, 0.4);
}
#token-dlg h3 { font-size: 19px; margin-bottom: 6px; }
#token-dlg p { font-size: 13px; color: var(--ink-soft); margin-bottom: 16px; }
#token-dlg input {
  width: 100%;
  font-family: inherit;
  font-size: 14.5px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  outline: none;
  margin-bottom: 16px;
}
#token-dlg input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59, 110, 246, 0.14); }

#toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translate(-50%, -80px);
  background: var(--ink);
  color: #fff;
  font-size: 13.5px;
  padding: 11px 22px;
  border-radius: 12px;
  z-index: 95;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 12px 30px -8px rgba(16, 24, 40, 0.4);
}
#toast.on { transform: translate(-50%, 0); }

/* ------------------------------------------------------------
   二次确认 / 空间统计面板 / 危险区
   ------------------------------------------------------------ */

#confirm-dlg, #space-dlg {
  position: fixed;
  inset: 0;
  z-index: 92;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(16, 24, 40, 0.45);
}
#confirm-dlg.on, #space-dlg.on { display: flex; }
#confirm-dlg .box, #space-dlg .box {
  background: #fff;
  border-radius: 16px;
  padding: 26px 28px;
  width: min(420px, 92vw);
  box-shadow: 0 24px 60px -12px rgba(16, 24, 40, 0.4);
}
#space-dlg .box.wide { width: min(620px, 94vw); }
#confirm-dlg h3, #space-dlg h3 { font-size: 18px; margin-bottom: 10px; }
#confirm-dlg p, #space-dlg p { font-size: 13px; color: var(--ink-soft); line-height: 1.7; }
#confirm-dlg p { white-space: pre-line; }
#cf-input, #dz-input {
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  background: #fff;
  margin-top: 12px;
}
#cf-input:focus, #dz-input:focus { border-color: var(--accent); }
.cf-btns { display: flex; gap: 10px; margin-top: 16px; }
.cf-btns .btn { flex: 1; }

.sp-total {
  font-size: 13.5px;
  color: var(--ink-soft);
  background: #f4f5f7;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 14px;
}
.sp-total b { color: var(--ink); font-size: 16px; }
.sp-rows { max-height: 300px; overflow-y: auto; margin-bottom: 16px; }
.sp-row {
  display: grid;
  grid-template-columns: minmax(0, 130px) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 9px 4px;
  border-bottom: 1px solid #f0f2f5;
}
.sp-row .sp-nm {
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sp-row .sp-mid { min-width: 0; }
.sp-bar {
  height: 7px;
  border-radius: 99px;
  background: #edeff3;
  overflow: hidden;
}
.sp-bar i { display: block; height: 100%; background: linear-gradient(90deg, #3b6ef6, #8b5cf6); border-radius: 99px; }
.sp-row .sp-sz { display: block; font-size: 11.5px; color: var(--ink-faint); margin-top: 3px; }
.sp-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.danger-zone {
  margin-top: 18px;
  border: 1px solid rgba(220, 38, 38, 0.35);
  border-radius: 12px;
  padding: 14px 16px;
  background: rgba(220, 38, 38, 0.03);
}
.danger-zone h4 { font-size: 13px; color: #dc2626; margin-bottom: 6px; }
.danger-zone p { font-size: 12.5px; margin-bottom: 10px; }
.dz-row { display: flex; gap: 10px; }
.dz-row input { margin-top: 0; flex: 1; }
.dz-row .btn.danger { flex: none; padding: 8px 16px; font-size: 13px; }

/* ------------------------------------------------------------
   页脚 / 响应式
   ------------------------------------------------------------ */

.colophon {
  border-top: 1px solid var(--line);
  padding: 20px 0 44px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--ink-faint);
}

@media (max-width: 720px) {
  .wrap { padding: 0 16px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
  h1.title { font-size: 24px; }
  .entry h3.name { font-size: 14px; }
  .entry .desc { font-size: 12px; }
  .toolbar .hint { display: none; }
  .cover-mark { font-size: 38px; }
}
