:root {
    --primary-color: #ff69b4;
    --secondary-color: #ff80ab;
    --background-color: #ffffff;
    --text-color: #333333;
    --light-text-color: #666666;
    --accent-color: #f3e8f1;
    --card-bg: #ffffff;
    --border-color: rgba(0, 0, 0, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    padding: 20px;
    overflow-x: hidden;
    max-width: 100%;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}
.container img{
    max-width:100%;
}

/* 首页顶栏：整合头像与导航，节省垂直空间 */
.home-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(145deg, #ffffff 0%, #fffafd 42%, #fff5f9 100%);
    border: 1px solid rgba(255, 105, 180, 0.14);
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(255, 105, 180, 0.08);
    padding: 10px 20px;
    margin-bottom: 24px;
    flex-wrap: wrap; /* 适配移动端 */
    gap: 15px;
}

.home-top-bar .profile-card {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    margin: 0;
    flex-shrink: 0;
}

.home-top-bar .site-nav {
    margin: 0;
    flex-shrink: 0;
}

/* 原有头像文字结构保持原样 */
.profile-card {
    display: block;
    padding: 14px 18px;
    margin-bottom: 20px;
    background: linear-gradient(145deg, #ffffff 0%, #fffafd 42%, #fff5f9 100%);
    border: 1px solid rgba(255, 105, 180, 0.14);
    border-radius: 14px;
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.04),
        0 8px 24px rgba(255, 105, 180, 0.08);
}

.profile-hero-inner {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.profile-hero-text {
    flex: 1;
    min-width: 0;
    padding-left: 2px;
    border-left: 3px solid rgba(255, 105, 180, 0.35);
}

.profile-hero-text h1 {
    margin: 0 0 4px 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-color);
    letter-spacing: -0.02em;
    line-height: 1.25;
}

.profile-tagline {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.45;
    color: var(--light-text-color);
}

.profile-pic {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.95);
    box-shadow:
        0 0 0 1px rgba(255, 105, 180, 0.2),
        0 4px 14px rgba(255, 105, 180, 0.18);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    background: #ffffff;
}

.profile-pic img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-pic:hover {
    transform: scale(1.03);
    box-shadow:
        0 0 0 1px rgba(255, 105, 180, 0.35),
        0 6px 18px rgba(255, 105, 180, 0.22);
}

.page-header {
    text-align: center;
    padding: 30px 20px;
    background: var(--accent-color);
    border-radius: 12px;
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.page-header p {
    color: var(--light-text-color);
}

.site-nav {
    display: flex;
    justify-content: center;
    margin: 24px 0;
}

.nav-inner {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-link {
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid transparent;
    background: linear-gradient(180deg, #ffffff 0%, #fff6fb 100%);
    color: var(--text-color);
    transition: all 0.2s ease;
    font-weight: 500;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.nav-link.inactive:hover {
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.nav-link.active {
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 6px 14px rgba(255, 105, 180, 0.35);
}

.about-section,
.articles-section,
.projects-section,
.contact-section,
.article-detail,
.project-detail {
    background: var(--background-color);
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}
.article-detail img{
    max-width:100%;
}
.about-section h2,
.articles-section h2,
.projects-section h2,
.contact-section h2,
.article-detail h2,
.project-detail h2 {
    margin-bottom: 20px;
    color: var(--primary-color);
    border-left: 5px solid var(--primary-color);
    padding-left: 10px;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.skill {
    background: #f9fafb;
    border: 1px solid var(--border-color);
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    transition: transform 0.2s ease;
}

.skill:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    justify-content: center;
}

.articles-section .grid,
.projects-section .grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    justify-content: stretch;
    width:100%;
}


@media (min-width: 1024px) {
    .articles-section .grid,
    .projects-section .grid {
        display: flex;
        flex-wrap: wrap; /* 允许换行 */
    }
    .card{
/*        max-width:356.66px;*/
        flex: 0 0 23.6%;
    }
}


.card {
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.media {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: linear-gradient(180deg, #fafbfc 0%, #f2f4f7 100%);
    position: relative;
    overflow: hidden;
}

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

.media.no-image::after {
    content: '无封面';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--light-text-color);
    font-size: 0.95em;
}

.card-content {
    padding: 18px;
}

.card-content h3 {
    margin-bottom: 10px;
    color: var(--primary-color);
    font-size: 1.2rem;
}

.card-content p {
    font-size: 0.95em;
    color: var(--light-text-color);
    margin-bottom: 10px;
}

.card-content .meta {
    font-size: 0.85em;
    color: var(--light-text-color);
    margin-bottom: 10px;
}

.card-content a {
    display: inline-block;
    margin-top: 8px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
    transition: color 0.2s ease;
}

.card-content a:hover {
    color: var(--secondary-color);
}

.section-footer {
    text-align: center;
    margin-top: 20px;
}

.view-all {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: #ffffff;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.view-all:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}

.search-container {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
}

.search-form {
    display: flex;
    gap: 10px;
    width: 380px;
    justify-content: flex-end;
}

.search-form input {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1em;
    min-width: 0;
}

.search-form button {
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.search-form button:hover {
    background-color: var(--secondary-color);
    transform: translateY(-1px);
}

.search-result-panel {
    width: 100%;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.search-result-panel ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.search-result-panel a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.95em;
}

.categories-container {
    margin: 10px 0 24px 0;
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
}

.categories-container h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 10px;
}

.category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* 文章分类：一级一行，二级在下方整行展开（非下拉浮层） */
.category-nav {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
    max-width: 100%;
}

/* 一级「全部」为当前态（未选分类）时不展示整块二级区域 */
.category-nav.category-nav--all .category-l2-stack {
    display: none;
}

/* 一级按钮同行垂直居中：裸 a 与 .category-l1-item 包装层混排时避免高低不齐 */
.category-row-l1 {
    align-items: center;
    align-content: center;
}

.category-l1-item {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.category-l2-panel {
    display: none;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin-top: 12px;
    padding: 12px 14px;
    background: linear-gradient(145deg, #fff5fb 0%, #ffe0ef 55%, #ffd6e8 100%);
    border: 1px solid rgba(255, 105, 180, 0.55);
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(255, 105, 180, 0.18);
    min-width: 0;
}

.category-l2-panel.is-open {
    display: block;
}

.category-l2-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    min-width: 0;
    max-width: 100%;
}

/* 二级：与一级圆角胶囊区分，使用偏矩形的虚线描边与略小字号 */
.category-btn-sub {
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.86em;
    font-weight: 500;
    border: 2px dashed rgba(255, 105, 180, 0.65);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 4px 12px rgba(219, 39, 119, 0.12);
}

.category-btn-sub:hover {
    border-style: solid;
    border-color: var(--primary-color);
    background: #ffffff;
}

.category-btn-sub.active {
    border-style: solid;
    border-color: transparent;
}

/* 文章列表：一级用 button，仅在本区域内重置，避免影响其它页面的 .category-btn */
.category-nav button.category-l1-trigger {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
    font: inherit;
    font-family: inherit;
    color: inherit;
    cursor: pointer;
    text-align: center;
}

.category-nav button.category-l1-trigger:focus {
    outline: none;
}

.category-nav button.category-l1-trigger:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.category-nav .category-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    line-height: 1.25;
    vertical-align: middle;
}

.category-btn {
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 105, 180, 0.35);
    background: linear-gradient(180deg, #ffffff 0%, #fff5fb 100%);
    color: var(--text-color);
    cursor: pointer;
    font-size: 0.95em;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    text-decoration: none;
}

.category-btn:hover {
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(255, 105, 180, 0.18);
}

.category-btn.active {
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 6px 14px rgba(255, 105, 180, 0.35);
}

.list-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.list-status {
    color: var(--light-text-color);
    font-size: 0.93em;
    background: #f9f5f8;
    border: 1px solid rgba(255, 105, 180, 0.18);
    padding: 6px 12px;
    border-radius: 999px;
}

.load-more-btn {
    padding: 10px 18px;
    background-color: var(--primary-color);
    color: #ffffff;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(255, 105, 180, 0.25);
}

.load-more-btn:hover {
    background-color: var(--secondary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(255, 105, 180, 0.25);
}

.pagination-wrapper {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.pagination-wrapper ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
    row-gap: 10px;
    padding: 0;
    margin: 0;
    max-width: 100%;
}

.pagination-wrapper li a,
.pagination-wrapper li span {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.2s ease;
}

.pagination-wrapper li.active span,
.pagination-wrapper li a:hover {
    background: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
}

.empty-placeholder {
    width: 100%;
    min-height: 180px;
    padding: 28px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--light-text-color);
    text-align: center;
}

.empty-emoji {
    font-size: 42px;
    line-height: 1;
    margin-bottom: 6px;
}

.empty-title {
    color: var(--text-color);
    font-weight: 600;
    margin-bottom: 4px;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 10px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 500;
    color: var(--text-color);
}

.form-group input,
.form-group textarea {
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1em;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 5px rgba(255, 105, 180, 0.3);
}

button {
    padding: 12px 20px;
    background-color: var(--primary-color);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
}

button:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(255, 105, 180, 0.3);
}

.success-message,
.error-message {
    margin-top: 20px;
    padding: 15px;
    border-left: 5px solid var(--primary-color);
    border-radius: 6px;
}

.success-message {
    background-color: #f3e8f1;
    color: var(--text-color);
}

.error-message {
    background-color: #ffe8ed;
    color: #d92e5b;
}

.back-link {
    margin-top: 24px;
}

.back-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.back-link a:hover {
    text-decoration: underline;
}

.site-footer {
    margin-top: 40px;
    padding: 20px 0;
    text-align: center;
    color: var(--light-text-color);
    border-top: 1px solid var(--border-color);
}

.site-footer .footer-inner {
    font-size: 0.9em;
}

.markdown-body {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-color);
    word-break: break-word;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
    margin: 1.5em 0 0.8em;
    font-weight: 600;
    color: var(--primary-color);
}

.markdown-body p {
    margin: 0.8em 0;
}

.markdown-body pre {
    background: #1e1e1e;
    color: #f5f5f5;
    padding: 14px;
    border-radius: 8px;
    overflow: auto;
    font-size: 0.95em;
}

.markdown-body code {
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.95em;
}

.markdown-body ul,
.markdown-body ol {
    padding-left: 1.5em;
    margin: 0.8em 0;
}

.markdown-body blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 14px;
    color: var(--light-text-color);
    margin: 1em 0;
}

.markdown-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.2em 0;
}

.markdown-body th,
.markdown-body td {
    border: 1px solid var(--border-color);
    padding: 8px 10px;
}

.markdown-body a {
    color: var(--primary-color);
    text-decoration: none;
}

.markdown-body a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .profile-card {
        padding: 12px 14px;
    }

    .profile-hero-inner {
        gap: 12px;
    }

    .profile-pic {
        width: 56px;
        height: 56px;
    }

    .profile-hero-text h1 {
        font-size: 1.12rem;
    }

    .profile-tagline {
        font-size: 0.82rem;
    }

    .search-container {
        align-items: stretch;
    }

    .search-form {
        width: 100%;
        flex-direction: row;
        align-items: stretch;
    }

    .search-form button {
        width: auto;
    }

    .home-top-bar {
        flex-direction: column;
        align-items: center;
        padding: 15px;
        gap: 15px;
    }
}
