/* ==========================================================
   upx8wiki · layout
   顶栏 / 页脚 / 页面栅格
   ========================================================== */

/* ---------------- 顶栏 ---------------- */

.hd {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--hd-bg);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--line);
}

.hd-in {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 0 24px;
    height: 58px;
    display: flex;
    align-items: center;
    gap: 26px;
    overflow: hidden;
}

.brand {
    display: flex;
    align-items: center;
    gap: 9px;
    flex: 0 0 auto;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -.015em;
    color: var(--tx);
}

.brand img {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    object-fit: cover;
}

.brand-t {
    display: block;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav {
    display: flex;
    align-items: center;
    gap: 1px;
    flex: 1 1 0;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.nav::-webkit-scrollbar {
    display: none;
}

.nav a {
    position: relative;
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    height: 58px;
    padding: 0 11px;
    font-size: 13.2px;
    color: var(--tx-2);
    white-space: nowrap;
    transition: color .15s ease;
}

.nav a:hover {
    color: var(--tx);
}

.nav a.on {
    color: var(--tx);
    font-weight: 600;
}

.nav a.on::after {
    content: "";
    position: absolute;
    left: 11px;
    right: 11px;
    bottom: -1px;
    height: 2px;
    background: var(--tx);
    border-radius: 2px 2px 0 0;
}

.hd-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.hd-search {
    display: flex;
    align-items: center;
    gap: 7px;
    width: 248px;
    height: 34px;
    padding: 0 11px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 7px;
    transition: border-color .16s ease, box-shadow .16s ease;
}

.hd-search:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.hd-search svg {
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
    fill: none;
    stroke: var(--tx-3);
    stroke-width: 1.9;
    stroke-linecap: round;
}

.hd-search input {
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    outline: 0;
    background: none;
    font-size: 12.5px;
    color: var(--tx);
    appearance: none;
}

.hd-search input::-webkit-search-cancel-button {
    appearance: none;
}

.hd-search input::placeholder {
    color: var(--tx-4);
}

.icon-btn {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    color: var(--tx-2);
    transition: background-color .15s ease, color .15s ease;
}

.icon-btn:hover {
    background: var(--line-2);
    color: var(--tx);
}

.icon-btn svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.icon-btn .i-sun {
    display: none;
}

/* 由 JS 写入当前实际模式，auto 模式下也能正确显示图标 */
html[data-effective="dark"] .icon-btn .i-sun {
    display: block;
}

html[data-effective="dark"] .icon-btn .i-moon {
    display: none;
}

/* ---------------- 主体 ---------------- */

.mn {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 22px 24px 40px;
}

/* ---------------- 页脚 ---------------- */

.ft {
    margin-top: 56px;
    background: var(--surface);
    border-top: 1px solid var(--line);
}

.ft-in {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 40px 24px 30px;
    display: grid;
    grid-template-columns: 1.7fr 1fr 1fr 1fr;
    gap: 40px;
}

.ft-name {
    font-size: 14.5px;
    font-weight: 800;
    letter-spacing: -.01em;
    margin-bottom: 9px;
}

.ft-desc {
    font-size: 12.3px;
    line-height: 1.75;
    color: var(--tx-3);
    max-width: 300px;
}

.ft-social {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 14px;
}

.ft-social a {
    font-size: 12px;
    color: var(--tx-3);
    transition: color .15s ease;
}

.ft-social a:hover {
    color: var(--accent);
}

.ft-t {
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .14em;
    color: var(--tx-4);
    margin-bottom: 10px;
}

.ft-col a {
    display: block;
    font-size: 12.8px;
    color: var(--tx-2);
    padding: 4.5px 0;
    transition: color .15s ease;
}

.ft-col a:hover {
    color: var(--tx);
}

.ft-bottom {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 15px 24px 26px;
    border-top: 1px solid var(--line-2);
    font-size: 11.8px;
    color: var(--tx-4);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
}

.ft-bottom a {
    color: var(--tx-3);
}

.ft-bottom a:hover {
    color: var(--tx);
}

/* ---------------- 响应式 ---------------- */

@media (max-width: 1024px) {
    .hd-search {
        width: 190px;
    }

    .ft-in {
        grid-template-columns: 1fr 1fr;
        gap: 30px;
    }
}

@media (max-width: 760px) {
    .hd-in {
        gap: 14px;
        padding: 0 16px;
    }

    .mn {
        padding: 16px 16px 30px;
    }

    .hd-search {
        width: 34px;
        padding: 0;
        justify-content: center;
        border-color: transparent;
        background: none;
    }

    .hd-search input {
        display: none;
    }

    .hd-search svg {
        width: 17px;
        height: 17px;
    }

    .hd-search.open {
        width: 200px;
        padding: 0 11px;
        justify-content: flex-start;
        border-color: var(--line);
        background: var(--surface);
    }

    .hd-search.open input {
        display: block;
    }

    .ft-in {
        grid-template-columns: 1fr;
        gap: 26px;
        padding: 30px 16px 24px;
    }

    .ft-bottom {
        padding: 14px 16px 24px;
    }
}
