/* ==========================================================================
   mmtx 主题全局样式表
   版本: 1.1.0
   适用程序: Typecho 1.3.0
   ========================================================================== */

/* 1. 基础重置与全局变量 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #faf6ec;
    color: #333;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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;
}

.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;
}

.post-title {
    font-size: 18px;
    margin-bottom: 8px;
    font-weight: 600;
    line-height: 1.4;
}

.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: 15px;
    align-items: center;
}

.post-thumb img {
    width: 140px;
    height: 90px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

/* 5. 分页组件样式 */
.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;
}

.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 12px;
    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;
}

/* 6. 右侧小工具栏 (Sidebar) */
.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;
}

.action-btns button,
.action-btns a {
    display: inline-block;
    padding: 6px 18px;
    border-radius: 16px;
    border: none;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    text-align: center;
    transition: opacity 0.2s;
}

.action-btns button:hover,
.action-btns a:hover {
    opacity: 0.85;
}

.btn-primary {
    background: #0066ff;
    color: #ffffff;
}

.btn-secondary {
    background: #e6f0ff;
    color: #0066ff;
}

.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;
}

/* 7. 文章正文详情页 (post.php) 与评论区 */
.article-detail .article-title {
    font-size: 24px;
    margin-bottom: 10px;
    color: #111111;
}

.article-content {
    font-size: 15px;
    color: #333333;
    line-height: 1.8;
}

.article-content p {
    margin-bottom: 16px;
}

/* 评论区样式 */
#comments {
    margin-top: 40px;
    border-top: 1px solid #f0f0f0;
    padding-top: 20px;
}

.comment-list {
    list-style: none;
    margin-bottom: 20px;
}

.comment-list li {
    padding: 12px 0;
    border-bottom: 1px dashed #f0f0f0;
    font-size: 14px;
}

.respond {
    margin-top: 20px;
    background: #f9fafb;
    padding: 20px;
    border-radius: 8px;
}

.respond input[type="text"],
.respond input[type="email"],
.respond input[type="url"],
.respond textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
}

.respond input:focus,
.respond textarea:focus {
    border-color: #0066ff;
}

/* 8. 页脚与移动端适配 */
.footer {
    text-align: center;
    padding: 20px;
    font-size: 12px;
    color: #999999;
}

.footer-icp {
    margin-top: 6px;
}

.footer-icp a {
    color: #999999;
}

.footer-icp a:hover {
    color: #0066ff;
}

@media (max-width: 900px) {
    .main-container {
        flex-direction: column;
        padding: 10px;
    }

    .sidebar-nav {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        padding: 10px 15px;
    }

    .nav-menu {
        display: flex;
        gap: 10px;
        width: auto;
    }

    .nav-menu a {
        padding: 6px 12px;
        flex-direction: row;
        gap: 4px;
    }

    .sidebar-widget {
        width: 100%;
    }

    /* 手机端：文章卡片改为纵向排列，缩略图在上、文字在下 */
    .post-card {
        flex-direction: column-reverse;
        align-items: stretch;
        gap: 12px;
    }

    .post-thumb {
        width: 100%;
        flex-shrink: 1;
    }

    .post-thumb img {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }
}

/* ==========================================================================
   9. 评论卡片样式（左头像 + 右信息）
   ========================================================================== */
.comment-item-card {
    display: flex;
    gap: 12px;
    padding: 14px 0;
}

.comment-avatar-thumb img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: block;
    object-fit: cover;
}

.comment-info-body {
    flex: 1;
    min-width: 0;
}

.comment-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 4px;
}

.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.6;
    color: #333333;
}

.comment-children {
    margin-left: 40px;
}

.comment-children .comment-item-card {
    border-top: 1px dashed #f0f0f0;
}

/* ==========================================================================
   10. 登录引导卡片样式（未登录状态）
   ========================================================================== */
.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;
}

/* ==========================================================================
   11. 评论表单网格布局与移动端适配
   ========================================================================== */
.respond-fields {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 10px;
}

.comments-title {
    font-size: 17px;
    margin-bottom: 18px;
}

.respond {
    margin-top: 24px;
}

.respond-title {
    font-size: 16px;
    margin-bottom: 14px;
}

.respond-logged {
    font-size: 14px;
    margin-bottom: 12px;
}

.cancel-comment-reply {
    font-size: 13px;
    margin-bottom: 8px;
}

.respond-closed {
    color: #999999;
    font-size: 14px;
}

.submit {
    background: #0066ff;
    color: #ffffff;
    border: none;
    padding: 10px 28px;
    border-radius: 8px;
    font-size: 14.5px;
    cursor: pointer;
    transition: background .2s;
    font-family: inherit;
}

.submit:hover {
    background: #2f7ae8;
}

/* 评论分页 */
.comments-wrap .page-navigator {
    list-style: none;
    display: flex;
    gap: 6px;
    justify-content: center;
    padding: 10px 0;
}

.comments-wrap .page-navigator li a,
.comments-wrap .page-navigator li span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    padding: 0 10px;
    border-radius: 6px;
    font-size: 13px;
    color: #555;
    background: #f5f7fa;
    transition: all .2s;
}

.comments-wrap .page-navigator li a:hover {
    background: #e6f0ff;
    color: #0066ff;
}

.comments-wrap .page-navigator li.current span {
    background: #0066ff;
    color: #fff;
}

@media (max-width: 720px) {
    .respond-fields {
        grid-template-columns: 1fr;
    }
    .comment-children {
        margin-left: 16px;
    }
}

/* ==========================================================================
   12. 归档页样式
   ========================================================================== */
.archive-year {
    font-size: 18px;
    color: #0066ff;
    margin: 24px 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #f0f0f0;
}

.archive-month-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.archive-item {
    display: flex;
    align-items: baseline;
    gap: 14px;
    padding: 8px 0;
    font-size: 14px;
    border-bottom: 1px dashed #f5f5f5;
}

.archive-item:last-child {
    border-bottom: none;
}

.archive-date {
    color: #999;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

.archive-title-link {
    color: #333;
    transition: color .2s;
}

.archive-title-link:hover {
    color: #0066ff;
}

/* ==========================================================================
   13. 友情链接页样式
   ========================================================================== */
.links-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.link-card {
    background: #ffffff;
    border: 1px solid #f0f0f0;
    border-radius: 10px;
    padding: 16px 18px;
    transition: all 0.2s ease;
}

.link-card:hover {
    border-color: #e6f0ff;
    box-shadow: 0 4px 14px rgba(0, 102, 255, 0.06);
    transform: translateY(-2px);
}

.link-name {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 6px;
}

.link-name a {
    color: #222;
    transition: color 0.2s;
}

.link-name a:hover {
    color: #0066ff;
}

.link-desc {
    font-size: 13px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 8px;
}

.link-url {
    font-size: 12px;
    color: #999;
    font-family: ui-monospace, Menlo, Consolas, monospace;
}

/* 友链搜索框 */
.links-search input {
    background: #ffffff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.links-search input:focus {
    border-color: #0066ff !important;
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.08);
}

@media (max-width: 720px) {
    .links-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   14. 友链页居中优化（方案一）
   ========================================================================== */
.article-detail .article-title {
    text-align: center;
}

.links-header {
    text-align: center;
}

.links-exchange {
    text-align: center;
}

/* ==========================================================================
   15. 站点统计小工具样式（同一行紧凑版）
   ========================================================================== */
.stats-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 12px;
    row-gap: 2px;
    padding-top: 2px;
}

.stats-list li {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    font-size: 13px;
    color: #555;
    padding: 2px 0;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stats-label {
    color: #666;
    white-space: nowrap;
}

.stats-num {
    font-weight: 700;
    color: #e5484d;
    font-size: 14px;
    margin-left: 0;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

@media (max-width: 720px) {
    .stats-list {
        grid-template-columns: 1fr 1fr;
        column-gap: 10px;
        row-gap: 2px;
    }
}

/* ==========================================================================
   16. 最新评论：作者名与评论内容同行显示，超出自动换行
   ========================================================================== */

/* 只针对“最新评论”这个列表，覆盖全局 nowrap，允许换行 */
.recent-comments-list li {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.7;
}

/* 使用最朴素的 inline 文本流，让作者名和内容自然排在一条文本流里 */
.recent-comments-list li a {
    display: inline;                /* 关键：inline，不是 flex/block */
    white-space: normal;
    word-break: break-word;         /* 长英文/链接自动断行 */
    overflow-wrap: anywhere;
}

/* 作者名：加粗 + 蓝色，跟随文本流 */
.recent-comment-author {
    font-weight: 600;
    color: #0066ff;
}

/* 评论内容：跟随文本流，颜色稍淡 */
.recent-comment-text {
    color: #555;
}