@font-face {
    font-family: "angelinaFont";
    src: local("Angelina"),
         url("/fonts/angelina.woff2") format("woff2"),
         url("/fonts/angelina.ttf") format("truetype");
    font-display: optional;
    font-style: normal;
    font-weight: 400;
}

.navigatebar {
    display: grid;
    grid-template-columns: minmax(108px, 1fr) auto minmax(36px, 1fr);
    grid-template-areas: "left center right";
    align-items: center;
    width: 100%;
    margin-top: 16px;
    margin-bottom: 18px;
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
    box-sizing: border-box;
    column-gap: 8px;
    min-height: 42px;
}

.navigatebar-left,
.navigatebar-center,
.navigatebar-right {
    display: flex;
    align-items: center;
    min-width: 0;
}

.navigatebar-left {
    grid-area: left;
    justify-self: start;
}

.navigatebar-center {
    grid-area: center;
    justify-self: center;
    justify-content: center;
    gap: clamp(10px, 3vw, 16px);
    white-space: nowrap;
}

.navigatebar-right {
    grid-area: right;
    justify-self: end;
    padding-right: 2px;
}

.navigatebar-button {
    margin-left: 0;
    margin-right: 0;
    color: #3f3f3f;
    font-size: 16px;
    line-height: 1.15;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    letter-spacing: 0.05px;
    display: inline-flex;
    align-items: center;
}

.navigatebar.is-zh .navigatebar-button:not(.navigatebar-mine) {
    font-family: "TsangerJinKai02", "STKaiti", "KaiTi", serif;
}

.navigatebar-button a {
    color: #3f3f3f;
    text-decoration: none;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 2px;
    transition: color .12s ease;
}

.navigatebar-button a:hover {
    color: #2f2f2f;
}

.navigatebar-slogan {
    display: none;
}

.navigatebar-mine {
    flex: 0 0 auto;
    margin-left: 0;
    margin-right: 0;
    font-size: 29px;
    line-height: 1;
    color: #3f3f3f;
    font-weight: 400;
    font-family: "angelinaFont", cursive;
    font-synthesis: none;
}

.navigatebar-mine a {
    color: #3f3f3f;
    font-family: "angelinaFont", cursive;
}

.navigatebar-about {
    margin-right: 0;
    flex: 0 0 auto;
    width: auto;
    justify-content: flex-end;
    font-size: 16px;
}

.lang-switch-icon {
    display: none;
}

.lang-switch-icon svg {
    width: 16px;
    height: 16px;
}

.lang-switch-text {
    display: inline-flex;
    align-items: center;
    color: #4e4e4e;
    text-decoration: none;
    border-bottom: 0;
    font-size: inherit;
    line-height: inherit;
    font-family: inherit;
    letter-spacing: inherit;
    min-height: 40px;
    padding: 0 4px;
}

.navigatebar-menu-item {
    font-size: 17px;
    line-height: 1.2;
}

.navigatebar-menu-item a {
    white-space: nowrap;
    color: #535353;
    padding: 0 4px;
}

.navigatebar-menu-item a.is-active {
    color: #262626;
    font-weight: 600;
}

.navigatebar.is-zh .navigatebar-menu-item a.is-active {
    font-weight: 500;
}

.navigatebar-actions {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.search-open-btn {
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    color: #5a5a5a;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.search-open-btn svg {
    width: 16px;
    height: 16px;
}

.search-open-btn:hover {
    color: #2f2f2f;
    background: #f3f3f3;
}

.theme-toggle-btn {
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    color: #5a5a5a;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.theme-toggle-btn svg {
    width: 16px;
    height: 16px;
}

.theme-toggle-btn:hover {
    color: #2f2f2f;
    background: #f3f3f3;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.search-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(10, 10, 10, 0.72);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 62px 12px 18px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .16s ease;
}

.search-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.search-container {
    width: 100%;
    max-height: calc(100vh - 84px);
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.24);
    display: flex;
    flex-direction: column;
}

.search-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 12px;
    border-bottom: 1px solid #f0f0f0;
}

.search-input {
    flex: 1;
    border: 0;
    outline: none;
    color: #2f2f2f;
    font-size: 16px;
    line-height: 1.4;
    background: transparent;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

.search-input::placeholder {
    color: #a0a0a0;
}

.search-close {
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #8f8f8f;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.search-results {
    overflow: auto;
    max-height: calc(100vh - 150px);
    padding: 8px 10px 10px;
}

.search-results.is-empty {
    padding: 0;
    max-height: 0;
}

.search-result-count,
.search-empty-state,
.search-loading,
.search-error,
.search-no-results {
    color: #8b8b8b;
    font-size: 12px;
    line-height: 1.4;
    padding: 8px 2px 10px;
}

.search-result-item {
    display: block;
    color: inherit;
    text-decoration: none;
    padding: 10px 8px;
    margin-bottom: 3px;
    border-radius: 8px;
}

.search-result-item:hover,
.search-result-item.selected {
    background: #f4f4f4;
}

.search-result-title {
    color: #242424;
    font-size: 17px;
    line-height: 1.42;
}

.search-result-summary {
    color: #666;
    font-size: 13px;
    line-height: 1.62;
    margin-top: 3px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.search-result-summary mark,
.search-result-title mark {
    background: #fde68a;
    color: inherit;
    border-radius: 2px;
    padding: 0 2px;
}

.search-result-meta {
    margin-top: 4px;
}

.search-result-date {
    color: #9a9a9a;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}

.search-footer {
    border-top: 1px solid #f2f2f2;
    padding: 8px 12px;
}

.search-tips {
    color: #a4a4a4;
    font-size: 11px;
    line-height: 1.35;
}

.site-footer {
    width: 100%;
    margin: 18px auto 14px;
    padding: 0 max(14px, env(safe-area-inset-left)) max(6px, env(safe-area-inset-bottom));
    box-sizing: border-box;
}

.site-footer-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

.site-footer-link {
    width: 22px;
    height: 22px;
    color: #666;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border-bottom: 0;
}

.site-footer-link svg {
    width: 17px;
    height: 17px;
}

.site-footer-link:active {
    color: #2f2f2f;
}

@media screen and (max-width: 430px) and (min-width: 381px) {
    .navigatebar {
        grid-template-columns: minmax(100px, 1fr) auto minmax(30px, 1fr);
        padding-left: max(14px, env(safe-area-inset-left));
        padding-right: max(14px, env(safe-area-inset-right));
    }

    .navigatebar-center {
        gap: 12px;
    }

    .navigatebar-button {
        font-size: 15px;
    }

    .navigatebar-menu-item {
        font-size: 16px;
    }

    .navigatebar-mine {
        font-size: 27px;
    }

    .navigatebar-about {
        font-size: 15px;
    }

    .navigatebar-button a,
    .lang-switch-text {
        min-height: 38px;
    }

    .search-open-btn,
    .theme-toggle-btn {
        width: 30px;
        height: 30px;
    }
}

@media screen and (max-width: 380px) {
    .navigatebar {
        grid-template-columns: minmax(90px, 1fr) auto minmax(24px, 1fr);
        column-gap: 6px;
        padding-left: max(12px, env(safe-area-inset-left));
        padding-right: max(12px, env(safe-area-inset-right));
    }

    .navigatebar-center {
        gap: 9px;
    }

    .navigatebar-button {
        font-size: 14px;
    }

    .navigatebar-mine {
        font-size: 24px;
    }

    .navigatebar-menu-item {
        font-size: 15px;
    }

    .navigatebar-about {
        font-size: 14px;
    }

    .navigatebar-button a,
    .lang-switch-text {
        min-height: 36px;
    }

    .search-open-btn,
    .theme-toggle-btn {
        width: 28px;
        height: 28px;
    }

    .search-open-btn svg,
    .theme-toggle-btn svg {
        width: 15px;
        height: 15px;
    }
}

@media screen and (max-width: 340px) {
    .navigatebar-center {
        gap: 7px;
    }

    .navigatebar-menu-item {
        font-size: 14px;
    }

    .navigatebar-mine {
        font-size: 22px;
    }
}
