:root {
    --text: #000; --meta: #a3a3a3; --bg: #fff;
    --f-ui: -apple-system, system-ui, sans-serif;
    --f-ser: Georgia, serif;
}

/* 基础重置 */
body { 
    font-family: var(--f-ui); 
    margin: 0; 
    background: var(--bg); 
    color: var(--text); 
    -webkit-font-smoothing: antialiased; 
    line-height: 1.5;
}

.container { 
    width: 100%; 
    max-width: 732px; 
    padding: 20px 24px; /* 减小默认顶部边距 */
    box-sizing: border-box; 
    margin: 0 auto; 
}

/* 统一按钮样式：增加点击区域 */
button { 
    border: 1px solid var(--text); 
    background: none; 
    padding: 8px 16px; /* 增加点击感 */
    cursor: pointer; 
    border-radius: 6px; 
    font-size: 14px; 
    transition: all 0.2s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
button:hover { background: var(--text); color: #fff; }

/* 列表项样式优化 */
.post-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid #f2f2f2;
}

.post-info a {
    font-size: 1.15em;
    font-weight: 700;
    color: #000;
    text-decoration: none;
    display: block;
    margin-bottom: 4px;
}

.post-meta {
    color: var(--meta);
    font-size: 0.9em;
}

.post-actions {
    display: flex;
    gap: 8px;
}

/* 内容展示区 (article.html 用) */
#content {
    margin-top: 30px;
}
#content h1 { font-size: 2.2em; line-height: 1.2; margin-bottom: 8px; }

#c, #content { 
    font-family: var(--f-ser); 
    font-size: 1.25em; 
    line-height: 1.65; 
    word-wrap: break-word;
    outline: none;
}

/* 1. 统一段落边距 */
#c p, #content p, 
#c blockquote, #content blockquote,
#c div, #content div { 
    margin: 0 0 1.2em 0; 
    line-height: 1.65; /* 显式声明行高，防止被继承修改 */
}

/* 2. 统一引用样式 (修复失效问题) */
#c blockquote, #content blockquote { 
    border-left: 4px solid #eee; 
    padding-left: 18px; 
    color: #666; 
    font-style: italic; 
}

/* 3. 统一链接样式 (修复不一致问题) */
#c a, #content a { 
    color: #1a0dab; 
    text-decoration: underline; 
}

/* 4. 统一图片样式 */
#c img, #content img { 
    max-width: 65%; 
    height: auto; 
    display: block; 
    margin: 30px auto; 
    border-radius: 4px; 
}

#c img + p, #content img + p {
    margin-top: 1.2em;
}

#c {
    display: block;
}

/* 5. 映射 execCommand 生成的字号 (确保编辑器和文章同步) */
#c font[size="2"], #content font[size="2"] { font-size: 0.85em; } 
#c font[size="3"], #content font[size="3"] { font-size: 1em; } 
#c font[size="4"], #content font[size="4"] { font-size: 1.25em; }

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 10px;
}

.header-actions {
    display: flex;
    gap: 8px;
}

.post-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 0; /* 增加间距，手机端更好点 */
    border-bottom: 1px solid #f2f2f2;
}

.post-info {
    flex: 1;
    min-width: 0; /* 防止长标题撑破布局 */
    padding-right: 15px;
}

.post-info a {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* 长标题自动显示省略号 */
    display: block;
}

.footer {
    margin-top: 80px;
    padding-top: 40px;
    position: relative;
}

.footer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 50px; /* 线条只长 50 像素 */
    height: 2px;
    background: var(--text); /* 使用正文颜色，形成视觉重点 */
}

/* --- 移动端深度优化 --- */

@media (max-width: 600px) {
    .container {
        padding: 10px 16px;
    }

    .header {
        flex-direction: row; /* 保持标题和按钮在一行，但缩小字号 */
        padding: 15px 0;
    }

    .header h1 {
        font-size: 1.2rem;
    }

    /* 关键：手机端列表项改为垂直排列 */
    .post-item {
        flex-direction: column;
        align-items: flex-start;
        position: relative;
    }

    .post-info {
        width: 100%;
        margin-bottom: 12px;
        padding-right: 0;
    }

    /* 按钮组在手机端横向铺满或靠左 */
    .post-actions {
        width: 100%;
        display: flex;
        justify-content: flex-start;
        gap: 12px;
    }

    /* 增加手机端按钮的可点击尺寸 (44px 是移动端最佳实践) */
    .btn-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
        margin-left: 0; /* 移除 PC 端的 margin */
        background: #fafafa; /* 手机端增加浅色背景，视觉更明显 */
    }

    /* 让新建按钮在手机端更醒目 */
    #newPostBtn {
        padding: 6px 12px;
        font-size: 13px;
    }
}