/* ==========================================================================
   mmtx 主题全局样式表｜首页+详情+评论 移动端全修复
   版本: 1.0.3
   适用程序: Typecho 1.3.0
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f4f6f9;
    color: #333;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
a {
    text-decoration: none;
    color: inherit;
}
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 2. 页面主体架构 */
.main-container {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    gap: 20px;
}

/* 3. 左侧导航栏 */
.sidebar-nav {
    width: 80px;
    background: #ffffff;
    border-radius: 12px;
    padding: 20px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    height: fit-content;
    flex-shrink: 0;
}
.logo-box a {
    display: block;
    width: 42px;
    height: 42px;
    background: #0066ff;
    color: #ffffff;
    border-radius: 10px;
    text-align: center;
    line-height: 42px;
    font-weight: bold;
    font-size: 18px;
    margin-bottom: 20px;
    transition: transform 0.2s ease;
}
.logo-box a:hover {
    transform: scale(1.05);
}
.nav-menu {
    width: 100%;
}
.nav-menu a {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 0;
    font-size: 12px;
    color: #666666;
    border-radius: 8px;
    transition: all 0.2s ease;
}
.nav-menu a .icon {
    font-size: 18px;
    margin-bottom: 4px;
}
.nav-menu a.active,
.nav-menu a:hover {
    color: #0066ff;
    background-color: #f0f6ff;
}

/* 4. 中间主内容区 */
.content-area {
    flex: 1;
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    min-width: 0;
}

/* 首页：分类标签筛选条 */
.filter-tags {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}
.tag-item {
    padding: 6px 16px;
    background: #f0f2f5;
    border-radius: 20px;
    font-size: 13px;
    color: #666666;
    transition: all 0.2s ease;
}
.tag-item.active,
.tag-item:hover {
    background: #e6f0ff;
    color: #0066ff;
}

/* 首页文章列表卡片 */
.post-card {
    display: flex;
    justify-content: space-between;
    padding: 20px 0;
    border-bottom: 1px solid #f0f0f0;
    gap: 20px;
    align-items: center;
}
.post-card:last-child {
    border-bottom: none;
}
.post-info {
    flex: 1;
    min-width: 0;
}
.post-title {
    font-size: 18px;
    margin-bottom: 8px;
    font-weight: 600;
    line-height: 1.45;
}
.post-title a {
    color: #222222;
    transition: color 0.2s;
}
.post-title a:hover {
    color: #0066ff;
}
.post-excerpt {
    font-size: 14px;
    color: #666666;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.6;
}
.post-meta {
    font-size: 12px;
    color: #999999;
    display: flex;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
}
.post-thumb img {
    width: 140px;
    height: 90px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

/* 分页 */
.pagination {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}
.pagination .page-navigator {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}
.pagination .page-navigator li {
    display: inline-block;
    margin: 0;
    padding: 0;
}
.pagination .page-navigator li a,
.pagination .page-navigator li span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border-radius: 8px;
    font-size: 13px;
    color: #555555;
    background-color: #f5f7fa;
    transition: all 0.2s ease;
    text-decoration: none;
}
.pagination .page-navigator li a:hover {
    background-color: #e6f0ff;
    color: #0066ff;
}
.pagination .page-navigator li.current a,
.pagination .page-navigator li.current span {
    background-color: #0066ff;
    color: #ffffff;
    font-weight: 600;
}

/* 右侧侧边栏挂件 */
.sidebar-widget {
    width: 280px;
    flex-shrink: 0;
}
.widget {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}
.profile-widget {
    text-align: center;
}
.profile-widget .avatar img {
    border-radius: 50%;
    margin: 0 auto 10px;
    width: 64px;
    height: 64px;
}
.profile-widget h3 {
    font-size: 16px;
    color: #222222;
    margin-bottom: 4px;
}
.profile-widget p {
    font-size: 13px;
    color: #888888;
}
.action-btns {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}
.action-btns a {
    display: inline-block;
    padding: 6px 18px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    text-align: center;
    transition: opacity 0.2s;
}
.action-btns a:hover {
    opacity: 0.85;
}
.btn-primary {
    background: #0066ff;
    color: #ffffff;
}
.btn-outline {
    background: #ffffff;
    color: #333333;
    border: 1px solid #d0d5dd;
}
.btn-outline:hover {
    background: #f5f7fa;
}
.widget-title {
    font-size: 15px;
    margin-bottom: 12px;
    color: #222222;
    font-weight: 600;
}
.widget-list {
    list-style: none;
    font-size: 13px;
    line-height: 2;
    color: #555555;
}
.widget-list li {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.widget-list a:hover {
    color: #0066ff;
}

/* ========== 文章详情页 post.php ========== */
.article-detail .article-title {
    font-size: 24px;
    margin-bottom: 12px;
    color: #111111;
    word-break: break-all;
}
.article-detail .post-meta {
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap:12px;
}
.article-content {
    font-size: 16px;
    color: #333333;
    line-height: 1.8;
}
.article-content p {
    margin-bottom: 16px;
}
/* 文章内图片防止溢出 */
.article-content img {
    border-radius: 8px;
}
.article-tags {
    margin-top: 30px;
    font-size:14px;
    color:#555;
}

/* ========== 评论区 comments.php ========== */
#comments {
    margin-top: 40px;
    border-top: 1px solid #f0f0f0;
    padding-top: 24px;
}
.comments-title {
    margin-bottom:16px;
    font-size:17px;
}
.comment-list {
    list-style: none;
    margin-bottom: 24px;
}
.comment-list > li {
    padding: 8px 0;
    border-bottom: 1px dashed #f0f0f0;
    font-size: 14px;
}

/* 评论卡片布局 左头像右内容 */
.comment-item-card {
    display: flex;
    gap: 12px;
    padding: 10px 0;
}
.comment-avatar-thumb img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: block;
    object-fit: cover;
    flex-shrink:0;
}
.comment-info-body {
    flex: 1;
    min-width: 0;
}
.comment-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}
.comment-author-name {
    font-weight: 600;
    color: #222222;
}
.comment-time {
    color: #999999;
    font-size: 12px;
}
.comment-reply-btn {
    margin-left: auto;
}
.comment-reply-btn a {
    color: #0066ff;
    text-decoration: none;
    font-size: 13px;
}
.comment-reply-btn a:hover {
    text-decoration: underline;
}
.comment-awaiting-moderation {
    color: #d97706;
    font-size: 12px;
    margin-bottom: 4px;
}
.comment-text-content {
    font-size: 14px;
    line-height: 1.65;
    color: #333333;
    overflow-wrap: anywhere;
    word-break: break-word;
}
/* 子评论嵌套 */
.comment-children {
    margin-left: 40px;
}
.comment-children .comment-item-card {
    border-top: 1px dashed #f0f0f0;
}

/* 发表评论表单 */
.respond {
    margin-top: 24px;
    background: #f9fafb;
    padding: 22px;
    border-radius: 10px;
}
.respond-title {
    margin-bottom:14px;
    font-size:16px;
}
.cancel-comment-reply {
    margin-bottom:10px;
}
.respond-logged {
    font-size:14px;
    margin-bottom:12px;
}
.respond-fields {
    display: flex;
    flex-direction: column;
    gap:10px;
    margin-bottom:12px;
}
.respond input[type="text"],
.respond input[type="email"],
.respond input[type="url"],
.respond textarea {
    width: 100%;
    padding: 11px;
    border: 1px solid #e2e8f0;
    border-radius: 7px;
    font-size: 14px;
    outline: none;
    background:#fff;
}
.respond textarea {
    resize: vertical;
}
.respond input:focus,
.respond textarea:focus {
    border-color: #0066ff;
}
.submit {
    margin-top:8px;
    padding:9px 22px;
    background:#0066ff;
    color:#fff;
    border:none;
    border-radius:7px;
    font-size:14px;
    cursor:pointer;
}
.submit:hover {
    opacity:0.92;
}
.respond-closed {
    color:#888;
    padding:10px 0;
}

/* 页脚 */
.footer {
    text-align: center;
    padding: 24px;
    font-size: 12px;
    color: #999999;
}

/* 登录提示 */
.login-prompt {
    text-align: center;
}
.logged-info {
    text-align: center;
    font-size: 14px;
    color: #222222;
    font-weight: 500;
    margin-bottom: 16px;
}
.login-prompt h3 {
    font-size: 16px;
    color: #222222;
    margin-bottom: 6px;
}
.login-prompt p {
    font-size: 13px;
    color: #888888;
    margin-bottom: 16px;
}
.login-btn {
    display: inline-block;
    padding: 8px 28px;
    background: #e5484d;
    color: #ffffff;
    border-radius: 6px;
    font-size: 14px;
    text-decoration: none;
    transition: opacity 0.2s;
}
.login-btn:hover {
    opacity: 0.85;
}

/* =============================================
        移动端 900px ｜首页 / 详情 / 评论
============================================= */
@media (max-width: 900px) {
    .main-container {
        flex-direction: column;
        padding: 10px;
        gap: 12px;
    }

    /* 顶部导航横向 */
    .sidebar-nav {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        padding: 10px 12px;
    }
    .logo-box a {
        margin-bottom: 0;
        width: 36px;
        height: 36px;
        line-height: 36px;
        font-size: 16px;
    }
    .nav-menu {
        display: flex;
        gap: 6px;
        width: auto;
    }
    .nav-menu a {
        padding: 6px 8px;
        flex-direction: row;
        gap: 3px;
        font-size: 11px;
    }
    .nav-menu a .icon {
        font-size: 16px;
        margin-bottom: 0;
    }

    .sidebar-widget {
        width: 100%;
    }

    /* ----首页列表卡片：手机上下堆叠布局---- */
    .post-card {
        flex-direction: column-reverse;
        align-items: flex-start;
        gap:12px;
        padding:16px 0;
    }
    .post-thumb {
        width:100%;
    }
    .post-thumb img {
        width:100%;
        height:160px;
    }

    .content-area {
        padding: 16px;
    }

    /* ----文章详情页适配---- */
    .article-detail .article-title {
        font-size: 20px;
    }
    .article-content {
        font-size:15px;
    }

    /* ----评论区手机端重点修复---- */
    /* 子评论缩进大幅减小，避免内容被挤没 */
    .comment-children {
        margin-left: 14px;
    }
    .comment-item-card {
        gap: 8px;
        padding:8px 0;
    }
    .comment-avatar-thumb img {
        width: 36px;
        height: 36px;
    }

    /* 评论表单缩小边距 */
    .respond {
        padding:14px;
    }
}

/* =============================================
        超小手机屏幕 480px
============================================= */
@media (max-width: 480px) {
    .filter-tags {
        gap:6px;
    }
    .tag-item {
        padding:4px 10px;
        font-size:12px;
    }
    .post-title {
        font-size:16px;
    }
    .post-meta {
        gap:8px;
    }
    .article-detail .article-title {
        font-size:18px;
    }
    .content-area {
        padding:12px;
    }
}
