/*
Theme Name: 简书风格主题
Theme URI: https://github.com/jianshu-theme
Author: Your Name
Author URI: https://yourwebsite.com
Description: 一个仿简书风格的WordPress主题，简约清新，以内容为中心，适合博客和创作社区
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: jianshu-theme
Tags: blog, one-column, two-columns, right-sidebar, custom-logo, responsive, clean, minimal
*/

/* ===== 全局重置与基础样式 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

a {
    color: #333;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #2271b1;
}

img {
    max-width: 100%;
    height: auto;
}

/* ===== 布局容器 ===== */
.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 calc((100% - 1180px) / 2);
}

.main-wrapper {
    display: flex;
    gap: 0;
    padding-top: 20px;
    padding-bottom: 40px;
}

.main-content {
    flex: 1;
    min-width: 0;
    max-width: 807px;
}

.sidebar {
    width: 280px;
    flex-shrink: 0;
    margin-left: 8.16667%;
}

/* ===== 顶部导航栏 ===== */
.site-header {
    background: #fff;
    box-shadow: none;
    border-bottom: 1px solid #f0f0f0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 calc((100% - 1180px) / 2);
}

@media screen and (max-width: 1024px) {
    .header-inner {
        padding: 0 20px;
    }
}

@media screen and (max-width: 768px) {
    .header-inner {
        padding: 0 15px;
    }
}

.site-logo {
    font-size: 20px;
    font-weight: 500;
    color: #2271b1;
    display: flex;
    align-items: center;
    gap: 4px;
}

.site-logo:hover {
    color: #2271b1;
}

.site-logo i {
    font-size: 24px;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 25px;
}

.main-nav a {
    color: #666;
    font-size: 15px;
    font-weight: 400;
    padding: 18px 0;
    display: block;
    position: relative;
}

.main-nav a::after {
    display: none;
}

.main-nav a:hover {
    color: #2271b1;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-form {
    display: flex;
    align-items: center;
    background: #f5f5f5;
    border-radius: 20px;
    padding: 6px 15px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.search-form:focus-within {
    background: #fff;
    border-color: #2271b1;
}

.search-input {
    border: none;
    background: transparent;
    padding: 4px;
    outline: none;
    width: 150px;
    font-size: 14px;
    color: #333;
}

.search-input::placeholder {
    color: #999;
}

.search-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    padding: 4px;
}

.write-btn {
    background: #2271b1;
    color: #fff;
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
}

.write-btn:hover {
    background: #ec6149;
    color: #fff;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    cursor: pointer;
    border: 1px solid #f0f0f0;
}

/* ===== 文章卡片列表 ===== */
.posts-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: #fff;
}

.post-card {
    background: #fff;
    border-radius: 0;
    padding: 20px 0;
    box-shadow: none;
    transition: background 0.2s ease;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    margin: 0;
}

.post-card:hover {
    background: #fafafa;
    box-shadow: none;
    transform: none;
}

.post-card:last-child {
    border-bottom: none;
}

.post-card-inner {
    display: flex;
    gap: 15px;
    align-items: flex-start;
    margin: 0;
}

.post-content {
    flex: 1;
    min-width: 0;
}

.post-title {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin-bottom: 4px;
    line-height: 1.5;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.post-title:hover {
    color: #000;
}

.post-excerpt {
    color: #999;
    font-size: 13px;
    line-height: 1.7;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-thumbnail {
    width: 125px;
    height: 100px;
    flex-shrink: 0;
    border-radius: 4px;
    overflow: hidden;
    background: #f5f5f5;
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}

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

.post-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: #999;
}

.post-author {
    display: flex;
    align-items: center;
    gap: 4px;
}

.author-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid #f0f0f0;
}

.author-name {
    color: #333;
    font-size: 12px;
}

.author-name:hover {
    color: #2271b1;
}

.post-stats {
    display: flex;
    gap: 10px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 3px;
    color: #999;
    font-size: 12px;
}

.stat-item i {
    font-size: 12px;
}

.post-time {
    color: #999;
    font-size: 12px;
}

.post-tag {
    display: none;
}

/* ===== 侧边栏 ===== */
.sidebar-widget {
    background: #fff;
    border-radius: 0;
    padding: 15px 0;
    margin-bottom: 0;
    box-shadow: none;
    border: none;
    border-bottom: 1px solid #f0f0f0;
}

.sidebar-widget:last-child {
    border-bottom: none;
}

.widget-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.download-app {
    text-align: center;
    padding: 15px 10px;
}

.download-app img {
    width: 150px;
    height: auto;
    margin-bottom: 8px;
}

.download-text {
    color: #999;
    font-size: 13px;
}

.hot-posts-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hot-post-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 0;
    border-bottom: none;
}

.hot-post-item:last-child {
    border-bottom: none;
}

.hot-rank {
    width: 18px;
    height: 18px;
    background: #2271b1;
    color: #fff;
    border-radius: 2px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
}

.hot-rank.rank-2, .hot-rank.rank-3 {
    background: #b4b4b4;
}

.hot-post-title {
    font-size: 13px;
    color: #333;
    line-height: 1.6;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hot-post-title:hover {
    color: #2271b1;
}

/* ===== 文章详情页 ===== */
.single-post-header {
    background: #fff;
    padding: 25px 0;
    margin-bottom: 0;
    box-shadow: none;
    border-bottom: 1px solid #f0f0f0;
}

.single-post-thumbnail {
    background: #fff;
    border-radius: 0;
    overflow: hidden;
    margin-bottom: 0;
    box-shadow: none;
}

.single-post-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
}

.single-title {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    line-height: 1.5;
    margin-bottom: 15px;
}

.single-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #999;
    font-size: 13px;
}

.author-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.author-avatar-large {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #f0f0f0;
}

.author-detail {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.author-name-large {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.author-name-large:hover {
    color: #2271b1;
}

.author-badge {
    font-size: 12px;
    color: #999;
}

.single-post-content {
    background: #fff;
    border-radius: 0;
    padding: 25px 0;
    box-shadow: none;
}

.single-post-content h2 {
    font-size: 20px;
    font-weight: 700;
    margin: 25px 0 12px;
    color: #333;
}

.single-post-content h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 20px 0 10px;
    color: #333;
}

.single-post-content p {
    margin-bottom: 15px;
    line-height: 2;
    color: #333;
    font-size: 16px;
}

.single-post-content img {
    display: block;
    margin: 20px auto;
    border-radius: 4px;
}

.single-post-content blockquote {
    border-left: 4px solid #2271b1;
    padding: 10px 15px;
    margin: 20px 0;
    color: #666;
    background: #f9f9f9;
    font-size: 15px;
}

.single-post-content pre {
    background: #f5f5f5;
    padding: 12px;
    border-radius: 4px;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.6;
}

.single-post-content code {
    background: #f5f5f5;
    padding: 2px 4px;
    border-radius: 2px;
    font-size: 13px;
}

.post-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 0;
    border-top: 1px solid #f0f0f0;
    margin-top: 25px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 13px;
    color: #666;
    background: #f5f5f5;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
}

.action-btn:hover {
    background: #2271b1;
    color: #fff;
}

.action-btn.liked {
    background: #2271b1;
    color: #fff;
}

.post-tags {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
}

.post-tags a {
    display: inline-block;
    padding: 3px 10px;
    margin: 5px 5px 5px 0;
    background: #f5f5f5;
    color: #666;
    border-radius: 15px;
    font-size: 12px;
}

.post-tags a:hover {
    background: #2271b1;
    color: #fff;
}

/* ===== 底部 ===== */
.site-footer {
    background: #fff;
    border-top: 1px solid #f0f0f0;
    padding: 25px 0;
    margin-top: 0;
}

.footer-content {
    text-align: center;
    color: #999;
    font-size: 13px;
    max-width: 100%;
    padding: 0 calc((100% - 1180px) / 2);
}

@media screen and (max-width: 1024px) {
    .footer-content {
        padding: 0 20px;
    }
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.footer-links a {
    color: #999;
    font-size: 13px;
}

.footer-links a:hover {
    color: #2271b1;
}

.copyright {
    color: #b4b4b4;
    font-size: 12px;
}

.icp-info {
    margin-top: 8px;
    font-size: 12px;
}

.icp-info a {
    color: #b4b4b4;
    transition: color 0.2s ease;
}

.icp-info a:hover {
    color: #2271b1;
}

/* ===== 分页 ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 20px 0;
    background: #fff;
    border-radius: 0;
    border-top: 1px solid #f0f0f0;
}

.page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    border-radius: 2px;
    background: #fff;
    color: #333;
    font-size: 14px;
    border: 1px solid #f0f0f0;
    transition: all 0.2s ease;
}

.page-numbers:hover {
    background: #f5f5f5;
    border-color: #2271b1;
    color: #2271b1;
}

.page-numbers.current {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
}

.nav-links {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 15px 0;
}

/* ===== 响应式设计 ===== */
@media screen and (max-width: 1024px) {
    .container {
        padding: 0 20px;
    }

    .main-wrapper {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        order: 1;
        margin-left: 0;
        margin-top: 15px;
    }

    .main-content {
        max-width: 100%;
    }
}

@media screen and (max-width: 768px) {
    .container {
        padding: 0 15px;
    }

    .header-inner {
        padding: 0 15px;
    }

    .main-nav {
        display: none;
    }

    .search-form {
        display: none;
    }

    .write-btn {
        padding: 6px 12px;
        font-size: 13px;
    }

    .post-card-inner {
        flex-direction: column;
    }

    .post-thumbnail {
        width: 100%;
        height: 160px;
        order: -1;
        margin-bottom: 10px;
    }

    .post-title {
        font-size: 16px;
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    .post-excerpt {
        font-size: 13px;
        -webkit-line-clamp: 2;
    }

    .post-meta {
        flex-wrap: wrap;
        gap: 8px;
    }

    .single-title {
        font-size: 20px;
    }

    .single-post-content {
        padding: 20px 0;
    }

    .single-post-content p {
        font-size: 15px;
    }

    .footer-links {
        flex-direction: column;
        gap: 8px;
    }
}

@media screen and (max-width: 480px) {
    .container {
        padding: 0 12px;
    }

    .site-logo {
        font-size: 18px;
    }

    .site-logo i {
        font-size: 20px;
    }

    .write-btn {
        padding: 5px 10px;
        font-size: 12px;
    }

    .post-card {
        padding: 15px 12px;
    }

    .post-title {
        font-size: 15px;
    }

    .post-excerpt {
        font-size: 12px;
    }

    .stat-item {
        font-size: 11px;
    }

    .single-title {
        font-size: 18px;
    }

    .single-post-content {
        padding: 15px 12px;
    }

    .single-post-content p {
        font-size: 14px;
    }

    .action-btn {
        padding: 5px 12px;
        font-size: 12px;
    }
}

/* ===== 加载动画 ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post-card {
    animation: fadeIn 0.5s ease forwards;
}

.post-card:nth-child(2) {
    animation-delay: 0.1s;
}

.post-card:nth-child(3) {
    animation-delay: 0.2s;
}

.post-card:nth-child(4) {
    animation-delay: 0.3s;
}

/* ===== 滚动条美化 ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* ===== 工具类 ===== */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.clearfix::after {
    content: '';
    display: table;
    clear: both;
}

/* ===== 补充样式优化 ===== */

/* 文章卡片无缩略图时的样式 */
.post-card-inner:not(:has(.post-thumbnail)) .post-content {
    max-width: 100%;
}

/* 作者名悬停效果 */
.author-name:hover {
    color: #2271b1;
}

/* 统计图标颜色 */
.stat-item i {
    color: #b4b4b4;
}

/* 文章内容链接 */
.single-post-content a {
    color: #3194d0;
    text-decoration: none;
}

.single-post-content a:hover {
    text-decoration: underline;
    color: #3194d0;
}

/* ===== 评论区域样式 ===== */
.comments-area {
    background: #fff;
    padding: 30px 0 10px;
    margin-top: 0;
    border-top: 1px solid #f0f0f0;
}

/* 评论表单 */
#respond {
    margin-bottom: 30px;
}

#respond h3,
.comments-title {
    font-size: 17px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e6e6e6;
    border-radius: 4px;
    font-size: 14px;
    color: #333;
    outline: none;
    transition: border-color 0.2s ease;
    background: #fafafa;
}

.comment-form input[type="text"]:focus,
.comment-form input[type="email"]:focus,
.comment-form input[type="url"]:focus {
    border-color: #2271b1;
    background: #fff;
}

.comment-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #e6e6e6;
    border-radius: 4px;
    font-size: 14px;
    color: #333;
    outline: none;
    transition: border-color 0.2s ease;
    resize: vertical;
    min-height: 100px;
    line-height: 1.7;
    background: #fafafa;
    font-family: inherit;
}

.comment-form textarea:focus {
    border-color: #2271b1;
    background: #fff;
}

.comment-form .form-submit {
    text-align: right;
    margin-top: 5px;
}

.comment-form .submit-btn,
.comment-form input[type="submit"] {
    display: inline-block;
    padding: 8px 24px;
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.comment-form .submit-btn:hover,
.comment-form input[type="submit"]:hover {
    background: #ec6149;
}

/* 评论列表 */
.comment-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0;
}

.comment-list .comment {
    padding: 16px 0 !important;
    border-bottom: 1px solid #f0f0f0;
    margin: 0 !important;
    list-style: none !important;
}

.comment-list .comment:last-child {
    border-bottom: none;
}

.comment-body {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.comment-list .children {
    list-style: none;
    padding: 0;
    margin: 0 0 0 52px;
}

.comment-list .children .comment {
    border-bottom: none;
    padding: 12px 0;
}

.comment-author-avatar {
    flex-shrink: 0;
    display: block !important;
    width: 38px;
    height: 38px;
    overflow: hidden;
}

.comment-author-avatar img {
    width: 38px !important;
    height: 38px !important;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #f0f0f0;
    display: block !important;
    min-width: 38px;
    min-height: 38px;
}

.demo-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: #2271b1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    flex-shrink: 0;
}

.demo-avatar-header {
    width: 32px;
    height: 32px;
    font-size: 14px;
    cursor: pointer;
}

.demo-avatar-sm {
    width: 20px;
    height: 20px;
    border: none;
}

/* 抽象几何图形头像 - 基于nth-child自动随机 */
.abstract-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

.abstract-avatar-header {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
    cursor: pointer;
}

.abstract-avatar svg {
    width: 100%;
    height: 100%;
    display: block;
}

.demo-avatar-lg {
    width: 48px;
    height: 48px;
    font-size: 20px;
}

.comment-content {
    flex: 1;
    min-width: 0;
}

.comment-author {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    display: inline-block;
}

.comment-author a {
    color: #333;
}

.comment-author a:hover {
    color: #2271b1;
}

.comment-time {
    font-size: 12px;
    color: #b4b4b4;
    margin-left: 8px;
}

.comment-awaiting-moderation {
    font-size: 12px;
    color: #2271b1;
    margin-left: 8px;
}

.comment-text {
    font-size: 14px;
    line-height: 1.8;
    color: #333;
    margin: 6px 0 0;
    word-break: break-word;
}

.comment-text p {
    margin: 0 0 8px;
}

.comment-text p:last-child {
    margin: 0;
}

.comment-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 8px;
}

.reply-link a {
    color: #999;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 3px;
    transition: color 0.2s ease;
}

.reply-link a:hover {
    color: #2271b1;
}

/* 评论分页 */
.comment-navigation {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 20px 0;
    margin-top: 10px;
}

.comment-navigation a {
    color: #999;
    font-size: 13px;
    padding: 4px 12px;
    border: 1px solid #f0f0f0;
    border-radius: 2px;
    transition: all 0.2s ease;
}

.comment-navigation a:hover {
    color: #2271b1;
    border-color: #2271b1;
}

.no-comments {
    color: #999;
    font-size: 14px;
    text-align: center;
    padding: 20px 0;
}

/* 取消回复链接 */
#cancel-comment-reply-link {
    color: #999;
    font-size: 13px;
    margin-left: 10px;
}

#cancel-comment-reply-link:hover {
    color: #2271b1;
}

/* 归档页面标题 */
.archive-header {
    background: #fff;
    padding: 20px 0;
    margin-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.archive-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.archive-description {
    color: #999;
    font-size: 14px;
    margin-top: 10px;
}

/* 搜索结果页面 */
.no-results {
    background: #fff;
    padding: 40px 20px;
    text-align: center;
}

.no-results h2 {
    font-size: 18px;
    color: #333;
    margin-bottom: 10px;
}

.no-results p {
    color: #999;
    font-size: 14px;
}

/* 文章卡片标题悬停 */
.post-title a:hover {
    color: #000;
}

/* 归档页面文章卡片 */
.archive .post-card {
    background: #fff;
}

/* 粘性文章样式 */
.sticky .post-card {
    border-left: 3px solid #2271b1;
}

/* 加载状态 */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* 空状态占位 */
.posts-list:empty::after {
    content: '暂无文章';
    display: block;
    text-align: center;
    color: #999;
    font-size: 14px;
    padding: 40px 0;
}

/* 文章卡片分隔线 */
.posts-list .post-card:not(:last-child) {
    border-bottom: 1px solid #f0f0f0;
}

/* 主内容区域 */
.main-content {
    background: #fff;
}

/* 侧边栏 */
.sidebar {
    background: #fff;
}

/* 热门文章标题悬停 */
.hot-post-title:hover {
    color: #2271b1;
}

/* 小工具区域间距 */
.sidebar-widget + .sidebar-widget {
    margin-top: 10px;
}