/**
 * post-comment.css — /post/ 内容页（站点详情）评论区重构样式
 * ------------------------------------------------------------------
 * 加载页：post.php（站点详情，URL 形如 /post/367.html）
 * 作用域：全部规则都挂在 `.post-comment-section` 下，
 *         只覆盖 comment.css 的通用样式，不影响详情页/AI 应用页。
 *
 * 设计语言与站点其它卡片一致：白卡 + 16px 圆角 + #eef2f6 描边；
 * 主色沿用站点蓝 #4a6cf7，暗色沿用 post.css 的 #2d3748 / #4a5568 体系。
 * ================================================================== */

/* ---------- 1. 外壳：与 .dh-entry 卡片对齐 ---------- */
.post-comment-section {
    margin-top: 16px;
    padding: 22px 24px 24px;
    background: #fff;
    border: 1px solid #eef2f6;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .02);
}

/* ---------- 2. 标题栏 ---------- */
.post-comment-section .comment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 14px;
    margin-bottom: 2px;
    border-bottom: 1px solid #f2f6fc;
}

.post-comment-section .comment-header h2 {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    font-size: 17px;
    font-weight: 800;
    color: #1a202c;
    letter-spacing: .2px;
}

.post-comment-section .comment-header h2 > i,
.post-comment-section .comment-header h2 > .pc-ico {
    width: 27px;
    height: 27px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: #eef3ff;
    color: #4a6cf7;
    font-size: 15px;
    flex: 0 0 auto;
}

/* 计数胶囊：裸数字看不出层级，这里做成实心小胶囊 */
.post-comment-section .pc-count {
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #4a6cf7;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.post-comment-section .pc-jump {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 30px;
    padding: 0 12px;
    border: 1px solid #e2eaf8;
    border-radius: 9px;
    background: #fbfcff;
    color: #55627a;
    font-size: 12.5px;
    text-decoration: none;
    white-space: nowrap;
    transition: background .18s, border-color .18s, color .18s;
}

.post-comment-section .pc-jump:hover {
    background: #f3f7ff;
    border-color: #c9d9f7;
    color: #3a5cd9;
}

.post-comment-section .pc-jump svg { opacity: .9; }

/* ---------- 3. 列表 ---------- */
.post-comment-section #commentList { margin: 0; }

.post-comment-section .comment-item {
    display: flex;
    gap: 12px;
    padding: 16px 0;
    border-bottom: 1px solid #f4f7fd;
}

.post-comment-section .comment-item:last-child {
    border-bottom: 0;
    padding-bottom: 4px;
}

.post-comment-section .comment-avatar {
    position: relative;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid #e8eefb;
    background: #eef3ff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.post-comment-section .comment-avatar > b {
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    color: #4a6cf7;
}

.post-comment-section .comment-avatar img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 11px;
    object-fit: cover;
}

.post-comment-section .comment-body {
    flex: 1;
    min-width: 0;
}

.post-comment-section .comment-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.post-comment-section .comment-author {
    font-size: 13.5px;
    font-weight: 700;
    color: #1d2637;
}

.post-comment-section .comment-time {
    font-size: 11.5px;
    color: #a8b4c8;
    font-variant-numeric: tabular-nums;
}

.post-comment-section .comment-content {
    font-size: 14.5px;
    line-height: 1.78;
    color: #3a4459;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

.post-comment-section .comment-actions { margin-top: 9px; }

.post-comment-section .comment-reply-btn {
    height: 26px;
    padding: 0 11px;
    border: 1px solid #e4ebf8;
    border-radius: 8px;
    background: #f7faff;
    color: #5c6b86;
    font-size: 12px;
    cursor: pointer;
    transition: background .18s, border-color .18s, color .18s;
}

.post-comment-section .comment-reply-btn:hover {
    background: #eef4ff;
    border-color: #cfdefa;
    color: #3a5cd9;
    text-decoration: none;
}

/* 待审核：comment.css 原来用 border-left + padding-left，会把这一条整体右移，
   跟其它评论头像对不齐。改成左右各外扩 16px 的块 + 内阴影竖条。 */
.post-comment-section .comment-item.pending {
    margin: 8px -16px;
    padding: 14px 16px;
    border-bottom: 0;
    border-left: 0;
    border-radius: 10px;
    background: #fffaf1;
    box-shadow: inset 3px 0 0 #f6ad55;
}

.post-comment-section .comment-item.pending .comment-status.pending {
    margin-left: 2px;
    padding: 1px 7px;
    border-radius: 6px;
    background: #fdf0cf;
    color: #b7791f;
    font-size: 11.5px;
    line-height: 1.6;
}

/* ---------- 4. 空状态 ---------- */
.post-comment-section .comment-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin: 18px 0;
    padding: 26px 18px;
    border: 1px dashed #dbe5f6;
    border-radius: 14px;
    background: #fbfcff;
    color: #98a5bb;
    font-size: 13.5px;
    line-height: 1.7;
    text-align: center;
}

.post-comment-section .comment-empty::before {
    content: "";
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #eef3ff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234a6cf7' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'><path d='M21 11.5a8.4 8.4 0 0 1-8.4 8.4c-1.5 0-2.9-.4-4.1-1.1L3 20l1.2-5.4A8.4 8.4 0 1 1 21 11.5z'/><circle cx='8.6' cy='11.6' r='.9' fill='%234a6cf7' stroke='none'/><circle cx='12.2' cy='11.6' r='.9' fill='%234a6cf7' stroke='none'/><circle cx='15.8' cy='11.6' r='.9' fill='%234a6cf7' stroke='none'/></svg>") center / 22px 22px no-repeat;
}

/* ---------- 5. 表单外壳 ---------- */
.post-comment-section .comment-form-wrapper {
    margin-top: 8px;
    padding: 20px;
    border: 1px solid #e6eefc;
    border-radius: 15px;
    background: linear-gradient(180deg, #f8faff 0%, #fcfdff 100%);
}

.post-comment-section .pc-form-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.post-comment-section .pc-form-head h3 {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    font-size: 15px;
    font-weight: 800;
    color: #1a202c;
}

.post-comment-section .pc-form-head h3 svg { color: #4a6cf7; }

.post-comment-section .pc-form-head > span {
    font-size: 12px;
    color: #a3b0c6;
}

/* 回复提示条：comment.js 只写 parent_id，界面上看不出在回复谁 */
.post-comment-section .pc-reply {
    display: none;
    align-items: center;
    gap: 8px;
    margin-bottom: 13px;
    padding: 8px 10px 8px 12px;
    border: 1px solid #d8e4ff;
    border-radius: 10px;
    background: #eef4ff;
    color: #41528c;
    font-size: 12.5px;
}

.post-comment-section .pc-reply.is-on { display: flex; }

.post-comment-section .pc-reply em {
    color: #3a5cd9;
    font-weight: 700;
    font-style: normal;
}

.post-comment-section .pc-reply button {
    margin-left: auto;
    padding: 3px 9px;
    border: 1px solid #cfdcf8;
    border-radius: 7px;
    background: #fff;
    color: #5c6b86;
    font-size: 12px;
    cursor: pointer;
}

.post-comment-section .pc-reply button:hover {
    border-color: #4a6cf7;
    color: #3a5cd9;
}

/* ---------- 6. 字段 ---------- */
.post-comment-section .comment-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 14px;
    margin-bottom: 14px;
}

.post-comment-section .comment-form-group {
    margin-bottom: 14px;
    min-width: 0;
}

.post-comment-section .comment-form-row .comment-form-group { margin-bottom: 0; }

.post-comment-section .comment-form-group label {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 6px;
    font-size: 12.5px;
    font-weight: 600;
    color: #5a6780;
    letter-spacing: .2px;
}

.post-comment-section .comment-form-group label .is-req {
    color: #f08080;
    font-style: normal;
}

.post-comment-section .comment-form-group label .is-opt {
    margin-left: 2px;
    padding: 0 5px;
    border-radius: 5px;
    background: #eef1f7;
    color: #98a5bb;
    font-size: 10.5px;
    font-weight: 500;
    font-style: normal;
    line-height: 16px;
}

.post-comment-section .comment-form-group input,
.post-comment-section .comment-form-group textarea {
    width: 100%;
    height: 41px;
    padding: 0 13px;
    border: 1px solid #dee7f6;
    border-radius: 10px;
    background: #fff;
    color: #253044;
    font-size: 14px;
    line-height: 41px;
    box-shadow: 0 1px 2px rgba(23, 44, 88, .03);
    transition: border-color .18s, box-shadow .18s;
    box-sizing: border-box;
}

.post-comment-section .comment-form-group input::placeholder,
.post-comment-section .comment-form-group textarea::placeholder { color: #b3bfd2; }

.post-comment-section .comment-form-group input:hover,
.post-comment-section .comment-form-group textarea:hover { border-color: #cbd9f2; }

.post-comment-section .comment-form-group input:focus,
.post-comment-section .comment-form-group textarea:focus {
    border-color: #4a6cf7;
    box-shadow: 0 0 0 3px rgba(74, 108, 247, .14);
    outline: none;
}

.post-comment-section .comment-form-group textarea {
    height: auto;
    min-height: 116px;
    padding: 11px 13px;
    line-height: 1.72;
    resize: vertical;
}

.post-comment-section .pc-text { margin-bottom: 12px; }

/* ---------- 7. 底部操作条 ---------- */
.post-comment-section .pc-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.post-comment-section .pc-tip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #a3b0c6;
}

.post-comment-section .pc-tip i,
.post-comment-section .pc-tip .pc-ico { font-size: 13px; color: #8fb0e8; flex: 0 0 auto; }

.post-comment-section .pc-len {
    margin-left: auto;
    font-size: 12px;
    color: #a9b5c8;
    font-variant-numeric: tabular-nums;
}

.post-comment-section .pc-len b { color: #7b8aa4; font-weight: 600; }

/* 距 300 字上限 30 字内变色（上限来自 comment/submit.php 的 mb_strlen 校验） */
.post-comment-section .pc-len.is-near b,
.post-comment-section .pc-len.is-near { color: #d98324; }

/* 重要：comment.js 提交时用 textContent 改按钮文字（会清空子节点），
   所以纸飞机图标只能用 ::before 画，不能写成 <i> / <svg> 子元素。 */
.post-comment-section .comment-submit-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 42px;
    margin: 0;
    padding: 0 24px 0 20px;
    border: 0;
    border-radius: 11px;
    background: linear-gradient(180deg, #5b7bff, #4a6cf7);
    box-shadow: 0 8px 18px -10px rgba(74, 108, 247, .9), inset 0 1px 0 rgba(255, 255, 255, .22);
    color: #fff;
    font-size: 14.5px;
    font-weight: 600;
    letter-spacing: .3px;
    cursor: pointer;
    transition: transform .16s, box-shadow .16s, filter .16s;
}

.post-comment-section .comment-submit-btn::before {
    content: "";
    width: 16px;
    height: 16px;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'><path d='M4 12 20 4l-4.2 16L12 14l-8-2z'/><path d='M12 14 20 4'/></svg>") center / contain no-repeat;
}

.post-comment-section .comment-submit-btn:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
    box-shadow: 0 12px 22px -10px rgba(74, 108, 247, .95);
}

.post-comment-section .comment-submit-btn:active { transform: translateY(0); }

.post-comment-section .comment-submit-btn:disabled {
    opacity: .65;
    transform: none;
    cursor: not-allowed;
}

.post-comment-section .comment-submit-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(74, 108, 247, .3);
}

/* ---------- 8. 提示与分页 ---------- */
.post-comment-section .comment-msg {
    border-radius: 10px;
    font-size: 13px;
}

.post-comment-section .comment-msg.success {
    background: #effaf2;
    border-color: #c8ecd3;
    color: #1b7a43;
}

.post-comment-section .comment-msg.error {
    background: #fff4f4;
    border-color: #fadada;
    color: #b3372f;
}

.post-comment-section .comment-pagination {
    display: flex;
    gap: 6px;
    margin-top: 18px;
    justify-content: center;
    flex-wrap: wrap;
}

/* 分页同时支持 <a>（服务端输出，爬虫可跟）与 <span>（comment.js 换页后） */
.post-comment-section .comment-page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 32px;
    padding: 0 10px;
    border: 1px solid #e4ebf7;
    border-radius: 9px;
    background: #fff;
    color: #5c6b86;
    font-size: 13px;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    box-sizing: border-box;
    transition: background .18s, border-color .18s, color .18s;
}

.post-comment-section .comment-page:hover:not(.active) {
    background: #f3f7ff;
    border-color: #cfdefa;
}

.post-comment-section .comment-page.active {
    background: #4a6cf7;
    border-color: #4a6cf7;
    color: #fff;
    box-shadow: 0 6px 14px -9px rgba(74, 108, 247, .9);
}

/* 「上一页 / 下一页」比数字弱一档 */
.post-comment-section .comment-page.is-nav {
    background: #f7faff;
    color: #6b7a94;
    padding: 0 12px;
}

.post-comment-section .comment-page.is-nav:hover {
    background: #eef4ff;
    color: #3a5cd9;
}

.post-comment-section .comment-page-gap {
    display: inline-flex;
    align-items: center;
    padding: 0 2px;
    color: #b3bfd2;
    font-size: 13px;
}

/* ---------- 9. 暗色（沿用 post.css 的 #2d3748 / #4a5568 体系） ---------- */
body.dark-mode .post-comment-section {
    background: #2d3748;
    border-color: #4a5568;
    box-shadow: none;
}

body.dark-mode .post-comment-section .comment-header { border-bottom-color: #3d4b60; }

body.dark-mode .post-comment-section .comment-header h2 { color: #e2e8f0; }

body.dark-mode .post-comment-section .comment-header h2 > i {
    background: #35425a;
    color: #8ba4f5;
}

body.dark-mode .post-comment-section .pc-count { background: #4a6cf7; }

body.dark-mode .post-comment-section .pc-jump {
    background: #35425a;
    border-color: #4a5568;
    color: #b6c3da;
}

body.dark-mode .post-comment-section .pc-jump:hover {
    background: #3d4b60;
    border-color: #5a6b85;
    color: #a8bfff;
}

body.dark-mode .post-comment-section .comment-item { border-bottom-color: #3d4b60; }

body.dark-mode .post-comment-section .comment-avatar {
    background: #35425a;
    border-color: #4a5568;
}

body.dark-mode .post-comment-section .comment-avatar > b { color: #8ba4f5; }

body.dark-mode .post-comment-section .comment-author { color: #e2e8f0; }

body.dark-mode .post-comment-section .comment-time { color: #93a3ba; }

body.dark-mode .post-comment-section .comment-content { color: #cbd5e0; }

body.dark-mode .post-comment-section .comment-reply-btn {
    background: #35425a;
    border-color: #4a5568;
    color: #a9b8d2;
}

body.dark-mode .post-comment-section .comment-reply-btn:hover {
    background: #3d4b60;
    color: #a8bfff;
}

body.dark-mode .post-comment-section .comment-item.pending {
    background: #3a3830;
    box-shadow: inset 3px 0 0 #b7791f;
}

body.dark-mode .post-comment-section .comment-item.pending .comment-status.pending {
    background: #4a4225;
    color: #ecc94b;
}

body.dark-mode .post-comment-section .comment-empty {
    background: #35425a;
    border-color: #4a5568;
    color: #a0aec0;
}

body.dark-mode .post-comment-section .comment-empty::before { background-color: #2d3748; }

body.dark-mode .post-comment-section .comment-form-wrapper {
    background: #35425a;
    border-color: #4a5568;
}

body.dark-mode .post-comment-section .pc-form-head h3 { color: #e2e8f0; }

body.dark-mode .post-comment-section .pc-form-head > span { color: #93a3ba; }

body.dark-mode .post-comment-section .pc-reply {
    background: #33415c;
    border-color: #4a5b7a;
    color: #a8b9dc;
}

body.dark-mode .post-comment-section .pc-reply em { color: #a8bfff; }

body.dark-mode .post-comment-section .pc-reply button {
    background: #3d4b60;
    border-color: #4a5b7a;
    color: #b6c3da;
}

body.dark-mode .post-comment-section .comment-form-group label { color: #a3b0c8; }

body.dark-mode .post-comment-section .comment-form-group label .is-opt {
    background: #3d4b60;
    color: #93a3ba;
}

body.dark-mode .post-comment-section .comment-form-group input,
body.dark-mode .post-comment-section .comment-form-group textarea {
    background: #26303f;
    border-color: #4a5568;
    color: #e2e8f0;
    box-shadow: none;
}

body.dark-mode .post-comment-section .comment-form-group input::placeholder,
body.dark-mode .post-comment-section .comment-form-group textarea::placeholder { color: #7c8ba1; }

body.dark-mode .post-comment-section .comment-form-group input:focus,
body.dark-mode .post-comment-section .comment-form-group textarea:focus {
    border-color: #5c7bff;
    box-shadow: 0 0 0 3px rgba(92, 123, 255, .18);
}

body.dark-mode .post-comment-section .pc-tip { color: #93a3ba; }

body.dark-mode .post-comment-section .pc-len { color: #93a3ba; }

body.dark-mode .post-comment-section .pc-len b { color: #c3cfe3; }

body.dark-mode .post-comment-section .comment-page {
    background: #35425a;
    border-color: #4a5568;
    color: #a9b8d2;
}

body.dark-mode .post-comment-section .comment-page.is-nav {
    background: #3d4b60;
    color: #96a3ba;
}

body.dark-mode .post-comment-section .comment-page.active {
    background: #4a6cf7;
    border-color: #4a6cf7;
    color: #fff;
}

body.dark-mode .post-comment-section .comment-page:hover:not(.active) {
    background: #3d4b60;
    border-color: #5a6b85;
}

body.dark-mode .post-comment-section .comment-page-gap { color: #7c8ba1; }

body.dark-mode .post-comment-section .comment-msg.success {
    background: #1f3a2c;
    border-color: #2f6b4a;
    color: #9ae6b4;
}

body.dark-mode .post-comment-section .comment-msg.error {
    background: #3d2426;
    border-color: #7a3b3b;
    color: #fc8181;
}

/* ---------- 10. 响应式 ---------- */
@media (max-width: 1000px) {
    .post-comment-section .comment-form-row { grid-template-columns: 1fr 1fr; }
    .post-comment-section .comment-form-row .comment-form-group:last-child { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
    .post-comment-section {
        padding: 18px 16px 20px;
        border-radius: 14px;
    }
    .post-comment-section .pc-form-head > span { display: none; }
    .post-comment-section .pc-tip { display: none; }
    .post-comment-section .pc-len { margin-left: 0; }
    .post-comment-section .pc-actions { justify-content: space-between; }
    .post-comment-section .comment-submit-btn { margin-left: auto; }
    .post-comment-section .comment-form-wrapper { padding: 16px; }

    /* page.css 第 27 节为了「移动端搜索框占位符居中」，把所有 form input 的
       text-align 都设成了 center !important（还带三层 :not()，权重不低）——
       昵称/QQ 输入框也被居中，输入框里的字看着像标题。这里用 #commentForm
       把评论区单独拉回左对齐。 */
    .post-comment-section #commentForm input[type="text"],
    .post-comment-section #commentForm input[type="email"],
    .post-comment-section #commentForm input::placeholder,
    .post-comment-section #commentForm textarea::placeholder {
        text-align: left !important;
    }
}

@media (max-width: 640px) {
    .post-comment-section .comment-form-row { grid-template-columns: 1fr; }
    .post-comment-section .comment-form-row .comment-form-group:last-child { grid-column: auto; }
    .post-comment-section .comment-header h2 { font-size: 16px; }
    .post-comment-section .comment-item { gap: 10px; }
    .post-comment-section .comment-avatar { flex-basis: 36px; width: 36px; height: 36px; }
    .post-comment-section .comment-content { font-size: 14px; }

    /* 页码在窄屏收紧一点：11 个分页项 + 间距在 390px 下刚好差 3px 就会换行，
       这里把间距收到 4px、上一页/下一页收到 7px，保证一行排得下 */
    .post-comment-section .comment-pagination { gap: 4px; }
    .post-comment-section .comment-page {
        min-width: 30px;
        height: 30px;
        padding: 0 8px;
        font-size: 12.5px;
    }
    .post-comment-section .comment-page.is-nav { padding: 0 7px; }
}
