* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    padding-top: 64px;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}
body::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    height: 64px;
}
nav {
    margin: 0 auto;
    padding: 0 8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}
a {
    color: #3b82f6;
    text-decoration: none;
}
.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #1e293b;
    text-decoration: none;
    display: flex;
    align-items: center;
    height: 100%;
}
.logo img {
    height: 36px;
    width: auto;
    object-fit: contain;
}
.nav-links {
    display: flex;
    list-style: none;
    height: 64px;
    align-items: center;
}
.nav-links li {
    margin-left: 0;
    height: 100%;
    display: flex;
    align-items: center;
}
.nav-links a {
    color: #475569;
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    padding: 0 14px;
    height: 100%;
    display: flex;
    align-items: center;
    position: relative;
    transition: color 0.2s ease;
}
/* 底部激活指示条 */
.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 14px;
    right: 14px;
    height: 2px;
    background: #3b82f6;
    border-radius: 1px;
    transform: scaleX(0);
    transition: transform 0.25s ease;
}
.nav-links a:hover {
    color: #1e293b;
}
.nav-links a:hover::after {
    transform: scaleX(1);
}
.nav-links a.active {
    color: #3b82f6;
    font-weight: 600;
}
.nav-links a.active::after {
    transform: scaleX(1);
}
main {
    max-width: 1400px;
    margin: 2rem auto;
}
footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
}
.loading {
    text-align: center;
    padding: 4rem;
    font-size: 1.2rem;
    color: #666;
}
/* ===== 标签与分类样式（公共） ===== */
.article-category {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
}
.article-category.tech {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
}
.article-category.tutorial {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
}
.article-category.life {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
}
.article-category.docker {
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    color: #0369a1;
}
.article-category.finance {
    background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%);
    color: #9d174d;
}
.article-date {
    color: #94a3b8;
    font-size: 0.85rem;
}

/* ===== 文章卡片样式（公共，供文章列表和搜索结果共享）===== */
.article-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem 2rem;
    color: inherit;
    transition: all 0.25s ease;
    margin-bottom: 1rem;
    overflow: hidden;
}

.article-card:hover {
    border-color: #d1d5db;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

.article-card-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0 0 0.75rem 0;
    line-height: 1.4;
}

.article-card-title a {
    color: #111827;
    text-decoration: none;
}

.article-card-title a:hover {
    color: #3b82f6;
}

.article-card-title mark {
    background: #fef08a;
    color: #1e293b;
    padding: 0 2px;
    border-radius: 2px;
}

.article-card-meta {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 0.875rem;
    flex-wrap: wrap;
}

.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #6b7280;
    font-size: 0.82rem;
    white-space: nowrap;
}

.meta-item svg {
    width: 14px;
    height: 14px;
    opacity: 0.7;
}

.meta-tags {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.article-card-summary {
    color: #6b7280;
    font-size: 0.92rem;
    line-height: 1.7;
    margin: 0 0 0.75rem 0;
    line-clamp: 3;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-card-summary mark {
    background: #fef08a;
    color: #1e293b;
    padding: 0 2px;
    border-radius: 2px;
}

.article-card-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: #3b82f6;
    font-size: 0.88rem;
    font-weight: 500;
    text-decoration: none;
    float: right;
    transition: gap 0.2s ease;
}

.article-card-link svg {
    width: 14px;
    height: 14px;
}

.article-card:hover .article-card-link {
    gap: 0.5rem;
}

/* ===== 状态提示（错误/空状态/加载中）===== */
.msg-error {
    text-align: center;
    padding: 4rem 1rem;
    color: #ef4444;
}

.msg-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: #64748b;
}

.msg-load-error {
    text-align: center;
    padding: 4rem 1rem;
    color: red;
}

.nav-error {
    color: red;
}

@media (max-width: 768px) {
    main {
        padding: 0 1rem;
    }
    nav {
        padding: 0 1rem;
    }
    .nav-links li {
        margin-left: 1rem;
    }
}

/* ===== 搜索功能（导航内图标 + 弹出框） ===== */
.nav-search {
    display: flex;
    align-items: center;
    margin-left: 24px;
    height: 100%;
}
.search-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    color: #64748b;
}
.search-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #1e293b;
}
.search-btn svg {
    width: 22px;
    height: 22px;
}

/* 搜索弹出框 */
.search-popup {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    animation: searchFadeIn 0.2s ease;
}
.search-popup-inner {
    position: relative;
    width: 480px;
    max-width: 90vw;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12);
}
@keyframes searchFadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.search-popup-inner input {
    width: 100%;
    padding: 14px 18px;
    border: none;
    background: transparent;
    color: #1e293b;
    font-size: 1rem;
    outline: none;
}
.search-popup-inner input::placeholder {
    color: #94a3b8;
}

/* 搜索建议 */
.search-suggestions {
    display: none;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    max-height: 320px;
    overflow-y: auto;
}
.search-suggestion-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    color: #334155;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.15s;
}
.search-suggestion-item:hover {
    background: rgba(0, 0, 0, 0.04);
}
.search-suggestion-type {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    flex-shrink: 0;
}
.search-suggestion-type.article {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}
.search-suggestion-type.tutorial {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}
.search-suggestion-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .nav-search {
        margin-left: 0;
        padding: 10px 24px;
    }
    .search-popup {
        left: 5%;
        right: 5%;
        transform: none;
    }
    .search-popup-inner {
        width: 100%;
    }
}

/* ===== 汉堡菜单按钮（默认隐藏） ===== */
.hamburger-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    flex-direction: column;
    gap: 5px;
    z-index: 1001;
}
.hamburger-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background: #334155;
    border-radius: 2px;
    transition: all 0.3s ease;
}
.hamburger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
}
.hamburger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

@media (max-width: 768px) {
    .hamburger-btn {
        display: flex;
    }
    .nav-links {
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        height: auto;
        padding: 0;
        transform: translateY(-100%);
        opacity: 0;
        transition: all 0.3s ease;
        pointer-events: none;
        z-index: 1000;
        border-top: 1px solid rgba(0, 0, 0, 0.06);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    }
    .nav-links.mobile-open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }
    .nav-links li {
        height: auto;
    }
    .nav-links a {
        padding: 14px 24px;
        border-bottom: 1px solid rgba(0, 0, 0, 0.04);
        color: #475569;
    }
    .nav-links a::after {
        display: none;
    }
}

/* ===== 返回顶部按钮 ===== */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}
.back-to-top:hover {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}