/*
Theme Name: Weibo Blog
Theme URI: https://example.com/weibo-blog
Author: Your Name
Author URI: https://example.com
Description: 单栏微博风格个人博客主题，简洁清新，专注于内容阅读。
Version: 1.0
License: GPL v2 or later
Text Domain: weibo-blog
*/

/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

a { color: #eb7340; text-decoration: none; }
a:hover { color: #d45f2e; }

/* === Top Bar (微博风格顶部导航) === */
.site-header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    background: #fff;
    border-bottom: 1px solid #e6e6e6;
    height: 50px;
}

.header-inner {
    max-width: 800px; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
    height: 100%; padding: 0 16px;
}

.site-title { font-size: 18px; font-weight: 700; }
.site-title a { color: #eb7340; }
.site-title a:hover { color: #d45f2e; }

.header-right { display: flex; align-items: center; gap: 16px; }
.header-right a { font-size: 13px; color: #666; }
.header-right a:hover { color: #eb7340; }

.header-menu { display: flex; list-style: none; gap: 12px; }
.header-menu li a { font-size: 13px; color: #666; padding: 4px 8px; }
.header-menu li a:hover { color: #eb7340; }
.header-menu li.current-menu-item a { color: #eb7340; font-weight: 600; }

/* === Main Content Area === */
.main-content { margin-top: 50px; }

.container { max-width: 800px; margin: 0 auto; padding: 20px 16px; }

/* === Post Entry (微博风格卡片) === */
.post-card {
    background: #fff;
    border: 1px solid #e6e6e6;
    border-radius: 4px;
    margin-bottom: 16px;
    padding: 20px;
    transition: box-shadow 0.2s;
    overflow: hidden;
}
.post-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }

/* 发布器风格头部 */
.post-header {
    display: flex; align-items: flex-start; gap: 12px;
    margin-bottom: 12px;
}

.avatar {
    width: 48px; height: 48px; border-radius: 50%;
    background: #f0f0f0; flex-shrink: 0;
    overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.post-meta { flex: 1; min-width: 0; }
.post-author { font-size: 15px; font-weight: 600; color: #333; }
.post-date { font-size: 12px; color: #999; margin-top: 2px; }

/* Post body */
.post-body { margin-bottom: 12px; }
.post-title {
    font-size: 18px; font-weight: 700; margin-bottom: 8px;
}
.post-title a { color: #333; }
.post-title a:hover { color: #eb7340; }

.post-excerpt { font-size: 14px; color: #555; line-height: 1.8; }
.post-excerpt p { margin-bottom: 8px; }

/* Post body - 限制子元素宽度一致 */
.post-body > *,
.post-content > * {
    max-width: 100%;
}

.post-thumbnail { margin-bottom: 12px; }
.post-thumbnail img { width: 100%; height: auto; border-radius: 4px; display: block; }

/* Post actions (微博操作栏) */
.post-actions {
    display: flex; align-items: center; gap: 24px;
    padding-top: 12px; border-top: 1px solid #f0f0f0;
    font-size: 13px; color: #999;
}
.post-actions a { color: #999; display: flex; align-items: center; gap: 4px; }
.post-actions a:hover { color: #eb7340; }

.read-more { margin-left: auto; color: #eb7340 !important; font-weight: 500; }

/* === Single Post === */
.single-post-card {
    background: #fff;
    border: 1px solid #e6e6e6;
    border-radius: 4px;
    padding: 24px 20px;
    margin-bottom: 16px;
    overflow: hidden;
}

.single-post-card .post-title {
    font-size: 24px; margin-bottom: 16px;
}

.post-content {
    font-size: 15px; line-height: 1.9; color: #444;
    text-align: justify;
}
.post-content p { margin-bottom: 16px; }
.post-content img { width: 100%; height: auto; border-radius: 4px; margin: 12px 0; display: block; }
.post-content h2, .post-content h3 { margin: 24px 0 12px; color: #333; }
.post-content blockquote {
    border-left: 4px solid #eb7340; margin: 16px 0;
    padding: 12px 16px; background: #fafafa; color: #666;
}
.post-content ul, .post-content ol { margin: 12px 0; padding-left: 24px; }
.post-content code {
    background: #f0f0f0; padding: 2px 6px; border-radius: 3px;
    font-size: 13px;
}
.post-content pre code { background: none; padding: 0; }

.post-tags { margin-top: 20px; display: flex; gap: 8px; flex-wrap: wrap; }
.post-tags a {
    display: inline-block; padding: 3px 10px;
    background: #f5f5f5; color: #666; font-size: 12px; border-radius: 3px;
}
.post-tags a:hover { background: #eb7340; color: #fff; }

/* === Navigation === */
.post-navigation {
    display: flex; justify-content: space-between;
    margin-bottom: 16px; gap: 8px;
}
.post-navigation a {
    flex: 1; background: #fff; border: 1px solid #e6e6e6;
    border-radius: 4px; padding: 12px 16px; font-size: 13px; color: #666;
}
.post-navigation a:hover { border-color: #eb7340; color: #eb7340; }
.nav-next { text-align: right; }

/* === Pagination (微博加载更多风格) === */
.pagination {
    text-align: center; padding: 20px 0;
}
.pagination .page-numbers {
    display: inline-block; padding: 6px 14px;
    border: 1px solid #e6e6e6; border-radius: 3px;
    background: #fff; color: #666; font-size: 13px; margin: 0 2px;
}
.pagination .page-numbers.current {
    background: #eb7340; color: #fff; border-color: #eb7340;
}
.pagination a.page-numbers:hover { border-color: #eb7340; color: #eb7340; }

/* === Comments (微博评论风格) === */
.comments-area {
    background: #fff; border: 1px solid #e6e6e6;
    border-radius: 4px; padding: 20px; margin-bottom: 16px;
}
.comments-title { font-size: 16px; font-weight: 600; margin-bottom: 16px; }

.comment-list { list-style: none; }
.comment { margin-bottom: 16px; }
.comment-body { display: flex; gap: 12px; }
.comment-author .avatar { width: 36px; height: 36px; border-radius: 50%; }
.comment-meta { font-size: 12px; color: #999; margin-bottom: 4px; }
.comment-author .fn { font-size: 14px; font-weight: 600; color: #333; font-style: normal; }
.comment-content { font-size: 14px; color: #444; line-height: 1.7; }
.reply a { font-size: 12px; color: #999; }
.reply a:hover { color: #eb7340; }
.children { list-style: none; padding-left: 48px; margin-top: 12px; }

.comment-respond { margin-top: 24px; }
.comment-reply-title { font-size: 15px; font-weight: 600; margin-bottom: 12px; }
.comment-form label { display: block; font-size: 13px; color: #666; margin-bottom: 4px; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%; padding: 8px 12px; border: 1px solid #e6e6e6;
    border-radius: 3px; font-size: 14px; font-family: inherit;
    margin-bottom: 12px;
}
.comment-form textarea { min-height: 100px; resize: vertical; }
.comment-form input:focus, .comment-form textarea:focus {
    outline: none; border-color: #eb7340;
}
.form-submit .submit {
    background: #eb7340; color: #fff; border: none;
    padding: 8px 24px; border-radius: 3px; font-size: 14px; cursor: pointer;
}
.form-submit .submit:hover { background: #d45f2e; }

/* === Sidebar (Widgets 区域) === */
.widget-area { margin-bottom: 16px; }
.widget {
    background: #fff; border: 1px solid #e6e6e6;
    border-radius: 4px; padding: 16px 20px; margin-bottom: 12px;
}
.widget-title {
    font-size: 14px; font-weight: 600; color: #333;
    padding-bottom: 8px; margin-bottom: 12px;
    border-bottom: 2px solid #eb7340;
}
.widget ul { list-style: none; }
.widget ul li { padding: 6px 0; border-bottom: 1px solid #f0f0f0; font-size: 13px; }
.widget ul li:last-child { border-bottom: none; }
.widget ul li a { color: #666; }
.widget ul li a:hover { color: #eb7340; }
.widget select { width: 100%; padding: 6px; border: 1px solid #e6e6e6; border-radius: 3px; }

/* === Footer === */
.site-footer {
    text-align: center; padding: 24px 16px;
    font-size: 12px; color: #999;
}

/* === Responsive === */
@media (max-width: 600px) {
    .container { padding: 12px; }
    .post-card { padding: 16px; }
    .single-post-card { padding: 16px; }
    .avatar { width: 36px; height: 36px; }
    .post-actions { gap: 12px; flex-wrap: wrap; }
    .post-title { font-size: 16px; }
    .single-post-card .post-title { font-size: 20px; }
    .children { padding-left: 24px; }
}

/* === 前端发布文章 === */
.publish-card { padding: 24px; }
.publish-success { background: #f0faf0; border: 1px solid #c3e6c3; border-radius: 4px; padding: 16px; margin-bottom: 12px; }
.publish-success a { color: #eb7340; font-weight: 500; }
.publish-error { background: #fef2f2; border: 1px solid #fecaca; border-radius: 4px; padding: 12px; margin-bottom: 12px; color: #b91c1c; }

.publish-field { margin-bottom: 12px; }
.publish-field input[type="text"],
.publish-field textarea {
    width: 100%; padding: 10px 14px; border: 1px solid #e6e6e6;
    border-radius: 4px; font-size: 14px; font-family: inherit;
    transition: border-color 0.2s;
}
.publish-field input[type="text"]:focus,
.publish-field textarea:focus { outline: none; border-color: #eb7340; }
.publish-field input[type="text"] { font-size: 18px; font-weight: 600; }
.publish-field textarea { resize: vertical; min-height: 120px; }

.image-upload-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px; border: 1px dashed #ccc; border-radius: 4px;
    color: #666; font-size: 13px; cursor: pointer; transition: all 0.2s;
}
.image-upload-btn:hover { border-color: #eb7340; color: #eb7340; }

.image-count { font-size: 12px; color: #999; margin-top: 6px; }
.image-count span { font-weight: 600; color: #333; }

.image-preview-grid {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 8px; margin-top: 8px;
}
.preview-item {
    aspect-ratio: 1; border-radius: 4px; overflow: hidden;
    border: 1px solid #e6e6e6;
}
.preview-item img { width: 100%; height: 100%; object-fit: cover; display: block; }

.publish-actions { display: flex; justify-content: flex-end; padding-top: 12px; border-top: 1px solid #f0f0f0; }
.publish-submit {
    background: #eb7340; color: #fff; border: none;
    padding: 10px 32px; border-radius: 4px; font-size: 15px;
    font-weight: 600; cursor: pointer; transition: background 0.2s;
}
.publish-submit:hover { background: #d45f2e; }

/* === 归档模板 === */
.archive-year { margin-bottom: 24px; }
.archive-year-title {
    font-size: 22px; font-weight: 700; color: #333;
    padding-bottom: 8px; margin-bottom: 16px;
    border-bottom: 2px solid #eb7340;
}
.archive-month { margin-bottom: 16px; }
.archive-month-title {
    font-size: 16px; font-weight: 600; color: #999;
    margin-bottom: 12px;
}

.archive-list { list-style: none; }
.archive-list li {
    padding: 4px 0;
    font-size: 14px;
}
.archive-list a { color: #eb7340; }
.archive-list a:hover { color: #d45f2e; }
