/* 全局重置与基础样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }
html {
    scrollbar-gutter: stable;
}
body { 
    font-family: Helvetica, Tahoma, Arial, "PingFang SC", "Hiragino Sans GB", "Heiti SC", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif;
    background: #f8f9fa; 
    color: #333; padding: 20px; 
}
.container { max-width: 860px; margin: 0 auto; background: #fff; border-radius: 12px; box-shadow: 0 2px 12px rgba(0,0,0,0.08); padding: 30px 40px 15px 40px; }
h1.site-title { font-size: 18px; margin-bottom: 20px; border-bottom: 2px solid #e9ecef; padding-bottom: 15px; }
h1.site-title a { color: #1e90ff; text-decoration: none; }
.post-item { padding: 15px 0; border-bottom: 1px solid #f1f3f5; cursor: pointer; transition: background 0.15s; }
.post-item:hover { background: #f8f9fa; margin: 0 -10px; padding: 15px 10px; border-radius: 6px; }
.post-title { font-size: 16px; font-weight: 600; color: #1a1a2e; }
.post-meta {
    font-size: 12px;
    color: #868e96;
    margin-top: 8px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;  /* iOS 平滑滚动 */
    scrollbar-width: none;              /* Firefox 细滚动条 */
    padding-bottom: 2px;                /* 为滚动条留出空间 */
}
/* 滚动条样式（WebKit 浏览器） */
.post-meta::-webkit-scrollbar {
    height: 4px;
}

.post-meta::-webkit-scrollbar-track {
    background: transparent;
}

.post-meta::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

.post-meta::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* 每个信息项之间的分隔 */
.post-meta .meta-item {
    display: inline-block;
    margin-right: 8px;
}
.post-meta .meta-item:last-child {
    margin-right: 0;
}

/* 分隔点 */
.post-meta .meta-divider {
    color: #d1d5db;
    margin: 0 4px;
    user-select: none;
}
.post-detail { margin-top: 10px; padding: 15px 0; display: none; border-top: 2px dashed #e9ecef; }
.post-content { line-height: 1.8; font-size: 14px; }
.post-content img { max-width: 100%; height: auto; }
.post-content pre { background: #f1f3f5; padding: 12px; border-radius: 6px; overflow-x: auto; }
/* 评论区 */
.comment-section { margin-top: 25px; border-top: 1px solid #e9ecef; padding-top: 20px; }
.comment-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f1f3f5; }
.comment-avatar img { width: 40px; height: 40px; border-radius: 50%; background: #e9ecef; flex-shrink: 0; }
.comment-body { flex: 1; }
.comment-meta, .nickname { font-weight: bold; margin-right: 12px; }
.comment-meta {
    font-weight: 600;
    font-size: 14px;
}
/* @提及高亮 */
.mention {
    color: #ff7000;
    font-weight: 600;
}
.comment-meta time {
    font-size: 12px;
    color: #adb5bd;
    font-weight: 400;
}
.comment-content { margin-top: 4px; font-size: 13px;}
.comment-content-input { font-size: 12px;}
.comment-nickname, .comment-email, .comment-website { font-size: 12px;}
.reply-item {
    margin-left: 52px;
    padding-left: 12px;
    border-left: 1px solid #dfefff;
}
/* 评论表单 */
.comment-form { margin-top: 15px; background: #f8f9fa; padding: 15px 20px; border-radius: 8px; }
.comment-form textarea { width: 100%; min-height: 80px; padding: 10px; border: 1px solid #dee2e6; border-radius: 6px; font-family: inherit; resize: vertical; }
.comment-form .form-row { display: flex; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.comment-form .form-row input { flex: 1; min-width: 120px; padding: 8px 12px; border: 1px solid #dee2e6; border-radius: 6px; }
.comment-form button { margin-top: 12px; background: #1e90ff; color: #fff; border: none; padding: 8px 24px; border-radius: 6px; cursor: pointer; font-size: 15px; }
.comment-form button:hover { background: #0066cc; }
.loading { text-align: center; padding: 20px; color: #868e96; }
.error-msg { color: #dc3545; font-size: 14px; margin-top: 8px; }
#back-top { display: none; margin-bottom: 15px; background: none; border: none; color: #1e90ff; cursor: pointer; font-size: 14px; }
#back-top:hover { text-decoration: underline; }
/* 文章图片网格 */
.post-image-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 12px;
    width: 50%;
}
/* 小屏幕适配：宽度小于780px时，网格占满 */
@media (max-width: 779px) {
    .post-image-grid {
        width: 100%;
    }
}
.post-image-grid .thumb {
    cursor: pointer;
    overflow: hidden;
    border-radius: 8px;
    background: #f0f0f0;
}
.post-image-grid .thumb img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    display: block;
    transition: transform 0.2s;
}
.post-image-grid .thumb img:hover {
    transform: scale(1.03);
}
/* Toast 提示框样式 - 渐显渐隐 */
#toast-message {
    position:fixed;
    top:50%;
    left:50%;
    transform:translate(-50%,-50%) scale(0.95);
    background:rgb(16 24 17);;
    color:#fff;
    padding:10px 30px;
    border-radius:12px;
    font-size:14px;
    z-index:9999;
    text-align:center;
    box-shadow:0 4px 20px rgba(0,0,0,0.3);
    min-width:200px;
    backdrop-filter:blur(4px);
    opacity:0;
    pointer-events:none;
    transition:opacity 1s ease, transform 1s ease;
}
#toast-message.show {
    opacity:1;
    pointer-events:auto;
    transform:translate(-50%,-50%) scale(1);
}
/* 文章详情展开动画 */
.post-detail-wrapper {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.4s ease,
                margin-top 0.3s ease;
    margin-top: 0;
}

.post-detail-wrapper.open {
    opacity: 1;
    margin-top: 12px; /* 与原有 margin-top 一致 */
    /* max-height 由 JavaScript 动态设置 */
}

/* 内容加载时的 loading 样式 */
.post-detail-wrapper .loading {
    padding: 20px;
    text-align: center;
    color: #868e96;
}