/* --- 基础与重置 --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* --- 浓郁粉色主题 --- */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #334155;
    line-height: 1.7;
    
    background: linear-gradient(135deg, #FADADD, #FFF0F5);
    background-size: 400% 400%;
    animation: gradient-animation 20s ease infinite;
    min-height: 100vh;
}

/* 动态背景动画 */
@keyframes gradient-animation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}


/* --- 樱花飘落特效 --- */
.sakura-petals {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.petal {
    position: absolute;
    top: -50px;
    background-image: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50"><path d="M25 0 C45 10 50 30 50 50 C30 50 15 45 0 50 C0 30 5 10 25 0 Z" fill="%23FCC7D6"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    animation: fall linear infinite;
}

@keyframes fall {
    to {
        transform: translateY(105vh) rotate(720deg);
    }
}


/* --- 布局容器 --- */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* --- 头部与页脚 --- */
.site-header, .site-footer {
    text-align: center;
    padding: 20px 0;
    position: relative;
    z-index: 1;
}

.site-header h1 {
    font-family: 'Inter', sans-serif;
    font-size: 2.5rem;
    color: #583749;
    margin-bottom: 0.5rem;
}

.site-footer {
    margin-top: 40px;
    font-size: 0.9rem;
    color: #64748b;
}

/* --- 文章卡片样式 --- */
.post-card {
    display: block;
    text-decoration: none;
    color: #334155;
    margin-bottom: 2rem;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: #ffffff;
    border: 1px solid #FBCFE8;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -2px rgba(0,0,0,0.05);
}

.post-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 15px -3px rgba(131, 83, 103, 0.1), 0 4px 6px -4px rgba(131, 83, 103, 0.1);
}

.post-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease-out;
}

.post-card:hover img {
    transform: scale(1.05);
}

.post-card-content {
    padding: 1.5rem;
}

.post-card-content h2 {
    font-family: 'Inter', sans-serif;
    color: #583749;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.post-card-content .meta {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 1rem;
}

.post-card-content p {
    font-size: 1rem;
}

.post-card-content h2:hover {
    color: #db2777;
}

/* --- 文章页面专属样式 --- */
.post-header {
    text-align: center;
    margin-bottom: 3rem;
}

#post-hero-image {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 12px;
    margin-top: 2rem;
    transition: transform 0.4s ease-out, box-shadow 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

#post-hero-image:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.post-content {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    border: 1px solid #FBCFE8;
    padding: 2rem 2.5rem;
    border-radius: 12px;
}

/* 【新增】文章内图片的样式 */
.post-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 2rem auto; /* 上下边距，并水平居中 */
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    cursor: zoom-in;
    transition: transform 0.3s ease;
}

.post-content img:hover {
    transform: scale(1.02);
}


.post-content h2,
.post-content h3,
.post-content h4 {
    font-family: 'Inter', sans-serif;
    color: #583749;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.post-content h2 { font-size: 1.8rem; border-bottom: 1px solid #FBCFE8; padding-bottom: 0.5rem; }
.post-content h3 { font-size: 1.5rem; }
.post-content p { margin-bottom: 1.2rem; }
.post-content a { color: #db2777; text-decoration: none; }
.post-content a:hover { text-decoration: underline; }
.post-content ul, .post-content ol { padding-left: 2rem; margin-bottom: 1.2rem; }
.post-content li { margin-bottom: 0.5rem; }

.post-content blockquote {
    border-left: 4px solid #db2777;
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    color: #64748b;
    font-style: italic;
}

.post-content pre {
    margin-bottom: 1.5rem;
    border-radius: 8px;
}
.post-content pre code {
    padding: 1rem;
    border-radius: 8px;
}

.back-link {
    display: inline-block;
    margin-bottom: 1rem;
    color: #db2777;
    text-decoration: none;
}

#pagination-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 3rem;
}

#pagination-nav a,
#pagination-nav span {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.2s ease, color 0.2s ease;
}

#pagination-nav a {
    color: #583749;
    background-color: rgba(255, 255, 255, 0.7);
    border: 1px solid #FBCFE8;
}

#pagination-nav a:hover {
    background-color: #db2777;
    color: #ffffff;
}

#pagination-nav span.active {
    background-color: #db2777;
    color: #ffffff;
    cursor: default;
}

.katex {
    font-size: 1.1em;
    color: #334155;
}

.post-header .meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
}

.post-number {
    font-size: 0.8rem;
    font-weight: 500;
    color: #db2777;
    background-color: #FCE7F3;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
}

.post-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #FBCFE8;
}

.nav-link a {
    display: block;
    padding: 1rem;
    border: 1px solid #FBCFE8;
    border-radius: 12px;
    text-decoration: none;
    transition: background-color 0.2s ease, transform 0.2s ease;
    height: 100%;
}

.nav-link a:hover {
    background-color: rgba(255, 255, 255, 0.8);
    transform: translateY(-3px);
}

.nav-link.next {
    text-align: right;
}

.nav-label {
    font-size: 0.8rem;
    color: #64748b;
    display: block;
    margin-bottom: 0.25rem;
}

.nav-title {
    font-weight: 500;
    color: #583749;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.references-collapsible {
    margin-top: 2.5rem;
    border-top: 1px solid #FBCFE8;
}

.references-toggle {
    background: none;
    border: none;
    padding: 1.5rem 0 1rem 0;
    width: 100%;
    text-align: left;
    font-family: 'Inter', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #583749;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.references-toggle .arrow {
    width: 1.2em;
    height: 1.2em;
    transition: transform 0.3s ease;
}

.references-collapsible.is-open .references-toggle .arrow {
    transform: rotate(90deg);
}

.references-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
}

.references-collapsible.is-open .references-panel {
    max-height: 2000px;
    transition: max-height 0.6s ease-in;
}

.references-panel h2,
.references-panel p > strong {
    display: none;
}

/* --- 【新增】图片灯箱样式 --- */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(29, 25, 26, 0.85);
    display: none; /* 默认隐藏 */
    justify-content: center;
    align-items: center;
    z-index: 1000;
    cursor: zoom-out;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lightbox-image {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
    cursor: default;
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s ease;
}

.lightbox-close:hover {
    color: #FBCFE8;
}

