/* 全站工具增强：Ctrl+K 搜索面板 + 我的收藏 / 最近使用 + 收藏按钮 */

/* ---------------- 顶部搜索入口 ---------------- */
.nav-search-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 30px;
    padding: 0 10px;
    margin-right: 4px;
    border: 1px solid #e2e8f4;
    border-radius: 999px;
    background: #f7f9fd;
    color: #55627c;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all .16s;
    white-space: nowrap;
    flex-shrink: 0;
}
.nav-search-btn:hover {
    border-color: #9db8e8;
    background: #eef4ff;
    color: #2b62d9;
}
.nav-search-btn .ns-kbd {
    font-family: inherit;
    font-size: 10px;
    color: #98a4bb;
    background: #fff;
    border: 1px solid #e4eaf5;
    border-radius: 4px;
    padding: 0 4px;
    line-height: 1.4;
}
.nav-search-btn .ns-icon { font-size: 12px; }
.nav-search-btn.is-floating {
    position: fixed;
    right: 18px;
    bottom: 84px;
    z-index: 900;
    box-shadow: 0 8px 22px rgba(38, 66, 122, .16);
    background: #fff;
}

/* ---------------- 快捷区：我的收藏 / 最近使用 ---------------- */
.sqt {
    max-width: 1180px;
    margin: 22px auto 6px;
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.sqt-block {
    background: #fff;
    border: 1px solid #e8eef8;
    border-radius: 16px;
    padding: 14px 16px 6px;
    box-shadow: 0 6px 18px rgba(38, 66, 122, .05);
}
.sqt-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}
.sqt-title { font-size: 14px; font-weight: 800; color: #22304d; }
.sqt-count { font-size: 12px; color: #98a4bb; }
.sqt-clear {
    border: 0;
    background: none;
    color: #98a4bb;
    font-size: 12px;
    cursor: pointer;
    padding: 2px 4px;
}
.sqt-clear:hover { color: #d93a30; }
.sqt-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-bottom: 10px;
}
.sqt-item {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 13px;
    border: 1px solid #e8eef8;
    border-radius: 999px;
    background: #fbfcfe;
    color: #333f58;
    font-size: 13px;
    text-decoration: none;
    transition: all .16s;
    max-width: 100%;
}
.sqt-item:hover {
    border-color: #9db8e8;
    background: #f2f7ff;
    color: #2b62d9;
    transform: translateY(-1px);
}
.sqt-icon { font-size: 15px; line-height: 1; }
.sqt-name {
    max-width: 190px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sqt-del {
    display: none;
    margin-left: 2px;
    color: #c2cbdb;
    font-size: 14px;
    line-height: 1;
}
.sqt-item:hover .sqt-del { display: inline; }
.sqt-del:hover { color: #d93a30; }

/* ---------------- 详情页收藏按钮 ---------------- */
.tool-fav-btn {
    margin-left: auto;
    flex: none;
    padding: 8px 16px;
    border: 1px solid #e2e8f4;
    border-radius: 999px;
    background: #fbfcfe;
    color: #55627c;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all .16s;
    white-space: nowrap;
}
.tool-fav-btn:hover { border-color: #f0c36d; background: #fff9ec; color: #b7791f; }
.tool-fav-btn.is-on {
    border-color: #f0c36d;
    background: #fff5dc;
    color: #b7791f;
}

/* ---------------- 命令面板 ---------------- */
html.sk-lock { overflow: hidden; }

.sk-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(20, 28, 45, .42);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 12vh 16px 24px;
    animation: sk-fade .14s ease-out;
}
@keyframes sk-fade { from { opacity: 0; } to { opacity: 1; } }

.sk-panel {
    width: 100%;
    max-width: 640px;
    max-height: 72vh;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(15, 25, 45, .28);
    overflow: hidden;
    animation: sk-pop .16s ease-out;
}
@keyframes sk-pop { from { transform: translateY(-8px) scale(.99); opacity: .6; } to { transform: none; opacity: 1; } }

.sk-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid #eef2f9;
}
.sk-search-icon { font-size: 17px; }
.sk-input {
    flex: 1;
    border: 0;
    outline: none;
    background: transparent;
    font-size: 15.5px;
    color: #1f2b45;
    min-width: 0;
}
.sk-input::placeholder { color: #a9b4c7; }
.sk-kbd {
    font-family: inherit;
    font-size: 11px;
    color: #8e9bb1;
    background: #f4f7fc;
    border: 1px solid #e4eaf5;
    border-radius: 6px;
    padding: 2px 7px;
}

.sk-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    -webkit-overflow-scrolling: touch;
}
.sk-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}
.sk-item.is-active { background: #eef4ff; }
.sk-item-icon { font-size: 19px; line-height: 1; flex: none; }
.sk-item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sk-item-body b {
    font-size: 14px;
    font-weight: 700;
    color: #22304d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sk-item-body small { font-size: 11.5px; color: #98a4bb; }
.sk-item-body mark { background: #ffe9a8; color: #8a5b00; border-radius: 3px; padding: 0 1px; }
.sk-star { color: #e8a33d; font-style: normal; }
.sk-item-go {
    font-size: 12px;
    color: #b6c1d3;
    opacity: 0;
    transition: opacity .15s;
    flex: none;
}
.sk-item.is-active .sk-item-go { opacity: 1; }

.sk-empty {
    padding: 32px 16px;
    text-align: center;
    font-size: 13.5px;
    color: #98a4bb;
    line-height: 1.8;
}
.sk-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 16px;
    border-top: 1px solid #eef2f9;
    background: #fafbfe;
    font-size: 11.5px;
    color: #98a4bb;
}

/* ---------------- 轻提示 ---------------- */
.site-toast {
    position: fixed;
    left: 50%;
    bottom: 34px;
    transform: translate(-50%, 12px);
    z-index: 2100;
    max-width: 84vw;
    padding: 11px 18px;
    border-radius: 12px;
    background: rgba(31, 43, 69, .94);
    color: #fff;
    font-size: 13.5px;
    line-height: 1.6;
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s, transform .22s;
}
.site-toast.is-show { opacity: 1; transform: translate(-50%, 0); }

/* ---------------- 黑夜模式 ---------------- */
[data-theme="dark"] .nav-search-btn {
    background: #232c3b;
    border-color: #313d4f;
    color: #a9b6cc;
}
[data-theme="dark"] .nav-search-btn:hover { background: #28344a; border-color: #4b7bec; color: #8fb4ff; }
[data-theme="dark"] .nav-search-btn .ns-kbd { background: #1c2431; border-color: #313d4f; color: #7d8ba1; }
[data-theme="dark"] .nav-search-btn.is-floating { background: #232c3b; box-shadow: 0 8px 22px rgba(0, 0, 0, .4); }
[data-theme="dark"] .sqt-block { background: #1f2735; border-color: #2e3949; box-shadow: none; }
[data-theme="dark"] .sqt-title { color: #e6edf9; }
[data-theme="dark"] .sqt-item { background: #232c3b; border-color: #313d4f; color: #c3cee0; }
[data-theme="dark"] .sqt-item:hover { background: #28344a; border-color: #4b7bec; color: #8fb4ff; }
[data-theme="dark"] .tool-fav-btn { background: #232c3b; border-color: #313d4f; color: #a9b6cc; }
[data-theme="dark"] .tool-fav-btn:hover,
[data-theme="dark"] .tool-fav-btn.is-on { background: #33291a; border-color: #6b5426; color: #e0ac63; }
[data-theme="dark"] .sk-panel { background: #1f2735; box-shadow: 0 24px 60px rgba(0, 0, 0, .5); }
[data-theme="dark"] .sk-input-row,
[data-theme="dark"] .sk-foot { border-color: #2b3546; }
[data-theme="dark"] .sk-foot { background: #1c2431; }
[data-theme="dark"] .sk-input { color: #e6edf9; }
[data-theme="dark"] .sk-input::placeholder { color: #6d7b93; }
[data-theme="dark"] .sk-kbd { background: #232c3b; border-color: #313d4f; color: #8e9bb1; }
[data-theme="dark"] .sk-item.is-active { background: #28344a; }
[data-theme="dark"] .sk-item-body b { color: #e6edf9; }
[data-theme="dark"] .sk-item-body small { color: #8e9bb1; }
[data-theme="dark"] .sk-item-body mark { background: #6b5426; color: #ffe9a8; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1180px) {
    /* 中等宽度先收起 kbd 提示，避免与右侧菜单项挤压 */
    .nav-search-btn .ns-kbd { display: none; }
    .nav-search-btn { padding: 0 8px; }
}
@media (max-width: 860px) {
    .nav-search-btn .ns-text { display: none; }
    .nav-search-btn {
        width: 30px;
        height: 30px;
        padding: 0;
        justify-content: center;
    }
    .nav-search-btn.is-floating { width: auto; padding: 0 12px; }
    .nav-search-btn.is-floating .ns-text { display: inline; }
    .sqt { padding: 0 12px; margin-top: 16px; }
    .sqt-name { max-width: 130px; }
    .tool-fav-btn { margin-left: 10px; }
    .sk-overlay { padding: 6vh 10px 16px; }
    .sk-panel { max-height: 82vh; }
}
