/* Hybrid 1 搜索（proto-hybrid-1-efficiency.html），作用域 #h1-mod，避免与 Bootstrap .row 冲突 */

/* 横向边距由外层 .content-site 与下方 #content 一致 */
#h1-mod {
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.io-grey-mode #h1-mod {
    --h1-label: #1d1d1f;
    --h1-secondary: rgba(60, 60, 67, 0.6);
    --h1-sep: rgba(60, 60, 67, 0.18);
    --h1-fill: rgba(120, 120, 128, 0.12);
    --h1-blue: #007aff;
    --h1-card-bg: #ffffff;
    --h1-input-bg: rgba(255, 255, 255, 0.92);
    --h1-shadow: 0 1px 0 rgba(0, 0, 0, 0.03), 0 14px 40px rgba(0, 0, 0, 0.06);
}

.io-black-mode #h1-mod {
    --h1-label: rgba(255, 255, 255, 0.92);
    --h1-secondary: rgba(235, 235, 245, 0.6);
    --h1-sep: rgba(84, 84, 88, 0.65);
    --h1-fill: rgba(120, 120, 128, 0.24);
    --h1-blue: #0a84ff;
    --h1-card-bg: #1c1c1e;
    --h1-input-bg: rgba(44, 44, 46, 0.9);
    --h1-shadow: none;
}

/* 外层去「卡片框」：与页头背景一体，控件仍保留自身描边 */
#h1-mod .searchCard {
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    color: var(--h1-label);
}

/* 表单参与布局但不额外占一层 flex/grid */
#h1-mod .h1-search-form {
    display: contents;
}

#h1-mod .h1-top-row {
    display: grid;
    grid-template-columns: 1fr 220px auto;
    gap: 12px;
    align-items: center;
}

#h1-mod .h1-top-row--no-cat {
    grid-template-columns: 1fr auto;
}

#h1-mod .h1-input-col {
    position: relative;
    min-width: 0;
}

#h1-mod .h1-input-ico {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    opacity: 0.55;
    pointer-events: none;
    color: var(--h1-secondary);
}

#h1-mod .h1-q {
    width: 100%;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--h1-sep);
    background: var(--h1-input-bg);
    padding: 0 14px 0 40px;
    font-size: 15px;
    letter-spacing: -0.01em;
    color: var(--h1-label);
    outline: none;
    box-sizing: border-box;
}

.io-grey-mode #h1-mod .h1-q::placeholder {
    color: rgba(60, 60, 67, 0.42);
}
.io-black-mode #h1-mod .h1-q::placeholder {
    color: rgba(235, 235, 245, 0.38);
}

.io-grey-mode #h1-mod .h1-q:focus {
    border-color: rgba(0, 122, 255, 0.45);
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.18);
}
.io-black-mode #h1-mod .h1-q:focus {
    border-color: rgba(10, 132, 255, 0.55);
    box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.22);
}

#h1-mod .scope {
    position: relative;
}

#h1-mod .h1-cat {
    width: 100%;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--h1-sep);
    background: var(--h1-input-bg);
    padding: 0 38px 0 14px;
    font-size: 14px;
    letter-spacing: -0.01em;
    color: var(--h1-label);
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    box-sizing: border-box;
}

#h1-mod .scope .caret {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.55;
    pointer-events: none;
    font-size: 12px;
}

#h1-mod .advBtn {
    height: 44px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid var(--h1-sep);
    background: var(--h1-fill);
    color: var(--h1-label);
    font-size: 13px;
    letter-spacing: -0.01em;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    box-sizing: border-box;
}

#h1-mod .advBtn:hover {
    filter: brightness(0.98);
}
#h1-mod .advBtn:active {
    transform: scale(0.99);
}

#h1-mod .hint {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--h1-sep);
    color: var(--h1-secondary);
    font-size: 12px;
    letter-spacing: -0.01em;
}

#h1-mod .kbd {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    border: 1px solid var(--h1-sep);
    border-bottom-width: 2px;
    padding: 2px 6px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.55);
    margin: 0 2px;
    font-size: 11px;
}

.io-black-mode #h1-mod .kbd {
    background: rgba(0, 0, 0, 0.28);
}

#h1-mod .h1-home-extra {
    margin-top: 10px;
}

#h1-mod .h1-include {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 12px;
    color: var(--h1-secondary);
    cursor: pointer;
}

#h1-mod .popover {
    display: none;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--h1-sep);
}

#h1-mod .popover.open {
    display: block;
}

#h1-mod .popTitle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--h1-secondary);
    font-size: 12px;
    letter-spacing: -0.01em;
    margin-bottom: 10px;
}

#h1-mod .h1-pop-sub {
    text-align: right;
    color: var(--h1-secondary);
}

#h1-mod .grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    max-height: min(380px, 48vh);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

#h1-mod .prov {
    padding: 10px;
    border-radius: 14px;
    border: 1px solid var(--h1-sep);
    background: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    box-sizing: border-box;
}

.io-black-mode #h1-mod .prov {
    background: rgba(0, 0, 0, 0.2);
}

.io-grey-mode #h1-mod .prov.active {
    border-color: rgba(0, 122, 255, 0.28);
    background: rgba(0, 122, 255, 0.1);
}
.io-black-mode #h1-mod .prov.active {
    border-color: rgba(10, 132, 255, 0.32);
    background: rgba(10, 132, 255, 0.16);
}

#h1-mod .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--h1-fill);
    border: 1px solid var(--h1-sep);
    flex-shrink: 0;
}

#h1-mod .prov.active .dot {
    background: var(--h1-blue);
    border-color: transparent;
}

#h1-mod .pName {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

#h1-mod .pDesc {
    font-size: 12px;
    color: var(--h1-secondary);
    letter-spacing: -0.01em;
}

/* 仅在有「用户提交」扩展时出现：右对齐辅助链接 */
#h1-mod .h1-results-toolbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 14px;
    margin-bottom: 0;
    min-height: 0;
}

#h1-mod .h1-results-toolbar.d-none {
    display: none !important;
}

#h1-mod .h1-results-toolbar:not(.d-none) + .results {
    margin-top: 10px;
}

#h1-mod .more {
    margin-left: auto;
    color: var(--h1-blue);
    font-size: 12px;
    text-decoration: none;
    font-weight: 600;
}

#h1-mod .more:hover {
    text-decoration: underline;
}

#h1-mod .results {
    margin-top: 14px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

#h1-mod .h1-sec-title {
    grid-column: 1 / -1;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--h1-secondary);
    margin: 4px 0 2px;
}

#h1-mod .tool {
    background: var(--h1-card-bg);
    border: 1px solid var(--h1-sep);
    border-radius: 14px;
    padding: 12px;
    min-height: 122px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-decoration: none !important;
    color: inherit !important;
    box-sizing: border-box;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

#h1-mod .tool:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.io-black-mode #h1-mod .tool:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

#h1-mod .tool .top {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

#h1-mod .tool .logo {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.18), rgba(0, 122, 255, 0.08));
    border: 1px solid rgba(0, 122, 255, 0.18);
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    color: rgba(0, 64, 184, 1);
}

.io-black-mode #h1-mod .tool .logo {
    background: linear-gradient(135deg, rgba(10, 132, 255, 0.22), rgba(10, 132, 255, 0.1));
    border-color: rgba(10, 132, 255, 0.24);
    color: #a9d3ff;
}

#h1-mod .tool .meta {
    min-width: 0;
}

#h1-mod .tool .name {
    font-size: 14px;
    letter-spacing: -0.01em;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#h1-mod .tool .desc {
    margin-top: 2px;
    font-size: 12px;
    color: var(--h1-secondary);
    letter-spacing: -0.01em;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

#h1-mod .tool .tagRow {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: auto;
    flex-wrap: wrap;
}

#h1-mod .tool .tag {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--h1-fill);
    border: 1px solid var(--h1-sep);
    color: var(--h1-secondary);
}

.io-grey-mode #h1-mod .tool .tag.blue {
    background: rgba(0, 122, 255, 0.1);
    border-color: rgba(0, 122, 255, 0.18);
    color: rgba(0, 64, 184, 1);
}

.io-black-mode #h1-mod .tool .tag.blue {
    color: #a9d3ff;
    background: rgba(10, 132, 255, 0.14);
    border-color: rgba(10, 132, 255, 0.22);
}

#h1-mod .h1-empty,
#h1-mod .h1-err,
#h1-mod .h1-loading {
    grid-column: 1 / -1;
    font-size: 13px;
    color: var(--h1-secondary);
    padding: 8px 0;
}

#h1-mod .h1-err {
    color: #dc3545;
}

@media (max-width: 1100px) {
    #h1-mod .results {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    #h1-mod .h1-top-row,
    #h1-mod .h1-top-row--no-cat {
        grid-template-columns: 1fr;
    }
    #h1-mod .advBtn {
        width: 100%;
    }
    #h1-mod .grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    #h1-mod .results {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    #h1-mod .grid {
        grid-template-columns: 1fr;
    }
    #h1-mod .results {
        grid-template-columns: 1fr;
    }
}
