/* 容器 */
.post-page-wrapper {
    max-width: 1140px;
    margin: 40px auto;
    display: flex;
    gap: 20px;
}

/* 左侧主内容 */
.post-main {
    flex: 7; /* 占 7 份 */
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.post-title {
    text-align: center;      /* 水平居中 */
    margin: 20px 0;          /* 上下间距，可根据需要调整 */
    font-size: 28px;         /* 字体大小，可调整 */
    font-weight: bold;       /* 加粗 */
    line-height: 1.4;        /* 行高 */
}

/* ====== 评论区整体 ====== */
.comments {
    margin-top: 40px;
}
.comments-icon {
    margin-right: 5px;
    cursor: none;
}
.comment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

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

.comment-list li {
    border-bottom: 1px solid #e0e0e0;
    padding: 10px 0;
}

.comment-author {
    font-weight: bold;
    margin-bottom: 4px;
}

.comment-meta {
    font-size: 12px;
    color: #888;
    margin-bottom: 6px;
}

.comment-content {
    white-space: pre-wrap;       /* 保留换行符 */
    word-break: break-word;       /* 超长单词自动换行 */
    overflow-wrap: break-word;    /* 新标准 */
    max-width: 100%;              /* 防止溢出父容器 */
}

.comment-content img.emoji {
    display: inline-block;
    max-width: 1.5em;   /* 控制 emoji 大小 */
    height: auto;
    vertical-align: middle;
}

/* 评论标题 */
.comment-reply-title {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
}

/* ====== 评论编辑器 ====== */
.comment-editor {
    position: relative;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fafafa;
    margin-top: 15px;
    overflow: hidden; /* 防止子元素超出 */
    transition: all 0.3s ease;
}

/* 编辑器获得焦点时，整个容器高亮 */
.comment-editor:focus-within {
    border-color: #409eff;
    box-shadow: 0 0 6px rgba(64, 158, 255, 0.3);
}

/* ====== 工具栏 ====== */
.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 8px;
    background: #f5f5f5;
    border-bottom: 1px solid #ddd;
    width: 100%;
    box-sizing: border-box;
}

/* 工具栏按钮样式 */
.editor-toolbar button,
.editor-toolbar select,
.editor-toolbar input[type="color"],
.editor-toolbar .emoji-btn {
    border: 1px solid #ccc;
    background: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}
.editor-toolbar button:hover,
.editor-toolbar select:hover,
.editor-toolbar input[type="color"]:hover,
.editor-toolbar .emoji-btn:hover {
    background: #eaeaea;
}
.emoji-btn {
    font-size: 18px;
    line-height: 1;
    padding: 4px 6px;
}

/* ====== 编辑区域 ====== */
.editor-content {
    min-height: 160px;
    padding: 12px;
    background: #fff;
    font-size: 15px;
    line-height: 1.6;
    outline: none;
    width: 100%;
    border: none;   /* 去掉自己边框 */
    border-radius: 0;
    box-sizing: border-box;
}

/* ====== emoji 面板 ====== */
.emoji-panel {
    position: absolute;
    top: 75px;   /* 紧贴工具栏下方 */
    left: 494px;
    border: 1px solid #ccc;
    background: #fff;
    padding: 8px;
    border-radius: 6px;
    display: none;
    z-index: 100;
    max-width: 220px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.emoji {
    cursor: pointer;
    font-size: 20px;
    margin: 4px;
    transition: transform 0.2s;
}
.emoji:hover {
    transform: scale(1.2);
}
/* HTML 源码 textarea 样式 */
#comment {
    width: 100%;          /* 占满编辑器宽度 */
    min-height: 200px;    /* 高度和编辑器差不多 */
    padding: 10px;
    font-size: 14px;
    line-height: 1.5;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-family: Arial, sans-serif;
    box-sizing: border-box;
    resize: vertical;     /* 可调节高度 */
}


/* ====== 剩余字符提示 ====== */
#char-count {
    margin-top: 4px;
    font-size: 12px;
    color: #666;
}

/* ====== HTML 切换按钮 ====== */
#toggle-html {
    margin-left: 4px;
}

/* ====== 编辑器内 emoji 自动换行 ====== */
.editor-content img.emoji {
    display: inline-block;
    margin: 2px;
}



/* ====== 提交按钮 ====== */
/* ====== 提交按钮容器 ====== */
.comment-form {
    display: flex;           /* 使用 flex 布局 */
    justify-content: flex-end; /* 水平靠右 */
}

/* ====== 提交按钮 ====== */
.comment-form #submit {
    display: inline-block;    /* 生效 */
    background: linear-gradient(135deg, #4e9af1, #0073aa);
    color: #fff;
    border: none;
    padding: 12px 26px;
    font-size: 15px;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 15px;
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

/* 悬停效果：加深颜色 + 提升按钮 */
.comment-form #submit:hover {
    background: linear-gradient(135deg, #0073aa, #005177);
    box-shadow: 0 6px 16px rgba(0, 115, 170, 0.45);
    transform: translateY(-2px);
}

/* 点击效果：轻微缩小 */
.comment-form #submit:active {
    transform: translateY(0);
    box-shadow: 0 3px 8px rgba(0, 115, 170, 0.35);
}


/* 右侧侧边栏容器 */
.post-sidebar {
    flex: 0 0 30%;       /* 固定占 30% 宽度 */
    max-width: 30%;      /* 最大宽度 30% */
    padding: 0;          /* 去掉容器内边距 */
    margin: 0;           /* 去掉容器外边距 */
    box-sizing: border-box;
}

/* 模块卡片占满右侧 100% */
.post-sidebar .sidebar-box {
    width: 100%;         /* 模块宽度占满右侧容器 */
    margin: 0 0 20px 0;  /* 底部间距保留，顶部清零 */
    padding: 15px;       /* 内边距可保留 */
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    box-sizing: border-box;
}



/* 侧边栏搜索框整体 */
.sidebar-search {
    padding: 15px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

/* 侧边栏搜索框整体 */
.sidebar-search {
    padding: 15px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

/* 搜索标题 */
.sidebar-search h3 {
    font-size: 18px;
    margin-bottom: 12px;
    color: #333;
}

/* 表单布局 */
.sidebar-search form.search-form {
    display: flex;
    margin: 0;
}

/* 输入框 */
.sidebar-search input.search-field {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    outline: none;
    font-size: 14px;
}

/* 提交按钮 */
.sidebar-search button.search-submit {
    padding: 10px 18px;
    border: none;
    background: #ff5722;
    color: #fff;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    transition: background 0.3s, transform 0.3s;
}

/* 鼠标悬停按钮效果 */
.sidebar-search button.search-submit:hover {
    background: #e64a19;
    transform: translateY(-2px);
}

/* 输入框和按钮在小屏幕自适应 */
@media screen and (max-width: 600px) {
    .sidebar-search form.search-form {
        flex-direction: column;
    }
    .sidebar-search input.search-field {
        border-radius: 4px 4px 0 0;
        margin-bottom: 6px;
    }
    .sidebar-search button.search-submit {
        border-radius: 0 0 4px 4px;
    }
}




/* 模块标题 */
.post-sidebar .sidebar-box h3 {
    font-size: 18px;
    margin: 0 0 12px 0;  /* 顶部间距清零，只保留底部 */
    padding-bottom: 6px;
    border-bottom: 2px solid #eee;
    color: #333;
}

/* 模块内容 ul */
.post-sidebar .sidebar-box ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
/*头像*/
.about-user {
    width: 120px;         /* 稍微大一点 */
    height: 120px;
    border-radius: 50%;   /* 圆形 */
    object-fit: cover;    /* 保持比例裁剪 */
    display: block;
    margin: 0 auto 15px auto; /* 居中 + 底部留间距 */
    box-shadow: 0 4px 8px rgba(0,0,0,0.1); /* 柔和阴影 */
    border: 3px solid #fff; /* 加个白边，更精致 */
}
.about-user:hover {
    transform: scale(1.05);
    transition: 0.3s ease;
}
.post-sidebar .sidebar-box ul li {
    margin-bottom: 8px;
    font-size: 15px;
    line-height: 1.4;
}

/* About Me 描述文字 */
.sidebar-about .about-description {
    font-size: 14px;
    line-height: 1.6;
    color: #555;
    text-align: left;       /* 整体左对齐 */
    text-indent: 2em;       /* 首行缩进 2 个字符 */
    margin: 10px 0;         /* 上下间距 */
}

/* 社交工具 */
/* About Me 社交工具容器 */
.about-social {
    display: flex;
    flex-wrap: wrap;          /* 自动换行 */
    justify-content: flex-start; /* 左对齐 */
    gap: 10px 12px;           /* 行间距 10px，列间距 12px */
    margin-top: 15px;
}

/* 图标大小和 hover */
.about-social i.fab {
    font-size: 30px;
    transition: transform 0.3s ease;
    flex: 0 0 calc(20% - 12px); /* 每行 5 个，减去列间距 */
    text-align: center;
}

.about-social i.fab:hover {
    transform: scale(1.2);
}

/* 不同社交平台颜色 */
.about-social i.fab.fa-twitter   { color: #1DA1F2; }
.about-social i.fab.fa-linkedin  { color: #0077B5; }
.about-social i.fab.fa-youtube   { color: #FF0000; }
.about-social i.fab.fa-github    { color: #333; }
.about-social i.fab.fa-facebook  { color: #1877F2; }
.about-social i.fab.fa-instagram { color: #C13584; }
.about-social i.fab.fa-tiktok    { color: #000; }
.about-social i.fab.fa-reddit    { color: #FF4500; }
.about-social i.fab.fa-pinterest { color: #E60023; }
.about-social i.fab.fa-discord   { color: #7289DA; }
.about-social i.fab.fa-medium    { color: #00AB6C; }


/* 单行截断（近期文章 / 热门文章 / 分类 等） */
.post-sidebar .sidebar-recent-posts li a,
.post-sidebar .sidebar-popular-posts li a,
.post-sidebar .sidebar-categories li a {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* 超宽省略号 */
    color: #333;
    text-decoration: none;
    transition: color .2s;
}
.post-sidebar .sidebar-recent-posts li a:hover,
.post-sidebar .sidebar-popular-posts li a:hover,
.post-sidebar .sidebar-categories li a:hover {
    color: #0073aa;
}

/* 推荐产品：两行截断，适配稍长标题 */
.post-sidebar .sidebar-products li a {
    display: -webkit-box;
    -webkit-line-clamp: 2;           /* 限制 2 行 */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    overflow-wrap: anywhere;          /* 防止长词/URL 撑破 */
    color: #333;
    text-decoration: none;
}

/* 近期评论：再做视觉压缩，最多显示 2 行（你后端已限制 200 字符） */
.post-sidebar .sidebar-recent-comments li {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;            /* 需要更少/更多可改 1/3 */
    -webkit-box-orient: vertical;
    line-height: 1.4;
    max-height: calc(1.4em * 2);      /* 双保险：两行高度 */
    overflow-wrap: anywhere;
    color: #444;
}
.post-sidebar .sidebar-recent-comments li a {
    color: inherit;
    text-decoration: none;
}

/* About Me：文本最多 3 行，头像可选 */
.post-sidebar .sidebar-about {
    text-align: center;
}
.post-sidebar .sidebar-about .about-avatar {
    width: 100px; height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 12px;
}
.post-sidebar .sidebar-about p {
    margin: 8px 0 10px;
    display: -webkit-box;
    -webkit-line-clamp: 3;            /* 最多 3 行介绍 */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #555;
}
.post-sidebar .sidebar-about .about-social a {
    display: inline-block;
    margin: 0 6px;
    font-size: 14px;
    color: #0073aa;
    text-decoration: none;
}
.post-sidebar .sidebar-about .about-social a:hover {
    text-decoration: underline;
}

/* 搜索框宽度自适应 */
.post-sidebar .sidebar-search input[type="search"] {
    width: 100%;
    box-sizing: border-box;
}
.search-bar button {
    padding: 10px 18px;
    border: none;
    background: #ff5722;
    color: #fff;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    transition: background 0.3s, transform 0.3s;
}

.search-bar button:hover {
    background: #e64a19;
    transform: translateY(-2px);
}

/* 广告位图片自适应 */
.post-sidebar .sidebar-ads img {
    max-width: 100%;
    border-radius: 6px;
    display: block;
    margin: 0 auto;
}

/* 兜底：任何在侧栏中的文字/链接都允许自动换行，避免破版 */
.post-sidebar .sidebar-box a,
.post-sidebar .sidebar-box li {
    overflow-wrap: anywhere;
    word-break: break-word;
}


/* 分类导航整体 */
.sidebar-box.sidebar-categories {
    background: #fff;
    border-radius: 6px;
    padding: 15px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

/* 去掉 ul 默认样式 */
.sidebar-box.sidebar-categories ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* 每个子分类独占一行 */
.sidebar-box.sidebar-categories li.child-cat {
    display: block;               /* 块级显示，换行 */
    margin-bottom: 12px;
}

/* 分类标题 */
.sidebar-box.sidebar-categories .child-cat-title {
    display: block;               /* 独占一行 */
    font-weight: bold;
    color: #333;
    font-size: 15px;
    margin-bottom: 4px;
}

/* 分类下无文章提示 */
.sidebar-box.sidebar-categories .child-cat-empty {
    display: block;               /* 独占一行 */
    margin-left: 15px;            /* 缩进 */
    color: #666;
    font-size: 14px;
}

/* 子分类帖子列表 */
.sidebar-box.sidebar-categories .child-posts {
    padding-left: 20px;           /* 缩进 */
    margin-top: 4px;
    margin-bottom: 6px;
}

.sidebar-box.sidebar-categories .child-posts li {
    margin-bottom: 4px;
}

/* 链接样式 */
.sidebar-box.sidebar-categories .child-posts li a {
    color: #0073aa;
    text-decoration: none;
    word-break: break-word;       /* 自动换行 */
}

.sidebar-box.sidebar-categories .child-posts li a:hover {
    text-decoration: underline;
}

