/* ===========================================================
   features.css — 站点功能组件样式
   站内搜索 / 博客筛选 / 作品集详情 / 文章阅读增强 / 404 搜索
   =========================================================== */

/* ---------- 导航栏搜索按钮 ---------- */
.nav-search-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    margin-left: 18px;
    border: 1px solid transparent;
    border-radius: 50%;
    background: rgba(74, 111, 165, 0.08);
    color: var(--primary-color, #4a6fa5);
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.nav-search-btn:hover {
    background: rgba(74, 111, 165, 0.16);
    color: var(--secondary-color, #166088);
}

.nav-search-btn:focus-visible {
    outline: 2px solid var(--primary-color, #4a6fa5);
    outline-offset: 2px;
}

@media (max-width: 768px) {
    .nav-search-btn {
        margin-left: auto;
        margin-right: 6px;
    }
}

/* ---------- 全站搜索弹层 ---------- */
.zs-overlay {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 10vh 16px 16px;
    background: rgba(15, 23, 38, 0.55);
    backdrop-filter: blur(2px);
}

.zs-overlay[hidden] {
    display: none !important;
}

.zs-dialog {
    width: 100%;
    max-width: 680px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 30px 70px rgba(10, 20, 40, 0.35);
    overflow: hidden;
    animation: zs-pop 0.18s ease-out;
}

@keyframes zs-pop {
    from { transform: translateY(-8px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.zs-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid #eef1f5;
}

.zs-head > i {
    color: #8a94a3;
    font-size: 16px;
}

.zs-input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    font-size: 16px;
    font-family: inherit;
    color: #26303d;
    background: transparent;
}

.zs-close {
    flex: none;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 8px;
    background: #f1f4f8;
    color: #6c757d;
    cursor: pointer;
}

.zs-close:hover {
    background: #e6ebf2;
    color: #26303d;
}

.zs-body {
    max-height: 56vh;
    overflow-y: auto;
    padding: 8px 10px 12px;
}

.zs-group {
    padding: 4px 0;
}

.zs-group-title {
    margin: 8px 8px 4px;
    font-size: 12px;
    font-weight: 600;
    color: #9aa3af;
    letter-spacing: 0.4px;
}

.zs-item {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    text-decoration: none;
    color: #26303d;
}

.zs-item:hover,
.zs-item:focus {
    background: #f4f8ff;
}

.zs-item-title {
    font-size: 15px;
    font-weight: 600;
    flex: none;
    max-width: 60%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.zs-item-desc {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    color: #8a94a3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.zs-item-meta {
    flex: none;
    font-size: 12px;
    color: #b3bcc9;
}

.zs-item-kind {
    flex: none;
    font-size: 11px;
    color: #4a6fa5;
    background: #eef3fa;
    border-radius: 999px;
    padding: 2px 8px;
}

.zs-item mark {
    background: #fff3b0;
    color: inherit;
    padding: 0;
}

.zs-hint,
.zs-empty {
    margin: 18px 12px;
    text-align: center;
    font-size: 14px;
    color: #9aa3af;
}

.zs-hint kbd,
.zs-kbd kbd {
    background: #f1f4f8;
    border: 1px solid #e2e8f0;
    border-bottom-width: 2px;
    border-radius: 5px;
    padding: 1px 6px;
    font-size: 11px;
    color: #6c757d;
}

.zs-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 18px;
    border-top: 1px solid #eef1f5;
    background: #fafbfd;
    font-size: 12px;
    color: #9aa3af;
}

/* ---------- 博客列表工具栏 ---------- */
.blog-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 0 0 26px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #eaeef4;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(30, 50, 80, 0.05);
}

.blog-search {
    flex: 1 1 220px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    background: #fbfcfe;
}

.blog-search i {
    color: #9aa3af;
    font-size: 14px;
}

.blog-search input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
    font-family: inherit;
    color: #26303d;
}

.blog-toolbar select {
    padding: 9px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    font-size: 14px;
    font-family: inherit;
    color: #33404f;
    background: #fff;
    cursor: pointer;
}

.blog-toolbar .blog-clear {
    border: none;
    background: #f1f4f8;
    color: #6c757d;
    border-radius: 9px;
    padding: 9px 12px;
    font-size: 13px;
    cursor: pointer;
}

.blog-toolbar .blog-clear:hover {
    background: #e6ebf2;
}

.blog-count {
    margin-left: auto;
    font-size: 13px;
    color: #8a94a3;
    white-space: nowrap;
}

.blog-empty {
    grid-column: 1 / -1;
    padding: 50px 20px;
    text-align: center;
    color: #8a94a3;
    background: #fafbfd;
    border: 1px dashed #e2e8f0;
    border-radius: 12px;
}

.blog-loadmore-wrap {
    text-align: center;
    margin-top: 32px;
}

.blog-loadmore {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 26px;
    border: 1px solid #dbe4f0;
    border-radius: 10px;
    background: #fff;
    color: #4a6fa5;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
}

.blog-loadmore:hover {
    background: #eef3fa;
}

.blog-empty-tags {
    margin-top: 10px;
    font-size: 13px;
    color: #b3bcc9;
}

/* ---------- 作品集工具栏 + 详情弹层 ---------- */
.portfolio-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 26px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #eaeef4;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(30, 50, 80, 0.05);
}

.portfolio-toolbar select {
    padding: 9px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    font-size: 14px;
    font-family: inherit;
    color: #33404f;
    background: #fff;
    cursor: pointer;
}

.portfolio-count {
    margin-left: auto;
    font-size: 13px;
    color: #8a94a3;
}

.portfolio-item .portfolio-content {
    position: relative;
}

.portfolio-detail-btn {
    margin-top: 12px;
    width: 100%;
    border: 1px solid #dbe4f0;
    background: #f7f9fc;
    color: #4a6fa5;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
}

.portfolio-detail-btn:hover {
    background: #eef3fa;
}

.pf-overlay {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background: rgba(15, 23, 38, 0.55);
}

.pf-overlay[hidden] {
    display: none !important;
}

.pf-dialog {
    width: 100%;
    max-width: 720px;
    max-height: 86vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 30px 70px rgba(10, 20, 40, 0.35);
}

.pf-media {
    height: 240px;
    background: #eef3fa;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4a6fa5;
    font-size: 46px;
}

.pf-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pf-content {
    padding: 22px 24px 26px;
}

.pf-title {
    font-size: 22px;
    color: #26303d;
    margin-bottom: 8px;
    padding-right: 30px;
}

.pf-close {
    position: absolute;
    right: 12px;
    top: 12px;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    color: #495057;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.pf-dialog {
    position: relative;
}

.pf-desc {
    color: #5b6675;
    font-size: 14px;
    line-height: 1.9;
    white-space: pre-wrap;
    margin: 12px 0 16px;
}

.pf-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.pf-tech span {
    font-size: 12px;
    color: #4a6fa5;
    background: #eef3fa;
    border-radius: 999px;
    padding: 4px 10px;
}

.pf-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.pf-links a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 16px;
    border-radius: 9px;
    background: #4a6fa5;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.pf-links a.secondary {
    background: #f1f4f8;
    color: #4a6fa5;
}

.pf-meta {
    margin-top: 14px;
    font-size: 12px;
    color: #b3bcc9;
}

/* ---------- 文章阅读增强 ---------- */
.article-progress {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 3px;
    background: transparent;
    z-index: 4000;
    pointer-events: none;
}

.article-progress > span {
    display: block;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, #4a6fa5, #4fc3a1);
    transition: width 0.1s linear;
}

.article-toc {
    margin: 0 0 26px;
    border: 1px solid #eaeef4;
    border-radius: 12px;
    background: #fafbfd;
    padding: 4px 16px 10px;
}

.article-toc summary {
    cursor: pointer;
    list-style: none;
    padding: 12px 0;
    font-weight: 600;
    font-size: 15px;
    color: #33404f;
}

.article-toc summary::-webkit-details-marker {
    display: none;
}

.article-toc summary i {
    color: #4a6fa5;
    margin-right: 8px;
}

.article-toc ol {
    list-style: none;
    margin: 0 0 6px 0;
    padding: 0;
}

.article-toc li {
    margin: 6px 0;
    font-size: 13.5px;
    line-height: 1.5;
}

.article-toc a {
    color: #5b6675;
    text-decoration: none;
}

.article-toc a:hover {
    color: #4a6fa5;
    text-decoration: underline;
}

.article-toc .toc-h3 {
    margin-left: 16px;
}

.article-toc .toc-h4 {
    margin-left: 32px;
    font-size: 13px;
}

.article-reading-line {
    color: #8a94a3;
    font-size: 13px;
    margin: -6px 0 18px;
}

.article-adjacent {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 30px 0 10px;
}

.adjacent-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 16px;
    border: 1px solid #eaeef4;
    border-radius: 12px;
    background: #fff;
    text-decoration: none;
    min-height: 66px;
}

.adjacent-item:hover {
    border-color: #c9d9ee;
    background: #f7fafe;
}

.adjacent-item.is-empty {
    background: transparent;
    border: none;
    min-height: 0;
}

.adjacent-label {
    font-size: 12px;
    color: #8a94a3;
}

.adjacent-title {
    font-size: 14px;
    font-weight: 600;
    color: #33404f;
    line-height: 1.4;
}

.adjacent-next {
    text-align: right;
}

.article-related {
    margin: 26px 0 10px;
    padding: 18px 20px;
    border: 1px solid #eaeef4;
    border-radius: 12px;
    background: #fff;
}

.article-related-title {
    font-size: 16px;
    color: #26303d;
    margin-bottom: 10px;
}

.article-related-title i {
    color: #4a6fa5;
    margin-right: 6px;
}

.article-related ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.article-related li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px dashed #eef1f5;
    font-size: 14px;
}

.article-related li:last-child {
    border-bottom: none;
}

.article-related a {
    color: #4a6fa5;
    text-decoration: none;
}

.article-related a:hover {
    text-decoration: underline;
}

.article-related li span {
    flex: none;
    color: #b3bcc9;
    font-size: 12px;
}

.article-share {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 18px 0 6px;
    padding: 14px 16px;
    border-top: 1px dashed #eef1f5;
}

.article-share-label {
    font-size: 13px;
    color: #8a94a3;
    margin-right: 4px;
}

.article-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #fff;
    color: #4a6fa5;
    font-size: 13px;
    font-family: inherit;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
}

.article-share-btn:hover {
    background: #eef3fa;
    border-color: #c9d9ee;
}

@media (max-width: 680px) {
    .article-adjacent {
        grid-template-columns: 1fr;
    }

    .adjacent-item {
        min-height: 0;
    }
}

/* ---------- 404 页面搜索与推荐 ---------- */
.nf-search {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 520px;
    margin: 26px auto 0;
    padding: 13px 16px;
    background: #fff;
    border: 1px solid #dbe4f0;
    border-radius: 12px;
    box-shadow: 0 8px 22px rgba(20, 40, 70, 0.08);
}

.nf-search i {
    color: #9aa3af;
}

.nf-search input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    font-family: inherit;
    color: #26303d;
    background: transparent;
}

.nf-recent {
    max-width: 720px;
    margin: 34px auto 0;
    text-align: left;
}

.nf-recent-title {
    font-size: 16px;
    color: #33404f;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nf-recent-title i {
    color: #4a6fa5;
}

.nf-recent ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.nf-recent li a {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid #eaeef4;
    border-radius: 10px;
    text-decoration: none;
    color: #33404f;
    font-size: 14px;
    font-weight: 500;
}

.nf-recent li a:hover {
    border-color: #c9d9ee;
    background: #f7fafe;
}

.nf-recent li span {
    font-size: 12px;
    color: #b3bcc9;
    font-weight: 400;
}

.nf-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 28px;
}

.nf-links a {
    padding: 9px 18px;
    border-radius: 999px;
    background: #f1f4f8;
    color: #4a6fa5;
    font-size: 13px;
    text-decoration: none;
}

.nf-links a:hover {
    background: #eef3fa;
}

@media (max-width: 600px) {
    .nf-recent ul {
        grid-template-columns: 1fr;
    }
}

/* ---------- 通用技术标签（博客列表复用） ---------- */
.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tech-tag {
    font-size: 12px;
    color: #4a6fa5;
    background: #eef3fa;
    border-radius: 999px;
    padding: 3px 9px;
}

/* ---------- 首页 Hero 搜索框 ---------- */
.hero-search {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 460px;
    margin: 26px auto 0;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #dbe4f0;
    border-radius: 12px;
    box-shadow: 0 8px 22px rgba(20, 40, 70, 0.08);
}

.hero-search i {
    color: #9aa3af;
}

.hero-search input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    font-size: 15px;
    font-family: inherit;
    color: #26303d;
}
