/* 灵机易动·软件工具导航 外壳与卡片样式（theme 模式下，保留主题 header/footer，只装饰内容区）
   颜色全部使用 AeroCore 主题变量，自动跟随明暗模式 */

/* 内容区外壳：居中、限宽，与主题头脚协调；以 14px 为基准字号 */
.ljyi-tools-shell {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 16px 40px;
    box-sizing: border-box;
    background: var(--bg-card);
    font-size: 14px;
    line-height: 1.6;
}

/* ========== 软件工具导航卡片（[ljyi_tools] 短代码，复刻官网直达） ========== */
.ljyi-wrap .ljyi-tools { max-width: 1100px; margin: 0 auto; padding: 20px 0 40px; font-size: 14px; line-height: 1.6; }
.ljyi-wrap .ljyi-tools-edit { flex: none; }
.ljyi-wrap .ljyi-tools-edit-link { display: inline-flex; align-items: center; gap: 4px; padding: 6px 14px; border-radius: 9999px; border: none; cursor: pointer; font-family: inherit; background: var(--bg-hover); color: #3b82f6; font-size: 14px; font-weight: 600; text-decoration: none; transition: background .15s ease; }
.ljyi-wrap .ljyi-tools-edit-link:hover { background: var(--border-primary); }
/* 管理视图：点击「管理」后切换为主视图（替换搜索/tabs/卡片网格，而非下方追加） */
.ljyi-wrap .ljyi-tools-admin { display: none; padding: 2px 0 0; }
.ljyi-wrap .ljyi-tools-admin-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 12px; }
.ljyi-wrap .ljyi-tools-admin-bar-left { display: flex; align-items: center; gap: 12px; }
.ljyi-wrap .ljyi-tools-admin-bar-right { display: flex; align-items: center; gap: 12px; }
.ljyi-wrap .ljyi-tools-admin-title { font-size: 20px; font-weight: 700; color: var(--text-primary); }
.ljyi-wrap .ljyi-tools-admin-count { font-size: 14px; color: var(--text-secondary); }
.ljyi-wrap .ljyi-tools-admin-add { border: none; cursor: pointer; background: #3b82f6; color: #fff; padding: 7px 16px; border-radius: 6px; font-size: 14px; font-weight: 600; font-family: inherit; transition: filter .15s; }
.ljyi-wrap .ljyi-tools-admin-add:hover { filter: brightness(.95); }
.ljyi-wrap .ljyi-tools-admin-cat-btn { border: 1px solid var(--border-primary); cursor: pointer; background: var(--bg-card); color: var(--text-secondary); padding: 6px 15px; border-radius: 6px; font-size: 14px; font-weight: 600; font-family: inherit; transition: background .15s; }
.ljyi-wrap .ljyi-tools-admin-cat-btn:hover { background: var(--bg-hover); }
.ljyi-wrap .ljyi-tools-admin-close { border: none; cursor: pointer; background: var(--border-primary); color: var(--text-secondary); padding: 6px 16px; border-radius: 9999px; font-size: 14px; font-weight: 600; }
.ljyi-wrap .ljyi-tools-admin-close:hover { background: var(--text-secondary); color: var(--bg-card); }
.ljyi-wrap .ljyi-tools-admin-loading, .ljyi-wrap .ljyi-tools-admin-msg { padding: 20px; text-align: center; color: var(--text-secondary); font-size: 14px; }

.ljyi-wrap .ljyi-tools-search { margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ljyi-wrap .ljyi-tools-search input {
  flex: 1 1 auto; min-width: 180px; max-width: 360px; padding: 10px 16px;
  border: 1px solid var(--border-input); border-radius: 9999px; background: var(--bg-card);
  font-size: 14px; color: var(--text-primary); outline: none; transition: border-color .2s, box-shadow .2s;
}
.ljyi-wrap .ljyi-tools-search input:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,.12); }
.ljyi-wrap .ljyi-tools-tabs { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 0 14px; }
.ljyi-wrap .ljyi-tools-tab {
  padding: 6px 14px; border-radius: 9999px; font-size: 14px; color: var(--text-secondary);
  background: var(--bg-hover); border: 1px solid var(--border-primary); cursor: pointer;
  white-space: nowrap; transition: all .2s; user-select: none;
}
.ljyi-wrap .ljyi-tools-tab:hover { background: var(--border-primary); color: var(--text-primary); }
.ljyi-wrap .ljyi-tools-tab.active { background: #3b82f6; color: #fff; border-color: #3b82f6; }
.ljyi-wrap .ljyi-tools-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; align-content: start;
}
.ljyi-wrap .ljyi-tools-card {
  display: flex; align-items: center; gap: 12px; position: relative; overflow: hidden;
  padding: 16px 18px; background: var(--bg-card); border: 1px solid var(--border-primary); border-radius: 10px;
  cursor: pointer; transition: all .2s;
}
.ljyi-wrap .ljyi-tools-card:hover {
  border-color: #3b82f6; background: var(--bg-hover); transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(25,118,210,.12);
}
.ljyi-wrap .ljyi-tools-badge {
  position: absolute; top: 6px; right: 6px; font-size: 10px; font-weight: 600; color: #fff;
  padding: 1px 6px; border-radius: 4px;
  background: linear-gradient(135deg, #d4a017, #f0c040);
  box-shadow: 0 1px 2px rgba(212,160,23,.3); letter-spacing: .3px;
}
.ljyi-wrap .ljyi-tools-icon {
  width: 48px; height: 48px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 19px; font-weight: 700;
}
.ljyi-wrap .ljyi-tools-favicon {
  width: 44px; height: 44px; border-radius: 10px; flex-shrink: 0;
  object-fit: contain; background: var(--bg-card);
  border: 1px solid var(--border-primary); box-shadow: 0 1px 3px rgba(15,23,42,.08);
  padding: 5px; display: inline-flex;
}
.ljyi-wrap .ljyi-tools-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ljyi-wrap .ljyi-tools-name {
  font-size: 15px; font-weight: 600; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ljyi-wrap .ljyi-tools-desc {
  font-size: 13px; color: var(--text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ljyi-wrap .ljyi-tools-empty { grid-column: 1 / -1; text-align: center; padding: 40px 20px; color: var(--text-secondary); font-size: 14px; }
@media (max-width: 900px) { .ljyi-wrap .ljyi-tools-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .ljyi-wrap .ljyi-tools-grid { grid-template-columns: 1fr; } }

/* ========== 管理面板（表格形式，与插件 lingji.css 对齐） ========== */
/* 管理面板顶部：左「工具列表 + 添加」，右「共N个工具 + 收起」 */
.ljyi-wrap .ljyi-tools-admin-toolbar { display: flex; align-items: center; margin-bottom: 12px; }
.ljyi-wrap .ljyi-tools-admin-filter { padding: 8px 14px; border: 1px solid var(--border-input); border-radius: 8px; font-size: 14px; font-family: inherit; background: var(--bg-card); color: var(--text-primary); }
.ljyi-wrap .ljyi-tools-admin-tablewrap { overflow-x: auto; border: 1px solid var(--border-primary); border-radius: 10px; min-height: 320px; background: var(--bg-card); }
.ljyi-wrap .ljyi-tools-admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ljyi-wrap .ljyi-tools-admin-table thead th { background: #2563eb; color: #fff; font-weight: 600; text-align: left; padding: 11px 16px; font-size: 14px; white-space: nowrap; }
.ljyi-wrap .ljyi-tools-admin-table thead th:first-child { border-top-left-radius: 10px; }
.ljyi-wrap .ljyi-tools-admin-table thead th:last-child { border-top-right-radius: 10px; }
.ljyi-wrap .ljyi-tools-admin-table tbody td { padding: 13px 16px; border-bottom: 1px solid var(--border-primary); vertical-align: middle; }
.ljyi-wrap .ljyi-tools-admin-table tbody tr:last-child td { border-bottom: none; }
.ljyi-wrap .ljyi-tools-admin-table tbody tr:hover { background: var(--bg-hover); }
.ljyi-wrap .ljyi-tools-admin-table .col-rec,
.ljyi-wrap .ljyi-tools-admin-table .col-icon,
.ljyi-wrap .ljyi-tools-admin-table .col-free,
.ljyi-wrap .ljyi-tools-admin-table .col-cat,
.ljyi-wrap .ljyi-tools-admin-table .col-act { white-space: nowrap; text-align: center; }
.ljyi-wrap .ljyi-tools-admin-table .col-name { text-align: left; }
.ljyi-wrap .ljyi-tools-official-tag { display: inline-block; vertical-align: middle; margin-right: 6px; font-size: 11px; font-weight: 600; color: #8a6d1a; background: linear-gradient(135deg, #f0c040, #d4a017); padding: 1px 7px; border-radius: 4px; letter-spacing: .3px; box-shadow: 0 1px 2px rgba(212,160,23,.3); }
.ljyi-wrap .ljyi-tools-rec-text { display: inline-block; color: #22c55e; font-size: 14px; font-weight: 600; cursor: pointer; }
.ljyi-wrap .ljyi-tools-rec-off { display: inline-block; color: var(--text-secondary); cursor: pointer; font-size: 14px; padding: 2px 6px; }
.ljyi-wrap .ljyi-tools-icon { display: inline-flex; width: 36px; height: 36px; border-radius: 8px; align-items: center; justify-content: center; color: #fff; font-size: 16px; font-weight: 700; }
.ljyi-wrap .ljyi-tools-admin-table .ljyi-tools-favicon { width: 34px; height: 34px; border-radius: 8px; padding: 4px; }
.ljyi-wrap .ljyi-tools-row-name { font-weight: 600; color: var(--text-primary); font-size: 15px; display: inline-flex; align-items: center; gap: 5px; text-decoration: none; }
.ljyi-wrap .ljyi-tools-row-name:hover { color: #2563eb; }
.ljyi-wrap .ljyi-tools-link-icon { color: var(--text-secondary); flex-shrink: 0; }
.ljyi-wrap .ljyi-tools-row-name:hover .ljyi-tools-link-icon { color: #2563eb; }
.ljyi-wrap .ljyi-tools-row-desc { color: var(--text-secondary); font-size: 13px; margin-top: 4px; }
.ljyi-wrap .ljyi-tools-free-badge { display: inline-block; background: #dcfce7; color: #16a34a; font-size: 13px; font-weight: 700; padding: 3px 8px; border-radius: 4px; }
.ljyi-wrap .ljyi-tools-cat-tag { display: inline-block; font-size: 13px; padding: 3px 10px; border-radius: 999px; line-height: 1.5; }
.ljyi-wrap .ljyi-tools-admin-table .col-act { display: flex; align-items: center; justify-content: center; gap: 6px; }
.ljyi-wrap .ljyi-tools-admin-table .ljyi-tools-admin-edit { border: none; cursor: pointer; background: #3b82f6; color: #fff; padding: 5px 14px; border-radius: 4px; font-size: 13px; font-weight: 600; }
.ljyi-wrap .ljyi-tools-admin-table .ljyi-tools-admin-edit:hover { filter: brightness(.95); }
.ljyi-wrap .ljyi-tools-admin-del { border: none; cursor: pointer; background: #fee2e2; color: #dc2626; padding: 5px 12px; border-radius: 6px; font-size: 13px; font-weight: 600; }
.ljyi-wrap .ljyi-tools-admin-del:hover { background: #fecaca; }
.ljyi-wrap .ljyi-tools-admin-move { border: none; cursor: pointer; background: var(--bg-hover); color: var(--text-secondary); padding: 5px 10px; border-radius: 6px; font-size: 14px; font-weight: 700; line-height: 1; }
.ljyi-wrap .ljyi-tools-admin-move:hover { background: var(--border-input); color: var(--text-primary); }
.ljyi-wrap .ljyi-tools-admin-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ljyi-wrap .ljyi-tools-admin-form input, .ljyi-wrap .ljyi-tools-admin-form select { padding: 8px 12px; border: 1px solid var(--border-input); border-radius: 8px; font-size: 14px; font-family: inherit; background: var(--bg-card); color: var(--text-primary); }
.ljyi-wrap .ljyi-tools-admin-form input[type="text"] { min-width: 160px; }
.ljyi-wrap .ljyi-tools-admin-form button { border: none; cursor: pointer; background: #3b82f6; color: #fff; padding: 8px 16px; border-radius: 8px; font-size: 14px; font-weight: 600; }
.ljyi-wrap .ljyi-tools-admin-form button:hover { filter: brightness(.95); }

/* 添加 / 编辑网址弹窗（居中对话框，不覆盖整页管理视图） */
.ljyi-tools-modal-backdrop {
  position: fixed; inset: 0; z-index: 99995;
  display: none; align-items: center; justify-content: center;
  background: rgba(15,23,42,.45); padding: 20px; box-sizing: border-box;
}
.ljyi-tools-modal {
  width: 100%; max-width: 460px; background: var(--bg-card); border-radius: 14px;
  box-shadow: 0 20px 60px rgba(15,23,42,.30); overflow: hidden;
  animation: ljyi-modal-in .18s ease;
}
@keyframes ljyi-modal-in { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.ljyi-tools-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border-primary); }
.ljyi-tools-modal-title { font-size: 17px; font-weight: 700; color: var(--text-primary); }
.ljyi-tools-modal-close { border: none; background: none; cursor: pointer; font-size: 22px; line-height: 1; color: var(--text-secondary); padding: 0 4px; }
.ljyi-tools-modal-close:hover { color: var(--text-primary); }
.ljyi-tools-modal-form { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 14px; }
.ljyi-tools-modal-field { display: flex; flex-direction: column; gap: 6px; }
.ljyi-tools-modal-field > span { font-size: 14px; font-weight: 600; color: var(--text-secondary); }
.ljyi-tools-modal-field input, .ljyi-tools-modal-field select { padding: 10px 14px; border: 1px solid var(--border-input); border-radius: 8px; font-size: 14px; font-family: inherit; width: 100%; box-sizing: border-box; background: var(--bg-card); color: var(--text-primary); }
.ljyi-tools-modal-field input:focus, .ljyi-tools-modal-field select:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,.12); outline: none; }
.ljyi-tools-modal-rec { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-secondary); }
.ljyi-tools-modal-rec input { width: auto; }
.ljyi-tools-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.ljyi-tools-modal-cancel { border: 1px solid var(--border-primary); background: var(--bg-card); color: var(--text-secondary); padding: 9px 20px; border-radius: 8px; font-size: 14px; cursor: pointer; font-family: inherit; }
.ljyi-tools-modal-cancel:hover { background: var(--bg-hover); }
.ljyi-tools-modal-save { border: none; background: #3b82f6; color: #fff; padding: 9px 22px; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit; }
.ljyi-tools-modal-save:hover { filter: brightness(.95); }
.ljyi-tools-modal-save:disabled { opacity: .6; cursor: default; }
/* 分类管理弹窗 */
.ljyi-tools-cat-list { max-height: 280px; overflow-y: auto; padding: 10px 22px 0; }
.ljyi-tools-cat-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border-primary); }
.ljyi-tools-cat-row:last-child { border-bottom: none; }
.ljyi-tools-cat-info { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.ljyi-tools-cat-info .ljyi-tools-cat-name { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.ljyi-tools-cat-info code { font-size: 13px; color: var(--text-secondary); background: var(--bg-hover); padding: 2px 6px; border-radius: 4px; }
.ljyi-tools-cat-empty { padding: 26px 20px; text-align: center; color: var(--text-secondary); font-size: 14px; }
#ljyi-tools-cat-form { border-top: 1px solid var(--border-primary); margin-top: 4px; }
