

/* ========== Comments Section ========== */
.comments-section {
    background: var(--bg-card-solid);
    border-radius: var(--card-radius, var(--radius-lg));
    padding: 28px 36px;
    margin-top: 22px;
    box-shadow: 0 1px 4px rgba(40, 30, 20, 0.06), 0 0 0 1px rgba(40, 30, 20, 0.04);
    border: none;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.comments-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}

.comments-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.comments-header-left i {
    font-size: 20px;
    color: var(--accent);
}

.comments-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.comments-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    background: var(--accent);
    border-radius: 11px;
}

/* Comment Empty */
.comment-empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
}

.comment-empty i {
    font-size: 40px;
    opacity: 0.3;
    display: block;
    margin-bottom: 12px;
}

.comment-empty p {
    font-size: 14px;
    margin: 0;
}

/* 评论项 - 参考emlog默认主题浮动布局 */
.comment-item {
    margin: 14px 0;
    padding: 0;
    overflow: visible;
}

/* 头像 - 左浮动 */
.comment-avatar {
    float: left;
    margin: 4px 10px 0 0;
}

.comment-avatar img {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-round);
    object-fit: cover;
    border: 2px solid var(--border-light);
}

.comment-is-author .comment-avatar img {
    border-color: var(--accent);
}

/* 评论信息气泡 */
.comment-infos {
    background: var(--bg-hover);
    padding: 14px 16px 12px;
    border-radius: var(--radius-md);
    margin-left: 52px;
    border: 1px solid var(--border-light);
    position: relative;
    line-height: 1.7;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.comment-item:hover > .comment-infos {
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.comment-is-author > .comment-infos {
    border-color: var(--accent);
    background: var(--accent-light);
}

.comment-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
}

.comment-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.comment-author-badge {
    display: inline-block;
    font-size: 10px;
    padding: 1px 8px;
    background: var(--accent);
    color: #fff;
    border-radius: 10px;
    font-weight: 600;
    line-height: 18px;
}

/* 顶置评论徽章与样式 */
.comment-top-badge {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 10px;
    padding: 1px 8px;
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: #fff;
    border-radius: 10px;
    font-weight: 600;
    line-height: 18px;
}
.comment-top-badge i {
    font-size: 11px;
}
.comment-is-top > .comment-infos {
    border: 1px solid rgba(245, 158, 11, 0.45);
    background: rgba(245, 158, 11, 0.06);
    box-shadow: 0 1px 4px rgba(245, 158, 11, 0.10);
}
.comment-is-top > .comment-avatar img {
    border-color: #f59e0b;
}

.comment-home-link {
    color: var(--text-muted);
    font-size: 13px;
    transition: color var(--transition-fast);
}

.comment-home-link:hover {
    color: var(--accent);
}

.comment-date {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: auto;
}

.comment-content {
    margin: 6px 0 0;
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-secondary);
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

.comment-content p {
    margin-bottom: 0.5em;
}

.comment-content p:last-child {
    margin-bottom: 0;
}

.comment-reply {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
}

.comment-reply a {
    color: var(--text-muted);
    transition: color var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast), opacity var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 12px;
    border: 1px solid var(--border-light);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
}

.comment-reply a:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-light);
}

/* 子评论缩进 - 参考emlog默认主题 */
.comment-children {
    margin: 10px 0 4px 28px;
    clear: both;
    border: none;
    padding: 0;
}

/* Comment Pagination */
.comment-pagination {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--border-light);
    text-align: center;
}

/* Comment Closed */
.comment-closed {
    text-align: center;
    padding: 32px 20px;
    color: var(--text-muted);
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.comment-closed i {
    font-size: 18px;
}

/* ========== Comment Form ========== */
.comment-form {
    display: flex;
    gap: 14px;
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--border-light);
}

.comment-form-avatar {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-round);
    background: var(--bg-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 18px;
    overflow: hidden;
}

.comment-form-avatar img {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-round);
    object-fit: cover;
}

.comment-form-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.comment-form-fields {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.form-input {
    flex: 1;
    min-width: 140px;
    padding: 10px 16px;
    border: 1.5px solid var(--border-input);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.form-input::placeholder {
    color: var(--text-tertiary);
}

.form-input-sm {
    min-width: 80px;
    max-width: 120px;
    padding: 8px 10px;
    font-size: 13px;
}

.comment-form-textarea-wrap {
    position: relative;
}

.form-textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border-input);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    line-height: 1.6;
    resize: vertical;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.form-textarea::placeholder {
    color: var(--text-tertiary);
}

/* ========== 修复输入框占位符括号文字重叠 ========== */

.form-input,
.form-textarea {
    font-family: inherit;
    letter-spacing: normal;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 2. 针对各浏览器占位符统一修复 */
.form-input::-webkit-input-placeholder,
.form-textarea::-webkit-input-placeholder {
    font-family: inherit;
    letter-spacing: 0.01em;
    color: var(--text-tertiary);
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
}

.form-input::-moz-placeholder,
.form-textarea::-moz-placeholder {
    font-family: inherit;
    letter-spacing: 0.01em;
    color: var(--text-tertiary);
    opacity: 1;
    -moz-osx-font-smoothing: grayscale;
}

.form-input:-ms-input-placeholder,
.form-textarea:-ms-input-placeholder {
    font-family: inherit;
    letter-spacing: 0.01em;
    color: var(--text-tertiary);
}

.form-input::placeholder,
.form-textarea::placeholder {
    font-family: inherit;
    letter-spacing: 0.01em;
    color: var(--text-tertiary);
}

.comment-form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.reply-to-info {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

.reply-to-info i {
    color: var(--accent);
}

.cancel-reply-link {
    color: var(--text-muted);
    font-size: 16px;
    transition: color var(--transition-fast);
}

.cancel-reply-link:hover {
    color: var(--accent);
}

.comment-form-submit-area {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.captcha-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.captcha-group .captcha {
    height: 40px;
    border-radius: var(--radius-md);
    cursor: pointer;
    border: 1.5px solid var(--border-input);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.captcha-group .captcha:hover {
    transform: scale(1.03);
    box-shadow: var(--shadow-md);
}

.captcha-group .captcha_input {
    width: 100px;
    padding: 10px 14px;
    border: 1.5px solid var(--border-input);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    letter-spacing: 2px;
    text-align: center;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
}

.captcha-group .captcha_input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.captcha-group .captcha_input::placeholder {
    color: var(--text-muted);
    letter-spacing: 0;
}

.captcha-display {
    display: inline-flex;
    align-items: center;
    height: 36px;
}

.btn-submit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: color var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast), opacity var(--transition-fast);
    box-shadow: 0 2px 8px var(--accent-glow);
}

.btn-submit:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px var(--accent-glow);
}

.btn-submit:active {
    transform: translateY(0);
}

.btn-submit i {
    font-size: 16px;
}

/* 深色模式评论区 */
body.dark-mode .comment-infos {
    border-color: #3a3530;
}

body.dark-mode .comment-item:hover > .comment-infos {
    border-color: #e0a860;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

body.dark-mode .comment-is-author > .comment-infos {
    border-color: #e0a860;
    background: rgba(224, 168, 96, 0.08);
}

body.dark-mode .comment-avatar img {
    border-color: #3a3530;
}

body.dark-mode .comment-is-author .comment-avatar img {
    border-color: #e0a860;
}

body.dark-mode .comment-is-top > .comment-infos {
    border-color: rgba(245, 158, 11, 0.5);
    background: rgba(245, 158, 11, 0.10);
}
body.dark-mode .comment-is-top > .comment-avatar img {
    border-color: #f59e0b;
}

body.dark-mode .comment-reply a {
    border-color: #3a3530;
}

body.dark-mode .form-input,
body.dark-mode .form-textarea {
    background: #1e1c1a;
    border-color: #3a3530;
    color: #e8e0d8;
}

body.dark-mode .form-input:focus,
body.dark-mode .form-textarea:focus {
    border-color: #e0a860;
    box-shadow: 0 0 0 3px rgba(224, 168, 96, 0.15);
}

body.dark-mode .captcha-group .captcha {
    border-color: #3a3530;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

body.dark-mode .captcha-group .captcha_input {
    background: #1e1c1a;
    border-color: #3a3530;
    color: #e8e0d8;
}

body.dark-mode .captcha-group .captcha_input:focus {
    border-color: #e0a860;
    box-shadow: 0 0 0 3px rgba(224, 168, 96, 0.15);
}

body.dark-mode .comment-form-avatar {
    background: #2d2a26;
}

/* Shiguang comments */
.comments-section {
    border-radius: 28px;
    padding: 28px 32px;
}

.comments-header {
    border-bottom-color: var(--border-light);
}

.comments-header-left > i,
.comments-count-badge {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.comments-header-left > i {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    color: #fff;
    border-radius: 11px;
    font-size: 18px;
}

.comment-infos {
    padding: 13px 15px;
    border: 1px solid var(--glass-border);
    border-radius: 17px;
    background: rgba(255,255,255,.46);
}

body.dark-mode .comment-infos {
    background: rgba(42,55,75,.52);
}

.comment-avatar img {
    border: 2px solid rgba(255,255,255,.92);
    box-shadow: 0 7px 18px rgba(68,81,107,.11);
}

.form-input,
.form-textarea,
.captcha-group .captcha_input,
.widget-search-input,
.widget-archive-select {
    border-color: var(--border-input);
    border-radius: 14px;
    background: var(--bg-input);
}

.form-input:focus,
.form-textarea:focus,
.captcha-group .captcha_input:focus {
    border-color: rgba(var(--accent-rgb), .50);
    box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .10);
}

.comment-submit,
.btn-submit {
    border-radius: 13px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: var(--shadow-accent);
}
